mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 22:43:11 +02:00
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
* Removed Q3Socket dependency from the Modbus switcher driver.
This commit is contained in:
parent
31661dab8a
commit
b5ad09d92c
@ -19626,3 +19626,6 @@
|
|||||||
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Removed Q3Socket dependency from the Software Authority switcher
|
* Removed Q3Socket dependency from the Software Authority switcher
|
||||||
driver.
|
driver.
|
||||||
|
2020-02-17 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Removed Q3Socket dependency from the Modbus switcher
|
||||||
|
driver.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// A Rivendell switcher driver for Modbus TCP
|
// A Rivendell switcher driver for Modbus TCP
|
||||||
//
|
//
|
||||||
// (C) Copyright 2017-2019 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2017-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -41,10 +41,11 @@ Modbus::Modbus(RDMatrix *matrix,QObject *parent)
|
|||||||
modbus_ip_address=matrix->ipAddress(RDMatrix::Primary);
|
modbus_ip_address=matrix->ipAddress(RDMatrix::Primary);
|
||||||
modbus_ip_port=matrix->ipPort(RDMatrix::Primary);
|
modbus_ip_port=matrix->ipPort(RDMatrix::Primary);
|
||||||
|
|
||||||
modbus_socket=new Q3Socket(this);
|
modbus_socket=new QTcpSocket(this);
|
||||||
connect(modbus_socket,SIGNAL(connected()),this,SLOT(connectedData()));
|
connect(modbus_socket,SIGNAL(connected()),this,SLOT(connectedData()));
|
||||||
connect(modbus_socket,SIGNAL(readyRead()),this,SLOT(readyReadData()));
|
connect(modbus_socket,SIGNAL(readyRead()),this,SLOT(readyReadData()));
|
||||||
connect(modbus_socket,SIGNAL(error(int)),this,SLOT(errorData(int)));
|
connect(modbus_socket,SIGNAL(error(QAbstractSocket::SocketError)),
|
||||||
|
this,SLOT(errorData(QAbstractSocket::SocketError)));
|
||||||
modbus_socket->connectToHost(modbus_ip_address.toString(),modbus_ip_port);
|
modbus_socket->connectToHost(modbus_ip_address.toString(),modbus_ip_port);
|
||||||
|
|
||||||
modbus_poll_timer=new QTimer(this);
|
modbus_poll_timer=new QTimer(this);
|
||||||
@ -301,7 +302,7 @@ void Modbus::readyReadData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Modbus::errorData(int err)
|
void Modbus::errorData(QAbstractSocket::SocketError err)
|
||||||
{
|
{
|
||||||
watchdogData();
|
watchdogData();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// A Rivendell switcher driver for Modbus TCP
|
// A Rivendell switcher driver for Modbus TCP
|
||||||
//
|
//
|
||||||
// (C) Copyright 2017 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2017-2020 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -25,7 +25,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <qsignalmapper.h>
|
#include <qsignalmapper.h>
|
||||||
#include <q3socket.h>
|
#include <qtcpsocket.h>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
|
|
||||||
#include <rd.h>
|
#include <rd.h>
|
||||||
@ -53,7 +53,7 @@ class Modbus : public Switcher
|
|||||||
private slots:
|
private slots:
|
||||||
void connectedData();
|
void connectedData();
|
||||||
void readyReadData();
|
void readyReadData();
|
||||||
void errorData(int err);
|
void errorData(QAbstractSocket::SocketError err);
|
||||||
void pollInputs();
|
void pollInputs();
|
||||||
void resetStateData(int line);
|
void resetStateData(int line);
|
||||||
void watchdogData();
|
void watchdogData();
|
||||||
@ -65,7 +65,7 @@ class Modbus : public Switcher
|
|||||||
int modbus_istate;
|
int modbus_istate;
|
||||||
int modbus_input_bytes;
|
int modbus_input_bytes;
|
||||||
std::vector<char> modbus_input_states;
|
std::vector<char> modbus_input_states;
|
||||||
Q3Socket *modbus_socket;
|
QTcpSocket *modbus_socket;
|
||||||
QTimer *modbus_poll_timer;
|
QTimer *modbus_poll_timer;
|
||||||
QTimer *modbus_watchdog_timer;
|
QTimer *modbus_watchdog_timer;
|
||||||
bool modbus_watchdog_active;
|
bool modbus_watchdog_active;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user