Jump to content

Component: Console Writer (Indicators): Difference between revisions

From Flowcode Help
XML import
 
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| Matrix TSL
| Matrix TSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 2.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| Indicators
| Indicators
|}
|}




==Console Writer component==
A simple component to aid in creating and wiriting data to a console tab. Allows text to be coloured and automatically appended with a timestamp.


==[[File:Component Icon 940e39a6_d035_4e43_8dbb_455ee4679066.png|Image]] Console Writer component==
==Version information==
A simple component to aid in creating and wiriting data to a console tab.
Allows text to be coloured and automatically appended with a timestamp.


==Examples==
Library Version, Component Version, Date, Author, Info
''<span style="color:red;">No additional examples</span>''
4, 2.0, 02-07-24, BR, Added a load more functionality to the component related to cursor control


==Detailed description==


==Downloadable macro reference==


''This component does not contain any downloadable macros''


==Simulation macro reference==


===<span style="font-weight: normal;"><u><tt>Clear</tt></u></span>===
Clears the contents of the console tab.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>CountLines</tt></u></span>===
Counts the number of lines in the console.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|ULONG]]




===<span style="font-weight: normal;"><u><tt>AddString</tt></u></span>===
Adds text string to the console window.


'''Parameters'''


:[[Variable Types|<- STRING]] ''Data''
::''This parameter may be returned back to the caller''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>SetTextLine</tt></u></span>===
Sets the string data from a specific line in the console.


'''Parameters'''


:[[Variable Types|LONG]] ''Line''
''No detailed description exists yet for this component''
::Line number, -1 for the last line.


:[[Variable Types|<- STRING]] ''Data''
==Examples==
::''This parameter may be returned back to the caller''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>SetColour</tt></u></span>===
Allows for full RGB colour selection


'''Parameters'''


:[[Variable Types|BYTE]] ''R''
::Colour channel, Range: 0-255


:[[Variable Types|BYTE]] ''G''
::Colour channel, Range: 0-255


:[[Variable Types|BYTE]] ''B''
::Colour channel, Range: 0-255




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>SetColourIdx</tt></u></span>===
Sets the text colour from the properties selection of colours.


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Range: 0-3




'''Return value'''
A basic example using two circular knobs to simulate data e.g., temperature.
Both xy chart and Console, log the data.


:''This call does not return a value''
{{Fcfile|Logging_Example.fcsx|Logging Example}}




===<span style="font-weight: normal;"><u><tt>GetTextLine</tt></u></span>===
Gets the string data from a specific line in the console.


'''Parameters'''


:[[Variable Types|LONG]] ''Line''
::Line number, -1 for the last line.




'''Return value'''


:[[Variable Types|STRING]]








==Property reference==
==Macro reference==
<span style="font-weight: normal;"><u>Console Name</u></span>


This property is of type ''Line of text'' and can be referenced with the variable name ''ConsoleName''.
===AddString===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AddString'''
|-
| colspan="2" | Adds text string to the end of the console window.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


''<span style="color:red;">No additional information</span>''


===AddStringAtCursor===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''AddStringAtCursor'''
|-
| colspan="2" | Adds text string to the current cursor position.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




<span style="font-weight: normal;"><u>Colour 0</u></span>
===Clear===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Clear'''
|-
| colspan="2" | Clears the contents of the console tab.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


This property is of type ''Color picker'' and can be referenced with the variable name ''Colour0''.


''<span style="color:red;">No additional information</span>''
===ClearFromCursorToLineEnd===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ClearFromCursorToLineEnd'''
|-
| colspan="2" | Clears the contents of the current selected line from the cursor position to the end of the line.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




===ClearFromLineStartToCursor===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ClearFromLineStartToCursor'''
|-
| colspan="2" | Clears the contents of the current selected line from the start of the line to the cursor position. Sets the Column position to 0.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


<span style="font-weight: normal;"><u>Colour 1</u></span>


This property is of type ''Color picker'' and can be referenced with the variable name ''Colour1''.
===ClearLine===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ClearLine'''
|-
| colspan="2" | Clears all data from a specific line. Automatically sets the cursor to the start of the line.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
| colspan="2" | Line number, -1 for the last line.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


''<span style="color:red;">No additional information</span>''


===ClearXCharsFromCursorPosition===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ClearXCharsFromCursorPosition'''
|-
| colspan="2" | Clears the specified number of characters starting from the cursor position.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CharacterCount
|-
| colspan="2" | Number of characters to remove&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




<span style="font-weight: normal;"><u>Colour 2</u></span>
===CountLines===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''CountLines'''
|-
| colspan="2" | Counts the number of lines in the console.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


This property is of type ''Color picker'' and can be referenced with the variable name ''Colour2''.


''<span style="color:red;">No additional information</span>''
===GetTextLine===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetTextLine'''
|-
| colspan="2" | Gets the string data from a specific line in the console.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
| colspan="2" | Line number, -1 for the last line.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




===SetColour===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetColour'''
|-
| colspan="2" | Allows for full RGB colour selection&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | R
|-
| colspan="2" | Colour channel, Range: 0-255&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | G
|-
| colspan="2" | Colour channel, Range: 0-255&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | B
|-
| colspan="2" | Colour channel, Range: 0-255&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


<span style="font-weight: normal;"><u>Colour 3</u></span>


This property is of type ''Color picker'' and can be referenced with the variable name ''Colour3''.
===SetColourIdx===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetColourIdx'''
|-
| colspan="2" | Sets the text colour from the properties selection of colours.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Range: 0-3&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


''<span style="color:red;">No additional information</span>''


===SetCursorPosition===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetCursorPosition'''
|-
| colspan="2" | Sets the position of the cursor&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Column
|-
| colspan="2" | Character position along the line, starting from 0&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
| colspan="2" | Line number, -1 for the last line.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




<span style="font-weight: normal;"><u>New Line After Data</u></span>
===SetTextLine===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetTextLine'''
|-
| colspan="2" | Sets the string data from a specific line in the console.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
| colspan="2" | Line number, -1 for the last line.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


This property is of type ''True or false'' and can be referenced with the variable name ''NLAfterData''.


''<span style="color:red;">No additional information</span>''
===ShowConsole===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ShowConsole'''
|-
| colspan="2" | Pops up the console window and shows the correct tab.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==


<span style="font-weight: normal;"><u>Clear On Sim Start</u></span>
{| class="mtx-class-macrotable wikitable"
 
|-
This property is of type ''True or false'' and can be referenced with the variable name ''ClearOnSimStart''.
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
Automatically clear the console tab when the simulation is started.
|-
 
|-
<span style="font-weight: normal;"><u>Add Timestamp</u></span>
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="90%" | Console Name
This property is of type ''True or false'' and can be referenced with the variable name ''Timestamp''.
|-
 
| colspan="2" | Textual name of the console shown as the tab name at the top of the console window.&nbsp;
''<span style="color:red;">No additional information</span>''
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour 0
 
|-
<span style="font-weight: normal;"><u>Date Format</u></span>
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call.&nbsp;
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''TimeStamp1::DateFormat''.
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour 1
Specifies the format of the date string.
|-
 
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
No - "DD/MM/YY"  
| width="90%" | Colour 2
 
|-
Yes - "MM/DD/YY"
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call.&nbsp;
 
|-
<span style="font-weight: normal;"><u>Time Separator</u></span>
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour 3
This property is of type ''Line of text'' and can be referenced with the variable name ''TimeStamp1::TimeSeperator''.
|-
 
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call.&nbsp;
Characters that are used in between the time digits
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
<span style="font-weight: normal;"><u>Date Separator</u></span>
| width="90%" | New Line After Data
 
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''TimeStamp1::DateSeparator''.
| colspan="2" | Automatically append a newline character after any data has been written to the console using the AddString  component macro.&nbsp;
 
|-
Characters that are used in between the date digits
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Clear On Sim Start
<span style="font-weight: normal;"><u>TimeStamp Separator</u></span>
|-
 
| colspan="2" | Automatically clear the console tab when the simulation is started.&nbsp;
This property is of type ''Line of text'' and can be referenced with the variable name ''TimeStamp1::TimeStampSeparator''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Characters that are used between the time and date strings when returning a full time stamp.
| width="90%" | Add Timestamp
 
|-
<span style="font-weight: normal;"><u>Override Colour</u></span>
| colspan="2" | Automatically adds a timestamp to the console after a newline character has been received.&nbsp;
 
|-
This property is of type ''True or false'' and can be referenced with the variable name ''OverrideColour''.
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | Timestamp
Overrides the current selected colour when writing the timestamp.
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Date Format
|-
| colspan="2" | Specifies the format of the date string. No - "DD/MM/YY" Yes - "MM/DD/YY" &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Time Separator
|-
| colspan="2" | Characters that are used in between the time digits&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Date Separator
|-
| colspan="2" | Characters that are used in between the date digits&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | TimeStamp Separator
|-
| colspan="2" | Characters that are used between the time and date strings when returning a full time stamp.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Override Colour
|-
| colspan="2" | Overrides the current selected colour when writing the timestamp.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Timestamp Colour
|-
| colspan="2" | Defines the colour of the time stamp text&nbsp;
|}


<span style="font-weight: normal;"><u>Timestamp Colour</u></span>
==Component Source Code==


This property is of type ''Color picker'' and can be referenced with the variable name ''TimestampColour''.
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ConsoleWriter.fcfx FC_Comp_Source_ConsoleWriter.fcfx]


''<span style="color:red;">No additional information</span>''
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ConsoleWriter.fcfx FC_Comp_Source_ConsoleWriter.fcfx]

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 2.0
Category Indicators


Console Writer component

A simple component to aid in creating and wiriting data to a console tab. Allows text to be coloured and automatically appended with a timestamp.

Version information

Library Version, Component Version, Date, Author, Info
4, 2.0, 02-07-24, BR, Added a load more functionality to the component related to cursor control

Detailed description

No detailed description exists yet for this component

Examples

A basic example using two circular knobs to simulate data e.g., temperature. Both xy chart and Console, log the data.

Logging Example






Macro reference

AddString

AddString
Adds text string to the end of the console window. 
- STRING Data
 
- VOID Return


AddStringAtCursor

AddStringAtCursor
Adds text string to the current cursor position. 
- STRING Data
 
- VOID Return


Clear

Clear
Clears the contents of the console tab. 
- VOID Return


ClearFromCursorToLineEnd

ClearFromCursorToLineEnd
Clears the contents of the current selected line from the cursor position to the end of the line. 
- VOID Return


ClearFromLineStartToCursor

ClearFromLineStartToCursor
Clears the contents of the current selected line from the start of the line to the cursor position. Sets the Column position to 0. 
- VOID Return


ClearLine

ClearLine
Clears all data from a specific line. Automatically sets the cursor to the start of the line. 
- LONG Line
Line number, -1 for the last line. 
- VOID Return


ClearXCharsFromCursorPosition

ClearXCharsFromCursorPosition
Clears the specified number of characters starting from the cursor position. 
- UINT CharacterCount
Number of characters to remove 
- VOID Return


CountLines

CountLines
Counts the number of lines in the console. 
- ULONG Return


GetTextLine

GetTextLine
Gets the string data from a specific line in the console. 
- LONG Line
Line number, -1 for the last line. 
- STRING Return


SetColour

SetColour
Allows for full RGB colour selection 
- BYTE R
Colour channel, Range: 0-255 
- BYTE G
Colour channel, Range: 0-255 
- BYTE B
Colour channel, Range: 0-255 
- VOID Return


SetColourIdx

SetColourIdx
Sets the text colour from the properties selection of colours. 
- BYTE Index
Range: 0-3 
- VOID Return


SetCursorPosition

SetCursorPosition
Sets the position of the cursor 
- LONG Column
Character position along the line, starting from 0 
- LONG Line
Line number, -1 for the last line. 
- VOID Return


SetTextLine

SetTextLine
Sets the string data from a specific line in the console. 
- LONG Line
Line number, -1 for the last line. 
- STRING Data
 
- VOID Return


ShowConsole

ShowConsole
Pops up the console window and shows the correct tab. 
- VOID Return


Property reference

Properties
Console Name
Textual name of the console shown as the tab name at the top of the console window. 
Colour 0
Used to define a colour channel referenced by the SetColourIdx component macro call. 
Colour 1
Used to define a colour channel referenced by the SetColourIdx component macro call. 
Colour 2
Used to define a colour channel referenced by the SetColourIdx component macro call. 
Colour 3
Used to define a colour channel referenced by the SetColourIdx component macro call. 
New Line After Data
Automatically append a newline character after any data has been written to the console using the AddString component macro. 
Clear On Sim Start
Automatically clear the console tab when the simulation is started. 
Add Timestamp
Automatically adds a timestamp to the console after a newline character has been received. 
Timestamp
Date Format
Specifies the format of the date string. No - "DD/MM/YY" Yes - "MM/DD/YY"  
Time Separator
Characters that are used in between the time digits 
Date Separator
Characters that are used in between the date digits 
TimeStamp Separator
Characters that are used between the time and date strings when returning a full time stamp. 
Override Colour
Overrides the current selected colour when writing the timestamp. 
Timestamp Colour
Defines the colour of the time stamp text 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_ConsoleWriter.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_ConsoleWriter.fcfx