public JobSettingControl() { AddJobCommand = new CommandHandler( obj => { var newJob = new JobInfo.FALotJobInfo { Name = obj as string }; JobManagerInstance.LotJobInstance.LotJobInfoList.Add(newJob); SelectedJob = JobManagerInstance.LotJobInstance.LotJobInfoList.Last(); }, true); RemoveJobCommand = new CommandHandler( obj => { JobManagerInstance.LotJobInstance.LotJobInfoList.Remove(obj as JobInfo.FALotJobInfo); if (JobManagerInstance.LotJobInstance.LotJobInfoList.Count > 0) SelectedJob = JobManagerInstance.LotJobInstance.LotJobInfoList.Last(); else SelectedJob = null; }, true); RenameJobCommand = new CommandHandler( obj => { var paramArray = (object[])obj; var selectedJob = (JobInfo.FALotJobInfo)paramArray[0]; var jobName = paramArray[1] as string; selectedJob.Name = jobName; }, true); CopyJobCommand = new CommandHandler( obj => { var paramArray = (object[])obj; var selectedJob = (JobInfo.FALotJobInfo)paramArray[0]; var jobName = paramArray[1] as string; var newLotJob = new JobInfo.FALotJobInfo(); selectedJob.CopyTo(newLotJob); newLotJob.Name = jobName; JobManagerInstance.LotJobInstance.LotJobInfoList.Add(newLotJob); SelectedJob = JobManagerInstance.LotJobInstance.LotJobInfoList.Last(); }, true); InitializeComponent(); }
public MainStatusControl() { AddLotIDCommand = new CommandHandler( obj => { try { var parameters = obj as object[]; var list = parameters[0] as System.Collections.IList; var textBox = parameters[1] as TextBox; var lotID = textBox.Text; if (list.Contains(lotID) == false) { textBox.Text = string.Empty; Manager.LogManager.Instance.WriteTraceLog(EquipmentInstance, string.Format("Add Lot By User. {0}", lotID)); list.Add(lotID); } } catch { } }, true); DeleteLotIDCommand = new CommandHandler( obj => { try { var parameters = obj as object[]; var list = parameters[0] as System.Collections.IList; var textBox = parameters[1] as TextBox; var selectedItem = textBox.Text; Manager.LogManager.Instance.WriteTraceLog(EquipmentInstance, string.Format("Remove Lot By User. {0}", selectedItem)); list.Remove(selectedItem); } catch { } }, true); InitializeComponent(); }
public AlarmRaisingStatusManager(Equipment.EquipmentBase equipment) { Equipment = equipment; RaisingAlarmList = new FAFramework.Utility.ThreadSafeObservableCollection<AlarmInfo>(); Equipment.OnRaiseAlarm += RaiseAlarm; TurnOffCommand = new CommandHandler( delegate { if (Equipment != null) Equipment.TurnOffSound(); }, true); _raisingAlarmList.CollectionChanged += delegate { AlarmCount = _raisingAlarmList.Count; }; }
public CAS501AControl() { SetZeroCommand = new CommandHandler( delegate(object param) { if (Part == null) return; try { Part.SetZero(); } catch (Exception e) { Manager.LogManager.Instance.WriteSystemLog(e.ToString()); } }, true); InitializeComponent(); }
public BandingJobSettingControl() { AddPositionCommand = new CommandHandler( obj => { JobInstance.Steps.Add(new FABandingPosMoveStep()); SelectedJobStep = JobInstance.Steps.Last(); }, true); RemovePositionCommand = new CommandHandler( obj => { if (obj == null) return; JobInstance.Steps.Remove(obj as FAJobStepBase); SelectedJobStep = JobInstance.Steps.Last(); }, true); InitializeComponent(); }
public MainDoorControl() { OpenDoorCommand = new CommandHandler( obj => { if (EquipmentInstance != null) { EquipmentInstance.OpenDoor(); } }, true); CloseDoorCommand = new CommandHandler( obj => { if (EquipmentInstance != null) { EquipmentInstance.CloseDoor(); } }, true); InitializeComponent(); }
public QuestionMessageBoxWindow() { Result = QuestionResult.None; YesCommand = new CommandHandler( delegate(object sender) { Result = QuestionResult.Yes; if (EquipmentInstance != null) EquipmentInstance.TurnOffSound(); this.Close(); }, true); NoCommand = new CommandHandler( delegate(object sender) { Result = QuestionResult.No; if (EquipmentInstance != null) EquipmentInstance.TurnOffSound(); this.Close(); }, true); CancelCommand = new CommandHandler( delegate(object sender) { Result = QuestionResult.Cancel; if (EquipmentInstance != null) EquipmentInstance.TurnOffSound(); this.Close(); }, true); InitializeComponent(); }
public DevicePositionCheckJobSettingControl() { AddPositionCommand = new CommandHandler( obj => { JobInstance.Steps.Add(new FASSDScanJobPositionMoveStep()); SelectedJobStep = JobInstance.Steps.Last(); }, true); RemovePositionCommand = new CommandHandler( obj => { if (obj == null) return; JobInstance.Steps.Remove(obj as FAJobStepBase); SelectedJobStep = JobInstance.Steps.Last(); }, true); AddIndexCommand = new CommandHandler( obj => { try { dynamic parameters = (object[])obj; var list = (ThreadSafeObservableCollection<int>)parameters[0]; var index = 0; if (int.TryParse(parameters[1], out index) == true) { list.Add(index); } } catch (Exception e) { MessageBox.Show(e.ToString()); Manager.LogManager.Instance.WriteSystemLog(e.ToString()); } }, true); RemoveIndexCommand = new CommandHandler( obj => { try { dynamic parameters = (object[])obj; var list = (ThreadSafeObservableCollection<int>)parameters[0]; int selectedIndex = (int)parameters[1]; if (list.Contains(selectedIndex) == true) { list.Remove(selectedIndex); } } catch (Exception e) { MessageBox.Show(e.ToString()); Manager.LogManager.Instance.WriteSystemLog(e.ToString()); } }, true); InitializeComponent(); }
public override void InitializeSequence() { base.InitializeSequence(); MakePreLoading(); MakeLoading(); MakeProcess(); MakePreUnloading(); MakeUnloading(); MakeForceUnloading(); SendLotInfoCommand = new CommandHandler( delegate(object obj) { try { var command = new FAVT5081InterfacePart.FANextMachineDataInfo.ProductInfoRequest(); command.LOT_ID = ProductInfo.ECInfo.LOT_CLOSE.LOT_ID; command.LOT_MOQ = ProductInfo.ECInfo.PACKING_MASTER_INFO.L_BOX_MOQ; command.LOT_QTY = ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_QTY; _nextMachineInterfaceResult.Clear(); VerticalBandingMachineUnit.VT5081Interface.AddCommand(command, _nextMachineInterfaceResult); } catch (Exception e) { Manager.LogManager.Instance.WriteTraceLog(Equipment, e.ToString()); } }, true); }
public TrayTransferRobotSettingControl() { AddTrayCodeCommand = new CommandHandler( obj => { try { var name = obj as string; if (string.IsNullOrEmpty(name)) { return; } var findResult = TrayTransferRobot.TrayCodeList.FirstOrDefault(x => x.Name == name); if (findResult != null) { return; } TrayTransferRobot.TrayCodeList.Add( new Modules.TrayTransferRobotModule.TrayCodeInfo { Name = name }); } catch (Exception e) { System.Diagnostics.Trace.WriteLine(e.ToString()); MessageBox.Show(e.ToString()); } }, true); RemoveTrayCodeCommand = new CommandHandler( obj => { try { if (TrayTransferRobot.TrayCodeList.Count <= 0) return; var selectedItem = obj as Modules.TrayTransferRobotModule.TrayCodeInfo; if (TrayTransferRobot.TrayCodeList.Contains(selectedItem) == true) TrayTransferRobot.TrayCodeList.Remove(selectedItem); } catch (Exception ex) { string msg = ex.ToString(); MessageBox.Show(msg); System.Diagnostics.Trace.WriteLine(msg); } }, true); CopyToLeft = new CommandHandler( obj => { try { var selectedItem = obj as Modules.TrayTransferRobotModule.TrayCodeInfo; selectedItem.TrayGap = TrayTransferRobot.TrayGapForTrayCodeTeaching; selectedItem.TrayCodeScanPosition.PositionX.Position = TrayTransferRobot.TransferServoX.ActualPos; selectedItem.TrayCodeScanPosition.PositionY.Position = TrayTransferRobot.TransferServoY.ActualPos; selectedItem.TrayCodeScanPosition.PositionX.DriveSpeed = 200; selectedItem.TrayCodeScanPosition.PositionX.AccelTime = 200; selectedItem.TrayCodeScanPosition.PositionX.DecelTime = 200; selectedItem.TrayCodeScanPosition.PositionY.DriveSpeed = 200; selectedItem.TrayCodeScanPosition.PositionY.AccelTime = 200; selectedItem.TrayCodeScanPosition.PositionY.DecelTime = 200; } catch (Exception ex) { string msg = ex.ToString(); MessageBox.Show(msg); System.Diagnostics.Trace.WriteLine(msg); } }, true); InitializeComponent(); }