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
This commit is contained in:
Charl Wentzel
2018-12-11 19:55:44 +02:00
parent 07f746db2a
commit 3f568364da
4 changed files with 393 additions and 123 deletions

View File

@@ -16,7 +16,7 @@
//---------------------------------------------------------------------------
typedef enum { jtNull = 0, jtBool = 1, jtInt = 2, jtFloat = 3, jtString = 4, jtArray = 5, jtObject = 6 } EDataType;
typedef enum { jtNull = 0, jtBool = 1, jtInt = 2, jtFloat = 3, jtString = 4, jtArray = 5, jtObject = 6 } EJsonDataType;
//---------------------------------------------------------------------------
@@ -25,7 +25,7 @@ class CDataMember
{
char * Name;
unsigned short NameLen;
EDataType Type;
EJsonDataType Type;
char * Value;
unsigned short Len;
@@ -41,8 +41,8 @@ class CDataMember
CDataMember * CreateChild( const char * Name, const int Len = -1 );
// Set Member value
bool SetValue( EDataType Type, const char * Value = NULL, int Len = -1 );
bool SetValuePtr( EDataType pType, const char * pValue, int pLen = -1 );
bool SetValue( EJsonDataType Type, const char * Value = NULL, int Len = -1 );
bool SetValuePtr( EJsonDataType pType, const char * pValue, int pLen = -1 );
public:
CDataMember( const char * pName = NULL, const int pLen = -1 );
@@ -57,8 +57,8 @@ public:
/* Check Type */
EDataType GetType() { return Type; };
EDataType GetChType( const char * Path );
EJsonDataType GetType() { return Type; };
EJsonDataType GetChType( const char * Path );
inline bool isNull() { return (Type == jtNull); };
inline bool isBool() { return (Type == jtBool); };