mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2015-02-27 Fred Gleason <fredg@paravelsystems.com>
* Renamed the 'SAS User Serial Interface' driver to 'SAS USI (3 digit)'. * Added an 'SAS USI (2 digit)' swticher driver in 'ripcd/sasusi2digit.cpp' and 'ripcd/sasusi2digit.h'.
This commit is contained in:
@@ -14800,3 +14800,5 @@
|
||||
2015-02-27 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Renamed the 'SAS User Serial Interface' driver to
|
||||
'SAS USI (3 digit)'.
|
||||
* Added an 'SAS USI (2 digit)' swticher driver in
|
||||
'ripcd/sasusi2digit.cpp' and 'ripcd/sasusi2digit.h'.
|
||||
|
||||
@@ -25,6 +25,7 @@ Quartz Electronics Type 1 Routing Protocol
|
||||
Serial Port Modem Control Lines
|
||||
Sierra Automated Systems 32000 Audio Router
|
||||
Sierra Automated Systems 64000 Audio Router
|
||||
Sierra Automated Systems User Serial Interface (USI) (2 digit)
|
||||
Sierra Automated Systems User Serial Interface (USI) (3 digit)
|
||||
Sine Systems ACU-1 (Prophet version)
|
||||
Software Authority Protocol
|
||||
@@ -590,6 +591,25 @@ and no terminator. This driver allows control of the system's GPO
|
||||
outputs as well as audio crosspoints.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
SIERRA AUTOMATED SYSTEMS User Serial Interface (USI) (2 digit)
|
||||
|
||||
Driver Name: SAS USI (2 digit)
|
||||
|
||||
Supported RML Commands:
|
||||
Switch Take ('ST')
|
||||
|
||||
GENERAL NOTES:
|
||||
Control can done by means of an RS-232C connection to the 'User Serial
|
||||
Interface' port on the unit. Serial port parameters should be:
|
||||
|
||||
Baud Rate: 9600
|
||||
Parity: None
|
||||
Data Bits: 8
|
||||
Stop Bits: 1
|
||||
Terminator: None
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
SIERRA AUTOMATED SYSTEMS User Serial Interface (USI) (3 digit)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // BT 16x1
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // BT 8x2
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0}, // BT ACS 8.2
|
||||
{1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,0,1,1,1,1,0,0,0,1,1,0,0,0,0}, // SAS USI
|
||||
{1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,0,1,1,1,1,0,0,0,1,1,0,0,0,0}, // SAS USI 3
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0}, // BT 16x2
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // BT SS 12.4
|
||||
{0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // Local Adapter
|
||||
@@ -64,7 +64,8 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // BT Sentinel 4 Web
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, // BT GPI-16
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, // Modem Lines
|
||||
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0} // Software Authority
|
||||
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0}, // Software Authority
|
||||
{0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,1,0,0,0,0} // SAS USI 2
|
||||
};
|
||||
bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{
|
||||
@@ -82,7 +83,7 @@ bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT 16x1
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT 8x2
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT ACS 8.2
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // SAS USI
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // SAS USI 3
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT 16x2
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT SS 12.4
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // Local Adapter
|
||||
@@ -103,7 +104,8 @@ bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT Sentinel 4 Web
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // BT GPI-16
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // Modem Lines
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // Software Authority
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // Software Authority
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // SAS USI 2
|
||||
};
|
||||
|
||||
int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
@@ -122,7 +124,7 @@ int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,0,0,0,0,0,0,0,0,0,16,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT 16x1
|
||||
{0,0,0,0,0,0,0,0,0,0,0,8,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT 8x2
|
||||
{0,0,0,0,0,0,0,0,0,0,0,8,2,16,16,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT ACS 8.2
|
||||
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // SAS USI
|
||||
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // SAS USI 3
|
||||
{0,0,0,0,0,0,0,0,0,0,0,16,2,16,16,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT 16x2
|
||||
{0,0,0,0,0,0,0,0,0,0,0,12,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT SS 12.4
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Local Adapter
|
||||
@@ -143,7 +145,8 @@ int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{1,0,0,0,0,0,0,0,0,0,0,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT Sentinel 4 Web
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT GPI-16
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Modem Lines
|
||||
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // Software Authority
|
||||
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Software Authority
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // SAS USI 2
|
||||
};
|
||||
|
||||
RDMatrix::RDMatrix(const QString &station,int matrix)
|
||||
@@ -603,6 +606,10 @@ QString RDMatrix::typeString(RDMatrix::Type type)
|
||||
return QString("BroadcastTools ACS 8.2");
|
||||
break;
|
||||
|
||||
case RDMatrix::SasUsi2Digit:
|
||||
return QString("SAS USI (2 digit)");
|
||||
break;
|
||||
|
||||
case RDMatrix::SasUsi3Digit:
|
||||
return QString("SAS USI (3 digit)");
|
||||
break;
|
||||
|
||||
@@ -38,7 +38,7 @@ class RDMatrix
|
||||
BtSs42=19,LiveWireLwrpAudio=20,Quartz1=21,BtSs44=22,BtSrc8III=23,
|
||||
BtSrc16=24,Harlond=25,Acu1p=26,LiveWireMcastGpio=27,Am16=28,
|
||||
LiveWireLwrpGpio=29,BtSentinel4Web=30,BtGpi16=31,ModemLines=32,
|
||||
SoftwareAuthority=33,LastType=34};
|
||||
SoftwareAuthority=33,SasUsi2Digit=34,LastType=35};
|
||||
enum Endpoint {Input=0,Output=1};
|
||||
enum Mode {Stereo=0,Left=1,Right=2};
|
||||
enum VguestAttribute {VguestEngine=0,VguestDevice=1,VguestSurface=2,
|
||||
|
||||
@@ -63,6 +63,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\
|
||||
sas32000.cpp sas32000.h\
|
||||
sas64000.cpp sas64000.h\
|
||||
sas64000gpi.cpp sas64000gpi.h\
|
||||
sasusi2digit.cpp sasusi2digit.h\
|
||||
sasusi3digit.cpp sasusi3digit.h\
|
||||
starguide3.cpp starguide3.h\
|
||||
starguide_feed.cpp starguide_feed.h\
|
||||
@@ -101,6 +102,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\
|
||||
moc_sas32000.cpp\
|
||||
moc_sas64000.cpp\
|
||||
moc_sas64000gpi.cpp\
|
||||
moc_sasusi2digit.cpp\
|
||||
moc_sasusi3digit.cpp\
|
||||
moc_starguide3.cpp\
|
||||
moc_swauthority.cpp\
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <sas32000.h>
|
||||
#include <sas64000.h>
|
||||
#include <sas64000gpi.h>
|
||||
#include <sasusi2digit.h>
|
||||
#include <sasusi3digit.h>
|
||||
#include <starguide3.h>
|
||||
#include <swauthority.h>
|
||||
@@ -175,6 +176,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num)
|
||||
ripcd_switcher[matrix_num]=new Sas64000Gpi(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::SasUsi2Digit:
|
||||
ripcd_switcher[matrix_num]=new SasUsi2Digit(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::SasUsi3Digit:
|
||||
ripcd_switcher[matrix_num]=new SasUsi3Digit(matrix,this);
|
||||
break;
|
||||
|
||||
132
ripcd/sasusi2digit.cpp
Normal file
132
ripcd/sasusi2digit.cpp
Normal file
@@ -0,0 +1,132 @@
|
||||
// sasusi2digit.cpp
|
||||
//
|
||||
// A Rivendell switcher driver for the SAS USI Protocol (2 digit)
|
||||
//
|
||||
// (C) Copyright 2002-2015 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <rddb.h>
|
||||
#include <globals.h>
|
||||
#include <sasusi2digit.h>
|
||||
|
||||
SasUsi2Digit::SasUsi2Digit(RDMatrix *matrix,QObject *parent,const char *name)
|
||||
: Switcher(matrix,parent,name)
|
||||
{
|
||||
RDTty *tty;
|
||||
sas_matrix=matrix->matrix();
|
||||
sas_ptr=0;
|
||||
|
||||
//
|
||||
// Get Matrix Parameters
|
||||
//
|
||||
sas_inputs=matrix->inputs();
|
||||
sas_outputs=matrix->outputs();
|
||||
sas_gpis=matrix->gpis();
|
||||
sas_gpos=matrix->gpos();
|
||||
|
||||
//
|
||||
// Initialize the connection
|
||||
//
|
||||
tty=new RDTty(rdstation->name(),matrix->port(RDMatrix::Primary));
|
||||
sas_device=new RDTTYDevice();
|
||||
if(tty->active()) {
|
||||
sas_device->setName(tty->port());
|
||||
sas_device->setSpeed(tty->baudRate());
|
||||
sas_device->setWordLength(tty->dataBits());
|
||||
sas_device->setParity(tty->parity());
|
||||
sas_device->open(IO_Raw|IO_ReadWrite);
|
||||
}
|
||||
delete tty;
|
||||
}
|
||||
|
||||
|
||||
RDMatrix::Type SasUsi2Digit::type()
|
||||
{
|
||||
return RDMatrix::SasUsi2Digit;
|
||||
}
|
||||
|
||||
|
||||
unsigned SasUsi2Digit::gpiQuantity()
|
||||
{
|
||||
return sas_gpis;
|
||||
}
|
||||
|
||||
|
||||
unsigned SasUsi2Digit::gpoQuantity()
|
||||
{
|
||||
return sas_gpos;
|
||||
}
|
||||
|
||||
|
||||
bool SasUsi2Digit::primaryTtyActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SasUsi2Digit::secondaryTtyActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SasUsi2Digit::processCommand(RDMacro *cmd)
|
||||
{
|
||||
char str[256];
|
||||
|
||||
switch(cmd->command()) {
|
||||
case RDMacro::ST:
|
||||
if((cmd->arg(1).toInt()<0)||(cmd->arg(1).toInt()>sas_inputs)||
|
||||
(cmd->arg(2).toInt()<1)||(cmd->arg(2).toInt()>sas_outputs)) {
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
return;
|
||||
}
|
||||
snprintf(str,256,"%c%02d%02d\x0D\x0A",20,
|
||||
cmd->arg(1).toInt(),cmd->arg(2).toInt());
|
||||
SendCommand(str);
|
||||
cmd->acknowledge(true);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SasUsi2Digit::SendCommand(char *str)
|
||||
{
|
||||
LogLine(RDConfig::LogDebug,QString().sprintf("sending USI cmd: %s",(const char *)PrettifyCommand(str)));
|
||||
|
||||
sas_device->writeBlock(str,strlen(str));
|
||||
}
|
||||
|
||||
|
||||
QString SasUsi2Digit::PrettifyCommand(const char *cmd) const
|
||||
{
|
||||
QString ret;
|
||||
if(cmd[0]<26) {
|
||||
ret=QString().sprintf("^%c%s",'@'+cmd[0],cmd+1);
|
||||
}
|
||||
else {
|
||||
ret=cmd;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
65
ripcd/sasusi2digit.h
Normal file
65
ripcd/sasusi2digit.h
Normal file
@@ -0,0 +1,65 @@
|
||||
// sasusi2digit.h
|
||||
//
|
||||
// A Rivendell switcher driver for the SAS USI Protocol (2 digit)
|
||||
//
|
||||
// (C) Copyright 2002-2015 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
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef SASUSI2DIGIT_H
|
||||
#define SASUSI2DIGIT_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <qsocket.h>
|
||||
#include <qhostaddress.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdmacro.h>
|
||||
#include <rdtty.h>
|
||||
|
||||
#include <switcher.h>
|
||||
|
||||
#define SASUSI2DIGIT_MAX_LENGTH 256
|
||||
|
||||
class SasUsi2Digit : public Switcher
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SasUsi2Digit(RDMatrix *matrix,QObject *parent=0,const char *name=0);
|
||||
RDMatrix::Type type();
|
||||
unsigned gpiQuantity();
|
||||
unsigned gpoQuantity();
|
||||
bool primaryTtyActive();
|
||||
bool secondaryTtyActive();
|
||||
void processCommand(RDMacro *cmd);
|
||||
|
||||
private:
|
||||
void SendCommand(char *str);
|
||||
QString PrettifyCommand(const char *cmd) const;
|
||||
RDTTYDevice *sas_device;
|
||||
char sas_buffer[SASUSI2DIGIT_MAX_LENGTH];
|
||||
unsigned sas_ptr;
|
||||
int sas_matrix;
|
||||
int sas_ipport;
|
||||
int sas_inputs;
|
||||
int sas_outputs;
|
||||
int sas_gpis;
|
||||
int sas_gpos;
|
||||
};
|
||||
|
||||
|
||||
#endif // SASUSI2DIGIT_H
|
||||
@@ -1,4 +1,4 @@
|
||||
// sasusi.cpp
|
||||
// sasusi3digit.cpp
|
||||
//
|
||||
// A Rivendell switcher driver for the SAS USI Protocol (3 digit)
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user