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
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
// redA Libraries
|
||||
#include "ApplicationCore.h"
|
||||
#include "SignalCore.h"
|
||||
#include "LogCore.h"
|
||||
|
||||
// Standard C/C++ Libraries
|
||||
#include <stdio.h>
|
||||
@@ -20,8 +20,8 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Global vars
|
||||
extern CLogCore * Log;
|
||||
extern char * ProcessName;
|
||||
extern char * ProcessName;
|
||||
extern CApplication * Application;
|
||||
|
||||
// Termination Vars
|
||||
bool Terminate = false;
|
||||
@@ -85,15 +85,15 @@ void SignalTerminate( int sig )
|
||||
|
||||
std::cerr << std::endl << ProcessName << ": ***********************************" << std::endl;
|
||||
|
||||
// Create Log Entry
|
||||
if (Log)
|
||||
// Create Application->Log Entry
|
||||
if (Application->Log)
|
||||
{
|
||||
Log->Message( dlLow, dlLow, "%s: ** %s signal received [%d] **", ProcessName, SigName, TermCount );
|
||||
Application->Log->Message( dlLow, dlLow, "%s: ** %s signal received [%d] **", ProcessName, SigName, TermCount );
|
||||
// Check for Terminate Limit
|
||||
if (TermCount < MaxTermCount) {
|
||||
Log->Message( dlLow, dlLow, "%s: ** Terminating normally... **", ProcessName );
|
||||
Application->Log->Message( dlLow, dlLow, "%s: ** Terminating normally... **", ProcessName );
|
||||
} else {
|
||||
Log->Message( dlLow, dlLow, "%s: ** Terminating immediately! **", ProcessName );
|
||||
Application->Log->Message( dlLow, dlLow, "%s: ** Terminating immediately! **", ProcessName );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -136,10 +136,10 @@ void SignalAbort( int sig )
|
||||
// Show signal received
|
||||
std::cerr << std::endl << ProcessName << ": ********************************" << std::endl;
|
||||
|
||||
// Create Log Entry - but don't post
|
||||
if (Log) {
|
||||
Log->Message( dlLow, dlLow, "%s: ** %s signal received **", ProcessName, SigName );
|
||||
Log->Message( dlLow, dlLow, "%s: ** Terminating immediately! **", ProcessName );
|
||||
// Create Application->Log Entry - but don't post
|
||||
if (Application->Log) {
|
||||
Application->Log->Message( dlLow, dlLow, "%s: ** %s signal received **", ProcessName, SigName );
|
||||
Application->Log->Message( dlLow, dlLow, "%s: ** Terminating immediately! **", ProcessName );
|
||||
}
|
||||
else {
|
||||
std::cerr << ProcessName << ": ** " << SigName << " signal received **" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user