2018-07-31 Fred Gleason <fredg@paravelsystems.com>

* Refactored 'RDMacro' to handle UTF-8 strings correctly.
This commit is contained in:
Fred Gleason
2018-07-31 12:54:08 -04:00
parent dbb0d9c415
commit 26c29e1d4e
47 changed files with 676 additions and 686 deletions

View File

@@ -105,14 +105,14 @@ void WheatnetSlio::processCommand(RDMacro *cmd)
switch(cmd->command()) {
case RDMacro::GO:
if((cmd->argQuantity()!=5)||
((cmd->arg(1).toString().lower()!="i")&&
(cmd->arg(1).toString().lower()!="o"))||
((cmd->arg(1).lower()!="i")&&
(cmd->arg(1).lower()!="o"))||
(cmd->arg(2).toInt()<1)||(cmd->arg(3).toInt()>slio_gpios)||
(cmd->arg(2).toInt()>slio_gpios)||
((cmd->arg(3).toInt()!=1)&&(cmd->arg(3).toInt()!=0)&&
(cmd->arg(1).toString().lower()!="i"))||
(cmd->arg(1).lower()!="i"))||
((cmd->arg(3).toInt()!=1)&&(cmd->arg(3).toInt()!=0)&&
(cmd->arg(3).toInt()!=-1)&&(cmd->arg(1).toString().lower()=="i"))||
(cmd->arg(3).toInt()!=-1)&&(cmd->arg(1).lower()=="i"))||
(cmd->arg(4).toInt()<0)) {
cmd->acknowledge(false);
emit rmlEcho(cmd);
@@ -120,7 +120,7 @@ void WheatnetSlio::processCommand(RDMacro *cmd)
}
if(cmd->arg(3).toInt()==0) { // Turn OFF
if(cmd->arg(4).toInt()==0) {
if(cmd->arg(1).toString().lower()=="o") {
if(cmd->arg(1).lower()=="o") {
SendCommand(QString().sprintf("<SLIO:%d|LVL:0>",cmd->arg(2).toInt()));
emit gpoChanged(matrixNumber(),cmd->arg(2).toInt()-1,false);
}
@@ -135,13 +135,13 @@ void WheatnetSlio::processCommand(RDMacro *cmd)
}
else {
if(cmd->arg(4).toInt()==0) { // Turn ON
if(cmd->arg(1).toString().lower()=="o") {
if(cmd->arg(1).lower()=="o") {
SendCommand(QString().sprintf("<SLIO:%d|LVL:1>",cmd->arg(2).toInt()));
emit gpoChanged(matrixNumber(),cmd->arg(2).toInt()-1,true);
}
}
else { // Pulse
if(cmd->arg(1).toString().lower()=="o") {
if(cmd->arg(1).lower()=="o") {
SendCommand(QString().sprintf("<SLIO:%d|LVL:%d>",
cmd->arg(2).toInt(),
cmd->arg(3).toInt()!=0));