Commit Graph

26 Commits

Author SHA1 Message Date
Charl Wentzel
bc89021a0e Important Update:
- DateTimeCore:
  - Added new functions to process data information
- JSONparse:
  - Bug fix: file permissions on create
2019-04-03 17:03:50 +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
83c192c1a6 Important Update:
- DataTreeCore:
  - Re-arrange method declaration order
  - Renamed methods Delete() to DeleteCh()
  - Added GetChName(), GetChType(), GetChLen() & ClearCh(Path) methods
- ApplicationCore:
  - Add WriteToScreen() method (Hide access to JSONparser)
2018-11-27 09:56:27 +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
bd85621b40 Bug fixes:
- DataTreeCore:
  - Incorrectly added new child to parent
- JSONparseCore:
  - Printed incomplete object (false error)
2018-11-20 12:59:21 +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
85a811c19f Important Bug fix:
- Fixed memory errors and leaks in DataTreeCore:
  - Initial values not set correctly for Name, Next/PrevPeer
  - Correctly set Last/FirstChild & Prev/NextPeer references on delete
  - Added methods SetValuePtr()
- Fixed memory errors and leaks in JSONparseCore:
  - Set set string/int/float values by passing pointers, ie. SetValuePtr()
2018-11-18 12:47:33 +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
12a8ddb7ba Important Update:
- JSONparseCore:
  - Allow JSON to be parsed from string data
- DataTreeCore:
  - Allow GetMember to work with now path, ie. return BaseMember param
2018-10-28 22:36:31 +00:00
Charl Wentzel
92ce01a3b7 Important Update:
- JSONparseCore:
  - Bug fix: Incorrectly terminated PrintString on null
- SelectableCore:
  - Add BaudRate, DataBits, Parity, StopBits, FlowCtrl, DataWait to THandle
  - Include Serial Port setup in SetPortHandle()
  - Read Serial Port config in LoadConfigData()
  - Rename SetSerialConfig() -> ConfigureSerialPort()
  - Configure Serial Port immediately after opening port
2017-11-29 11:30:05 +02:00
Charl Wentzel
4af8f529c9 Minor Update:
- DateTimeCore:
  - Change default separators for date/time, allow no separators
- JSONparseCore:
  - Bug fix: Output escape sequences in Hexadecimal
2017-08-23 18:03:11 +02:00
Charl Wentzel
18b487cbdd Minor Update:
- JSONparseCore:
  - Simplify & correct PrintObject() and PrintArray() logic
2017-08-18 05:21:09 +02:00
Charl Wentzel
2b7c49d5bb Important Update:
- DataTreeCore:
  - Add Parent & Prev Child links to DataMembers
  - Update CreateMember() to set Parent/Sibling reference
      & increase Parent->Len
  - Remove AddMember()
  - Update DestroyMember() to decrease Parent->Len
- JSONparseCore:
  - Update ParseArray() for above changes made to DataTreeCore
2017-08-11 15:42:59 +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
c32875509d Minor updates:
- JSONparseCore:
  - Set File mode on create
- SelectableCore:
  - Check pipe() return value on create
  - Validate replacement of stdin with pipe
2017-07-17 22:51:30 +02:00
Charl Wentzel
b7ed169730 Major Update & Bug fixes:
- FileCore:
  - Replace dlNone -> dlLow
  - Remove temporary code used by CBaslerCamera
- Function Core:
  - Add method SetDebugLevel()
  - Remove global parameter BaseMember;
- JSONparse:
  - Print Bool parameters as true/false, not 1/0
- SelectCore:
  - Add method SetDebugLevel()
- SignalCore:
  - Replace dlNone -> dlLow
2017-07-09 16:31:47 +02:00
Charl Wentzel
706cd9caf6 Bug fix:
- Validate File Path and add '/' when saving JSON file
2017-06-22 17:21:28 +02:00
Charl Wentzel
9677052042 Important Update:
- Bug fix JSONparseCore: Allow for blank path in file name
- Added new Class LiteProtocolCore for basic protocol
2017-04-30 17:32:19 +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
200f7e1f8b Important Update:
- Improve "printing" for JSON with single & multi line objects
- Fix bugs in getting, setting & creating array elements
- "array[]" allowed to create/add element at end of an array
- No longer duplicate get() path (reduce memory allocation)
  - added NameLen to TMember to eliminate zero-terminate requirement
- Fix ReadfromXXX() return values
2017-04-05 08:07:53 +02:00
Charl Wentzel
66fc4bc123 Important Update:
- Bug fix: incorrect memory allocation in SetValue()
- Implement conversion of escaped chars during parsing
- Implement escaping chars during printing
2017-04-03 21:48:29 +02:00
Charl Wentzel
2e2ba113f1 Major Update:
- Update printing: Do not use '\n' if indent = 0
- Implement refilling of buffer (from fd) while parsing
  - No longer use LineMark, but keep track of char position with CharNo
  - Use Mark to reference point for shifting buffer on refill
- SkipWhiteSpace no longer inline method
  - Refill buffer if required, change Mark & CharNo on line break
- CreateBuffer(), RefillBuffer() & FreeBuffer() now public methods
- Make Loading and Saving more flexible:
  - Refactor from LoadFromFile():
    ReadFromFile(), ReadFromHandle(), ReadFromBuffer()
  - Refactor from SaveToFile() & PrintToScreen:
    WriteToFile(), WriteToScreen, WriteToHandle()
2017-04-02 19:44:44 +02:00
Charl Wentzel
8f39adb0f3 Important update:
- Buffer:
  - fix undefined value: zero terminate buffer when loading from FD
- DataTree:
  - fix memory leak: destroy temporary search path
  - improve delete(): delete all children for member if no path given
  - bug fix: initiate object with 0 length (not -1)
- JSONparse:
  - Remove level parameter
  - Add path to load/save/print methods (print only portion of tree)
  - fix memory leak: destroy temporary object name
2017-03-29 21:27:28 +02:00
Charl Wentzel
5691b22df9 Minor Update:
- Pass printf Mask for Int/Float values on Get/Set methods
  - On GetValue use mask for default value
- Add SetArray() method
- Bug fix: Incorrect malloc size in SetValue()
- Bug fix: Len not calculated if -1 passed to SetValue()
- Set default value for Len = -1 on SetValue() methods
- Don't pass Len to SetValue() unless required
2017-03-27 04:29:11 +02:00
Charl Wentzel
a22f60b152 Major Update:
- Bug fix: BufferCore - set correct auto buffer size
- Change Get/Set methods to use BaseReference and full path instead of
    ParentPath and MemberName
- Add Create param to all Get methods (create if not found)
- Implement arrays & parsing of arrays
- Set CJSONparse as friend class to DataTree (access protected methods)
- Print JSON to screen
2017-03-26 22:26:52 +02:00
Charl Wentzel
b823bd7ea7 Important Update: (incomplete)
- Split CConfigCore into two classes:
  - DataTreeCore.h - Tree data structure and access
  - JSONparseCore.h - JSON parsing functionality
- Renamed TConfigParam struct to TDataMember
- Renamed most of CDataTreeCore methods
2017-03-23 20:53:32 +02:00