public void AddCmm(int cmmNo, string cmmName) { var use = LogicUnits.Any(p => p.LogicUnit.CmmNo == cmmNo); if (use) { return; } ICMMControl cmmCtrl = null; bool connected = false; if (string.Compare(cmmName, "Pcdmis", true) == 0) { cmmCtrl = PcdmisClient.Inst; } else { cmmCtrl = CalypsoClient.Inst; } connected = cmmCtrl.Online(); LogicUnitViewModel luVm = new LogicUnitViewModel(cmmNo, cmmName, cmmCtrl); luVm.CanOnline = !connected; luVm.CanOffline = connected; luVm.LogicUnit.CmmOnline = connected; LogicUnits.Add(luVm); }
public RootActivity(ICMMControl cmmControl, ActivityController ac) { AActivities = new List <IAActivity <Tray, bool> >(); AActivities.Add(new LoadActivity()); //AActivities.Add(new MeasureTrayActivity(cmmControl, ac)); //AActivities.Add(new SafeLocateActivity(cmmControl)); AActivities.Add(new UnloadActivity()); }
public LogicUnit(int cmmNo, string cmmName, ICMMControl cmmControl) { CmmNo = cmmNo; CmmName = cmmName; _cmmControl = cmmControl; Working = false; _actCtrl = new ActivityController() { Mark = true, IsOffline = false }; _actCtrl.Cont_Evt = new AutoResetEvent(false); _traySelector = new TraySelectActivity(cmmNo); _rootActivity = new RootActivity(cmmControl, _actCtrl); _offlineWaitFlag = new AutoResetEvent(false); }
public LogicUnitViewModel(int cmmNo, string cmmName, ICMMControl cmmClient) { LogicUnit = new LogicUnit(cmmNo, cmmName, cmmClient); OfflineCommand = new DelegateCommand(CmmOffline).ObservesCanExecute(() => CanOffline); OnlineCommand = new DelegateCommand(CmmOnline).ObservesCanExecute(() => CanOnline); StartWorkflowCommand = new DelegateCommand(StartWorkflow).ObservesCanExecute(() => Started); ClearErrorCommand = new DelegateCommand(ClearError).ObservesCanExecute(() => CmmError); RetryCommand = new DelegateCommand(RetryMeasurePart).ObservesCanExecute(() => CmmError); NextPartCommand = new DelegateCommand(NextPart).ObservesCanExecute(() => CmmError); cmmClient.OfflineEvent += CmmClient_OfflineEvent; LogicUnit.StartedEvent += LogicUnit_StartedEvent; LogicUnit.StoppedEvent += LogicUnit_StoppedEvent; MyEventAggregator.Inst.GetEvent <CmmErrorEvent>().Subscribe(OnCmmEvent); CmmError = false; }
public SafeLocateActivity(ICMMControl cmmControl /*, ActivityController ac*/) { _cmm = cmmControl; }
public MeasureTrayActivity(ICMMControl cmmControl, ActivityController ac) { _ac = ac; _selector = new PartSelectActivity(); _mesPartActivity = new MeasurePartActivity(cmmControl); }
public MeasurePartActivity(ICMMControl cmm) { _cmm = cmm; }