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 03-27-2008
Naresh Yamani's Avatar
Naresh Yamani Naresh Yamani is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 11
Downloads: 20
Uploads: 0
Thanks: 7
Thanked 7 Times in 4 Posts
Rep Power: 157
Naresh Yamani is on a distinguished road
Default Updating Labels

Hello,

In a model when I am testing, the object labels are not updating when you press the Stop button until unless you click the mouse button in the view window. This happens if you write a code in Tools->Model Triggers->On Run Stop. Is there any way to update labels without clicking the mouse button.

Thanks
Naresh
  #2  
Old 03-27-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Naresh,

In the code that fires when the model stops try inserting the following line of code:

repaintall():

That command should repaint all of the windows and update the labels.

Good Luck,
Brandon
__________________
thats not normal.
  #3  
Old 03-27-2008
Naresh Yamani's Avatar
Naresh Yamani Naresh Yamani is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 11
Downloads: 20
Uploads: 0
Thanks: 7
Thanked 7 Times in 4 Posts
Rep Power: 157
Naresh Yamani is on a distinguished road
Default

Hello Brandon,

I have tried using repaintall(); but the labels of the object are not updating with the code written in "On Run Stop".

Could you please look at it.

Thanks
Naresh
  #4  
Old 03-28-2008
tobias.biemueller tobias.biemueller is offline
Flexsim User
 
Join Date: Aug 2007
Location: Bielefeld, Germany
Posts: 42
Downloads: 22
Uploads: 0
Thanks: 23
Thanked 18 Times in 16 Posts
Rep Power: 164
tobias.biemueller is on a distinguished road
Default

Hello Naresh,

maybe you can build up a small sample model, which show the problem and share it with the community.
Then its easier for us to help you or to show you a solution for that.

Regards Tobias
  #5  
Old 03-28-2008
Naresh Yamani's Avatar
Naresh Yamani Naresh Yamani is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 11
Downloads: 20
Uploads: 0
Thanks: 7
Thanked 7 Times in 4 Posts
Rep Power: 157
Naresh Yamani is on a distinguished road
Default

Hi Tobias,

Find the attached model. The label “status” is not updating when you press the “stop” button. But if you mouse click in any view windows then it’s changing. There is one line of code in :

Tools->Model Triggers->On Run Stop
Tools->Model Triggers->On Run Start

Regards
Naresh
Attached Files
File Type: zip LabelUpdate_OnRunStop.zip (59.8 KB, 302 views)
  #6  
Old 03-28-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi naresh,

I tested your model and also have the same problem as you. status is not updated in the tree.
The label is updated but you can not see it until click in the view, so it looks like it a bug in the updating of the tree.

If you want to be sure that the label is updated, add this line after your setlabelnum in OnRunStop:
pt("status=");pf(getlabelnum(current,"status")); pr();

Open the console window and run the model, you will see that status has value 0 in the console but not in the tree.

Lars-olof
  #7  
Old 03-28-2008
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

Naresh,

The fact that the window isn't being repainted when you hit the stop button is why the label appears to not be updating. The node is updating, but the window isn't repainting to show the change as you can see by following Lars-olof's instructions. When you click in a window, it receives a paint message so it redraws itself with the updated data.

I'm not sure why repaintall() isn't working to fix the problem, but if you really need this functionality, the following lines of code do work here:

forobjecttreeunder(node("VIEW:/1"))
{
repaintview(a);
}

This essentially does the same thing as repaintall(), except it sends a repaint message to every control widget instead of just each window. (Thus sending a repaint message to the tree control widget itself instead of just the window that has a tree control widget in it.)
The Following 3 Users Say Thank You to Phil BoBo For This Useful Post:
Tom David (03-29-2008)
  #8  
Old 03-28-2008
Naresh Yamani's Avatar
Naresh Yamani Naresh Yamani is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 11
Downloads: 20
Uploads: 0
Thanks: 7
Thanked 7 Times in 4 Posts
Rep Power: 157
Naresh Yamani is on a distinguished road
Default

Thanks Phil. I really need this functionality and got it now.

-Naresh


Thread Thread Starter Forum Replies Last Post
can I use an edit box entry to update multiple labels? KelvinHo Q&A 10 03-28-2008 07:17 AM
Display Labels with the Recorder tsconcept Q&A 9 09-26-2007 08:16 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.