Skip to content

Commit

Permalink
QTester104 version 2.4.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen committed Mar 23, 2024
1 parent 6184a19 commit 0a019f1
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 251 deletions.
41 changes: 20 additions & 21 deletions qtester104/IEC104.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# -------------------------------------------------
# Project created by QtCreator 2009-12-28T16:19:15
# -------------------------------------------------
QT += network \
widgets
TARGET = QTester104
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
iec104_class.cpp \
logmsg.cpp \
qiec104.cpp
HEADERS += mainwindow.h \
iec104_types.h \
bdtr.h \
iec104_class.h \
logmsg.h \
qiec104.h
FORMS += mainwindow.ui
OTHER_FILES += \
qtester104.ini
# -------------------------------------------------
# Project created by QtCreator 2009-12-28T16:19:15
# -------------------------------------------------
QT += network \
widgets
TARGET = QTester104
TEMPLATE = app
SOURCES += main.cpp \
mainwindow.cpp \
iec104_class.cpp \
logmsg.cpp \
qiec104.cpp
HEADERS += mainwindow.h \
iec104_types.h \
iec104_class.h \
logmsg.h \
qiec104.h
FORMS += mainwindow.ui
OTHER_FILES += \
qtester104.ini
108 changes: 68 additions & 40 deletions qtester104/iec104_class.cpp

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion qtester104/iec104_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class iec104_class {
int tout_supervisory; // countdown to send supervisory window control
int tout_gi; // countdown to send general interrogation
int tout_testfr; // countdown to send test frame
bool broken_msg = false;
bool connectedTCP; // tcp connection state
bool seq_order_check; // if set: test message order, disconnect if out of order
unsigned char masterAddress; // master link address (primary address, originator address, oa)
Expand All @@ -214,7 +215,7 @@ class iec104_class {

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

Expand All @@ -225,6 +226,8 @@ class iec104_class {

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

// wait milliseconds for data bytes
virtual void waitBytes(int bytes, int msTout) = 0;
// make tcp connection, user provided
virtual void connectTCP() = 0;
// tcp disconnect, user provided
Expand Down
12 changes: 6 additions & 6 deletions qtester104/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

using namespace std;

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

Expand Down Expand Up @@ -325,9 +325,9 @@ void MainWindow::slot_I104M_ready_to_read() {
break;
case iec104_class::C_RC_TA_1: // regulating step command with time tag
case iec104_class::C_RC_NA_1: // regulating step command
sprintf(buf, "R--> I104M: regulating step command %f", double(pmsg->setpoint));
sprintf(buf, "R--> I104M: regulating step command %s", pmsg->setpoint==0?"LOWER":"RAISE");
I104M_Loga(buf);
obj.rcs = static_cast<unsigned char>(pmsg->setpoint);
obj.rcs = pmsg->setpoint==0?1:2;
i104.sendCommand(&obj);
LastCommandAddress = obj.address;
break;
Expand Down Expand Up @@ -447,7 +447,7 @@ void MainWindow::on_pbSendCommandsButton_clicked() {
break;
case iec104_class::P_AC_NA_1:
obj.value = ui->leCmdValue->text().toInt();
obj.qpa =static_cast<unsigned char>(ui->leCmdValue->text().toUInt());
obj.qpa = ui->leCmdValue->text().toInt();
break;
}
obj.qu = static_cast<unsigned char>(ui->cbCmdDuration->currentText().left(1).toUInt());
Expand Down Expand Up @@ -1004,7 +1004,7 @@ void MainWindow::on_pbCopyVals_clicked() {
}

void MainWindow::I104M_processPoints(iec_obj* obj, unsigned numpoints) {
static t_msgsupsq msg;
t_msgsupsq msg;

switch (obj->type) {
case iec104_class::M_DP_TB_1: { // double state with time tag
Expand Down
Loading

0 comments on commit 0a019f1

Please sign in to comment.