Class JythonMonitorScannableDynamicCommandControl

java.lang.Object
gda.factory.FindableBase
uk.ac.gda.client.livecontrol.LiveControlBase
uk.ac.gda.client.livecontrol.JythonMonitorScannableDynamicCommandControl
All Implemented Interfaces:
Findable, LiveControl

public class JythonMonitorScannableDynamicCommandControl extends LiveControlBase
Subclass of CommandControl to create a button and run commands on the command server. It monitors a scannable and button text and command to run changes based on scannable position. Example use case is to move a shutter in and out as a single button.

Example bean definition:
 
	<bean id="hard_shutter_toggle_button" class="uk.ac.gda.client.livecontrol.JythonMonitorScannableDynamicCommandControl">
		<property name="scannableName" value="fsi1"/>
		<property name="buttonTooltip" value="Move the hard x-ray shutter"/>
		<property name="group" value="Hard X-Ray" />
		<property name="buttonTextMap">
			<util:map map-class="java.util.HashMap">
				<entry key="In" value="Open" />
				<entry key="Out" value="Close" />
			</util:map>
		</property>
		<property name="commandMap">
			<util:map map-class="java.util.HashMap">
				<entry key="In" value="pos fsi1 'Out'" />
				<entry key="Out" value="pos fsi1 'In'" />
			</util:map>
		</property>
	</bean>
 
 
  • Field Details

    • commandMap

      protected Map<String,String> commandMap
    • buttonTextMap

      protected Map<String,String> buttonTextMap
    • button

      protected org.eclipse.swt.widgets.Button button
  • Constructor Details

    • JythonMonitorScannableDynamicCommandControl

      public JythonMonitorScannableDynamicCommandControl()
  • Method Details

    • createControl

      public void createControl(org.eclipse.swt.widgets.Composite composite)
      Description copied from interface: LiveControl
      This method will create the GUI for this control.
      Specified by:
      createControl in interface LiveControl
      Parameters:
      composite - The composite onto which the control should draw
    • runCommand

      protected void runCommand(String command)
    • updateScannable

      public void updateScannable(Object theObserved, Object arg)
    • getButtonTextMap

      public Map<String,String> getButtonTextMap()
    • setButtonTextMap

      public void setButtonTextMap(Map<String,String> stateMap)
    • getButtonTextMapValue

      protected String getButtonTextMapValue(Object position)
    • getButtonTextMapKey

      protected String getButtonTextMapKey(Object position)
    • getCommandMap

      public Map<String,String> getCommandMap()
    • setCommandMap

      public void setCommandMap(Map<String,String> commandMap)
    • getCommandMapValue

      protected String getCommandMapValue(Object position)
    • getCommandMapKey

      protected String getCommandMapKey(Object position)
    • getScannableName

      public String getScannableName()
    • setScannableName

      public void setScannableName(String scannableName)
    • setButtonText

      public void setButtonText(String buttonText)
    • setButtonTooltip

      public void setButtonTooltip(String buttonTooltip)
    • getCommand

      public String getCommand()
    • setCommand

      public void setCommand(String command)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class LiveControlBase
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class LiveControlBase
    • toString

      public String toString()
      Overrides:
      toString in class LiveControlBase