-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormGalilControllerIO.cpp
More file actions
57 lines (49 loc) · 2.3 KB
/
FormGalilControllerIO.cpp
File metadata and controls
57 lines (49 loc) · 2.3 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
49
50
51
52
53
54
55
56
57
#include "FormGalilControllerIO.h"
#include "ui_FormGalilControllerIO.h"
FormGalilControllerIO::FormGalilControllerIO(QString group, QWidget *parent) :
QMainWindow(parent),
ui(new Ui::FormGalilControllerIO)
{
ui->setupUi(this);
this->group = group;
CONNECT_CLOSE_BUTTON;
ui->lblTitle->setText(this->group + " Controller IO");
int byte = 0;
int bit = 0;
// Outputs
for(bit = 0; bit <= 15; bit++)
{
if(bit < 8)
{
this->findChild<QESimpleShape*>(QString("ledByteOut%1_%2").arg(STRING(1), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBo%d_STATUS.VAL", this->group.toStdString().c_str(), 1, bit));
this->findChild<QELineEdit*>(QString("txtByteOut%1_%2").arg(STRING(1), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBo%d_CMD.DESC", this->group.toStdString().c_str(), 1, bit));
}
this->findChild<QESimpleShape*>(QString("ledByteOut%1_%2").arg(STRING(byte), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBo%d_STATUS.VAL", this->group.toStdString().c_str(), byte, bit));
this->findChild<QELineEdit*>(QString("txtByteOut%1_%2").arg(STRING(byte), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBo%d_CMD.DESC", this->group.toStdString().c_str(), byte, bit));
}
// Inputs
for(byte = 0; byte <= 2; byte++)
{
for(bit = 0; bit <= 7; bit++)
{
this->findChild<QESimpleShape*>(QString("ledByte%1_%2").arg(STRING(byte), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBi%d_STATUS.VAL", this->group.toStdString().c_str(), byte, bit));
this->findChild<QELineEdit*>(QString("txtByte%1_%2").arg(STRING(byte), STRING(bit)))->setVariableNameProperty
(QString::asprintf("%sGalil%dBi%d_STATUS.DESC", this->group.toStdString().c_str(), byte, bit));
}
}
QString subs = "";
foreach (QEPushButton* widget, this->findChildren<QEPushButton*>())
{
subs = widget->getVariableNameSubstitutionsProperty();
widget->setVariableNameSubstitutionsProperty("group=" + this->group + "," + subs);
}
}
FormGalilControllerIO::~FormGalilControllerIO()
{
delete ui;
}