mtsimulator.git
3 years agoMtSimulator, WorkerInterface master
Marcelin [Thu, 4 Apr 2019 20:54:35 +0000 (22:54 +0200)]
MtSimulator, WorkerInterface

* MtSimulator:
** Logging as CSV file

* WorkerInterface:
* derived from QObject: needed for the timer in MtSimulator

3 years agoMtSimulator, Regulator, SimSlave, SimSlaveUnit
Marcelin [Sun, 31 Mar 2019 19:27:10 +0000 (21:27 +0200)]
MtSimulator, Regulator, SimSlave, SimSlaveUnit

* MtSimulator:
** mtSimulator: task receipient: a slave name only is possible
** doublesAreEqual(): error on: values equal and 0
* Regulator:
** avoiding first fetch
** error: target() in oneStep()
** no regulation on wrong input values
* SimSlave:
** config file: option setfrombus for units
** MinIntervalOfCall 20 -> 50 msec
* SimSlaveUnit
** implementation of setFromBus

3 years agoRefactoring Regulator, comments
Marcelin [Tue, 26 Mar 2019 19:32:29 +0000 (20:32 +0100)]
Refactoring Regulator, comments

3 years agoRegulator improvements
Winfried [Sun, 24 Mar 2019 18:49:05 +0000 (19:49 +0100)]
Regulator improvements

3 years agonew classes Regulator and MinMaxRegulator
Winfried [Sun, 24 Mar 2019 07:05:04 +0000 (08:05 +0100)]
new classes Regulator and MinMaxRegulator

3 years agoControl of formula dump, creating of csv
Marcelin [Fri, 22 Mar 2019 19:30:12 +0000 (20:30 +0100)]
Control of formula dump, creating of csv

*Option --csv-pacseth creates the simulation data of pacseth

3 years agoDebugging reduced
Marcelin [Sun, 10 Mar 2019 21:39:39 +0000 (22:39 +0100)]
Debugging reduced

3 years agoAvoiding memory leaks, error handling
Marcelin [Fri, 8 Mar 2019 20:46:28 +0000 (21:46 +0100)]
Avoiding memory leaks, error handling

* DataTable: handling non existing CSV file
* Logger: debug messages disabled
* main: test of memory leaks in parser
* comments to find the delete operator of each new()
* definition of MtSimulatorDummy to replace MtSimulator with no memory
  requests
* new: GCIClassification.dia+*.svg

3 years agoMtSimulator, remoteexecutor
Marcelin [Sat, 2 Mar 2019 20:12:27 +0000 (21:12 +0100)]
MtSimulator, remoteexecutor

* MtSimulator: initialization corrected
* remoteexecutor: TaskAcceptor renamed to TaskInitiator

3 years agoMtSimulator, SimSlave, SimSlaveUnit
Marcelin [Thu, 21 Feb 2019 22:20:37 +0000 (23:20 +0100)]
MtSimulator, SimSlave, SimSlaveUnit

*MtSimulator: new: startTime set in MtSimulator in order to allow all
             slaves and units to have the same startTime when a setpoint
             is made
*SimSlave: new: getParent()
**SimSlaveUnit: fix: startTime removed
**SimSlaveUnit: fix:ignoreSetPoint(): ignores identical setpoint
                values which are requested automatically by Spree

3 years agopowerToResistance
Marcelin [Sun, 17 Feb 2019 22:52:35 +0000 (23:52 +0100)]
powerToResistance

*powerToResistance: resistance at 298.15K

3 years agoMathematicalFunction,
Marcelin [Thu, 14 Feb 2019 21:43:02 +0000 (22:43 +0100)]
MathematicalFunction,

*MathematicalFunction: fix: wrong condition for decreasing function

3 years agoSimSlave
Marcelin [Tue, 12 Feb 2019 22:53:55 +0000 (23:53 +0100)]
SimSlave

* SimSlave: fix: call of handleAllStorages()

3 years agoLogger, MtSimulator, remoteexecutor, SimSlave
Marcelin [Mon, 11 Feb 2019 21:21:19 +0000 (22:21 +0100)]
Logger, MtSimulator, remoteexecutor, SimSlave

* Logger: new: ignoreQDebug, clearErrors()
* MtSimulator:
** all slaves are handled in one process.
** IPC with a self developed message system (remoteexecutor.*)
   DBus messages has too many restrictions
** removed: TaskManager, InverterDBusReceiver...

* SimSlave: serves requests via WorkerService

3 years agoThread specific DBus receiver, SimSlave
Marcelin [Thu, 7 Feb 2019 23:10:39 +0000 (00:10 +0100)]
Thread specific DBus receiver, SimSlave

* new: DBusReceiver, BMSDBusReceiver, InverterDBusReceiver
* SimSlave: fix: wrong condition in getLastCall()

3 years agoTaskManager, SharedMemory, DBUS-communications
root [Tue, 5 Feb 2019 20:36:40 +0000 (21:36 +0100)]
TaskManager, SharedMemory, DBUS-communications

* new class: TaskManager
* new class: SharedMemory
** the Inverter thread and the BMS thread must be syncronized
** Both sends via DBUS to the other: therefore both must be initialized
   before the DBUS messages can be sent
* DBUS communication:
** see document activity_dbus.dia
** it is not allowed to use the DBUS between DBUS message and DBUS
   answer
** the task manager is used to move task from the DBUS slot method

3 years agoMinIntervalOfCall, SimSlaveUnit
root [Wed, 30 Jan 2019 22:58:55 +0000 (23:58 +0100)]
MinIntervalOfCall, SimSlaveUnit

* MinIntervalOfCall set from 10 to 5
* SimSlaveUnit: fix for calculateDeltaT(): if actual==last

3 years agoConst functions, DataTable, Logger, Parser, SimSlaveUnit
Marcelin [Tue, 29 Jan 2019 23:12:25 +0000 (00:12 +0100)]
Const functions, DataTable, Logger, Parser, SimSlaveUnit

* const functions: possibility to change the values interactivly
* Data table number format: scientific notations
* Logger: new debug() + ignoreDebug, errorCount
* Parser:
** min, max, minmax, abs, ispositive
** fix: identifiers with function names as part are handled wrong
* SimSlaveUnit:
** new feature: storage

3 years agoArithmeticFunction MtVariant Parser SlaveUnitInfo SimSlave
Marcelin [Sat, 26 Jan 2019 19:56:22 +0000 (20:56 +0100)]
ArithmeticFunction MtVariant Parser SlaveUnitInfo SimSlave

* ArithmeticFunction: fix: error in calculateDeltaT()
* new: union ModuleAlarm
* MtVariant: fix: error in copy constructor
* Parser:
** Strings (as function arguments)
** more than one function argument
** redefined: sign()
** new: ispositive(), interval()
*SlaveUnitInfo:
** storing name
** SlaveUnitInfo addresses stored in _mapValidXXXRegister
* SimSlave:
** fix: wrong: fetch() stores SlaveUnitInfos in _mapInputRegister
** new feature: <slaveUnit>.last
** storing "last call": avoiding endless looping in QBus events
* SimSlaveUnit:
** fix: distinction between real time (clock) and relative time (related
   to the setpoint)
** new: getInterval()

3 years agoParser, SimSlaveUnit
Marcelin [Mon, 21 Jan 2019 20:29:48 +0000 (21:29 +0100)]
Parser, SimSlaveUnit

* Parser: new function integralext() integralp on a remote slave
* SimSlaveUnit: signals removed

3 years agoDataTable, integralP, SimSlaveUnit Unittests
Marcelin [Thu, 17 Jan 2019 20:26:21 +0000 (21:26 +0100)]
DataTable, integralP, SimSlaveUnit Unittests

* Fix: wrong index (Segmentation violation)
* integralp() uses fetch() instead of calculate(), loop limitation
* SimSlaveUnit: calling calculateDeltaT() in setPoint()
* nearly all of the tests are running correct

3 years agoIPC MtVariant Parser SimSlaveUnit
Marcelin [Wed, 16 Jan 2019 22:19:13 +0000 (23:19 +0100)]
IPC MtVariant Parser SimSlaveUnit

* IPC: get value of a slave hosted in another process
* new: MtVariant::asString()
* Parser: fix in reg expr for the qualified name (slave.slaveunit)
* SimSlaveUnit: new getDataTypeString()

3 years agoMtSimulator, Recursion level, Parser
Marcelin [Tue, 15 Jan 2019 19:53:33 +0000 (20:53 +0100)]
MtSimulator, Recursion level, Parser

* Recursion level in the parser
* Logger: milliseconds
* Access of slaves by address, by name
* new: SlaveUnitInfo
* Parser: Qualified names, integralp
* SimSlave: data type specific fetch()
* SimSlaveUnit: setPoint() with data

3 years agoSlave, SlaveUnit, Refactoring, inverter.conf
Marcelin [Thu, 10 Jan 2019 20:17:41 +0000 (21:17 +0100)]
Slave, SlaveUnit, Refactoring, inverter.conf

* SlaveUnit:
* Fix: storing start time (in setPoint())
* Slave:
* Fix: insertion into mapInputRegister
* MtSimulator: getSlaveUnit() no more const

* Refactoring: Slave -> SimSlave SlaveUnit -> SimSlaveUnit
* inverter.conf: corrections
* removed: base class VirtualModbusServer

3 years agomathematicalfunction.cpp, slaveunit.cpp
Marcelin [Tue, 8 Jan 2019 00:33:01 +0000 (01:33 +0100)]
mathematicalfunction.cpp, slaveunit.cpp

*delta, max loop set to avoid infinite looping

3 years agodynamic deltat, main, datatable, slave, virtualmodbusserver
Marcelin [Mon, 7 Jan 2019 22:39:45 +0000 (23:39 +0100)]
dynamic deltat, main, datatable, slave, virtualmodbusserver

* dynamic deltaT: Syntax in function definition, calculateDeltaT()
* main: option --base-dir
* datatable: interpolating (x,y) pairs
* formula may contain "actual" or "last"

3 years agoDataTable, testfunction, dataTableInterpolation
Marcelin [Sat, 29 Dec 2018 23:17:57 +0000 (00:17 +0100)]
DataTable, testfunction, dataTableInterpolation

* slave.cpp: regularExpression for efficiency datatable
* tst_functiontest.cpp: test_datatable(), test_datatableInterpolate()
* new: datatable.cpp
* new: datatable.h

3 years agoJsonCommunication, logger
Marcelin [Fri, 28 Dec 2018 20:16:31 +0000 (21:16 +0100)]
JsonCommunication, logger

*JsonCommunication: using QWebSocketServer
*logger: writing to file
*main: get port from argument
*client.html: test client for TCP
*test client in python

3 years agointegral, jsoncommunication, logger, Spy, tcpclient
Marcelin [Sat, 22 Dec 2018 18:16:29 +0000 (19:16 +0100)]
integral, jsoncommunication, logger, Spy, tcpclient

* integral.cpp works
* jsoncommunication: logging, no automatic disconnect
* Logger: output into a list widget

*Spy:
** logging into a list box
** TCP client to ask modbus server
* new: TCPClient

3 years agoMtSimulator
Marcelin [Tue, 18 Dec 2018 21:16:57 +0000 (22:16 +0100)]
MtSimulator

MtSimulator

* new: JsonCommunication: a TCP server
* MtSimulator::getSlaveUnit() corrected
* new: Integral (not tested)

3 years ago# WARNING: head commit changed in the meantime
Marcelin [Sun, 16 Dec 2018 20:12:26 +0000 (21:12 +0100)]
# WARNING: head commit changed in the meantime

MtSimulator

* new: RegisterType
* Time_t changed to qint64
* new: ArithmeticFunction, removed: ConstFunction RampFunction
* new: parser.cpp+h

3 years agoStart
Marcelin [Thu, 13 Dec 2018 19:20:06 +0000 (20:20 +0100)]
Start