void Btn_UpdateCommandUI(object sender, UpdateCommandUIEventArgs e) { // See AutoConfig in RS if (UIEnvironment.CurrentlyExecutingCommand != null) { return; } var path = Station.ActiveStation?.ActiveTask?.ActivePathProcedure; if (path == null) { return; } //Need a running controller var ctrl = path.Parent.Parent as RsIrc5Controller; if (ctrl == null || ctrl.SystemState != SystemState.Started) { return; } //Need at least 2 move instructions e.Enabled = (path.Instructions.OfType <RsMoveInstruction>().Count(mi => mi.GetToPointArgument() != null) >= 2); // For VR: First target must be configured // See CKT_AutoConfig, check seems expensive - for now defer until exec e.Enabled = true; }
void StartPosBtn_UpdateCommandUI(object sender, UpdateCommandUIEventArgs e) { var jt = Selection.SelectedObjects.SingleSelectedObject; e.Enabled = (jt != null); e.Checked = (jt == GetStartJointTarget()); }
static void Btn_UpdateCommandUI(object sender, UpdateCommandUIEventArgs e) { if (!_blocked && Station.ActiveStation?.ActiveTask?.ActivePathProcedure != null && Simulator.State != SimulationState.Running) { e.Enabled = true; } else { e.Enabled = false; } }
private static void btnAMU_UpdateCommandUI(object sender, UpdateCommandUIEventArgs e) { e.Enabled = Project.ActiveProject is Station; }
static void button2_UpdateCommandUI(object sender, UpdateCommandUIEventArgs e) { // This enables the button, instead of "button1.Enabled = true". e.Enabled = true; }