1 Star 0 Fork 12

冰雅轩/iec104text

forked from 真高兴/iec104text 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mainwindow.h 4.49 KB
一键复制 编辑 原始数据 按行查看 历史
真高兴 提交于 2014-08-20 09:03 . v1.0 创建104text
/*
* 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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/ice_elegant/iec104text.git
git@gitee.com:ice_elegant/iec104text.git
ice_elegant
iec104text
iec104text
master

搜索帮助

246c6175 1850385 950819b3 1850385