[ from a customer ]
There are scripts and state machines involved in the gauge screens in the 2.1 Murphy Standard Configuration. How do I add a new gauge screen in that rotation?
How do I add a Gauge Screen in 2.1 Murphy Standard Config?
- jpurdum
- Enovation Controls Development
- Posts: 153
- Joined: Mon Jun 21, 2010 11:19 am
- jpurdum
- Enovation Controls Development
- Posts: 153
- Joined: Mon Jun 21, 2010 11:19 am
Re: How do I add a Gauge Screen in 2.1 Murphy Standard Confi
We load this same configuration for our Standard product shipped off the line. Which means there are certain features we wanted in it to make it usable for the end customer if they use the PV750 as is without loading a different configuration. These features include
- returning to the last gauge screen viewed when rebooting or returning from the menu
- using the gauge screen pop-ups which become viewable when you hit the return key (lower right key)
- the end user's ability to change the home screen from the User Settings screen
- the end user's ability to disable a gauge screen from the rotation
In order to have these features, we had to write some scripts and use a state machine. In 2.0, adding a new screen to the rotation in the 2.0 standard config was admittedly very difficult. Although I wouldn't call it straight forward in 2.1, it is very much improved. The steps to do this are below...
Steps to add a Gauge screen in rotation of gauge screens in the 2.1 Murphy Standard Configuration
- make a copy of the config and give it a new name
- open the config and go to the Page Designer
- make sure the Main Layer is selected – you should see the following gauge screen already in the config
- Select the Programming tab
- Select the State Machine “GaugeScreenGoTo”
- In this state add the two actions
- Assuming you’re going to place this screen between Engine and Transmission…
- Go to the Scripting Tab and select the script “GaugeScreenInit”
- At the top of this script you will see the enum “GaugeScreens”, add “GSNewGaugeScreen” between “GSEngine” and “GSTransmission”. It should now look like
- Add a line for your screen such that the function now looks like
- go back to the Page Designer tab
- select the settings layer
- select the User Settings page
- under Screen in the table, select one of the lamp gauge elements that represent the selected screen
- under the properties window, select Go to Lamp Gauge...
- Unfortunately, this is the most tedious part of the whole process, you will need to modify all the existing ordered values to shift them down to add your screen. The easiest way is to start with the last element which should be 7 to 7, and change it to 8 to 8. Do this all the way down to changing 2 to 2 to 3 to 3.
- Now add another Text Element. Make it's range 2 to 2, and change the Text to "New Gauge Screen"
- Save, Create and Load and you should see your new screen in the rotation of gauge screens
- returning to the last gauge screen viewed when rebooting or returning from the menu
- using the gauge screen pop-ups which become viewable when you hit the return key (lower right key)
- the end user's ability to change the home screen from the User Settings screen
- the end user's ability to disable a gauge screen from the rotation
In order to have these features, we had to write some scripts and use a state machine. In 2.0, adding a new screen to the rotation in the 2.0 standard config was admittedly very difficult. Although I wouldn't call it straight forward in 2.1, it is very much improved. The steps to do this are below...
Steps to add a Gauge screen in rotation of gauge screens in the 2.1 Murphy Standard Configuration
- make a copy of the config and give it a new name
- open the config and go to the Page Designer
- make sure the Main Layer is selected – you should see the following gauge screen already in the config
- o Engine
o GPS
o GraphicDemo
o Machine 1
o Machine 2
o StartupScreen
o Transmission
o Video
- o When you paste, it’s named the same – the second one in the list is your new screen, so rename it
o I named mine “New Gauge Screen”, so that’s how I’ll refer to it from here
- Select the Programming tab
- Select the State Machine “GaugeScreenGoTo”
- o You should see an Initial state in addition to a state for each of the current gauge screens
- In this state add the two actions
- o UIApp->Show View(MainLayer.Default New Gauge Screen View)
o CCM->Fire Event(GaugeScreenReturnToInit)
- o Name this transition ShowGSNewGaugeScreen
o Leave the “Generate Event for this transition” checked
- o Uncheck “Generate Event for this transition”
o Select the even GaugeScreenReturnToInit from the pull down list in the Name: field
- Assuming you’re going to place this screen between Engine and Transmission…
- Go to the Scripting Tab and select the script “GaugeScreenInit”
- At the top of this script you will see the enum “GaugeScreens”, add “GSNewGaugeScreen” between “GSEngine” and “GSTransmission”. It should now look like
- enum GaugeScreens
{- GSEngine = 0,
GSNewGaugeScreen,
GSTransmission,
GSMachine1,
GSMachine2,
GSGPS,
GSGraphicsDemo,
GSVideo,
GSMAX // designed for 32 screens or less
- GSEngine = 0,
- Add a line for your screen such that the function now looks like
- void GSSetupEvents()
{- gsEventHandles[GSEngine] = EventID("ShowGSEngine");
gsEventHandles[GSNewGaugeScreen] = EventID(“ShowGSNewGaugeScreen”);
gsEventHandles[GSTransmission] = EventID("ShowGSTransmission");
gsEventHandles[GSMachine1] = EventID("ShowGSMachine1");
gsEventHandles[GSMachine2] = EventID("ShowGSMachine2");
gsEventHandles[GSGPS] = EventID("ShowGSGPS");
gsEventHandles[GSGraphicsDemo] = EventID("ShowGSGraphicsDemo");
gsEventHandles[GSVideo] = EventID("ShowGSVideo");
o Where GSNewGaugeScreen matches the new gauge screen enum just above this in the script, and “ShowGSNewGaugeScreen” matches the new transition event you added to the state machine above - gsEventHandles[GSEngine] = EventID("ShowGSEngine");
- o If there are errors, correct them and compile again. If the compile is not successful, this will not run properly on the PV750
- go back to the Page Designer tab
- select the settings layer
- select the User Settings page
- under Screen in the table, select one of the lamp gauge elements that represent the selected screen
- under the properties window, select Go to Lamp Gauge...
- Unfortunately, this is the most tedious part of the whole process, you will need to modify all the existing ordered values to shift them down to add your screen. The easiest way is to start with the last element which should be 7 to 7, and change it to 8 to 8. Do this all the way down to changing 2 to 2 to 3 to 3.
- Now add another Text Element. Make it's range 2 to 2, and change the Text to "New Gauge Screen"
- Save, Create and Load and you should see your new screen in the rotation of gauge screens