示例#1
0
        private static void LoadUnloadingPoint(object o)
        {
            try
            {
                List <UnloadingPointController>     listUnloadingPointController     = new  List <UnloadingPointController>();
                List <AscmUnloadingPointController> listAscmUnloadingPointController = AscmUnloadingPointControllerService.GetInstance().GetList("from AscmUnloadingPointController");
                List <AscmUnloadingPoint>           listAscmUnloadingPoint           = AscmUnloadingPointService.GetInstance().GetList("from AscmUnloadingPoint");
                foreach (AscmUnloadingPointController controller in listAscmUnloadingPointController)
                {
                    UnloadingPointController unloadingPointController = new UnloadingPointController();
                    unloadingPointController.ascmUnloadingPointController = controller;
                    foreach (AscmUnloadingPoint unloadingPoint in listAscmUnloadingPoint)
                    {
                        if (unloadingPoint.controllerId == controller.id)
                        {
                            unloadingPointController.listAscmUnloadingPoint.Add(unloadingPoint);
                        }
                    }
                    listUnloadingPointController.Add(unloadingPointController);
                }

                foreach (UnloadingPointController controller in listUnloadingPointController)
                {
                    Thread thread = new Thread(UpdateStatus);
                    thread.Start(controller);
                }
            }
            catch (Exception ex)
            {
                //this.AddLog("加载卸货点控制器异常:");// + ex.Message
            }
        }
示例#2
0
 private static void UpdateStatus(Object o)
 {
     try
     {
         UnloadingPointController controller = (UnloadingPointController)o;
         int[] status = controller.ReadStatus();
         foreach (AscmUnloadingPoint point in controller.listAscmUnloadingPoint)
         {
             if (!controller.Connected)
             {
                 point.status = AscmUnloadingPoint.StatusDefine.breakdown;
             }
             else
             {
                 if (status[point.controllerAddress] == 1)
                 {
                     point.status = AscmUnloadingPoint.StatusDefine.inUse;
                 }
                 if (status[point.controllerAddress] == 0)
                 {
                     point.status = AscmUnloadingPoint.StatusDefine.idle;
                 }
             }
             Oracle.AscmUnloadingPointUpdate(point);
         }
     }
     catch (Exception e)
     {
     }
 }
示例#3
0
        private static void LoadUnloadingPoint(object o)
        {
            try
            {
                List<UnloadingPointController> listUnloadingPointController = new  List<UnloadingPointController>();
                List<AscmUnloadingPointController> listAscmUnloadingPointController = AscmUnloadingPointControllerService.GetInstance().GetList("from AscmUnloadingPointController");
                List<AscmUnloadingPoint> listAscmUnloadingPoint = AscmUnloadingPointService.GetInstance().GetList("from AscmUnloadingPoint");
                foreach (AscmUnloadingPointController controller in listAscmUnloadingPointController)
                {
                    UnloadingPointController unloadingPointController = new UnloadingPointController();
                    unloadingPointController.ascmUnloadingPointController = controller;
                    foreach (AscmUnloadingPoint unloadingPoint in listAscmUnloadingPoint)
                    {
                        if (unloadingPoint.controllerId == controller.id)
                        {
                            unloadingPointController.listAscmUnloadingPoint.Add(unloadingPoint);
                        }
                    }
                    listUnloadingPointController.Add(unloadingPointController);
                }

                foreach (UnloadingPointController controller in listUnloadingPointController)
                {
                    Thread thread = new Thread(UpdateStatus);
                    thread.Start(controller);
                }
            }
            catch (Exception ex)
            {
                //this.AddLog("加载卸货点控制器异常:");// + ex.Message
            }
        }