Skip to content

Commit 0a019f1

Browse files
committed
QTester104 version 2.4.1.
1 parent 6184a19 commit 0a019f1

File tree

8 files changed

+267
-251
lines changed

8 files changed

+267
-251
lines changed

qtester104/IEC104.pro

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# -------------------------------------------------
2-
# Project created by QtCreator 2009-12-28T16:19:15
3-
# -------------------------------------------------
4-
QT += network \
5-
widgets
6-
TARGET = QTester104
7-
TEMPLATE = app
8-
SOURCES += main.cpp \
9-
mainwindow.cpp \
10-
iec104_class.cpp \
11-
logmsg.cpp \
12-
qiec104.cpp
13-
HEADERS += mainwindow.h \
14-
iec104_types.h \
15-
bdtr.h \
16-
iec104_class.h \
17-
logmsg.h \
18-
qiec104.h
19-
FORMS += mainwindow.ui
20-
OTHER_FILES += \
21-
qtester104.ini
1+
# -------------------------------------------------
2+
# Project created by QtCreator 2009-12-28T16:19:15
3+
# -------------------------------------------------
4+
QT += network \
5+
widgets
6+
TARGET = QTester104
7+
TEMPLATE = app
8+
SOURCES += main.cpp \
9+
mainwindow.cpp \
10+
iec104_class.cpp \
11+
logmsg.cpp \
12+
qiec104.cpp
13+
HEADERS += mainwindow.h \
14+
iec104_types.h \
15+
iec104_class.h \
16+
logmsg.h \
17+
qiec104.h
18+
FORMS += mainwindow.ui
19+
OTHER_FILES += \
20+
qtester104.ini

qtester104/iec104_class.cpp

Lines changed: 68 additions & 40 deletions
Large diffs are not rendered by default.

qtester104/iec104_class.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class iec104_class {
197197
int tout_supervisory; // countdown to send supervisory window control
198198
int tout_gi; // countdown to send general interrogation
199199
int tout_testfr; // countdown to send test frame
200+
bool broken_msg = false;
200201
bool connectedTCP; // tcp connection state
201202
bool seq_order_check; // if set: test message order, disconnect if out of order
202203
unsigned char masterAddress; // master link address (primary address, originator address, oa)
@@ -214,7 +215,7 @@ class iec104_class {
214215

215216
protected:
216217
void LogFrame(char* frame, int size, bool is_send);
217-
void LogPoint(int address, double val, char* qualifier, cp56time2a* timetag);
218+
void LogPoint(char* buf, int address, double val, char* qualifier, cp56time2a* timetag);
218219
void parseAPDU(iec_apdu* papdu, int sz, bool accountandrespond = true); // parse APDU, ( accountandrespond == false : process the apdu out of the normal handshake )
219220
char* trim(char* s);
220221

@@ -225,6 +226,8 @@ class iec104_class {
225226

226227
// ---- pure virtual funcions, user defined on derived class (mandatory)---
227228

229+
// wait milliseconds for data bytes
230+
virtual void waitBytes(int bytes, int msTout) = 0;
228231
// make tcp connection, user provided
229232
virtual void connectTCP() = 0;
230233
// tcp disconnect, user provided

qtester104/mainwindow.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
using namespace std;
4242

43-
#define QTESTER_VERSION "v2.1"
44-
#define QTESTER_COPYRIGHT "Copyright © 2010-2019 Ricardo Lastra Olsen"
43+
#define QTESTER_VERSION "v2.4.1"
44+
#define QTESTER_COPYRIGHT "Copyright © 2010-2024 Ricardo Lastra Olsen"
4545
#define CURDIRINIFILENAME "/qtester104.ini"
4646
#define CONFDIRINIFILENAME "../conf/qtester104.ini"
4747

@@ -325,9 +325,9 @@ void MainWindow::slot_I104M_ready_to_read() {
325325
break;
326326
case iec104_class::C_RC_TA_1: // regulating step command with time tag
327327
case iec104_class::C_RC_NA_1: // regulating step command
328-
sprintf(buf, "R--> I104M: regulating step command %f", double(pmsg->setpoint));
328+
sprintf(buf, "R--> I104M: regulating step command %s", pmsg->setpoint==0?"LOWER":"RAISE");
329329
I104M_Loga(buf);
330-
obj.rcs = static_cast<unsigned char>(pmsg->setpoint);
330+
obj.rcs = pmsg->setpoint==0?1:2;
331331
i104.sendCommand(&obj);
332332
LastCommandAddress = obj.address;
333333
break;
@@ -447,7 +447,7 @@ void MainWindow::on_pbSendCommandsButton_clicked() {
447447
break;
448448
case iec104_class::P_AC_NA_1:
449449
obj.value = ui->leCmdValue->text().toInt();
450-
obj.qpa =static_cast<unsigned char>(ui->leCmdValue->text().toUInt());
450+
obj.qpa = ui->leCmdValue->text().toInt();
451451
break;
452452
}
453453
obj.qu = static_cast<unsigned char>(ui->cbCmdDuration->currentText().left(1).toUInt());
@@ -1004,7 +1004,7 @@ void MainWindow::on_pbCopyVals_clicked() {
10041004
}
10051005

10061006
void MainWindow::I104M_processPoints(iec_obj* obj, unsigned numpoints) {
1007-
static t_msgsupsq msg;
1007+
t_msgsupsq msg;
10081008

10091009
switch (obj->type) {
10101010
case iec104_class::M_DP_TB_1: { // double state with time tag

0 commit comments

Comments
 (0)