Ejemplo n.º 1
0
IcyConnector::IcyConnector(int version,QObject *parent)
    : Connector(parent)
{
    icy_protocol_version=version;
    icy_recv_buffer="";
    icy_authenticated=false;

    icy_socket=new QTcpSocket(this);
    connect(icy_socket,SIGNAL(connected()),this,SLOT(socketConnectedData()));
    connect(icy_socket,SIGNAL(disconnected()),
            this,SLOT(socketDisconnectedData()));
    connect(icy_socket,SIGNAL(readyRead()),this,SLOT(socketReadyReadData()));
    connect(icy_socket,SIGNAL(error(QAbstractSocket::SocketError)),
            this,SLOT(socketErrorData(QAbstractSocket::SocketError)));
}
Ejemplo n.º 2
0
Harlond::Harlond(RDMatrix *matrix,QObject *parent)
  : Switcher(matrix,parent)
{
  bt_recv_buffer="";

  //
  // Get Matrix Parameters
  //
  bt_ip_address=matrix->ipAddress(RDMatrix::Primary);
  bt_tcp_port=matrix->ipPort(RDMatrix::Primary);
  bt_password=matrix->password(RDMatrix::Primary);
  bt_matrix=matrix->matrix();
  bt_inputs=matrix->inputs();
  bt_outputs=matrix->outputs();
  bt_start_cart=matrix->startCart(RDMatrix::Primary);
  bt_stop_cart=matrix->stopCart(RDMatrix::Primary);

  //
  // Reset Timers
  //
  bt_reset_mapper=new QSignalMapper(this);
  connect(bt_reset_mapper,SIGNAL(mapped(int)),this,SLOT(resetTimeoutData(int)));
  for(int i=0;i<bt_inputs;i++) {
    bt_reset_states.push_back(false);
    bt_reset_timers.push_back(new QTimer(this));
    bt_reset_mapper->setMapping(bt_reset_timers.back(),i);
    connect(bt_reset_timers.back(),SIGNAL(timeout()),
	    bt_reset_mapper,SLOT(map()));
  }

  //
  // Initialize TCP/IP Connection
  //
  bt_socket=new QSocket(this);
  connect(bt_socket,SIGNAL(connected()),this,SLOT(socketConnectedData()));
  connect(bt_socket,SIGNAL(disconnected()),this,SLOT(socketDisconnectedData()));
  connect(bt_socket,SIGNAL(readyRead()),this,SLOT(socketReadyReadData()));
  connect(bt_socket,SIGNAL(error(QAbstractSocket::SocketError)),
	  this,SLOT(socketErrorData(QAbstractSocket::SocketError)));
  bt_watchdog_timer=new QTimer(this);
  connect(bt_watchdog_timer,SIGNAL(timeout()),this,SLOT(watchdogTimeoutData()));
  bt_watchdog_timer->start(5000,true);
}