canUploadDroneMission
sabrobotix-suite / lib/roles / canUploadDroneMission
Function: canUploadDroneMission()
canUploadDroneMission(
role,options):boolean
Defined in: lib/roles.ts:124
Whether the button that sends a flight plan to an aircraft may be pressed.
Unlike its neighbours this one takes state as well as a role, because a mission upload replaces what the vehicle will fly. The three conditions are not decoration: without a selected drone there is no addressee, without a connection the upload cannot be confirmed, and starting one while another mission operation is running is how a vehicle ends up holding half of each.
It reads as a rule rather than living inside the dialog so that a test can hold it to it.
Parameters
role
string | null | undefined
options
hasSelectedDrone
boolean
connected
boolean
operationActive
boolean
Returns
boolean