#include <VControlPanel.h>
Inherits wxPanel.
Collaboration diagram for VControlPanel:

Public Types | |
| enum | GUIElements { PLAY_BTN, FF_BTN, RESTART_BTN, STATUS_BTN, SPEED_CHOICE, ACCURACY_CHOICE, SPEED_DISPLAY, FPS_DISPLAY } |
Public Member Functions | |
| VControlPanel (wxFrame *frame, VWorld *world, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize) | |
| bool | initFromXML (const wxXmlNode &node) |
| void | onPlayBtn (wxCommandEvent &event) |
| Play button callback. Toggles between play and stop. | |
| void | onFFBtn (wxCommandEvent &event) |
| void | onResetBtn (wxCommandEvent &event) |
| Reset button callback. Reloads the XML file and re-starts the sim. | |
| void | onSpeedChoice (wxCommandEvent &event) |
| Speed choice callback. Sets the time zoom factor for the model. | |
| void | onAccuracyChoice (wxCommandEvent &event) |
| Accuracy choice callback. Sets the stepsize for the model. | |
| void | runModel () |
| void | updateGUI (const long double curTime) |
| bool | isPlaying () const |
Protected Attributes | |
| VWorld * | myModel |
| The World that I am controling. | |
| bool | myIsPlaying |
| Set true if I am currently running the model forward. | |
| long double | myLastModelUpdate |
| The time of the last model update. | |
| long double | myLastGUIUpdate |
| The time of the last GUI update (used to calculate FPS). | |
| double | myDesiredSpeedFactor |
| The desired time acceleration factor (from the GUI). | |
| double | myActualSpeedFactor |
| double | myStepSize |
| The step size to use. | |
GUI elements | |
| wxButton * | myPlayBtn |
| wxButton * | myFFBtn |
| wxButton * | myRestartBtn |
| wxButton * | myStatusBtn |
| wxChoice * | mySpeedChoice |
| wxChoice * | myAccuracyChoice |
| wxTextCtrl * | myActualSpeed |
| wxTextCtrl * | myFPS |
Definition at line 26 of file VControlPanel.h.
|
|
Definition at line 29 of file VControlPanel.h. |
|
||||||||||||||||||||||||
|
Create a VControlPanel
Definition at line 33 of file VControlPanel.cpp. References memTraceMsg. |
|
|
Initialize the GUI from an XML node. This should be the <application> node. Definition at line 112 of file VControlPanel.cpp. References traceId. |
|
|
Definition at line 72 of file VControlPanel.h. References myIsPlaying. Referenced by ViewerGUI::onIdle(). |
|
|
Accuracy choice callback. Sets the stepsize for the model.
Definition at line 166 of file VControlPanel.cpp. References myAccuracyChoice, myStepSize, and traceId. |
|
|
Fast foward button callback. Pops up a dialog to get the number of seconds to advance the model. Model is advanced and paused Definition at line 131 of file VControlPanel.cpp. References MWorld::advanceModel(), myIsPlaying, myModel, myStepSize, onPlayBtn(), and traceId. Here is the call graph for this function: ![]() |
|
|
Play button callback. Toggles between play and stop.
Definition at line 118 of file VControlPanel.cpp. References myFPS, myIsPlaying, myLastModelUpdate, myPlayBtn, and pcTimer(). Referenced by onFFBtn(), and onResetBtn(). Here is the call graph for this function: ![]() |
|
|
Reset button callback. Reloads the XML file and re-starts the sim.
Definition at line 147 of file VControlPanel.cpp. References myIsPlaying, onPlayBtn(), ViewerApp::reInit(), ViewerApp::theApp, and traceId. Here is the call graph for this function: ![]() |
|
|
Speed choice callback. Sets the time zoom factor for the model.
Definition at line 158 of file VControlPanel.cpp. References myActualSpeedFactor, myDesiredSpeedFactor, mySpeedChoice, and traceId. |
|
|
Advance the physics model. This will calculate how much real-time has passed since the last time this function was called and will advance the model the correct amount. This function could potentially take a long time if you wait too long between calls. This function is part of the automatic speed control. If it takes longer to move the model forward than it should, I slow down the time acceleration Definition at line 201 of file VControlPanel.cpp. References MWorld::advanceModel(), myActualSpeedFactor, myIsPlaying, myLastModelUpdate, myModel, myStepSize, and pcTimer(). Referenced by ViewerGUI::onIdle(). Here is the call graph for this function: ![]() |
|
|
Update the GUI. This will calculate the time since it was last called and if it has been more than 1/5th of a second, the GUI elements will be re-drawn. This function is also part of the automatic speed control. It will increase the speed if we are getting a good FPS Definition at line 173 of file VControlPanel.cpp. References TemplateUtil::min(), myActualSpeed, myActualSpeedFactor, myDesiredSpeedFactor, myFPS, myLastGUIUpdate, and traceId. Referenced by ViewerGUI::onIdle(). Here is the call graph for this function: ![]() |
|
|
Definition at line 104 of file VControlPanel.h. Referenced by onAccuracyChoice(). |
|
|
Definition at line 106 of file VControlPanel.h. Referenced by updateGUI(). |
|
|
The actual time acceleration factor that I am using (might not be able to do what the user wants because they have a slow computer) Definition at line 90 of file VControlPanel.h. Referenced by onSpeedChoice(), runModel(), and updateGUI(). |
|
|
The desired time acceleration factor (from the GUI).
Definition at line 87 of file VControlPanel.h. Referenced by onSpeedChoice(), and updateGUI(). |
|
|
Definition at line 99 of file VControlPanel.h. |
|
|
Definition at line 107 of file VControlPanel.h. Referenced by onPlayBtn(), and updateGUI(). |
|
|
Set true if I am currently running the model forward.
Definition at line 79 of file VControlPanel.h. Referenced by isPlaying(), onFFBtn(), onPlayBtn(), onResetBtn(), and runModel(). |
|
|
The time of the last GUI update (used to calculate FPS).
Definition at line 84 of file VControlPanel.h. Referenced by updateGUI(). |
|
|
The time of the last model update.
Definition at line 82 of file VControlPanel.h. Referenced by onPlayBtn(), and runModel(). |
|
|
The World that I am controling.
Definition at line 76 of file VControlPanel.h. Referenced by onFFBtn(), and runModel(). |
|
|
Definition at line 98 of file VControlPanel.h. Referenced by onPlayBtn(). |
|
|
Definition at line 100 of file VControlPanel.h. |
|
|
Definition at line 103 of file VControlPanel.h. Referenced by onSpeedChoice(). |
|
|
Definition at line 101 of file VControlPanel.h. |
|
|
The step size to use.
Definition at line 93 of file VControlPanel.h. Referenced by onAccuracyChoice(), onFFBtn(), and runModel(). |
1.4.5