If you have a specific function that needs to be run when the user right-clicks on the selection adorner, you can set the default '_CALLBACK_EquipmentRightCLick' label to a custom function of your own. The current default function is "DefaultEquipmentRightClickCallback".
The '_CALLBACK_EquipmentRightClick' label is set by default in the SA_Style_1_MultiRes starter project. To view labels, navigate to the Standards activity and select Labels.
Syntax
Workspace_RightClickEquipment()
Returns
None
Example
IF Workspace_IsSelContext("MyPlant.SkimMilk.TNK02", "", TRUE) THEN
Workspace_RightClickEquipment()
END
In the Visualization activity | Menu Configuration grid, the menu for "Drive" equipment type can be defined as:
Page |
Level 1 |
Menu Command |
---|---|---|
Drive_Menu |
@(Auto) |
TagWrite(Workspace_GetSelContext() + ".AutoCmd",1) |
Drive_Menu |
@(Manual) |
TagWrite(Workspace_GetSelContext() + ".ManCmd",1) |
Drive_Menu |
@(Start) |
TagWrite(Workspace_GetSelContext() + ".StartCmd",1) |
Drive_Menu |
@(Stop) |
TagWrite(Workspace_GetSelContext() + ".StopCmd",1) |
After the user clicks the left mouse button on the equipment "MyPlant.SkimMilk.TNK02" to select it, then clicks the right mouse button on the equipment, it will bring up the "Drive_Menu" pop-up menu commands as outlined in the table above.
Published June 2018