protected override void ReleaseProcedureItemHandler(Object item)
        {
            Task.Run(() => {
                ProcedureControlServices procItem = item as ProcedureControlServices;
                RobotUnity robot = procItem.GetRobotUnity();
                robot.ShowText("Procedure :" + procItem.procedureCode);
                robot.ShowText("Robot Rleased :" + robot.properties.Label);
                robot.ShowText(">>>>>>>>>");
                if (procItem.procedureCode == ProcedureControlServices.ProcedureCode.PROC_CODE_ROBOT_TO_READY)
                {
                    robotManagementService.AddRobotUnityReadyList(robot);
                }
                else if (procItem.procedureCode == ProcedureControlServices.ProcedureCode.PROC_CODE_ROBOT_TO_CHARGE)
                {
                    robotManagementService.AddRobotUnityReadyList(robot);
                }
                else
                {
                    robot.ShowText("Add Wait Task" + robot.properties.Label);
                    robot.ShowText("----------------");
                    robotManagementService.AddRobotUnityWaitTaskList(robot);
                    try
                    {
                        procItem.ReleaseProcedureHandler -= ReleaseProcedureItemHandler;
                    }
                    catch { }
                }

                /*    var element = RegisterProcedureItemList.Find (e => e.item.procedureCode == procItem.procedureCode);
                 *  element.procedureDataItems.EndTime = DateTime.Now;
                 *  element.procedureDataItems.StatusProcedureDelivered = "OK";
                 *  RegisterProcedureItemList.Remove (element);*/
            });
        }
Beispiel #2
0
        protected void Debug(object ojb, string log)
        {
            ProcedureControlServices pCs = (ProcedureControlServices)ojb;
            RobotUnity rb   = pCs.GetRobotUnity();
            string     rBid = rb.properties.Label + " => (^_^) ";

            switch (pCs.procedureCode)
            {
            case ProcedureCode.PROC_CODE_BUFFER_TO_MACHINE:
                Console.WriteLine(rBid + "BUFFER_TO_MACHINE:" + log);
                break;

            case ProcedureCode.PROC_CODE_FORKLIFT_TO_BUFFER:
                Console.WriteLine(rBid + "FORKLIFT_TO_BUFFER:" + log);
                break;

            case ProcedureCode.PROC_CODE_BUFFER_TO_RETURN:
                Console.WriteLine(rBid + "BUFFER_TO_RETURN:" + log);
                break;

            case ProcedureCode.PROC_CODE_MACHINE_TO_RETURN:
                Console.WriteLine(rBid + "MACHINE_TO_RETURN:" + log);
                break;

            case ProcedureCode.PROC_CODE_RETURN_TO_GATE:
                Console.WriteLine(rBid + "RETURN_TO_GATE:" + log);
                break;

            case ProcedureCode.PROC_CODE_ROBOT_TO_READY:
                Console.WriteLine(rBid + "ROBOT_TO_READY:" + log);
                break;

            case ProcedureCode.PROC_CODE_ROBOT_TO_CHARGE:
                Console.WriteLine(rBid + "ROBOT_TO_CHARGE:" + log);
                break;

            default:
                break;
            }
        }
Beispiel #3
0
        protected override void ReleaseProcedureItemHandler(Object item)
        {
            Task.Run(() => {
                ProcedureControlServices procItem = item as ProcedureControlServices;
                RobotUnity robot = procItem.GetRobotUnity();
                robot.ShowText("Procedure :" + procItem.procedureCode);
                robot.ShowText("Robot Rleased :" + robot.properties.Label);
                robot.ShowText(">>>>>>>>>");
                robot.border.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
                                                    new Action(delegate() {
                    robot.setColorRobotStatus(RobotStatusColorCode.ROBOT_STATUS_OK);
                }));
                if (procItem.procedureCode == ProcedureControlServices.ProcedureCode.PROC_CODE_ROBOT_TO_READY)
                {
                    robotManagementService.AddRobotUnityReadyList(robot);
                }
                else if (procItem.procedureCode == ProcedureControlServices.ProcedureCode.PROC_CODE_ROBOT_TO_CHARGE)
                {
                    robotManagementService.AddRobotUnityReadyList(robot);
                }
                else
                {
                    robot.ShowText("Add Wait Task" + robot.properties.Label);
                    robot.ShowText("----------------");
                    robotManagementService.AddRobotUnityWaitTaskList(robot);
                    try
                    {
                        procItem.ReleaseProcedureHandler -= ReleaseProcedureItemHandler;
                    }
                    catch { }
                }

                /*    var element = RegisterProcedureItemList.Find (e => e.item.procedureCode == procItem.procedureCode);
                 *  element.procedureDataItems.EndTime = DateTime.Now;
                 *  element.procedureDataItems.StatusProcedureDelivered = "OK";
                 *  RegisterProcedureItemList.Remove (element);*/
            });
        }