Exemplo n.º 1
0
 private void InitClass()
 {
     _UiData = new UiData();
     _CrtEVOMachine = new EVOMachine(true);
     _CrtWaterValve = new WaterValve();
     _CrtMixerUnit = new MixerUnit();
     _CrtCanisterUnit = new CanisterUnit();
     _CrtDeviceUnit = new DeviceUnit();
     _CrtBeanHopperUint = new BeanHopperUint();
     _CrtIngredient = new IngredientInfo(true);
     _CrtRecipeInfo = new RecipeInfo();
     _LstEVOMachine = new ObservableCollection<EVOMachine>();
     _LstDeviceUnit = new ObservableCollection<DeviceUnit>();
     _lstMaintenceInfo = new ObservableCollection<EvoMaintenceInfo>();
     _EvoRecipe = new EvoRecipe();
     _IDControl = new IDGenrator();
     _crtDBItem = new DBItem();
     _EvoUpdate = new EvoUpdate();
     _MachineInfo = new MachineInfo();
     _CrtEVOCleaning = new EVOCleaning();
     Tmr.Interval = TimeSpan.FromSeconds(5);
     Tmr.Tick += Tmr_Tick;
     _ComSetting = (ComSetting)Function.XmlSerializer.LoadFromXml("EVO.com.xml", typeof(ComSetting));
     comunication.Getinstance().SetComPort(_ComSetting.Port, _ComSetting.BaudRate);
     int ret = comunication.Getinstance().Open();
     comunication.EVOEvent += comunication_EVOEvent;
 }
Exemplo n.º 2
0
        private void GetLstDeviceUnit()
        {
            _LstDeviceUnit.Clear();
            DeviceUnit devtmp;
            if (_CrtEVOMachine!=null)
            {
                foreach (var item in _CrtEVOMachine._WaterValve)
                {
                    devtmp = new DeviceUnit();
                    devtmp._Type = DeviceType.DEV_VALVE;
                    devtmp.Name = item.Name;
                    devtmp.DeviceIoAdress = item.DeviceIoAdress;
                    devtmp.DeviceID = item.DeviceID;
                    
                    _LstDeviceUnit.Add(devtmp);
                }
                foreach (var item in _CrtEVOMachine._MixerUnit)
                {
                    devtmp = new DeviceUnit();
                    devtmp._Type = DeviceType.DEV_MIXER;
                    devtmp.Name = item.Name;
                    devtmp.DeviceIoAdress = item.DeviceIoAdress;
                    devtmp.DeviceID = item.DeviceID;
                    devtmp.Speed = item.Speed;
                    _LstDeviceUnit.Add(devtmp);
                }
                foreach (var item in _CrtEVOMachine._CanisterUnit)
                {
                    devtmp = new DeviceUnit();
                    devtmp._Type = DeviceType.DEV_CANISTER;
                    devtmp.Name = item.Name;
                    devtmp.DeviceIoAdress = item.DeviceIoAdress;
                    devtmp.DeviceID = item.DeviceID;

                    _LstDeviceUnit.Add(devtmp);
                }
                foreach (var item in _CrtEVOMachine._BeanHopperUint)
                {
                    devtmp = new DeviceUnit();
                    devtmp._Type = DeviceType.DEV_HOPPER;
                    devtmp.Name = item.Name;
                    devtmp.DeviceIoAdress = item.DeviceIoAdress;
                    devtmp.DeviceID = item.DeviceID;

                    _LstDeviceUnit.Add(devtmp);
                }

            }
        }