Commit Graph

15 Commits

Author SHA1 Message Date
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
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
6263c0f508 Important update:
- DataTreeCore:
  - Renamed Get/SetMemXxx() methods to Get/SetChXxx()
  - Renamed GetMember() to GetChild()
  - Updated: JSONparse, ApplicationCore, FunctionCore, SelectableCore,
             and WatchdogCore
  - Remove unused PrevChild & Last vars in GetChild (GetMember)
- JSONparseCore:
  - Use return values from write() and PrintXxx() methods to report fail
- SelectableCore:
  - Fix possible uninitialised FlowCtrl & Parity value
- DateTimeCore:
  - Fix possible memory overrun in temp buffer
- EventBufferCore:
  - Fix possible uninitialised value error in AddEvent
2018-11-20 11:27:09 +02:00
Charl Wentzel
2382ff4527 Important Update:
- DataTreeCore:
  - Rename all Get/SetChild...() methods to Get/SetMem...()
- Update all other objects with new methods
2018-11-17 20:02:47 +02:00
Charl Wentzel
f2a1ca950a Major Update:
- DataTreeCore:
  - Merge TDataMember and CDataTree into => CDataMember
  - Each node, incl root is now CDataMember object
  - Modified function to not require BaseMember (Object is basemember)
  - Split/duplicat most functions to require, or not require child path
  - Added isNull/Object/Array/Sting() etc methods
  - Many other methods removed or restructured
- Updated DataTree usage in: JSONparseCore,
  ApplicationCore, FunctionCore, SelectableCore, WatchdogCore
2018-11-17 19:10:59 +02:00
Charl Wentzel
7f39f8b985 Important update:
- SelectableCore:
  - Rename methods: SetSerialPortConfig() -> WriteSerialConfig(),
      GetSerialPortConfig() -> ReadSerialConfig(),
      InputHandle() -> OutputHandle(),
      ProcessBuffer() -> ProcessInputBuffer()
      SetPortHandle(config)() -> SetSerialHandle(Config)()
  - Rename serial port identification: "Port" -> "SerialPort"
    - Update logs accordingly
  - Add LinePrinter Port
    - Add to LoadConfig()
    - Add SetLinePrinterHandle() & OpenLinePrinterPort() methods
    - Add handling for open/read/write/close events
  - Add CloseDelay for AutoManage (non-persistent) ports
    - Rename handle timer: ReopenStart -> LastAction
    - Reset timer on all open/read/write/close events
    - Check for Close timeout in Process() and close port
    - Remove CloseChildren parameter on Close() method
    - Add QuickReopen parameter to Close() method
- SelectCore:
  - Overwrite existing handle - not yet removed
  - Handle In/Out baudrate on serial port separately
2017-12-06 08:43:25 +02:00
Charl Wentzel
4c6f971a7d Important update:
- Bug fix: start/end char for Watchdog protocol
2017-11-21 11:40:30 +02:00
Charl Wentzel
9f7e1b486e Important Update:
- SelectableCore:
  - Split handling of Handle from Input() to InputHandle() method
  - Allow multiple handles to be connected to single Channel
  - Update logs to report Handle, not Channel name
- TimingCore:
  - Convert all functions to inline functions in header (remove .cpp file)
  - Add new function TimeLeft()
- WatchdogCore:
  - Bug fix: No watchdog channel, use InputHandle() method not Input()
  - Bug fix: ping ignored, use To:"watchdog" in ping command
2017-11-21 10:15:26 +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
aaf3c59727 Important Updates:
- DataTreeCore:
  - Allow types float, int & bool to be read as strings with GetStr()
- LogCore:
  - Add comments to Logging parameters
- WatchDogCore:
  - Call CSelectableCore::Process() in Process() to manage connect
- SelectableCore:
  - Allow SetSocketHandle() to be called if Handle already set as socket
  - added strlcase() method to convert string to lower case
  - Update Handle structure:
    - renamed Address -> HostName
    - renamed PortNo -> PortName
    - added AddressList for all resolved addresses
    - added AddressInfo for active address
  - Add ResolveAddress() method
    - Domain name and protocol port resolving with GetAddrInfo()
  - JSON updated:
    - domain name can be provided instead of IP address
    - protocol can be specified instead of Port No, e.g. "HTTP" / "SSH"
  - Resolve address before connect, or use next resolved address
2017-07-22 09:40:17 +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
b900d735b9 Important update:
- Used new core protocol function to create command
- Bug fix: use correct sequence: From, To, Command
2017-07-08 22:39:32 +02:00
Charl Wentzel
d013078c1f Bug fixes:
- Remove LogStr var
- Create new Command Str before adding parameters
- Set Watchdog name correctly
2017-07-05 18:20:29 +02:00
Charl Wentzel
04edaf6e34 Major update:
- Add CWatchdogCore component.  Sends ping to watchdog server
2017-07-05 17:06:31 +02:00