Important Update:
- LogCore: - Removed global DebugLevel var, now passed as parameter - Implemented binary output values - FunctionCore, SelectCore and SelectableCore: - internal DebugLevel param implemented - new internal DisplayOutput param (Normal/Hex/Bin) - BufferCore: - Bug fix: allow for empty search string/marker
This commit is contained in:
@@ -22,7 +22,7 @@ extern char ProcessName[];
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Life cycle
|
||||
CFunctionCore::CFunctionCore( const char * FunctionName )
|
||||
CFunctionCore::CFunctionCore( const char * FunctionName, EDebugLevel pDebugLevel, int pOuputDisplay )
|
||||
{
|
||||
// Set name
|
||||
if (FunctionName) {
|
||||
@@ -36,8 +36,12 @@ CFunctionCore::CFunctionCore( const char * FunctionName )
|
||||
// IO Functions
|
||||
FirstIO = NULL;
|
||||
|
||||
// Output
|
||||
OutputDisplay = pOuputDisplay;
|
||||
DebugLevel = pDebugLevel;
|
||||
|
||||
// Report status
|
||||
LogMessage( dlLow, "%s: Function '%s' - Created", ProcessName, FunctionName );
|
||||
LogMessage( DebugLevel, dlLow, "%s: Function '%s' - Created", ProcessName, FunctionName );
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -82,7 +86,7 @@ CFunctionCore::~CFunctionCore()
|
||||
}
|
||||
|
||||
// Report status
|
||||
LogMessage( dlLow, "%s: Function '%s' - Destroyed", ProcessName, Name );
|
||||
LogMessage( DebugLevel, dlLow, "%s: Function '%s' - Destroyed", ProcessName, Name );
|
||||
|
||||
// Destroy Name
|
||||
if (Name) {
|
||||
@@ -118,7 +122,7 @@ TLocalIO * CFunctionCore::AddLocalIO( const char * IOName )
|
||||
strcpy( (*LocalIO)->Name, IOName );
|
||||
|
||||
// Log Event
|
||||
LogMessage( dlLow, "%s: Local IO '%s' - Created", Name, IOName );
|
||||
LogMessage( DebugLevel, dlLow, "%s: Local IO '%s' - Created", Name, IOName );
|
||||
}
|
||||
|
||||
return *LocalIO;
|
||||
@@ -155,7 +159,7 @@ bool CFunctionCore::AddInput( const char * IOName, CFunctionCore * OutFunction,
|
||||
strcpy( (*LinkedIO)->IOName, OutputName );
|
||||
|
||||
// Log Event
|
||||
LogMessage( dlLow, "%s: Input Linked - '%s'/'%s' <-- '%s'/'%s'", Name, Name, IOName, OutFunction->GetName(), OutputName );
|
||||
LogMessage( DebugLevel, dlLow, "%s: Input Linked - '%s'/'%s' <-- '%s'/'%s'", Name, Name, IOName, OutFunction->GetName(), OutputName );
|
||||
}
|
||||
|
||||
// Link Return direction as well
|
||||
@@ -196,7 +200,7 @@ bool CFunctionCore::AddOutput( const char * IOName, CFunctionCore * InFunction,
|
||||
strcpy( (*LinkedIO)->IOName, InputName );
|
||||
|
||||
// Log Event
|
||||
LogMessage( dlLow, "%s: Output Linked - '%s'/'%s' --> '%s'/'%s'", Name, Name, IOName, InFunction->GetName(), InputName );
|
||||
LogMessage( DebugLevel, dlLow, "%s: Output Linked - '%s'/'%s' --> '%s'/'%s'", Name, Name, IOName, InFunction->GetName(), InputName );
|
||||
}
|
||||
|
||||
// Link return direction as well
|
||||
@@ -225,12 +229,12 @@ int CFunctionCore::Input( const char * IOName, const char * Data, int MaxLen )
|
||||
if (!(LocalIO = GetLocalIO( IOName )))
|
||||
{
|
||||
// Log event
|
||||
LogMessage( dlHigh, "%s: Local IO '%s' - Input rejected, Local IO not found", Name, IOName );
|
||||
LogMessage( DebugLevel, dlHigh, "%s: Local IO '%s' - Input rejected, Local IO not found", Name, IOName );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Log event
|
||||
ShowOutput( dlHigh, OUT_NORMAL, Data, MaxLen, "%s: Local IO '%s' - IN:", Name, IOName );
|
||||
ShowOutput( DebugLevel, dlHigh, OutputDisplay, Data, MaxLen, "%s: Local IO '%s' - IN:", Name, IOName );
|
||||
|
||||
// Return processed bytes
|
||||
return MaxLen;
|
||||
@@ -252,12 +256,12 @@ int CFunctionCore::Output( const char * IOName, const char * Data, int Len )
|
||||
if (!(LocalIO = GetLocalIO( IOName )))
|
||||
{
|
||||
// Log Event
|
||||
LogMessage( dlHigh, "%s: Local IO '%s' - Output rejected, Local IO not found", Name, IOName );
|
||||
LogMessage( DebugLevel, dlHigh, "%s: Local IO '%s' - Output rejected, Local IO not found", Name, IOName );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Log event
|
||||
ShowOutput( dlHigh, OUT_NORMAL, Data, Len, "%s: Local IO '%s' - OUT:", Name, IOName );
|
||||
ShowOutput( DebugLevel, dlHigh, OutputDisplay, Data, Len, "%s: Local IO '%s' - OUT:", Name, IOName );
|
||||
|
||||
// Return processed bytes
|
||||
return Len;
|
||||
|
||||
Reference in New Issue
Block a user