Difference between revisions of "DispatchAction"

From Moving Light Assistant
Jump to: navigation, search
m (Add Preset & Channel photo display actions.)
m
Line 43: Line 43:
  
 
===Set Preset Name Text===
 
===Set Preset Name Text===
:optionalParameter (string) = Preset Name text. i.e.<code>DS Back</code>.
+
:parameter (string) = Preset Name text. i.e.<code>DS Back</code>.
 
Will set the 'Note' field for the selected Presets to the string sent as the parameter.
 
Will set the 'Note' field for the selected Presets to the string sent as the parameter.
  
 
===Set Preset ID Text===
 
===Set Preset ID Text===
:optionalParameter (string) = Preset ID text. i.e.<code>10.1</code>.
+
:parameter (string) = Preset ID text. i.e.<code>10.1</code>.
 
Will set the 'Preset ID' field for the selected Presets to the string sent as the parameter.
 
Will set the 'Preset ID' field for the selected Presets to the string sent as the parameter.
  
 
===Set Preset Type Text===
 
===Set Preset Type Text===
:optionalParameter (string) = Preset Type text. i.e.<code>Colour</code>.
+
:parameter (string) = Preset Type text. i.e.<code>Colour</code>.
 
Will set the 'Preset Type' field for the selected Presets to the string sent as the parameter.
 
Will set the 'Preset Type' field for the selected Presets to the string sent as the parameter.
  
 
===Set Preset Focus Cue Text===
 
===Set Preset Focus Cue Text===
:optionalParameter (string) = Preset Focus Cue text. i.e.<code>155</code>.
+
:parameter (string) = Preset Focus Cue text. i.e.<code>155</code>.
 
Will set the 'Focus Cue' field for the selected Presets to the string sent as the parameter.
 
Will set the 'Focus Cue' field for the selected Presets to the string sent as the parameter.
  
 
===Set Preset Set Text===
 
===Set Preset Set Text===
:optionalParameter (string) = Preset Set text. i.e.<code>Open Stage</code>.
+
:parameter (string) = Preset Set text. i.e.<code>Open Stage</code>.
 
Will set the 'Set' field for the selected Presets to the string sent as the parameter.
 
Will set the 'Set' field for the selected Presets to the string sent as the parameter.
  
Line 87: Line 87:
  
 
===Set Channel Focused Flag===
 
===Set Channel Focused Flag===
:optionalParameter as string = <code>True</code> or <code>False</code>
+
:parameter as string = <code>True</code> or <code>False</code>
 
Will set the 'Focussed' checkbox for the selected Channel to on (True) or off (False).
 
Will set the 'Focussed' checkbox for the selected Channel to on (True) or off (False).
  
 
===Set Channel Auto Flag===
 
===Set Channel Auto Flag===
:optionalParameter (string) = <code>True</code> or <code>False</code>
+
:parameter (string) = <code>True</code> or <code>False</code>
 
Will set the 'Auto' checkbox for the selected Channel to on (True) or off (False).
 
Will set the 'Auto' checkbox for the selected Channel to on (True) or off (False).
  
 
===Set Channel Focus Cue===
 
===Set Channel Focus Cue===
:optionalParameter (string) = Cue Number text. i.e.<code>424</code>.
+
:parameter (string) = Cue Number text. i.e.<code>424</code>.
 
Will set the 'Focus Cue' field of the selected Channels to the string sent as the parameter.
 
Will set the 'Focus Cue' field of the selected Channels to the string sent as the parameter.
  
 
===Set Channel Note===
 
===Set Channel Note===
:optionalParameter (string) = Note text to set from Channel. i.e.<code>Downstage Backlight</code>.
+
:parameter (string) = Note text to set from Channel. i.e.<code>Downstage Backlight</code>.
 
Will set the 'Note' field for the selected Channels to the string sent as the parameter.
 
Will set the 'Note' field for the selected Channels to the string sent as the parameter.
  

Revision as of 13:32, 18 July 2015

DispatchAction( action, optionalParameter )

action is a string.
optionalParameter is a string (only some actions require the optionalParameter).

This function sends a user interface action to the Preset Documentation view. These actions would normally by triggered by clicking on the user interface, i.e. clicking on a toolbar button, or selecting a Preset in the Preset table.

Example.

PresetDocView:DispatchAction("Take Photo")

This would send an action that would be the same as clicking on the camera (Take Photo) button.

PresetDocView:DispatchAction("Set Channel Focused Flag", "True")

This function with an optional parameter would be the same as clicking on the focussed checkbox for a channel, in this case setting the checkbox to it's True state (on).

Action Strings

Take Photo

This action would be the same as clicking on the camera (Take Photo) button. It will behave in the same way, in that it will add the photo to the Preset if the photo mode is set to Preset, and to a Channel if the photo mode is set to Channel. It will fail in the same way as if you clicked on the button if there are insufficient available photos (the maximum is 4 for a Preset or a Channel). :There is no optional parameter.

Take Channel Photo

This action will take a Channel photo regardless of the Channel/Preset photo mode radio buttons. The advantage of this method of taking photos is that the taken photo will always be saved to the Channel that was selected at the time the Take Channel Photo command is sent. It will fail in the same way as if you clicked on the button if there are insufficient available photos (the maximum is 4 for a Preset or a Channel). :There is no optional parameter.

Take Preset Photo

This action will take a Preset photo regardless of the Channel/Preset photo mode radio buttons. The advantage of this method of taking photos is that the taken photo will always be saved to the Preset that was selected at the time the Take Preset Photo command is sent. It will fail in the same way as if you clicked on the button if there are insufficient available photos (the maximum is 4 for a Preset or a Channel). :There is no optional parameter.

Select First Preset

Will select the first Preset in the Preset table on the left in the Preset Documentation view. It is the same as if you had clicked on the first Preset in the Preset table. Note that table will not scroll to show the selection.

Select Last Preset

Will select the last Preset in the Preset table on the left in the Preset Documentation view. It is the same as if you had clicked on the last Preset in the Preset table. Note that table will not scroll to show the selection.

Select Next Preset

Will select the next Preset in the Preset table on the left in the Preset Documentation view. If no Preset was previously selected, it will select the first Preset. Note that table will not scroll to show the selection.

Select Previous Preset

Will select the previous Preset in the Preset table on the left in the Preset Documentation view. If no Preset was previously selected, it will not do anything. Note that table will not scroll to show the selection.

Select All Presets

Will select all the Presets in the Preset table on the left in the Preset Documentation view.

Deselect All Presets

Will deselect all the Presets in the Preset table on the left in the Preset Documentation view.

Set Preset Name Text

parameter (string) = Preset Name text. i.e.DS Back.

Will set the 'Note' field for the selected Presets to the string sent as the parameter.

Set Preset ID Text

parameter (string) = Preset ID text. i.e.10.1.

Will set the 'Preset ID' field for the selected Presets to the string sent as the parameter.

Set Preset Type Text

parameter (string) = Preset Type text. i.e.Colour.

Will set the 'Preset Type' field for the selected Presets to the string sent as the parameter.

Set Preset Focus Cue Text

parameter (string) = Preset Focus Cue text. i.e.155.

Will set the 'Focus Cue' field for the selected Presets to the string sent as the parameter.

Set Preset Set Text

parameter (string) = Preset Set text. i.e.Open Stage.

Will set the 'Set' field for the selected Presets to the string sent as the parameter.

Select First Channel

Will select the first Channel in the Channel table on the right in the Preset Documentation view. It is the same as if you had clicked on the first channel in the channel table. Note that table will not scroll to show the selection.

Select Last Channel

Will select the last Channel in the Channel table on the right in the Preset Documentation view. It is the same as if you had clicked on the last Channel in the Channel table. Note that table will not scroll to show the selection.

Select Next Channel

Will select the next Channel in the Channel table on the right in the Preset Documentation view. If no Channel was previously selected, it will select the first Channel. Note that table will not scroll to show the selection.

Select Previous Channel

Will select the previous Channel in the Channel table on the right in the Preset Documentation view. If no Channel was previously selected, it will not do anything. Note that table will not scroll to show the selection.

Select All Channels

Will select all the Channels in the Channel table on the right in the Preset Documentation view.

Deselect All Channels

Will deselect all the Channels in the Channel table on the right in the Preset Documentation view.

Set Preset Photo Mode

This will set the photo mode so that any image adding, deletion, edit, capture or photo display are for the Preset as opposed to the Channel.

Set Channel Photo Mode

This will set the photo mode so that any image adding, deletion, edit, capture or photo display are for the Channel as opposed to the Preset.

Set Channel Focused Flag

parameter as string = True or False

Will set the 'Focussed' checkbox for the selected Channel to on (True) or off (False).

Set Channel Auto Flag

parameter (string) = True or False

Will set the 'Auto' checkbox for the selected Channel to on (True) or off (False).

Set Channel Focus Cue

parameter (string) = Cue Number text. i.e.424.

Will set the 'Focus Cue' field of the selected Channels to the string sent as the parameter.

Set Channel Note

parameter (string) = Note text to set from Channel. i.e.Downstage Backlight.

Will set the 'Note' field for the selected Channels to the string sent as the parameter.

Display Preset Photo

parameter (string) = Photo number (1-4).

Will display the specified preset photo for the selected preset. If the photo number is greater than the number of photos, then the last photo will be displayed.

Display First Preset Photo

Will display the first preset photo for the selected preset.

Display Last Preset Photo

Will display the last preset photo for the selected preset.

Display Channel Photo

parameter (string) = Photo number (1-4).

Will display the specified channel photo for the selected channel. If the photo number is greater than the number of photos, then the last photo will be displayed.

Display First Channel Photo

Will display the first channel photo for the selected channel.

Display Last Channel Photo

Will display the last channel photo for the selected channel.

Examples

Setting all channels focused flags to true

The example below will simply set all channels for the selected preset to focused.

PresetDocView:DispatchAction("Select All Channels")
PresetDocView:DispatchAction("Set Channel Focused Flag", "True")

Removing all channel photos

The example below will remove all the channel photos for the selected preset.

numChannels = PresetDocView:GetChannelCount()
if numChannels > 0 then
PresetDocView:DispatchAction("Select First Channel")
currentChannel = 1
while currentChannel <= numChannels do
numPhotos = PresetDocView:GetPhotoCountForSelectedChannel()
if numPhotos > 0 then
while numPhotos > 0 do
PresetDocView:DispatchAction("Display Channel Photo", numPhotos)
PresetDocView:DispatchAction("Remove Displayed Channel Photo")
numPhotos = numPhotos - 1
end
end
PresetDocView:DispatchAction("Select Next Channel")
currentChannel = currentChannel + 1
end
end