Commit Graph

23 Commits

Author SHA1 Message Date
Charl Wentzel
01ec1071b1 Important Update:
- Save reference to process config in Function Core
  - Moved from DeviceCore to here as common feature
  - "Config" : object
    Allow additional config to be stored in application definition
  - "Config" : string
    Name reference to config object in main JSON file
  - Remove from Device Core
2019-04-22 10:29:52 +02:00
Charl Wentzel
889df6c7de Important Update:
- DeviceCore:
  - Added PollCycle variable (not used here)
- WatchdogCore:
  - Return "true" on in Process()
- SelectableCore:
  - Minor update (code compacted)
- Application/Function:
  - Added CApplication as friend of CFunction
  - Added param WaitToTerminate on Function
  - Application Run() only exists if all (WaitToTerminate) functions
    has terminated cleanly.
2019-03-09 20:41:25 +02:00
Charl Wentzel
49294ab6b5 Important Update:
- Update Command port:
  - Simplified error handling
  - Provide error reply
- Added method GetNextParamGroup()
2019-01-10 11:46:41 +02:00
Charl Wentzel
b679da9c29 Important Update:
- Renamed JSON parameter: PollGroup -> ParamGroup
2019-01-09 15:48:37 +02:00
Charl Wentzel
f10750ca2d Important Update:
- Remove separate poll group specifications in JSON file
- Implemented PollGroups per parameter or node in JSON file
- Implemented copying of PollGroups from Template
2019-01-09 15:19:06 +02:00
Charl Wentzel
3472f506b6 Major Update:
- JSONparseCore:
  - Add initialisations values for class params
  - Add method AddBase() to dynamically change DataTree
  - Added Error messages
- DeviceCore:
  - Implement ValueTree (JSON tree)
    - Node are added as devices & params are created/added
    - Nodes (and path) are referenced on devices & params
    - Node values are updated as device params are updated
  - Added Persistence File (not yet complete)
  - Updated InitDevices() & InitDeviceParams()
    - Split into smaller methods: CopyTemplateParam() & InitDeviceParam()
    - Load Device definition or Parameter maps from files
    - Allow loading of nested parameter map files
    - Load Parameter as JSON tree, generate names/path dynamically
2019-01-09 10:56:38 +02:00
Charl Wentzel
3e40f7a86d Important Update:
- Implement Handle Address renaming:
- Restructure JSON config, with address list and rename list
- SelectableCore:
  - Add method GetHandleAddress() - lookup renamed handle
  - Add init values to all struct and classes declarations
- Replace malloc()/strcpy() sequences with strdup()
2019-01-08 08:35:21 +02:00
Charl Wentzel
c5da842ac1 Major Update:
- FunctionCore:
  - Add OutputFormat param on Output() method - override output format
- SelectableCore:
  - Update Log output formats (process/functionblock)
- DeviceCore:
  - Updated device data format (different byte sequences)
  - Added ID & Address fields to TDevice struct
  - Add search methods for ID & Address
  - Update AddDevice() method to check for duplicate ID & address
  - Handle Invalid reply different from reply timeout
  - Add methods ValidReplyReceived() for standardise operation
  - Bug fix: DeviceTypes added as to Device List!
  - Bug fix: Check if Device/DeviceType created before adding params
  - Added correct handling of new Device Data types (LH & HL)
  - Updated log messages
2018-12-16 00:42:43 +02:00
Charl Wentzel
f1be4e9540 Important Update:
- Switch from malloc/free -> new/delete for structures
- Bug fix: Move Parameter groups to Device (not class)
- Update Parameter groups:
  - Update Read/Write indicators as params are added
2018-12-13 12:41:37 +02:00
Charl Wentzel
dc76d99b58 Important Update;
- ApplicationCore:
  - Minor log updates
- FunctionCore:
  - Initialise structs & object params in declaration
- DeviceCore:
  - Update logs with more consistent structure
  - Initialise structs & object params in declaration
  - Implemented DeviceType templates
    - Added Add/Get/Destroy methods
    - Load from config or separate template file
    - Build Devices/Params from template
  - Implemented ParamGroups
    - Added Add/Get/Destroy methods
    - Load with DeviceTypes
  - Added JSON parser to read separate template files
  - Bug fix: Getxxxx() methods
2018-12-13 09:17:39 +02:00
Charl Wentzel
90beb031af Minor Update 2018-12-11 21:36:24 +02:00
Charl Wentzel
3f568364da Important Update:
- DataTreeCore:
  - Rename enum EDataType -> EJsonDataType
- DeviceCore:
  - Rename enum EMBDataType -> EDeviceDataType
  - Add method GetNextTypeDevice() method
  - Bug fix: Add Type Name: 0 -> "none"
  - Added permanent Event Channel to TDevice
  - Add param Type to TDevice
  - Removed UpdateInterval/Timeout params & methods from TDevice
  - Separated DeviceInit() method from Init()
  - Add param DeviceInit to force/avoid DeviceInit() in Init()
  - Renamed and restructured SetUpdate() & SetParamScan() methods to:
      SetParamAccess() & SetParamEvent()
  - Converted DestroyDevice() and DestroyDeviceParam() to inline methods
  - Moved methods GetCmdParam() and HandleCommand() from CModbusInterface
  - Renamed TDeviceParam field:
    UpdateInterval/Timeout -> EventInterval/Timeout
  - Renamed TDeviceParam field: Scan -> Read
  - Added TDeviceParam field: Write
2018-12-11 19:55:44 +02:00
Charl Wentzel
07f746db2a Important Update:
- DeviceCore:
  - Add dtNone data type
  - Add Config param, reference to data tree
  - Add Init() methods, loading config from JSON
  - Add GetDataType() method, converts text to data type enum
  - Add Set/UpdateStringValue() methods with Len param
  - Clear compiler warnings, missing switch case values
2018-12-10 21:21:13 +02:00
Charl Wentzel
a972fb9101 Major Update:
- Implement consistent Function addition to application
  - Use TYPE_XXX constants to declare function type
  - Use NewXXXX() methods to call constructor correctly
  - Add FunctionType list (with constructor) to Application
  - Create Function by comparison to FunctionType list
- Simplify LoadConfig() and Init() methods for functions
  - Combine methods into Init() method
  - Pass relevant data member to Init() method
  - Remove all CDataMember references on functions
- ApplicationCore:
  - Split ReadParam() method from LoadConfig() method
  - Split main configuration into separate files:
    - config/ - main config file, general application settings
    - definition/ - application definition, e.g. function blocks
  - Definition and Address List files specified in config file
  - Load address file in address/ branch
  - Made DataTree & JSONparser private
  - Made Config, Definition & Address branches public
  - Removed unnecessary branch references
  - Improved event logging
- DataTreeCore:
  - Allow GetChFirstChild & GetChElement to create parent branches
    with correct type, ie. Object/Array
  - Remove unnecessary Create param from GetXxx functions
  - Bug fix: Print empty objects/arrays correct, ie. empty brackets
  - Bug fix: Adding element at specific index
  - Bug fix: Error when get/create string value with "null"
- FunctionCore:
  - Type param now set as constant via constructor
  - Create empty Handles & Channels objects if none in Config
- SelectableCore:
  - Add Queue length parameter to handles for UNIX and TCP sockets
- DeviceCore:
  - Bug fix: missing Process() method
2018-11-24 13:35:23 +02:00
Charl Wentzel
7434334280 Major Update:
- FunctionCore, SelectCore, SelectableCore, DeviceCore, FileCore:
  - Update Logs to show [ProcessName]/[FunctionName]
- SelectableCore:
  - Update ConnectTypeName array (more readable)
  - Return THandle on all OpenXxxx() methods
  - Do not remove select handle for UDPremoteClient (same handle as server)
  - Add correct Handle when adding RemoteClient to Selector
2018-11-22 11:29:55 +02:00
Charl Wentzel
2f81d1fbbe Important Update:
- Library Clean up:
  - Removed all unused C/C++ libraries from source
  - First C/C++ libraries then redA libraries
- Library changes:
  - renamed BufferCore -> CharBufferCore
  - added ItemBufferCore
- CharBufferCore:
  - Derive RollingBuffer & ShiftBuffer from common class CharBuffer
  - CharBuffer is mostly a virtual class (interface)
2017-07-22 17:46:05 +02:00
Charl Wentzel
434377f122 Major Update:
- Implement new ApplicationCore:
  - Manage Tools: Log, DataTree, JSONparser & Selector
  - Load configuration, Manage FunctionBlocks
- FunctionCore & dirived classes, SignalCore:
  - affects: SelectableCore, DeviceCore, FileCore, WatchdogCore
  - Do not pass Log()
  - Define and pass Type
  - Update/reduce included headers
  - Use ProcessName and Application global vars
  - Get Log, DataTree from Application
  - Use virtual Init() function to set must have Channels/Handles
- DataTreeCore:
  - Bug fix: Check if child members exist and destroy in SetValuePtr()
  - Add method GetFirstChild with BaseMember & Path
  - Bug fix: do not use RootMember if no Parent in GetChildxxx() methods
- SignalCore, SelectCore:
  - Use Application->Log()
- FunctionCore:
  - Add itself to Application (function list)
  - Add parameter: LinkConfigMember, Type
  - Use virtual LoadConfigData() to configure from DataTree
  - Rename methods: LoadConfig() -> InitConfig(),
      InitLogging() -> SetLogParam(), SetDebugLevel() -> SetLogLevel()
  - Add method: GetType(), LoadChannelLinkData(), InitChannelLinks()
  - Modify LinkIn/OutputChannel() to use name for InFunction, not pointer
- SelectableCore & Dirived classes:
  - Affects DeviceCore & WatchdogClient
  - Rename parameter: Select -> Selector, BaseMember -> ConfigMember
  - Get Selector from Application->Selector
  - Change Handles JSON structure from Array to Key:Value pairs
  - Bug fix: check if Selector exist during Input()
  - Bug fix: do not set PortNo if not exist
2017-07-16 20:29:01 +02:00
Charl Wentzel
3f86de71b1 Major update:
- DataTreeCore:
  - Bug fix: GetMember() error if member not found
- FunctionCore: (affected: SelectableCore, FileCore, WatchdogCore)
  - Made destructor virual
  - Standardize method parameter naming, e.g. pName, pLog
  - Renamed parameters: DebugLevel -> LogLevel, OutputDisplay -> LogOutput
  - Reinstated parameter BaseMember
  - Removed logging parameters from constructor
  - Created method InitLoggging() (shows "Function Created" message)
  - Split LoadConfig() method into parts:
    - Implemented public LoadConfig() methods
    - Implemented LoadConfigData() method, load parameters from DataTree
- WatchdogCore:
  - Derive from CSelectableCore instead of CFunctionCore
  - Rename parameter: PingTimeout -> PingInterval
  - Replace Ping Channel with Handle only
  - Add method SetInterval()
  - Send command direct to handle with (channel) Input()
- SelectableCore:
  - Rename parameters: Auto -> AutoManage, ReopenTimeout -> ReopenDelay
  - Implemented own virtual LoadConfigData() method
- DeviceCore:
  - Made all logging conditional: if (Log) Log->Message(...)
- SelectCore:
  - Renamed parameters: DebugLevel -> LogLevel
2017-07-11 06:20:14 +02:00
Charl Wentzel
ee29625b9a Important update:
- DataTree->GetStr return Member->Value or NULL if not found
- Rename DeviceCore EDataType to EMBDataType, avoid conflict with JSONpaser
- Add DataTree to FunctionCore with LoadConfig() method
- Change ProcessName to char * (from char[])
- JSONparse:
  - Rename RootPath to BasePath on all methods to reduce confusion
  - Allow FilePath to be NULL, add '/' if not present
  - Fixed Parsing sequence in ParseObject & ParseArray
2017-04-10 21:33:14 +02:00
Charl Wentzel
2d9faa7fa6 Important Update:
- Add GetValue/SetValue commands for Device command interface
- Bug fix: use case compare on searches
2017-03-02 12:31:50 +02:00
Charl Wentzel
d4ee138da8 Update in progress:
- Started work on Set/Get commands for DeviceCore
2017-02-16 03:02:18 +02:00
Charl Wentzel
5c2d7d4b51 Bug fix:
- Display signed parameters correctly
2017-02-08 08:44:30 +02:00
Charl Wentzel
47577e9f4c Major Updated:
- Added new CDeviceCore Class
  - Methods and structures moved from CModbusInterface
  - Keep track of Devices and DeviceParameters
  - Provides methods & parameters related to polling process
  - Provides parameter events
2016-09-07 08:49:58 +02:00