代码拉取完成,页面将自动刷新
同步操作将从 真高兴/iec104text 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* This software implements an IEC 60870-5-104 protocol tester.
* Copyright ?2010,2011,2012 Ricardo L. Olsen
*
* Disclaimer
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtWidgets/QMainWindow>
#include <QtNetwork/QUdpSocket>
#include <QLineEdit>
#include <QTextBrowser>
#include <QPushButton>
#include <QTimer>
#include <QSettings>
#include <QTableWidgetItem>
#include <map>
#include "bdtr.h"
#include "iec104_class.h"
#include "qiec104.h"
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
protected:
void closeEvent( QCloseEvent *event );
public:
MainWindow( QWidget *parent = 0 );
~MainWindow();
private slots:
void on_cbLog_clicked();
void on_pbSendCommandsButton_clicked();
void on_pbConnect_clicked(); // connect button pressed
void on_pbGI_clicked(); // GI button pressed
void slot_timer_logmsg(); // timer for log messages
void slot_timer_BDTR_kamsg(); // timer for sending keepalive BDTR messages
void slot_BDTR_pronto_para_ler(); // BDTR: sinal para leitura de dados no tcp do BDTR
void slot_dataIndication( iec_obj *obj, int numpoints );
void slot_interrogationActConfIndication();
void slot_interrogationActTermIndication();
void slot_tcpconnect(); // tcp connect for iec104
void slot_tcpdisconnect(); // tcp disconnect for iec104
void slot_commandActConfIndication( iec_obj *obj );
void slot_commandActTermIndication( iec_obj *obj );
private:
std::map <int, QTableWidgetItem *> mapPtItem_ColAddress; // map of points to cells of table
std::map <int, QTableWidgetItem *> mapPtItem_ColValue;
std::map <int, QTableWidgetItem *> mapPtItem_ColType;
std::map <int, QTableWidgetItem *> mapPtItem_ColCause;
std::map <int, QTableWidgetItem *> mapPtItem_ColFlags;
std::map <int, QTableWidgetItem *> mapPtItem_ColCount;
Ui::MainWindow *ui;
QTimer *tmLogMsg; // timer to show log messages
QIec104 i104;
unsigned LastCommandAddress;
int SendCommands; // 1 = allow sending commands, 0 = don't send commands
int Hide;
// BDTR Related
void BDTR_Loga( QString str, int id=0 ); // BDTR: log messages
void BDTR_processPoints( iec_obj *obj, int numpoints ); // BDTR: process points
inline bool BDTR_HaveDualHost() { return ( BDTR_host_dual != (QHostAddress)"0.0.0.0"); };
bool isPrimary; // define se modo primrio ou secundrio (o secundrio permanece desconectado pelo IEC104)
static const int BDTR_CntToBePrimary = 2; // counts necessary to be primary when not receiving keepalive messages
int BDTR_CntDnToBePrimary; // countdown to be primary when not receiving keepalive messages
int BDTR_Logar; // controla log das mensagens BDTR
QTimer *tmBDTR_kamsg; // timer to send keep alive messages to the dual host
static const int BDTR_seconds_kamsg = 7;
QUdpSocket *udps; // BDTR: udp socket
QHostAddress BDTR_host; // endereo IP do cliente BDTR (normalmente a prpria mquina)
QHostAddress BDTR_host_dual; // endereo IP do cliente BDTR dual
static const int BDTR_porta = 65280; // porta UDP para envio de dados aos clientes BDTR
static const int BDTR_porta_escuta = 65281; // porta UDP para envio de dados aos clientes BDTR
static const unsigned char BDTR_orig = 0; // endereo de origem BDTR
};
#endif // MAINWINDOW_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。