Simulation Functionality
From Flowcode Help
Jump to navigationJump to searchContents
Built in functions
| Property | ||
| Gets the value of a property as a string | ||
| Sets a components 'color' property as a R,G,B value | ||
| Sets a components property as a string | ||
| Copies a property value from one target to another | ||
| Sets all child components property as a string | ||
| Copies the values of a properties children from the source to dest | ||
| Sets whether the property is visible or not | ||
| Sets whether the property can be edited in the UI or not | ||
| Gets whether the property is visible or not | ||
| Gets whether the property can be edited in the UI or not | ||
| Gets a components property filter string for lists, files, etc | ||
| Sets a components property filter string for lists, files, etc | ||
| Copies a property filter from one target to another | ||
| Gets a single lists index value from a property by line number | ||
| Gets a single list entry from a property by named index | ||
| Sets an existing list entries text for the property by named index | ||
| Alters or appends a list entries text for the property by named index | ||
| Returns the id of the panel hosting the component | ||
| Sets whether a component can interact with the mouse | ||
| Gets whether a component can interact with the mouse | ||
| Sets whether a component can be seen on the panel | ||
| Gets whether a component can be seen on the panel | ||
| Sets whether a component is checked in collision detections | ||
| Gets whether a component is checked in collision detections | ||
| Sets whether a component is considered for compilation or not | ||
| Gets whether a component will be compiled or not | ||
| Gets the type-instance of the component, >= 1 is valid | ||
| Finds a named object that is part of the component | ||
| Gets the root component handle | ||
| Gets the top-level owner of the component | ||
| Gets the owner of the component | ||
| Gets the next (younger) sibling of the components handle | ||
| Gets the previous (elder) sibling of the components handle | ||
| Gets the first (eldest) child of the component | ||
| Gets the last (youngest) child of the component | ||
| Gets the original definition of the component, returns Current if no original copy | ||
| Clones an existing object to another position on the panel | ||
| Deletes an existing object, removing it from the panel | ||
| Returns the name of the panel from the id | ||
| Returns the main background colour of the panel | ||
| Gets the number of 2d panels | ||
| Creates a new 2d panel | ||
| Adds a new component to a panel | ||
| Position | ||
| Returns the positions coordinates in (X,Y,Z) array | ||
| Returns the component size in (X,Y,Z) array | ||
| Moves the object to the given coordinates in World coordinates | ||
| Sets the objects size to a value | ||
| Gets a handle to an object representing the components current position | ||
| Gets a handle to an empty position | ||
| Sets an objects position based on a component or pre-defined position | ||
| Sets an objects coordinates based on a position | ||
| Sets an objects scale based on a position | ||
| Sets an objects orientation based on a position | ||
| Gets a handle to an object representing the components bounding box position | ||
| Returns the position of a line's nodes as a comma-separated list | ||
| Sets the nodes of a line | ||
| Blends positions from two sources to a destination | ||
| Blends positions from two sources to a destination over time | ||
| Stops all animations started by this component | ||
| Moves the object by the given offset relative to its parent along an axis | ||
| Moves the object by the given offset relative to its parent | ||
| Moves the object to the given coordinates relative to its parent | ||
| Sets the objects scale to a value | ||
| Multiplies the objects scale by a value | ||
| Divides the objects scale by a value | ||
| Rotates the object to the given rotation | ||
| Rotates the object by the given rotation along an axis | ||
| Rotates the object around the X axis | ||
| Rotates the object around the Y axis | ||
| Rotates the object around the Z axis | ||
| Returns the positions coordinates in (X,Y,Z) array | ||
| Returns the positions scale in (X,Y,Z) array | ||
| Returns the positions quaternion in (X,Y,Z,W) array | ||
| Returns the positions euler angles in (P,Y,R) array | ||
| Coordinate maths functions | ||
| 2D Panel functions | ||
| Camera positioning for 3D panel | ||
| PCloud | ||
| Creates a new point cloud tied to a position handle | ||
| Sets whether the point cloud is displayed or not | ||
| Sets the position for the point cloud to be located at | ||
| Gets the position the point cloud is located at | ||
| Sets the X,Y,Z point lists | ||
| Sets the X,Y,Z point lists | ||
| Sets the X,Y,Z point lists in a height-map grid | ||
| Sets the X,Y,Z point lists in a height-map grid | ||
| Sets the X,Y,Z point lists in a flat height-map grid | ||
| Given an XY on the grid, sets the vertex value at that point | ||
| Creates a unit scaled axis (X, Y or Z) with a center of zero and a range of two | ||
| Sets the RGB colour of the entire cloud | ||
| Sets the RGB colour of the individual points in the cloud | ||
| Given an XY on the grid, sets the vertex colour at that point | ||
| Sets the rendering mode of the point cloud | ||
| Enables or disables simple lighting for point mode, providing a normal passing through the point and (0,0,0) | ||
| Manually refresh the screen the point cloud exists on | ||
| LinkBar | ||
| Creates a new bar linking a pair of position handles | ||
| Sets whether the link is displayed or not | ||
| Sets the position for the start point of the bar | ||
| Sets the position for the end point of the bar | ||
| Sets the clipping adjustments for the beginning of the link | ||
| Sets the clipping adjustments for the end of the link | ||
| Sets the graphic for the start point of the bar | ||
| Sets the graphic for the main line of the bar | ||
| Sets the graphic for the end point of the bar | ||
| Gets the position the bars start point is located at | ||
| Gets the position the bar is located at | ||
| Gets the position the bars end point is located at | ||
| Manually refresh the screen the bar exists on | ||
| Sets whether Flowcode should automatically draw links for component object property types | ||
| TextLabel | ||
| Creates a new text label that always faces the camera | ||
| Sets whether the label is displayed or not | ||
| Sets the position for the point to draw the text at | ||
| Sets the offset from the SetPos() position for the label | ||
| Sets the text for the label | ||
| Sets the multipliers for the width and height of the label | ||
| Sets the foreground and background colours for the label | ||
| Sets whether to draw at a fixed size or to scale based on distance from the camera | ||
| Gets the position the label is located at | ||
| Manually refresh the screen the label exists on | ||
| Collision | ||
| Tests whether an object collides with the table top, returns Z distance to move to rest on the table | ||
| Tests whether an object collides with a position | ||
| Tests whether an object collides with a position | ||
| Returns the position to move Pos to so it does not collide with Test - null if no collide | ||
| Tests whether an object collides with a position | ||
| Returns the position to move Pos to so it does not collide with any other object - null if no collide | ||
| Graphics | ||
| Sends a redraw request to the given component | ||
| Sets the draw colour for and subsequent graphics objects | ||
| Sets the draw colour for and subsequent graphics objects | ||
| Sets the text font for subsequent text objects | ||
| Sets the text scale for subsequent text objects | ||
| Sets the thinkness when drawing lines and points | ||
| Creates a drawing area on a shape | ||
| Begins drawing on a given shape | ||
| Ends drawing started with DrawBegin() | ||
| Deletes a drawing area for a shape | ||
| Draws a line of text texture | ||
| Draws a point on a texture | ||
| Draws a line on a texture | ||
| Draws a smooth line on a texture | ||
| Draws a rectangle on a texture | ||
| Draws a circle on a texture | ||
| Clear texture to the given component | ||
| Routines to change the last drawn shape | ||
| Gets the button state from the mouse: 4 for left, 1 for right |
| Gets the handle of the component under the mouse |
| Gets the position of the mouse, intersecting with a component or the viewing plane |
| Gets the X/Y position of the mouse in screen coords |
| Gets the side of the component clicked on, 0 to 5 |
| Simulates a click on an object |
| Simulates a click-drag on an object |
| Simulates a click-release on an object |
| Simulates a key-press on an object |
| Simulates a key-release on an object |
| Gets a paths item value from the FCD document |
| Gets a FCD items handle, suitable for traversal with the Tree API |
| Gets a FCD paths handle, suitable for traversal with the Tree API |
| Override item value from the FCD document from path |
| Reset paths item value from the FCD document |
| Plays a formatted file sound, returns true if the sound played OK |
| Loads a wave file into memory, providing the values needed to play it |
| Creates a sound object that data can be played through |
| Sets the volume of playbacks for this sound |
| Gets the volume of playbacks for this sound in the range 0 to 1 |
| Gets the number of bits per sample for the sound |
| Gets the current sample rate for the sound |
| Sets the current sample rate for the sound - this will stop the playing sound |
| Queues a sound for playing |
| Queues a sound for playing, with the format provided |
| Stops all playing and queued sounds |
| Gets the number of sample blocks queued or playing for the sound |
| Adds a group to the scope to which streams may be added |
| Sets the visibility of the given group |
| Adds a stream to the given group suitable for inputs and operations |
| Adds a fixed-view stream to the given group suitable for inputs and operations |
| Renames the given scope group, stream or buffer |
| Sets the labels for the Y-axis of the given stream |
| Sets the group, stream or buffers line colour |
| Gets the streams line colour |
| Sets the groups background colour |
| Gets the stream groups background colour |
| Sets whether a stream can be decoded via the components event - defaults to 'true' |
| Gets whether a stream can be decoded via the components event - defaults to 'true' |
| Adds an input to the stream from a port |
| Adds an input to the stream from an analog channel |
| Adds an input to the stream from a custom injection |
| Adds an operation to act on the inputs of the stream |
| Clears all inputs and operations from the given stream |
| Sets the contents of a snapshot stream |
| Sets one of 32 custom analog values for the group |
| Gets a block of the output stream with each input sample operated on, returns number of samples read |
| Searches back through the output history for a value, returns offset of found sample from TimeUS, 0 if not found |
| Attempts to calculate the wave period given a series of transitions for the stream, returns calculated period |
| Sets the graphical format of the packets added with AddPacket and Add...Packets |
| Returns the graphical format of the packets added with AddPacket and Add...Packets |
| Adds an overlay packet to the stream at a given offset from the current time |
| Adds overlay packets to the stream by decoding the stream contents with a fixed period rate |
| Adds overlay packets to the stream by decoding the stream contents with a variable period rate |
| Clears existing overlay packets from the stream |
| Clears all existing overlay packets from the stream |
| Converts a duration in ticks into a time in seconds |
| Converts a time in seconds into a duration in ticks |
| Converts a float to an array containing 4 bytes |
| Returns a float value from an unsigned long representation (used to store or transfer it) |
| Calculates the frequency from an array of data. |
| Calculates the amplitude from an array of data. |
| Adds a window to the list of consoles available |
| Adds a window to the list of consoles available |
| Gets the default (read-only) console window |
| Gets a console window |
| Returns the name of a console |
| Renames the given console |
| Sets whether to show address and bytes for the console |
| Sets the colour of text inserted by the user from now on |
| Sets the colour of text inserted by the component from now on |
| Adds a block of text to the console window |
| Reads a line of text from the given console, pass -1 for final line |
| Writes a line of text from the given console, pass -1 for final line |
| Reads a line of bytes from the given console extending the array if needed |
| Writes a line of bytes from the given console, pass -1 for final line |
| Counts the number of lines in the console |
| Clears all the text in the console |
| Gets a ports value from its index |
| Sets a ports value from its index |
| Gets an analog value from its channel index |
| Sets an analog value from its index, range 0->1 |
| Gets a ports details from its name or index |
| Expands a string using the built-in pathname expansion variables |
| Expands a string to the name of a macro used in the generated code |
| Expands a string to the name of a global variable used in the generated code |
| Expands a string to the name of a property used in the generated code |
| Expands a macro name to the code generated for the header of that macro |
| Expands a macro name to the code generated for the body of that macro |
| Expands a macro name to the code generated for the tail of that macro |
| Gets the value of the given object, if available |
| Gets the name of the given object |
| Gets the full '.' separated name of the given object |
| Gets the value of a named sub-item of the given object, if available |
| Updates the object to step depth-first through the tree |
| Updates the object to point to the next (younger) sibling |
| Updates the object to point to the next (younger) sibling matching the name |
| Updates the object to point to the Nth next (younger) sibling matching the name |
| Updates the object to point to the last (elder) sibling |
| Updates the object to point to its parent object |
| Updates the object to point to the root of the tree |
| Updates the object to point to the head (eldest) child |
| Updates the object to point to the tail (youngest) child |
| Updates the object to point to the '.' separated named child path |
| Returns the number of immediate children present for the object |
| Returns true if the object has children, else false |
| Returns the number of immediate children present for the object |
| Returns true if the object has a parent, else false if it is the root |
| Updates the object to point to the head (eldest) attribute, if any |
| Updates the object to point to the tail (youngest) attribute, if any |
| Updates the object to point to the named attribute, if any |
| Creates a copy of the handle and returns the copy |
| Gets an absolute path from a relative filename | ||
| Gets an relative path from an absolute filename | ||
| Creates a directory structure | ||
| Finds the type of a file: 0=Unknown, 1=File, 2=Dir, 4=Disk | ||
| Gets the number of bytes in the file, by handle or name | ||
| Deletes the file or directory structure | ||
| Creates the new file as a standard stream | ||
| Opens the existing file as a standard stream | ||
| Reads an array from the file, returns elements read | ||
| Writes an array to the file | ||
| Sets the position of the next read or write in the file | ||
| Gets the position of the next read or write in the file | ||
| Writes all unwritten data to the file in one block | ||
| Buffer | ||
| Opens the existing file as a circular buffer | ||
| Creates the new file as a circular buffer | ||
| Reads a single byte from the input stream, -1 if empty | ||
| Writes a single byte to the input stream | ||
| Reads an array from the input stream, returns elements read | ||
| Writes an array to the input stream | ||
| NVM | ||
| Opens the existing file as a block of non-volatile memory | ||
| Creates the new file as a block of non-volatile memory | ||
| Reads a single byte from the NVM, -1 if empty | ||
| Writes a single byte to the NVM multiple times | ||
| Reads an array from the NVM, returns elements read | ||
| Writes an array to the NVM | ||
| Displays a simple 'Ok' message box |
| Invokes the Win32 API MessageBox function |
| Displays a simple 'Yes/No' message box |
| Displays a simple 'Yes/No/Cancel' message box (0 == Cancel, 1 == No, 2 == Yes) |
| Displays a message box that allows the user to input text. Returns true if 'Ok' clicked, false otherwise |
| Returns the value of a monotonic non-decrementing millisecond counter |
| Returns the current UTC Modified Julian Date value |
| Returns the current local time as a Modified Julian Date value |
| Increments or decrements a Modified Julian Date and millisecond value |
| Converts a Modified Julian Date into a Gregorian calendar date |
| Converts a Gregorian calendar date into a Modified Julian Date |
| Converts a Modified Julian Date into a number of seconds since a specified epoch |
| Returns the Modified Julian Date given by the number of seconds since a specified epoch |
| Gets the day of the week that the MJD represents |
| Returns true if the given year is a leap year, else false |
| Returns the number of days in the given month |
| Takes English text and optional hint and converts to the current language |
| Sends a System.User message to the targeted component |
| Sends the currently processing message to the target |
| Returns true if the macro exists |
| Calls a macro |
| Given a handle to an object with viewable presence, shows that object on screen |
| Creates a general-purpose garbage collected handle for resource management |
| Sets a general purpose word in the handle for use by its owner |
| Gets a general-purpose word set by the owner of a custom handle |
| Deletes any handle created by the component |
| Gets the handle of the component that posted this event - 0 for system |
| Calls the Component.Timer event with Ident as an argument after Millisecs time |
| Kills any timers with the given ident for this component |
| Enables or disables the software watchdog during long operations |
| Claims an event message by name, returns true if claimed |
| Releases a previously claimed an event message by name, returns true if released |
| Allows an event to be fired or removes the ability for an event to fire - this may be nested |
| Claims mouse clicks for the target object |
| Releases mouse clicks for the target object |
| Allows calls to one of your children to be redirected to another component |
| Start the simulation engine |
| Stop the simulation engine |
| Sets the speed the simulation engine |
| Sets the clipboard with text data |
| Reads text data from the clipboard |
| Checks to see if a Flowcode window has the focus |
| Launches an external file or program on this computer |
| Writes an integer value to the registry |
| Writes a string value to the registry |
| Reads an integer value from the registry |
| Reads a string value from the registry |
| Prints out the string or value on a line in the debug window |
| Prints out the string or value with a new-line in the debug window |
| Temporary debug function |
Events
| Preprocess | Broadcast to all components immediately before compilation is started | |
| AddProperty | Sent to a component to allow dynamic amendment of global property declarations | |
| AddConst | Sent to a component to allow dynamic amendment of global variable declarations | |
| AddVarSize | Sent to a component to allow dynamic amendment of global array-size declarations | |
| AddVar | Sent to a component to allow dynamic amendment of global constant declarations | |
| AddHeader | Sent to a component to allow dynamic amendment of header code | |
| AddInterrupts | Sent to a component to allow dynamic amendment of the interrupts for a component | |
| AddInterrupt | Sent to a component to allow dynamic amendment of a single interrupts code | |
| Start | Broadcast to all components that compilation is starting | |
| Stop | Broadcast to all components that compilation has stopped | |
| GetVarSize | Sent to a component to amend the size of the expected array | |
| HtmlBodyInfo | Sent to a component to retrieve tags to be placed in the html body | |
| HtmlScriptHeader | Sent to a component to retrieve script code to be placed in the html header section | |
| PropertyEx | Sent when a property has been changed by the User (specific property and value identified) | |
| Property | Sent when a property has been changed by the User | |
| ProjectClosedown | Sent to the component when the project is closing | |
| Added | Broadcast to all existing components once a new component has been added | |
| Adding | Broadcast to all existing components when a new component is about to be added | |
| Resize | Sent to the mouse target when the user has altered the position of a component child | |
| Removed | Broadcast to all remaining components after a component has been removed | |
| Removing | Broadcast to all existing components when a component is about to be removed | |
| Renamed | Sent to the component when the component is renamed | |
| Deleted | Closedown routine for the component | |
| Deleting | Send to a component when it is being deleted | |
| Initialise | Initialisation routine for the component once the component is linked to its parent | |
| Initialising | Initialisation routine before the component is linked to its parent | |
| AddLine | Post to the owning component when a line is inserted by the user | |
| TextChanged | Post when the console text is changed by the user in some way | |
| MemChanged | Post when the console memory is changed by the user in some way | |
| PinPopulate | Sent when auto-populate of digital connections is requested | |
| PinChange | Sent during simulation if a connected port pin changes | |
| AnPopulate | Sent when auto-populate of analog connections is requested | |
| AnChange | Sent during simulation if a connected ADC channel changes | |
| ChipChange | Sent when the target device has changed | |
| Unconnected | Sent when the component is compiled with unconnected pins | |
| FCDChange | Sent when some settings of the target device have changed | |
| Pause | Broadcast to all components that simulation has paused | |
| Resume | Broadcast to all components that simulation has resumed | |
| Start | Broadcast to all components that simulation is starting | |
| Stop | Broadcast to all components that simulation has stopped | |
| CleanHandle | Called when a custom handle is deleted to allow cleanup of resources | |
| Timer | Called back on the panel command System.TimerStart | |
| User | Called back on the panel command System.Notify | |
| LoadComplete | Broadcast after a project has finished loading | |
| Complete | Sent when a sound queued by the component has finished playing | |
| ResyncPacket | Sent when Packet_ResyncEv is specified in scope decoding | |
| Decode | Sent when a block of the stream is to be decoded into packets | |
| FmtPacket | Sent when a %e is read in a format string when decoding a packet | |
| Overlay | Sent when the mouse hovers over a scope stream | |
| GraphicPoll | Called when a tooltip graphic is updating with the draw image already pushed | |
| GetText | Called when a tooltip text string can be displayed | |
| GetGraphic | Called when a tooltip graphic can be displayed with the draw image already pushed | |
| Animated | Notification than an animation has finished | |
| Background | Updates the background container of the 2d panel | |
| Redraw | Reconstructs and redraws the target component | |
| ButtonName | Sent to give a meaningful name to a button on a simulated mouse-click | |
| KeyMapDown | Post when a mapped key is pressed for the component | |
| KeyMapUp | Post when a mapped key is released for the component | |
| MappingKeys | Sent to find out how many keys it is possible to map to the component during simulation | |
| MappingName | Sent to give a meaningful name to a custom key-map event for a component | |