View Single Post
  #1  
Old 10-12-2015
Marco Baccalaro Marco Baccalaro is offline
Flexsim Distributor
 
Join Date: Nov 2008
Posts: 8
Downloads: 2
Uploads: 1
Thanks: 10
Thanked 47 Times in 7 Posts
Rep Power: 0
Marco Baccalaro has a spectacular aura aboutMarco Baccalaro has a spectacular aura about
Smile User Triggers Module

User Triggers module work on 7.5 version.
This module adds User Triggers tool in the toolbox in order to create functions and triggers that are linked together.
These functions and triggers can be used instead of sending messages and delayed messages and having a big amount of logic written into the On Message Trigger.
In can be used to:
  • give better order to code specially in complex objects where On Message trigger have most of the logic by having separated triggers
  • make code more readable by giving a name to the functions instead of calling onmessage and ondelayedmesage functions and helping development by suggesting parameters in those functions
  • give up to 8 parameters to these functions of any type instead of the 3 numerical of onmessage and ondelayedmesage functions

How to install it:
put the "User Triggers Module" folder into the Flexsim "modules" folder
run Flexsim

This module adds:
  • User Triggers tool under Modeling Logic in Toolbox
  • The User Triggers tab in any standard library object

How to use it:
  • By the toolbox add, by Modeling logic, a User Trigger
  • Give a name to the function (eg. newfunction), to the trigger (eg. OnNewFunction) and the parameters choosing for everyone the type and marking if it is optional
  • Open an object properties, under User Triggers tab, add the trigger choosing it by the list
  • Edit its code (parameters are suggested on the code header).
  • Call the function anywhere choosing if to delay it or not, in this case use -1 as delay parameter or NO_DELAY macro
Attached Files
File Type: zip User Triggers.zip (585.4 KB, 591 views)
Reply With Quote
The Following 5 Users Say Thank You to Marco Baccalaro For This Useful Post:
Anna Lisa Dierking (10-19-2015), Jing Chen (10-12-2015), Lucie Lerivrey (10-13-2015), mgiubilato (10-26-2015), Zhao Feng Zhang (11-26-2015)