-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobottesttool.cpp
More file actions
48 lines (39 loc) · 1.69 KB
/
robottesttool.cpp
File metadata and controls
48 lines (39 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "robottesttool.h"
#include "robottesttoolitem.h"
#include <QMessageBox>
#include <QMenu>
#include <QAction>
RobotTestTool::RobotTestTool(int * omniTestDirDeg, int * omniTestVelocityBody, int * omniTestVelocityAngular, int * throwerTestPwm, int* throwerTestRpm)
{
Config & temp =Config::getConfig();
conf = & temp;
//Home widget for calibration tool
QTabWidget * centralWidget = new QTabWidget(this);
setCentralWidget(centralWidget);
QVBoxLayout * omniTabLayout = new QVBoxLayout();
QWidget * omniTabWidget= new QWidget();
omniTabWidget->setLayout(omniTabLayout);
QVBoxLayout * throwerTabLayout = new QVBoxLayout();
QWidget * throwerTabWidget= new QWidget();
throwerTabWidget->setLayout(throwerTabLayout);
//Add widgets to tabs
centralWidget->addTab(omniTabWidget, QString("Omni test"));
centralWidget->addTab(throwerTabWidget, QString("Thrower test"));
/* Omni cheatsheet
* dirDeg - direction of movement (0 is forward, 90 is sideways to the right)
* velocityBody: drive speed
* velocityAngular: spinning speed
*/
//Omni test
new RobotTestToolItem("Omni dirDeg", omniTestDirDeg, omniTabLayout, -255, 255);
new RobotTestToolItem("Omni velocityBody", omniTestVelocityBody, omniTabLayout, -255, 255);
new RobotTestToolItem("Omni velocityAngular", omniTestVelocityAngular, omniTabLayout, -255, 255);
//Thrower test
new RobotTestToolItem("Roller", throwerTestPwm, throwerTabLayout, 0, 255);
new RobotTestToolItem("Thrower RPM", throwerTestRpm, throwerTabLayout, 0, 13000);
}
void RobotTestTool::toggleBool(bool * boolean) {
qDebug() << "changing boolean value to: " << *boolean;
* boolean = ! *boolean;
qDebug() << "New value is: " << *boolean;
}