Jump to content

Component: Console Writer (Indicators): Difference between revisions

From Flowcode Help
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 5: Line 5:
|-
|-
| width="20%" style="color:gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0
| 2.0
|-
|-
| width="20%" style="color:gray;" | Category
| width="20%" style="color:gray;" | Category
Line 15: Line 15:
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.
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.


==Component Source Code==
==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==
 
 
 


Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_ConsoleWriter.fcfx FC_Comp_Source_ConsoleWriter.fcfx]


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]


==Detailed description==




Line 46: Line 51:


==Examples==
==Examples==




Line 63: Line 74:
{{Fcfile|Logging_Example.fcsx|Logging Example}}
{{Fcfile|Logging_Example.fcsx|Logging Example}}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Clear'''
|-
| colspan="2" | Clears the contents of the console tab. 
|-
|-
| 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''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CountLines'''
|-
| colspan="2" | Counts the number of lines in the console. 
|-
|-
| 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''
|}




==Macro reference==
===AddString===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 96: Line 92:
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddString'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddString'''
|-
|-
| colspan="2" | Adds text string to the console window. 
| colspan="2" | Adds text string to the end of the console window. 
|-
|-
|-
|-
Line 109: Line 105:




===AddStringAtCursor===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTextLine'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddStringAtCursor'''
|-
|-
| colspan="2" | Sets the string data from a specific line in the console. 
| colspan="2" | Adds text string to the current cursor position. 
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
|-
| colspan="2" | Line number, -1 for the last line. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
Line 132: Line 124:




===Clear===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetColour'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Clear'''
|-
|-
| colspan="2" | Allows for full RGB colour selection 
| colspan="2" | Clears the contents of the console tab. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | R
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | G
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | B
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 160: Line 138:




===ClearFromCursorToLineEnd===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetColourIdx'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearFromCursorToLineEnd'''
|-
|-
| colspan="2" | Sets the text colour from the properties selection of colours. 
| colspan="2" | Clears the contents of the current selected line from the cursor position to the end of the line. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
|-
| colspan="2" | Range: 0-3 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 178: Line 152:




===ClearFromLineStartToCursor===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ShowConsole'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearFromLineStartToCursor'''
|-
|-
| colspan="2" | Pops up the console window and shows the correct tab. 
| 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. 
|-
|-
|-
|-
Line 191: Line 166:




===ClearLine===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTextLine'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearLine'''
|-
|-
| colspan="2" | Gets the string data from a specific line in the console. 
| colspan="2" | Clears all data from a specific line. Automatically sets the cursor to the start of the line. 
|-
|-
|-
|-
Line 204: Line 180:
| colspan="2" | Line number, -1 for the last line. 
| colspan="2" | Line number, -1 for the last line. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




 
===ClearXCharsFromCursorPosition===
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ClearXCharsFromCursorPosition'''
|-
|-
| colspan="2" | Clears the specified number of characters starting from the cursor position. 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Console Name
|-
| colspan="2" | Textual name of the console shown as the tab name at the top of the console window. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 0
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Colour 1
| width="90%" | CharacterCount
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 2
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 3
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | New Line After Data
|-
| colspan="2" | Automatically append a newline character after any data has been written to the console using the AddString  component macro. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Clear On Sim Start
|-
| colspan="2" | Automatically clear the console tab when the simulation is started. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Add Timestamp
|-
| colspan="2" | Automatically adds a timestamp to the console after a newline character has been received. 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | 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"  
|-
| 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 
|-
| 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 
|-
| 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. 
|-
| 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. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Timestamp Colour
|-
| colspan="2" | Defines the colour of the time stamp text 
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Clear'''
|-
| colspan="2" | Clears the contents of the console tab. 
|-
|-
| colspan="2" | Number of characters to remove 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 307: Line 204:




===CountLines===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 320: Line 218:




===GetTextLine===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddString'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTextLine'''
|-
|-
| colspan="2" | Adds text string to the console window. 
| colspan="2" | Gets the string data from a specific line in the console. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" |  
|-
| 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''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTextLine'''
|-
| colspan="2" | Sets the string data from a specific line in the console. 
|-
|-
|-
|-
Line 351: Line 232:
| colspan="2" | Line number, -1 for the last line. 
| colspan="2" | Line number, -1 for the last line. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" |  
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




===SetColour===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 389: Line 266:




===SetColourIdx===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 407: Line 285:




===SetCursorPosition===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ShowConsole'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetCursorPosition'''
|-
|-
| colspan="2" | Pops up the console window and shows the correct tab. 
| colspan="2" | Sets the position of the cursor 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Column
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTextLine'''
|-
| colspan="2" | Gets the string data from a specific line in the console. 
|-
|-
| colspan="2" | Character position along the line, starting from 0 
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
Line 432: Line 303:
|-
|-
| colspan="2" | Line number, -1 for the last line. 
| colspan="2" | Line number, -1 for the last line. 
|-
| 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''
|}
==Property reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Console Name
|-
| colspan="2" | Textual name of the console shown as the tab name at the top of the console window. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 0
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 1
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 2
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Colour 3
|-
| colspan="2" | Used to define a colour channel referenced by the SetColourIdx component macro call. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | New Line After Data
|-
| colspan="2" | Automatically append a newline character after any data has been written to the console using the AddString  component macro. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Clear On Sim Start
|-
| colspan="2" | Automatically clear the console tab when the simulation is started. 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Add Timestamp
|-
| colspan="2" | Automatically adds a timestamp to the console after a newline character has been received. 
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | 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"  
|-
| 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 
|-
| 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 
|-
| 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. 
|-
| 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. 
|-
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
| width="90%" | Timestamp Colour
|-
| colspan="2" | Defines the colour of the time stamp text 
|}==Macro reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Clear'''
|-
| colspan="2" | Clears the contents of the console tab. 
|-
|-
| 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''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CountLines'''
|-
| colspan="2" | Counts the number of lines in the console. 
|-
|-
| 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''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AddString'''
|-
| colspan="2" | Adds text string to the console window. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 567: Line 309:




===SetTextLine===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 590: Line 333:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ShowConsole===
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetColour'''
|-
| colspan="2" | Allows for full RGB colour selection 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | R
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | G
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | B
|-
| colspan="2" | Colour channel, Range: 0-255 
|-
| 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''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetColourIdx'''
|-
| colspan="2" | Sets the text colour from the properties selection of colours. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Range: 0-3 
|-
| 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''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 647: Line 345:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTextLine'''
|-
| colspan="2" | Gets the string data from a specific line in the console. 
|-
|-
| width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG
| width="90%" | Line
|-
| colspan="2" | Line number, -1 for the last line. 
|-
| 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''
|}




Line 751: Line 429:
| colspan="2" | Defines the colour of the time stamp text 
| colspan="2" | Defines the colour of the time stamp text 
|}
|}
==Component Source Code==
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]
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 13:01, 2 July 2024

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