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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default Are there functions / keyboard shortcuts for controlling the Flexsim debugger?

Hi,

I am wondering if there are functions for controlling the Flexsim debugger, i.e. next line, step-into, continue and stop simulation clock. I would want to use these commands with the keyboard instead of having to press the buttons with the mouse. I tried to look at the debug() function, but did not get it working and I am not sure if that is the way it is supposed to be used anyhow.

I know how to create the keyboard shortcuts (see https://www.flexsim.com/community/fo...board+shortcut) if there are functions that can control the debug.

Anyone who knows if this can be done?

Thank you!

Kind regards,
Axel
Reply With Quote
  #2  
Old 07-23-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

To make it clearer I tried to use the debug command like below. I called this function from the perspective view/eventfunctions/onKeyDown node. The shortcuts are working as the prints work, but the debug instructions throw me "exception: Exception caught in flexscript execution of MODEL:/Tools/UserCommands/customKeyboardShortcuts/code line 8 instruction 12. Discontinuing execution."

Code:
/**customKeyboardShortcuts*/
//pf(lastkeydown());pr();
treenode debugObject = parnode(1);

if(lastkeydown()){ //key pressed? 
	switch (lastkeydown()){ 
		case 113:    //p.e. F2-Key
			pt("F2");pr();
			debug(DEBUG_STEP);
			break;
		//F3 key
		case 114: 
			pt("F3"); pr();
			debug(DEBUG_STEP_INTO);
			break;
		//F4 key
		case 115:
			pt("F4");pr();
			debug(DEBUG_CONTINUE);
			break;
		case 116:
			pt("F5");pr();
			debug(DEBUG_STOP_SIMULATION);
			break;
		case 117:
			pt("F6");pr();
			debug(DEBUG_STOP);
			break;
	}
}
Reply With Quote
  #3  
Old 07-23-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

You need to pass in the code node as the second parameter, and that will change depending on which code you're debugging. Also your method requires you to click into the perspective view when you want to start stepping through.

I've asked that we add it to the debugger.
Reply With Quote
The Following 4 Users Say Thank You to Jason Lightfoot For This Useful Post:
arunkrmahadeva (07-23-2015), Axel Kohonen (07-23-2015), Kris Geisberger (07-23-2015), RalfGruber (07-24-2015)
  #4  
Old 07-24-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Thank you Jason,

That makes sense. Do you know of some good way to get the current code node, i.e. the one that the debugger is active in? Or how can I get it? Is there a way to have a onKeyTrigger in the editor instead of the perspective view? That way the onKeyTrigger would be fired in the correct node more easily.

Thank you! That would make the debugger easier to use!

Kind regards,
Axel
Reply With Quote
  #5  
Old 07-24-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

From the perspective view you'd have to scan through the Views:active>documents/code entries and find the code editor window that had the active debugger and then find the object that was focused on.

From the debugger, the onkeyDown would need to be in a number of view levels of the GUI to detect which had your mouse focus - and then the path to the objectfocus code node pointer of the code editor will be changing for each event.

Both are just a little messy/clunky - hopefully our developers can come up with something better.
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Axel Kohonen (07-24-2015)
  #6  
Old 07-24-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Hi Jason,

Thank you for the suggestions! I will try to get one of those working when I get the time for it.

Yes, it would be great if they would as I think many of the Flexsim users would appreciate it.

Axel
Reply With Quote
  #7  
Old 07-24-2015
Alessio Merlo Alessio Merlo is offline
Flexsim User
 
Join Date: Oct 2013
Posts: 1
Downloads: 13
Uploads: 0
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
Alessio Merlo is on a distinguished road
Default

Jason, will you insert this function in the next release of Flexsim 7.7?

Without using perspective, Axel, you can edit OnKeyUp with the switch case directly in the CodeEditor GUI saved in VIEW:/standardviews/code/CodeEditor.
Reply With Quote
The Following User Says Thank You to Alessio Merlo For This Useful Post:
Axel Kohonen (08-02-2015)
  #8  
Old 07-24-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Not for me to say - sorry - but they seem to always do a good job of putting things in if they can. If I hear back I'll post here or maybe one of the guys will.
Reply With Quote
  #9  
Old 08-02-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Thank you Alessio and Jason,

Alessio, I cannot seem to find the onKeyUp within the View:/standardview/code/codeEditor. I assume it would be in the eventfunctions node, but there is no onKeyUp node there. Where did you find it (I am using Flexsim 7.5.2)? Also, I tried to add the node, but it disappears when I save, close and reopen the model. Is there a way to save the node so that it stays there also when you save and close and reopen the model?

Thank you!
Axel
Reply With Quote
  #10  
Old 08-03-2015
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

You can use create a module to make the change 'stick'.
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Axel Kohonen (08-03-2015)
  #11  
Old 08-03-2015
Axel Kohonen
Guest
 
Posts: n/a
Downloads: 22
Uploads: 0
Default

Thank you Jason,

You mean as mentioned in these posts?
https://www.flexsim.com/community/fo...=create+module

and

https://www.flexsim.com/community/fo...ight=bitbucket

If that is the case then I guess I need to maintain my changes in later versions, right? Until the functionality is added in the official release at least.

Thank you!
Axel
Reply With Quote
Reply

Tags
debugging

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with redefined keyboard keys Danny Pavan Q&A 2 06-21-2010 09:26 AM
COM Object for Controlling Flexsim Anthony Johnson User Development 6 02-25-2009 11:43 AM
Flexsim Debugger Anthony Johnson Gripes and Goodies 6 02-06-2009 05:37 AM
Controlling Flexsim Remotely Anthony Johnson Wiki Articles 2 01-02-2009 12:36 PM
Change Flexsim keyboard shortcut AlanZhang Q&A 1 12-03-2008 02:41 PM


All times are GMT -6. The time now is 04:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.