Example #1
0
void setupwindow::onCmdConf(const struct moduleservice::result *res, QDialog *dialog) {

    struct moduleservice::cmd command;
    if ((dialog == this) && (res->data.state == moduleservice::eCmdOk)) {
        switch (currentButton) {
        case eCurrInternetAus:
            ui->pushButtonInternetAus->setStyleSheet("background-color: green");
            break;
        case eCurrInternetEin:
            ui->pushButtonInternetEin->setStyleSheet("background-color: green");
            break;
        case eCurrGlockeAus:
            ui->pushButtonGlockeAus->setStyleSheet("background-color: green");
            break;
        case eCurrGlockeEin:
            ui->pushButtonGlockeEin->setStyleSheet("background-color: green");
            break;
        case eCurrLichtEingangEin:
            ui->pushButtonLichtEingangEin->setStyleSheet("background-color: green");
            command.type = moduleservice::eSwitchstate;
            command.destAddr = 240;
            command.ownAddr = 102;
            command.data.switchstate = 0;
            currentButton = eCurrNone;
            emit serviceCmd(&command, this);
            break;
        case eCurrLichtEingangAus:
            ui->pushButtonLichtEingangAus->setStyleSheet("background-color: green");
            command.type = moduleservice::eSwitchstate;
            command.destAddr = 240;
            command.ownAddr = 104;
            command.data.switchstate = 0;
            currentButton = eCurrNone;
            emit serviceCmd(&command, this);
            break;
        case eCurrLichtEingangAuto:
            ui->pushButtonLichtEingangAuto->setStyleSheet("background-color: green");
            command.type = moduleservice::eSwitchstate;
            command.destAddr = 240;
            command.ownAddr = 103;
            command.data.switchstate = 0;
            currentButton = eCurrNone;
            emit serviceCmd(&command, this);
            break;
        default:
            break;
        }

//        printf("setupwindow cmdconf %d\n", res->data.state);
    }
}
Example #2
0
	void CAdminExecutorServiceClientSkel::serviceCmd_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
	{
		H_AUTO(CAdminExecutorServiceClientSkel_serviceCmd_SCMD);
		uint32	commandId;
			nlRead(__message, serial, commandId);
		std::string	command;
			nlRead(__message, serial, command);
		serviceCmd(sender, commandId, command);
	}
Example #3
0
void setupwindow::on_pushButtonInternetEin_pressed() {

    struct moduleservice::cmd command;

    command.type = moduleservice::eSetvaldo31_do;
    command.destAddr = 240;
    memset(&command.data, 0, sizeof(command.data));
    command.data.setvaldo31_do.setval[27] = 2; // off, relay normally closed
    ui->pushButtonInternetEin->setStyleSheet("background-color: darkGreen");
    ui->pushButtonInternetAus->setStyleSheet("background-color: grey");
    currentButton = eCurrInternetEin;

    emit serviceCmd(&command, this);
}
Example #4
0
void setupwindow::on_pushButtonGlockeEin_pressed() {

    struct moduleservice::cmd command;

    command.type = moduleservice::eSwitchstate;
    command.destAddr = 240;
    command.ownAddr = 100;
    command.data.switchstate = 1;
    ui->pushButtonGlockeEin->setStyleSheet("background-color: darkGreen");
    ui->pushButtonGlockeAus->setStyleSheet("background-color: grey");
    currentButton = eCurrGlockeEin;

    emit serviceCmd(&command, this);
}