Пример #1
0
        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);
        }
Пример #2
0
 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());
 }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }
Пример #5
0
 public SafeLocateActivity(ICMMControl cmmControl /*, ActivityController ac*/)
 {
     _cmm = cmmControl;
 }
Пример #6
0
 public MeasureTrayActivity(ICMMControl cmmControl, ActivityController ac)
 {
     _ac              = ac;
     _selector        = new PartSelectActivity();
     _mesPartActivity = new MeasurePartActivity(cmmControl);
 }
 public MeasurePartActivity(ICMMControl cmm)
 {
     _cmm = cmm;
 }