diff --git a/ChangeLog b/ChangeLog index e532e85a..98b547eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15819,3 +15819,6 @@ 2017-06-02 Fred Gleason * Updated 'NEWS'. * Incremented the package version to 2.16.0. +2017-06-05 Fred Gleason + * Modified the 'Command Send' ['CC'] RML so as to have a destination + argument of 'localhost' be sent to the localhost. diff --git a/lib/rdmacro_event.cpp b/lib/rdmacro_event.cpp index 4db48cb1..09376217 100644 --- a/lib/rdmacro_event.cpp +++ b/lib/rdmacro_event.cpp @@ -245,31 +245,35 @@ void RDMacroEvent::exec(int line) if(args.size()==2) { port=args[1].toUInt(); } - //stationname=event_cmds[line]->arg(0).toString(); - sql= - QString().sprintf("select VARVALUE from HOSTVARS \ - where (STATION_NAME=\"%s\")&&(NAME=\"%s\")", - (const char *)event_ripc->station(), - (const char *)stationname); - q=new RDSqlQuery(sql); - if(q->first()) { - stationname=q->value(0).toString(); - } - delete q; - station=new RDStation(stationname); - if(station->exists()) { - rml.setAddress(station->address()); + if(stationname.lower()=="localhost") { + rml.setAddress(QString("127.0.0.2")); } else { - addr.setAddress(stationname); - if(addr.isNull()) { - emit finished(line); - delete station; - return; + sql= + QString().sprintf("select VARVALUE from HOSTVARS \ + where (STATION_NAME=\"%s\")&&(NAME=\"%s\")", + (const char *)event_ripc->station(), + (const char *)stationname); + q=new RDSqlQuery(sql); + if(q->first()) { + stationname=q->value(0).toString(); } - rml.setAddress(addr); + delete q; + station=new RDStation(stationname); + if(station->exists()) { + rml.setAddress(station->address()); + } + else { + addr.setAddress(stationname); + if(addr.isNull()) { + emit finished(line); + delete station; + return; + } + rml.setAddress(addr); + } + delete station; } - delete station; rml.setArgQuantity(event_cmds[line]->argQuantity()-2); cmd= (RDMacro::Command)(256*event_cmds[line]->arg(1).toString().ascii()[0]+