mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2018-03-11 Fred Gleason <fredg@paravelsystems.com>
* Converted ripcd(8) to use RDApplication. * Documented a 'Notification' message type in 'docs/apis/notification.xml'. * Added an 'RDMulticaster' class. * Added an 'mcast_recv_test' program in 'tests/'. * Added a 'SYSTEM.NOTIFICATION_ADDRESS' field to the database. * Incremented the database version to 276. * Added an 'Mcast Address for Notifications' control to the 'System-Wide Settings' dialog in rdadmin(1). * Implemented the 'Process Notification' ['ON'] command in ripcd(8). * Added an 'RDRipc::sendNotification()' method. * Added an 'RDRipc::notificationReceived()' signal.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A Rivendell switcher driver for systems using Software Authority Protocol
|
||||
//
|
||||
// (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -22,10 +22,11 @@
|
||||
|
||||
#include <qstringlist.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rddb.h>
|
||||
#include <globals.h>
|
||||
#include <swauthority.h>
|
||||
|
||||
#include "globals.h"
|
||||
#include "swauthority.h"
|
||||
|
||||
SoftwareAuthority::SoftwareAuthority(RDMatrix *matrix,QObject *parent)
|
||||
: Switcher(matrix,parent)
|
||||
@@ -297,7 +298,7 @@ void SoftwareAuthority::DispatchCommand()
|
||||
swa_istate=0;
|
||||
sql=QString("update MATRICES set ")+
|
||||
QString().sprintf("INPUTS=%d ",swa_inputs)+
|
||||
"where (STATION_NAME=\""+RDEscapeString(rdstation->name())+"\")&&"+
|
||||
"where (STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\")&&"+
|
||||
QString().sprintf("(MATRIX=%d)",swa_matrix);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
@@ -312,7 +313,7 @@ void SoftwareAuthority::DispatchCommand()
|
||||
sql=QString().sprintf("select NUMBER from INPUTS where \
|
||||
(STATION_NAME=\"%s\")&& \
|
||||
(MATRIX=%d)&&(NUMBER=%d)",
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
@@ -320,14 +321,14 @@ void SoftwareAuthority::DispatchCommand()
|
||||
(STATION_NAME=\"%s\")&&\
|
||||
(MATRIX=%d)&&(NUMBER=%d)",
|
||||
(const char *)name,
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
}
|
||||
else {
|
||||
sql=QString().sprintf("insert into INPUTS set NAME=\"%s\",\
|
||||
STATION_NAME=\"%s\",MATRIX=%d,NUMBER=%d",
|
||||
(const char *)name,
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
}
|
||||
delete q;
|
||||
@@ -343,7 +344,7 @@ void SoftwareAuthority::DispatchCommand()
|
||||
swa_istate=0;
|
||||
sql=QString("update MATRICES set ")+
|
||||
QString().sprintf("OUTPUTS=%d ",swa_outputs)+
|
||||
"where (STATION_NAME=\""+RDEscapeString(rdstation->name())+"\")&&"+
|
||||
"where (STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\")&&"+
|
||||
QString().sprintf("(MATRIX=%d)",swa_matrix);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
@@ -366,7 +367,7 @@ void SoftwareAuthority::DispatchCommand()
|
||||
sql=QString().sprintf("select NUMBER from OUTPUTS where \
|
||||
(STATION_NAME=\"%s\")&&\
|
||||
(MATRIX=%d)&&(NUMBER=%d)",
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
@@ -374,14 +375,14 @@ void SoftwareAuthority::DispatchCommand()
|
||||
(STATION_NAME=\"%s\")&&\
|
||||
(MATRIX=%d)&&(NUMBER=%d)",
|
||||
(const char *)name,
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
}
|
||||
else {
|
||||
sql=QString().sprintf("insert into OUTPUTS set NAME=\"%s\",\
|
||||
STATION_NAME=\"%s\",MATRIX=%d,NUMBER=%d",
|
||||
(const char *)name,
|
||||
(const char *)rdstation->name(),
|
||||
(const char *)rda->station()->name(),
|
||||
swa_matrix,f0[0].toInt());
|
||||
}
|
||||
delete q;
|
||||
@@ -393,7 +394,7 @@ void SoftwareAuthority::DispatchCommand()
|
||||
//
|
||||
sql=QString("update MATRICES set ")+
|
||||
QString().sprintf("GPIS=%d,GPOS=%d where ",swa_gpis,swa_gpos)+
|
||||
"(STATION_NAME=\""+RDEscapeString(rdstation->name())+"\")&&"+
|
||||
"(STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\")&&"+
|
||||
QString().sprintf("(MATRIX=%d)",swa_matrix);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
@@ -446,7 +447,7 @@ void SoftwareAuthority::ExecuteMacroCart(unsigned cartnum)
|
||||
RDMacro rml;
|
||||
rml.setRole(RDMacro::Cmd);
|
||||
rml.setCommand(RDMacro::EX);
|
||||
rml.setAddress(rdstation->address());
|
||||
rml.setAddress(rda->station()->address());
|
||||
rml.setEchoRequested(false);
|
||||
rml.setArgQuantity(1);
|
||||
rml.setArg(0,cartnum);
|
||||
|
||||
Reference in New Issue
Block a user