// switcher.cpp // // Abstract base class for Rivendell Switcher/GPIO drivers. // // (C) Copyright 2002-2007,2010 Fred Gleason // // $Id: switcher.cpp,v 1.1.8.3 2013/11/16 01:06:01 cvs Exp $ // // 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 #include #include #include #include Switcher::Switcher(RDMatrix *matrix,QObject *parent,const char *name) : QObject(parent,name) { switcher_station_name=matrix->station(); switcher_matrix_number=matrix->matrix(); } Switcher::~Switcher() { } QString Switcher::stationName() const { return switcher_station_name; } int Switcher::matrixNumber() const { return switcher_matrix_number; } void Switcher::sendGpi() { } void Switcher::sendGpo() { } void Switcher::executeMacroCart(unsigned cartnum) { RDMacro rml; rml.setRole(RDMacro::Cmd); rml.setCommand(RDMacro::EX); rml.setAddress(rdstation->address()); rml.setEchoRequested(false); rml.setArgQuantity(1); rml.setArg(0,cartnum); emit rmlEcho(&rml); } void Switcher::logBytes(uint8_t *data,int len) { QString str; for(int i=0;ifirst()) { delete q; sql="insert into "+table+" set STATION_NAME=\""+ RDEscapeString(stationName())+"\","+ QString().sprintf("MATRIX=%u,NUMBER=%d",matrixNumber(),line); q=new RDSqlQuery(sql); } delete q; }