mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 17:13:47 +02:00
2018-06-21 Fred Gleason <fredg@paravelsystems.com>
* Added support for the Broadcast Tools SS 2.1 switcher.
This commit is contained in:
@@ -42,6 +42,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\
|
||||
btgpi16.cpp btgpi16.h\
|
||||
btsentinel4web.cpp btsentinel4web.h\
|
||||
btss124.cpp btss124.h\
|
||||
btss21.cpp btss21.h\
|
||||
btss164.cpp btss164.h\
|
||||
btss41mlr.cpp btss41mlr.h\
|
||||
btss42.cpp btss42.h\
|
||||
@@ -95,6 +96,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\
|
||||
moc_btsrc8iii.cpp\
|
||||
moc_btss124.cpp\
|
||||
moc_btss164.cpp\
|
||||
moc_btss21.cpp\
|
||||
moc_btss41mlr.cpp\
|
||||
moc_btss42.cpp\
|
||||
moc_btss44.cpp\
|
||||
|
122
ripcd/btss21.cpp
Normal file
122
ripcd/btss21.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
// btss21.cpp
|
||||
//
|
||||
// A Rivendell switcher driver for the BroadcastTools SS 2.1
|
||||
//
|
||||
// (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
|
||||
// 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 <qstringlist.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <globals.h>
|
||||
#include <btss21.h>
|
||||
|
||||
|
||||
BtSs21::BtSs21(RDMatrix *matrix,QObject *parent)
|
||||
: Switcher(matrix,parent)
|
||||
{
|
||||
//
|
||||
// Get Matrix Parameters
|
||||
//
|
||||
bt_matrix=matrix->matrix();
|
||||
bt_inputs=matrix->inputs();
|
||||
bt_outputs=matrix->outputs();
|
||||
|
||||
//
|
||||
// Initialize the TTY Port
|
||||
//
|
||||
RDTty *tty=new RDTty(rdstation->name(),matrix->port(RDMatrix::Primary));
|
||||
bt_device=new RDTTYDevice();
|
||||
if(tty->active()) {
|
||||
bt_device->setName(tty->port());
|
||||
bt_device->setSpeed(tty->baudRate());
|
||||
bt_device->setWordLength(tty->dataBits());
|
||||
bt_device->setParity(tty->parity());
|
||||
bt_device->open(IO_Raw|IO_ReadWrite);
|
||||
}
|
||||
delete tty;
|
||||
}
|
||||
|
||||
|
||||
BtSs21::~BtSs21()
|
||||
{
|
||||
delete bt_device;
|
||||
}
|
||||
|
||||
|
||||
RDMatrix::Type BtSs21::type()
|
||||
{
|
||||
return RDMatrix::BtSs21;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtSs21::gpiQuantity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtSs21::gpoQuantity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool BtSs21::primaryTtyActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool BtSs21::secondaryTtyActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void BtSs21::processCommand(RDMacro *cmd)
|
||||
{
|
||||
QString str;
|
||||
|
||||
switch(cmd->command()) {
|
||||
case RDMacro::ST:
|
||||
if((cmd->arg(1).toInt()<0)||(cmd->arg(1).toInt()>bt_inputs)||
|
||||
(cmd->arg(2).toInt()<1)||(cmd->arg(2).toInt()>1)) {
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
return;
|
||||
}
|
||||
if(cmd->arg(1).toInt()==0) {
|
||||
str=QString().sprintf("*%dM",BTSS21_UNIT_ID);
|
||||
bt_device->writeBlock(str,str.length());
|
||||
}
|
||||
else {
|
||||
str=QString().sprintf("*%d%d",BTSS21_UNIT_ID,
|
||||
cmd->arg(1).toInt());
|
||||
bt_device->writeBlock(str,str.length());
|
||||
}
|
||||
cmd->acknowledge(true);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
}
|
||||
}
|
55
ripcd/btss21.h
Normal file
55
ripcd/btss21.h
Normal file
@@ -0,0 +1,55 @@
|
||||
// btss21.h
|
||||
//
|
||||
// A Rivendell switcher driver for the BroadcastTools SS 2.1
|
||||
//
|
||||
// (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
|
||||
// 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 BTSS21_H
|
||||
#define BTSS21_H
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdmacro.h>
|
||||
#include <rdtty.h>
|
||||
#include <rdoneshot.h>
|
||||
|
||||
#include <switcher.h>
|
||||
|
||||
#define BTSS21_UNIT_ID 0
|
||||
|
||||
class BtSs21 : public Switcher
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BtSs21(RDMatrix *matrix,QObject *parent=0);
|
||||
~BtSs21();
|
||||
RDMatrix::Type type();
|
||||
unsigned gpiQuantity();
|
||||
unsigned gpoQuantity();
|
||||
bool primaryTtyActive();
|
||||
bool secondaryTtyActive();
|
||||
void processCommand(RDMacro *cmd);
|
||||
|
||||
private:
|
||||
RDTTYDevice *bt_device;
|
||||
int bt_matrix;
|
||||
int bt_inputs;
|
||||
int bt_outputs;
|
||||
};
|
||||
|
||||
|
||||
#endif // BTSS21_H
|
@@ -37,6 +37,7 @@
|
||||
#include <btsrc8iii.h>
|
||||
#include <btss124.h>
|
||||
#include <btss164.h>
|
||||
#include <btss21.h>
|
||||
#include <btss41mlr.h>
|
||||
#include <btss42.h>
|
||||
#include <btss44.h>
|
||||
@@ -126,6 +127,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num)
|
||||
ripcd_switcher[matrix_num]=new BtSs164(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::BtSs21:
|
||||
ripcd_switcher[matrix_num]=new BtSs21(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::BtSs41Mlr:
|
||||
ripcd_switcher[matrix_num]=new BtSs41Mlr(matrix,this);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user