public void Remove(Button RemovalButton) { if (ButtonList.ContainsValue(RemovalButton)) { ButtonList.Remove(RemovalButton.Name); } foreach (KeyValuePair <string, Geometry2D> entry in RemovalButton.GeometryList) { GuiNode.DetachGeometry(entry.Value); } }
protected override void OnInitialize() { // Join Game Popup _joinGamePanel = GameObjectUtilities.FindGameObject("JoinGameContainer/JoinPanelContainer"); _buttons = new ButtonList("JoinGameContainer/JoinPanelContainer/ButtonPanel"); _backButton = _buttons.GetButton("BackButtonContainer"); _refreshButton = _buttons.GetButton("RefreshButtonContainer"); _gameListObject = GameObjectUtilities.FindGameObject("JoinGameContainer/JoinPanelContainer/GameListContainer/Viewport/Content"); _gameItemPrefab = Resources.Load("GameItem") as GameObject; }
/// <summary> /// Add a button to the current toast. /// </summary> /// <param name="button">An instance of class that implement <see cref="IToastButton"/> for the button that will be used on the toast.</param> /// <returns>The current instance of <see cref="ToastContentBuilder"/></returns> public ToastContentBuilder AddButton(IToastButton button) { // List has max 5 buttons if (ButtonList.Count == 5) { throw new InvalidOperationException("A toast can't have more than 5 buttons"); } ButtonList.Add(button); return(this); }
/// <summary> /// Sets the <see cref="ActiveButtonIndex"/> when a button is activate. /// </summary> /// <param name="data">The data to retrieve the button being activated.</param> protected virtual void SetActiveButtonIndexWhenButtonActivated(SurfaceData data) { SpatialTargetFacade spatialTarget = data.Transform.gameObject.TryGetComponent <SpatialTargetFacade>(false, true); if (spatialTarget == null) { return; } ignoreActiveButtonIndexChanges = true; ActiveButtonIndex = ButtonList.IndexOf(spatialTarget.gameObject); ignoreActiveButtonIndexChanges = false; }
protected override void OnInitialize() { var panel = TransformFinder.Find("Menu/ErrorContainer"); _panelVisibility = panel.GetChild(0); _buttons = new ButtonList("ErrorContainer/ErrorPanelContainer/ButtonPanel"); _messageText = ComponentFinder.Find <InputField>("ErrorPanel/Scroll View/Viewport/Content", _panelVisibility); _backButton = _buttons.GetButton("BackButtonContainer"); _backButton.onClick.AddListener(OnBackButtonClick); }
protected override void InitializeButtons() { base.InitializeButtons(); ShootButtons[0] = ShootButton; ReloadButtons[0] = ReloadButton; ShootButtons[1] = SecondaryShootButton; ButtonList.Add(ReloadButtons[1] = new MMInput.IMButton(PlayerID, "Reload2")); for (var i = 2; i < MaximumNumberOfWeapons; i++) { ButtonList.Add(ShootButtons[i] = new MMInput.IMButton(PlayerID, "Shoot" + (i + 1))); ButtonList.Add(ReloadButtons[i] = new MMInput.IMButton(PlayerID, "Reload" + (i + 1))); } }
private QState StatePlaceHGAZUp(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { OutputEEUpFromLifterPositionTravellingTimeStopWatch.Start(); HSTWorkcell.outputEEHoldingHGAs = false; OutputEEUpFromLifterPositionTravellingTimeStopWatch.Stop(); if (HSTMachine.Workcell != null) { if (HSTMachine.Workcell.getPanelOperation() != null) { if (HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel() != null) { UIUtility.Invoke(HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel(), () => { HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel().labelOutputUpFromLifterPositionTravellingTime.Text = OutputEEUpFromLifterPositionTravellingTimeStopWatch.ElapsedTime.ToString(); }); } } } OutputEELeavesOutputCarrierAfterHGAPlaceProcessCycleTimeStopWatch.Stop(); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { CommonFunctions.Instance.LogProcessCycleTime("Output EE Leaves Output Carrier After HGA Place Process Cycle Time.csv", OutputEELeavesOutputCarrierAfterHGAPlaceProcessCycleTimeStopWatch.ElapsedTime); } ProcessStopWatch PSW1 = new ProcessStopWatch(_controller.IncomingCarrier.CarrierID, new Stopwatch()); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { CommonFunctions.Instance.OutputStationHGADetectionStabilityProcessCycleTimeStopWatch.Enqueue(PSW1); } TransitionTo(statePublishSigOutputCarrierPlaceDone); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } return(null); } return(stateRun); }
private QState StatePickHgaCheckVacuum(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { InputEELifterVacuumProcessTimeStopWatch.Start(); if (HSTMachine.Workcell.HSTSettings.Install.EnableFlattenerAsInput) { _controller.RetractInputEEFlattener(); Thread.Sleep(HSTMachine.Workcell.HSTSettings.Install.FlattenerDeployDuration); } InputEELifterVacuumProcessTimeStopWatch.Stop(); if (HSTMachine.Workcell != null) { if (HSTMachine.Workcell.getPanelOperation() != null) { if (HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel() != null) { UIUtility.Invoke(HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel(), () => { HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel().labelInputLifterVacuumProcessTime.Text = InputEELifterVacuumProcessTimeStopWatch.ElapsedTime.ToString(); }); } } } TransitionTo(statePickHgaPublishPickDone); } catch (Exception ex) { if (_retryCount < 1) { Log.Error(this, "Failed to perform vaccuum check on Input EE after picked HGAs. Retry count: {0}, Exception: {1}, StateName: {2}", _retryCount, ex.Message, this.CurrentStateName); TransitionTo(this.targetState); } else { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } _retryCount++; } return(null); } return(stateRun); }
private void timer1_Tick(object sender, EventArgs e) { Sys_Button sys_Button = ButtonList.Find(b => b.Button_Sub == "Save"); if (sys_Button != null) { BarItem barItem = (BarItem)sys_Button.Button_BarItem; if (barItem != null) { barItem.PerformClick(); timer1.Enabled = false; } } }
protected override void OnInitialize() { // Main Menu _menuPanel = GameObject.Find("PauseContainer").transform.GetChild(0).gameObject; _buttons = new ButtonList("PauseContainer/PausePanelContainer/PauseContainer"); _continueButton = _buttons.GetButton("ContinueButtonContainer"); _settingsButton = _buttons.GetButton("SettingsButtonContainer"); _quitButton = _buttons.GetButton("QuitButtonContainer"); _gameContainer = GameObjectUtilities.FindGameObject("Game/Canvas"); _canvasGroup = _gameContainer.GetComponent <CanvasGroup>(); _director.GameEnded += OnEndGame; }
public void PromptExceptionErrorMessage(Active ap, string ProcessName, Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); ErrorMessageHST errorMessageHST = new ErrorMessageHST(ap, btnlst, ex); errorMessageHST.Format(ex); errorMessageHST.SourceProcess = ProcessName; errorMessageHST.SourceState = ap.CurrentStateName; errorMessageHST.Format(); Log.Error(this, "{0}, ProcessName:{1}, Error:{2}", LoggerCategory.StateTransition, ProcessName, ex.ToString()); ServiceManager.ErrorHandler.RegisterMessage(errorMessageHST); }
private QState StateRunInitCompleteMoveToParkPosition(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigRecover)) { if (errorMessage != null) { ErrorButton response = (ErrorButton)(((QEvent)qEvent).EventObject); switch (response) { case ErrorButton.Stop: { _retryCount = 0; } break; default: errorMessage = null; System.Windows.Forms.MessageBox.Show(string.Format("Unhandled Button: {0}", response.ToString()), response.ToString()); return(null); } return(null); } } if (qEvent.IsSignal(SigStateJob)) { try { if (!_workcell.IsIgnoreHomeAxisForByPass) { _controller.GoToParkPosition(false); } if (HSTWorkcell.disableBoundaryCheck) { PublishSignal(new QEvent(HSTWorkcell.SigTestProbeBoundaryCheckComplete)); } TransitionTo(stateCheckProbeFunctionalTest); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } return(null); } return(stateRunInit); }
private QState StateReportGetputError(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigRecover)) { if (errorMessage != null) { ErrorButton response = (ErrorButton)(((QEvent)qEvent).EventObject); switch (response) { case ErrorButton.OK: // Reject, treat as bad carrier { PublishSignal(new QEvent(HSTWorkcell.SigEndRunProcess)); } break; default: errorMessage = null; System.Windows.Forms.MessageBox.Show(string.Format("Unhandled Button: {0}", response.ToString()), response.ToString()); return(null); } return(null); } } if (qEvent.IsSignal(SigStateJob)) { try { CommonFunctions.Instance.ActivePopupGetputErrorMessage = true; if (FISManager.Instance.IsFISConnected) { HSTException.Throw(HSTErrors.TestElectronecsGetputErrorDetection2, new Exception(CommonFunctions.Instance.GetputErrorMessage)); } else { HSTException.Throw(HSTErrors.TestElectronecsGetputErrorDetection, new Exception(CommonFunctions.Instance.GetputErrorMessage)); } } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); return(null); } } return(stateRun); }
private QState StateInputTurnSectionTurnForward(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { if (!_controller.IsInputTurnStationHoldCarrier()) { int retrycount = 0; while (!_controller.IsInputTurnStationHoldCarrier()) { if (retrycount < 4) { Thread.Sleep(500); } else { HSTException.Throw(HSTErrors.InputTurnStationInPositionNotOnError, new Exception("Inpositon on timeout")); } retrycount++; } } _controller.InhibitInputConveyor(true); _controller.InputTurnSectionTurnTo90Deg(out _timeUsed); TransitionTo(stateVisionInspectCarrierAfterLoad); _retryCount = 0; } catch (Exception ex) { if (_retryCount < 3) { Log.Error(this, "Failed to turn Input Turn Station to 90 degrees. Retry count: {0}, Exception: {1}, StateName: {2}", _retryCount, ex.Message, this.CurrentStateName); TransitionTo(this.targetState); } else { ButtonList btnlst = new ButtonList(ErrorButton.Retry, ErrorButton.Stop, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } _retryCount++; return(null); } return(null); } return(stateRun); }
protected override void OnInitialize() { _lobbyPanel = GameObject.Find("LobbyContainer").transform.GetChild(0).gameObject; _buttons = new ButtonList("LobbyContainer/LobbyPanelContainer/ButtonPanel"); _backButton = _buttons.GetButton("BackButtonContainer"); _readyButton = _buttons.GetButton("ReadyButtonContainer"); _changeIconButton = _buttons.GetButton("ChangeIconButtonContainer"); _roomNameObject = GameObjectUtilities.FindGameObject("LobbyContainer/LobbyPanelContainer/LobbyPanel/RoomNameContainer/RoomName"); _playerListObject = GameObjectUtilities.FindGameObject("LobbyContainer/LobbyPanelContainer/LobbyPanel/PlayerListContainer"); _playerItemPrefab = Resources.Load("PlayerItem") as GameObject; _playerSpacePrefab = Resources.Load("PlayerSpace") as GameObject; }
public MenuRoom(Game1 game, Room parent) : base(game, parent) { ButtonList.Add(new KeyValuePair <string, Action>("Maps", () => { Game.CurrentRoom = new MapListRoom(Game, this, false); })); ButtonList.Add(new KeyValuePair <string, Action>("Editor", () => { Game.CurrentRoom = new MapListRoom(Game, this, true); })); ButtonList.Add(new KeyValuePair <string, Action>("Quit", () => { Game.Exit(); })); }
public CategorySelectViewModel(INavigationService navigationService, IRzeszowiak RzeszowiakRepository) { _rzeszowiakRepository = RzeszowiakRepository ?? throw new NullReferenceException("ListViewModel => IRzeszowiakRepository RzeszowiakRepository == null !"); _navigationService = navigationService ?? throw new NullReferenceException("INavigationService navigationService == null !"); for (int i = 1; i < 4; i++) { ButtonList.Add(new CatButtonDisplay((byte)i) { Title = "", IsVisible = false, Image = CatSelectImage.none }); } CategoryTappet = new Command <CatDisplay>(ItemTapedAsync); ButtonTappped = new Command <CatButtonDisplay>(ButtonTappedAsync); ButtonCloseTappped = new Command(async() => { await _navigationService.GoBackAsync(); }); }
private QState StatePlaceHGAVacuumOff(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { bool IsOn = false; OutputLifterPurgeProcessTime.Start(); _controller.SetVacuum(IsOn); OutputLifterPurgeProcessTime.Stop(); if (HSTMachine.Workcell != null) { if (HSTMachine.Workcell.getPanelOperation() != null) { if (HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel() != null) { UIUtility.Invoke(HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel(), () => { HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel().labelOutputLifterPurgeProcessTime.Text = OutputLifterPurgeProcessTime.ElapsedTime.ToString(); }); } } } OutputEEPlacesDownHGAOntoOutputCarrierProcessCycleTimeStopWatch.Stop(); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { CommonFunctions.Instance.LogProcessCycleTime("Output EE Places Down HGAs Onto Output Carrier Process Cycle Time.csv", OutputEEPlacesDownHGAOntoOutputCarrierProcessCycleTimeStopWatch.ElapsedTime); } OutputEELeavesOutputCarrierAfterHGAPlaceProcessCycleTimeStopWatch.Start(); TransitionTo(statePlaceHGAZUp); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } return(null); } return(stateRun); }
private QState StatePickHgaZUpToParkPosition(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { InputEEUpFromLifterPositionTravellingTimeStopWatch.Start(); _controller.DoJobMoveZToPark(false); HSTWorkcell.inputEEPickDone = true; InputEEUpFromLifterPositionTravellingTimeStopWatch.Stop(); if (HSTMachine.Workcell != null) { if (HSTMachine.Workcell.getPanelOperation() != null) { if (HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel() != null) { UIUtility.Invoke(HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel(), () => { HSTMachine.Workcell.getPanelOperation().getOperationStatusPanel().labelInputUpFromLifterPositionTravellingTime.Text = InputEEUpFromLifterPositionTravellingTimeStopWatch.ElapsedTime.ToString(); }); } } } TransitionTo(statePickHgaCheckVacuum); } catch (Exception ex) { if (_retryCount < 1) { Log.Error(this, "Failed to move Input EE up after picked HGAs. Retry count: {0}, Exception: {1}, StateName: {2}", _retryCount, ex.Message, this.CurrentStateName); TransitionTo(this.targetState); } else { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } _retryCount++; } return(null); } return(stateRun); }
private QState StateReportWriterBrigeError(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigRecover)) { if (errorMessage != null) { ErrorButton response = (ErrorButton)(((QEvent)qEvent).EventObject); switch (response) { case ErrorButton.OK: // Reject, treat as bad carrier { HSTMachine.Workcell.IsUnderWriterBridgeFailureAlert = false; PublishSignal(new QEvent(HSTWorkcell.SigEndRunProcess)); HSTMachine.Instance.MainForm.getPanelCommand().stopSystemProcess(); } break; default: errorMessage = null; System.Windows.Forms.MessageBox.Show(string.Format("Unhandled Button: {0}", response.ToString()), response.ToString()); return(null); } return(null); } } if (qEvent.IsSignal(SigStateJob)) { try { HSTException.Throw(HSTErrors.TestElectronicsWriterBridgeDetection, new Exception(string.Format("{0},{1}Carrier ID={2}", "High percentage of writer bridging was detected, please confirm UTIC machine!", Environment.NewLine, HSTMachine.Workcell.WRBridgeFailueCarrierId))); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); return(null); } } return(stateRun); }
private QState StateReleaseCarrier(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { try { _controller.InhibitInputTurnStation(false); _controller.WaitInputTurnStationPartCleared(); _controller.InhibitInputTurnStation(true); string ProcessCycleTimeDirectory = HSTSettings.Instance.Directory.DataPath + "\\ProcessCycleTime"; if (!Directory.Exists(ProcessCycleTimeDirectory)) { Directory.CreateDirectory(ProcessCycleTimeDirectory); } HGADetectionAtInputTurnStationProcessCycleTimeStopWatch.Stop(); BoatLeavesInputTurnStationProcessCycleTimeStopWatch.Stop(); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { CommonFunctions.Instance.LogProcessCycleTime("HGA Detection At Input Turn Station Process Cycle Time.csv", HGADetectionAtInputTurnStationProcessCycleTimeStopWatch.ElapsedTime); CommonFunctions.Instance.LogProcessCycleTime("Boat Leaves Input Turn Station Process Cycle Time.csv", BoatLeavesInputTurnStationProcessCycleTimeStopWatch.ElapsedTime); } TransitionTo(statePublishSigCarrierInInputStation); } catch (Exception ex) { throw new Exception("InputTurnStation release part failed.", ex); } } catch (Exception ex2) { ButtonList btnlst = new ButtonList(ErrorButton.Retry, ErrorButton.Stop, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex2); return(null); } return(null); } return(stateRun); }
/// <summary> Unbind a mouse button from firing an action. </summary> public static void UnbindMouseButton(ButtonList mouseButton, string actionName) { if (InputMap.HasAction(actionName)) { foreach (InputEvent inputEvent in InputMap.GetActionList(actionName)) { if (inputEvent is InputEventMouseButton) // It could also be an InputEventKey { InputEventMouseButton mbEvent = (InputEventMouseButton)inputEvent; if (mbEvent.ButtonIndex == (int)mouseButton) { InputMap.ActionEraseEvent(actionName, inputEvent); return; } } } } }
public void AddButton(string Name, Image image) { EditorButton Button = new EditorButton(); Button.Kind = ButtonPredefines.Glyph; Button.Image = image; Button.Tag = Name; if (image.HorizontalResolution > 60) { Button.Width = 60; } else { Button.Width = (int)image.HorizontalResolution; } ButtonList.Add(Button); CalcButtonInfo(); }
public ControlPanel() : base(new Rectangle(100, 20, 1400, 50)) { int x = 110; foreach (string s in ButtonList.Split(',')) { AddButton(new Button(new Rectangle(x, 25, ButtonWidth, 40), s) { DepthBase = -0.005f }); x += ButtonWidth + ButtonMargin; } Visible = true; ActiveOption = ""; }
private QState StateCheckCarrierPresentInOutputTurnStation(IQEvent qEvent) { if (qEvent.IsSignal(SigStateJob)) { try { if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.DryRun && HSTMachine.Workcell.HSTSettings.Install.DryRunWithoutBoat) { Thread.Sleep(1000); } else { _controller.WaitOutputTurnStationPartReady(); PublishSignal(new QEvent(HSTWorkcell.SigCarrierIsInOutputTurnStation)); } if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { if (CommonFunctions.Instance.BoatArrivesAtOutputTurnStationFromOutputStationProcessCycleTimeStopWatch.Count > 0) { ProcessStopWatch PSW = CommonFunctions.Instance.BoatArrivesAtOutputTurnStationFromOutputStationProcessCycleTimeStopWatch.First(); PSW.Stop(); CommonFunctions.Instance.LogProcessCycleTime("Boat Arrives At Output Turn Station From Output Station Process Cycle Time.csv", PSW.GetElapsedTime(), PSW.CarrierID, PSW.GetStartTime(), PSW.GetStopTime()); CommonFunctions.Instance.BoatArrivesAtOutputTurnStationFromOutputStationProcessCycleTimeStopWatch.Dequeue(); } } BoatLeavesOutputTurnStationProcessCycleTimeStopWatch.Start(); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { Log.Info(this, "{0}, ProcessName:{1}, StateName:StateWaitForCarrierPresentInOutputTurnStation, Received QSignal:{2} and transition to new State:StateOutputTurnSectionTurnForward", LoggerCategory.StateTransition, _processName, qEvent.QSignal.ToString()); } TransitionTo(stateOutputTurnSectionTurnForward); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.Retry, ErrorButton.Stop, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } return(null); } return(stateRun); }
private QState StatePlaceHgaVacuumOff(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { InputEEPrecisorVacuumProcessTimeStopWatch.Start(); _controller.DoJobVacuum(false); InputEEPlacesDownHGAOntoPrecisorNestProcessCycleTimeStopWatch.Stop(); if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog) { CommonFunctions.Instance.LogProcessCycleTime("Input EE Places Down HGAs Onto Precisor Nest Process Cycle Time.csv", InputEEPlacesDownHGAOntoPrecisorNestProcessCycleTimeStopWatch.ElapsedTime); } Thread.Sleep(200); if (HSTMachine.Workcell.HSTSettings.Install.EnableFlattenerAsPrecisor) { _controller.ExtendInputEEFlattener(); Thread.Sleep(HSTMachine.Workcell.HSTSettings.Install.FlattenerDeployDuration); } QF.Instance.Publish(new QEvent(HSTWorkcell.SigPrecisorSetVacuumOn)); Thread.Sleep(200); TransitionTo(stateWaitPrecisorTurnOnAllVacuums); } catch (Exception ex) { if (_retryCount < 1) { Log.Error(this, "Failed to turn off Vaccum channel on Input EE. Retry count: {0}, Exception: {1}, StateName: {2}", _retryCount, ex.Message, this.CurrentStateName); TransitionTo(this.targetState); } else { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } _retryCount++; } return(null); } return(stateRun); }
protected void ToggleToolByName(string toolName, bool enabled) { try { Sys_Button sys_Button = ButtonList.Find(b => b.Button_Sub != null && b.Button_Sub.Equals(toolName)); if (sys_Button != null) { BaseBar.BeginUpdate(); sys_Button.Button_Enabled = enabled; BarLargeButtonItem barButtonItem = (BarLargeButtonItem)sys_Button.Button_BarItem; barButtonItem.Enabled = enabled; BaseBar.EndUpdate(); } } catch (Exception ex) { SharedFunc.RaiseError(ex); } }
public void Stop() { timer1.Enabled = false; Sys_Button sys_Button = ButtonList.Find(b => b.Button_Sub == "Stop"); if (sys_Button == null) { return; } sys_Button.Button_Enabled = false; RefreshTool(sys_Button); sys_Button = ButtonList.Find(b => b.Button_Sub == "Start"); if (sys_Button == null) { return; } sys_Button.Button_Enabled = true; RefreshTool(sys_Button); }
private QState StatePublishOutputEEBoundaryCheckComplete(IQEvent qEvent) { LogStateInfo(_processName, System.Reflection.MethodBase.GetCurrentMethod().Name, qEvent); if (qEvent.IsSignal(SigStateJob)) { try { PublishSignal(new QEvent(HSTWorkcell.SigOutputEEBoundaryCheckComplete)); TransitionTo(stateRunInitCompleteMoveToParkPosition); } catch (Exception ex) { ButtonList btnlst = new ButtonList(ErrorButton.OK, ErrorButton.NoButton, ErrorButton.NoButton); TransitionToErrorState(btnlst, ex); } return(null); } return(stateRunInit); }
private void ButtonHandle() { ButtonList.AddRange(new List <UIButton> { btnNumberOne, btnNumberTwo, btnNumberThree, btnNumberFour, btnNumberFive, btnNumberSix, btnNumberSeven, btnNumberEight, btnNumberNine, btnNumberZero }); foreach (var button in ButtonList) { button.TouchUpInside += setNumberToList; } }
/// <summary> /// Clears the current Application Bar and adds the given elements. /// </summary> /// <param name="AppBar"></param> /// <param name="Buttons"></param> /// <param name="MenuItems"></param> public static void SetElements(ApplicationBar AppBar, ButtonList Buttons, ItemList MenuItems) { ClearElements(AppBar); foreach (ApplicationBarIconButton b in Buttons) AppBar.Buttons.Add(b); foreach (ApplicationBarMenuItem i in MenuItems) AppBar.MenuItems.Add(i); }
/// <summary> /// Assigns a new value to a button. /// </summary> /// <param name="keyToAssignTo">The button to assign the new value to.</param> /// <param name="newKey">The new value of the first parameter.</param> /// <param name="assignedKey">The button that was assigned to.</param> /// <returns>The original value of the button that was assigned the new value.</returns> public Buttons AssignKey(ButtonList keyToAssignTo, Buttons newKey, out ButtonList assignedKey) { Buttons holdingKey; switch(keyToAssignTo) { case ButtonList.Machine1Key: holdingKey = Machine1Key; Machine1Key = newKey; assignedKey = ButtonList.Machine1Key; break; case ButtonList.Machine2Key: holdingKey = Machine2Key; Machine2Key = newKey; assignedKey = ButtonList.Machine2Key; break; case ButtonList.Machine3Key: holdingKey = Machine3Key; Machine3Key = newKey; assignedKey = ButtonList.Machine3Key; break; case ButtonList.Machine4Key: holdingKey = Machine4Key; Machine4Key = newKey; assignedKey = ButtonList.Machine4Key; break; case ButtonList.Machine5Key: holdingKey = Machine5Key; Machine5Key = newKey; assignedKey = ButtonList.Machine5Key; break; case ButtonList.Machine6Key: holdingKey = Machine6Key; Machine6Key = newKey; assignedKey = ButtonList.Machine6Key; break; case ButtonList.Machine7Key: holdingKey = Machine7Key; Machine7Key = newKey; assignedKey = ButtonList.Machine7Key; break; case ButtonList.Machine8Key: holdingKey = Machine8Key; Machine8Key = newKey; assignedKey = ButtonList.Machine8Key; break; case ButtonList.Machine9Key: holdingKey = Machine9Key; Machine9Key = newKey; assignedKey = ButtonList.Machine9Key; break; case ButtonList.Machine0Key: holdingKey = Machine0Key; Machine0Key = newKey; assignedKey = ButtonList.Machine0Key; break; case ButtonList.QuickBoxKey: holdingKey = QuickBoxKey; QuickBoxKey = newKey; assignedKey = ButtonList.QuickBoxKey; break; case ButtonList.CameraZoomPlusKey: holdingKey = CameraZoomPlusKey; CameraZoomPlusKey = newKey; assignedKey = ButtonList.CameraZoomPlusKey; break; case ButtonList.CameraZoomMinusKey: holdingKey = CameraZoomMinusKey; CameraZoomMinusKey = newKey; assignedKey = ButtonList.CameraZoomMinusKey; break; case ButtonList.MusicKey: holdingKey = MusicKey; MusicKey = newKey; assignedKey = ButtonList.MusicKey; break; default: throw new KeyNotFoundException("There was a programming error in Options.cs, line 179."); } return holdingKey; }