PDA

View Full Version : Custom Console


Phil BoBo
04-23-2010, 05:16 PM
Here is a user library that adds a Custom Console gui and several hidden user commands that allow you to print to that console.

The commands it adds are cpt(), cpr(), cpf(), and cpd().

The console can be opened by dragging it from the library to the model. You can also drag the "Assign as Control GUI" icon from the library to the model to assign the custom console as the Model Control GUI for easy access from the toolbar.

This user library also shows off the ModelLibraries feature that allows you to have global variables and user commands that are not visible to the user.

Vincent Bechard
04-26-2010, 08:41 AM
Thanks for this useful library. It illustrates very well a new functionnality in Flexsim 5, which was not mentionned in the What's New. I think it should have been writen in bold and underlined font! It is as great as the new flexsxcript handling features!

Flexsim Users: if you used to develop complex libraries, don't miss this amazing feature! You can almost have a template model within a model, all private stuff (variables, commands, triggers) that usual users won't see. Incredible! I like that, I will upgrade my old-style libraries today...

Jason Lightfoot
04-26-2010, 09:23 AM
ModelLibraries was also supported in 4.52 - I'm not sure it was ever listed under new features.

Vincent Bechard
04-26-2010, 09:45 AM
What???? I spent the last year on developping several libraries. I've never seen anything related to that feature in the documentation... Anyways, I have wings today, so many exciting clean ups to do!

Phil BoBo
04-26-2010, 09:50 AM
It wasn't documented in 4.52. It is now. It is in the manual under Miscellaneous Concepts > Creating Custom Libraries.

mark.gormley
04-27-2010, 02:43 AM
Thanks for this Phil, very useful.

Just a quick addition, it may be worth adding 1 more command, something like
cClear(); to clear the custom console of all text, which would just be:

/**Clear Custom Console*/
if(CustomConsole)
{
setviewtext(CustomConsole,"");
}


Thanks!

Mark

Luciano
12-12-2011, 04:19 AM
Thaks for the lib Phil, very useful.

One question: the cpt() implementatation use the setviewtext() and getviewtext()
to add a line to the custom console.
When the console contains a lot of info this is a heavy method to add a line.
There is another way to add a line to the custom console view? The flexsim pt() command use the same commands?

Thanks!
Luciano.