Add default constructor for BUTTON()

half-duplex
Phil Taylor 2022-04-26 08:41:58 +01:00
rodzic 3ef1950dc2
commit 49d1cc085a
2 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -225,17 +225,17 @@ void usbController::runTimer()
}
else if ((buttons >> i & 1) && !(tempButtons >> i & 1))
{
/* if (i < buttonList.size() && buttonList[i].offCommand.text && buttonList[i].onCommand.index>0) {
qDebug() << "Off Button event:" << buttonList[i].offCommand.text->toPlainText();
if (buttonList[i].offCommand.index > 2) // Band selection
if (i < buttonList.size()) {
qDebug() << "Off Button event:" << buttonList[i].offCommand.text;
if (buttonList[i].offCommand.bandswitch)
{
emit setBand(buttonList[i].offCommand.index - 3);
//emit setBand(buttonList[i].onCommand.index - 13);
}
else {
emit button(false, i);
}
}
*/
}
}
}

Wyświetl plik

@ -54,7 +54,7 @@ enum cmds {
};
struct COMMAND {
COMMAND(){}
COMMAND() {}
COMMAND(int index, QString text, cmds command, char suffix) :
index(index), text(text), command(command), suffix(suffix), bandswitch(false){}
@ -62,24 +62,26 @@ struct COMMAND {
index(index), text(text), command(command),band(band), bandswitch(true) {}
int index;
QString text;
cmds command;
char suffix;
bool bandswitch;
bandType band;
QString text;
bool bandswitch;
};
struct BUTTON {
BUTTON(char num, QRect pos, const QColor col) :
num(num), pos(pos), textColour(col) {}
BUTTON() {}
BUTTON(char num, QRect pos, const QColor textColour) :
num(num), pos(pos), textColour(textColour) {}
quint8 num;
QRect pos;
const QColor textColour;
int onEvent = 0;
int offEvent = 0;
COMMAND onCommand;
COMMAND offCommand;
const QColor textColour;
QGraphicsTextItem* onText;
QGraphicsTextItem* offText;
};