ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 05-20-2011
Allister Wilson Allister Wilson is offline
Flexsim User
 
Join Date: Jul 2009
Posts: 17
Downloads: 8
Uploads: 0
Thanks: 22
Thanked 30 Times in 12 Posts
Rep Power: 151
Allister Wilson will become famous soon enoughAllister Wilson will become famous soon enough
Default Continually repainting a view when the simulation isn't running

Hi. I have a custom GUI control which needs to be constantly repainted (it displays constantly changing data obtained from a DLL).
The trick I've used up till now is to use a hotlinkx which calls repaintview on the control.

My problem is that this doesn't work when the simulation is stopped, I've tried various things like calling repaintview from inside the control's OnDraw attribute, or posting a WM_PAINT message from the same place (which seems to cause an infinite loop and freeze flexsim), but unsurprisingly these don't give the desired result.

Is there some way to get a view to constantly repaint, even when the simulation isn't running?
  #2  
Old 05-24-2011
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Attached is a sample model that uses the setticker() command to continuously execute a node. In that node, I repaint a view. In the draw code of an object in the view, I execute code to change the object's color based on how many seconds have passed since the last draw code (so that the logic can be based on real time).

setticker() is called in the Model Control GUI's OnOpen and OnClose.

You can use this method to continually repaint a view without running the simulation.
Attached Files
File Type: fsm repaint_without_simulation_running.fsm (16.9 KB, 107 views)
The Following 6 Users Say Thank You to Phil BoBo For This Useful Post:
Olivier Pellegrin (05-25-2011)


Thread Thread Starter Forum Replies Last Post
about model's continuously running Frans Zeng Q&A 10 05-21-2010 12:47 AM
Running Multiple Versions michaelsmith Installation 2 01-12-2010 07:48 AM
Problems with running time Jan Brandau Q&A 23 11-18-2009 04:16 AM
In what cases the running simulation would stop itself? KelvinHo Q&A 1 05-08-2008 08:32 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.