Exemplo n.º 1
0
    public static int CompareDateMonths(this DateSave dateSave)
    {
        int yearsDiff = DateSystem.Year - dateSave.Year;
        int monthDiff = DateSystem.Month - dateSave.Month;

        return((yearsDiff * 12) + monthDiff);
    }
Exemplo n.º 2
0
        public bool Asix_Arc_Run(string PlatformName, string Position, int stime, int R)
        {
            bool     sta       = false;
            DateTime starttime = DateTime.Now;
            double   X         = TableManage.TablePosItem(PlatformName, Position).dPosX;
            double   Y         = TableManage.TablePosItem(PlatformName, Position).dPosY;
            bool     ArcXYMove = TableManage.TableDriver(PlatformName).ArcMove(TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dAcc, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dDec, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dSpeed, X, Y, R, 0, (CoordinateType)0);

            for (int i = 0; i < 3; i++)
            {
                if (ArcXYMove == true)
                {
                    break;
                }
                else
                {
                    Thread.Sleep(10);
                    ArcXYMove = TableManage.TableDriver(PlatformName).ArcMove(0.50, 0.50, 0.50, X, Y, 5, 0, (CoordinateType)0);
                }
            }
            bool ArcXYMove_run = TableManage.TableDriver(PlatformName).StartCure(false);

            if (ArcXYMove_run == true)
            {
                ArcXYMove_run = true;
            }
            else
            {
                ArcXYMove_run = false;
                return(ArcXYMove_run);
            }
            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                int iStep = 0;
                TableManage.TableDriver(PlatformName).CureMoveDone(out iStep);
                if (iStep == 0)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 3
0
        public bool Delay(int stime)    //一个检测
        {
            bool     sta       = false;
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 4
0
 public void BIZZRun()
 {
     RunClass.Instance().Meth.OutPut_One_Run("三色灯红", "true");
     RunClass.Instance().Meth.OutPut_One_Run("三色灯绿", "false");
     while (true)
     {
         RunClass.Instance().Meth.OutPut_One_Run("BIZZ", "true");
         Thread.Sleep(2000);
         RunClass.Instance().Meth.OutPut_One_Run("BIZZ", "false");
         Thread.Sleep(1000);
         //this.BeginInvoke(new EventHandler(delegate
         //{
         if (AlarmForm.FormHint == "hint")
         {
             DateSave.Instance().Production.Current_TIME = 0;
             RunClass.Instance().Meth.OutPut_One_Run("BIZZ", "false");
             RunClass.Instance().Meth.OutPut_One_Run("三色灯红", "false");
             RunClass.Instance().Meth.OutPut_One_Run("三色灯绿", "true");
             // AlarmForm.Hide();
             break;
             //  Bizz.Abort();
         }
         //}));
     }
 }
Exemplo n.º 5
0
 public void Loaddate()
 {
     DateSave.DateSav = DateSave.Instance().LoadObj();
     DateSave.Instance().Production.Empty_run = false;
     DateSave.Instance().Production.IsStop = false;
     //  DateSave.Instance().Production.StationMaterial = false;
 }
Exemplo n.º 6
0
        public bool High_Asix_Line_Run(string PlatformName, string Position, int stime, double X_Setover, double Y_Setover, double X_Camer, double Y_Camer)
        {
            bool     sta         = false;
            DateTime starttime   = DateTime.Now;
            double   X           = TableManage.TablePosItem(PlatformName, Position).dPosX + X_Setover + X_Camer;
            double   Y           = TableManage.TablePosItem(PlatformName, Position).dPosY + Y_Setover + Y_Camer;
            bool     LineXYZMove = TableManage.TableDriver(PlatformName).LineXYZMove(TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dAcc, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dDec, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dSpeed, X, Y, 500);

            for (int i = 0; i < 3; i++)
            {
                if (LineXYZMove == true)
                {
                    break;
                }
                else
                {
                    Thread.Sleep(10);
                    LineXYZMove = TableManage.TableDriver(PlatformName).LineXYZMove(TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dAcc, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dDec, TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dSpeed, X, Y, 500);
                }
            }
            TableManage.TableDriver(PlatformName).StartCure(false);
            int iStep1 = 0;

            TableManage.TableDriver(PlatformName).CureMoveDone(out iStep1);
            if (iStep1 == 0)
            {
            }
            else
            {
            }
            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                double   CurrentX = TableManage.TableDriver(PlatformName).CurrentX;
                double   CurrentY = TableManage.TableDriver(PlatformName).CurrentY;
                if ((X - 0.01 < CurrentX && X + 0.01 > CurrentX) && (Y - 0.01 < CurrentY && Y + 0.01 > CurrentY))
                {
                    sta = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 7
0
    public static int CompareDateWeeks(this DateSave dateSave)
    {
        int yearsDiff = DateSystem.Year - dateSave.Year;
        int monthDiff = DateSystem.Month - dateSave.Month;
        int weekDiff  = DateSystem.Week - dateSave.Week;

        return((yearsDiff * 48) + (monthDiff * 4) + weekDiff);
    }
Exemplo n.º 8
0
    public static int CompareDateDays(this DateSave dateSave)
    {
        int yearsDiff = DateSystem.Year - dateSave.Year;
        int monthDiff = DateSystem.Month - dateSave.Month;
        int weekDiff  = DateSystem.Week - dateSave.Week;
        int dayDiff   = DateSystem.Day - dateSave.Day;

        return((yearsDiff * 336) + (monthDiff * 28) + (weekDiff * 7) + dayDiff);
    }
Exemplo n.º 9
0
        public bool WaitINPut_More_Check(List <string> IONum, int stime)  //多个检测
        {
            List <bool> InPut_More_List = new List <bool>();

            for (int i = 0; i < IONum.Count; i++)
            {
                InPut_More_List.Add(false);
            }
            int      staNum    = 0;
            bool     sta       = false;
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                for (int i = 0; i < IONum.Count; i++)
                {
                    if (IOManage.INPUT(IONum[i]).On)
                    {
                        // sta = true;
                        InPut_More_List[staNum] = true;
                    }
                    else
                    {
                        // sta = false;
                        InPut_More_List[staNum] = false;
                    }
                    staNum++;
                }
                for (int i = 0; i < InPut_More_List.Count; i++)
                {
                    if (InPut_More_List[i] == false)
                    {
                        break;
                    }
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }

            return(sta);
        }
Exemplo n.º 10
0
        public double  调高数据()
        {
            double high = 0.0;
            // double ad = MainControls.ProductionData.Production.BaselineSimulation;//、、 获取基准模拟量
            double ad   = DateSave.Instance().Production.BaselineSimulation;//、、 获取基准模拟量
            double date = 0.0;

            Thread.Sleep(100);
            TableManage.TableDriver("运动平台")._GetAdc(1, out date);      //当前模拟量

            double ad12 = DateSave.Instance().Production.Z_AxialDatum; //获取Z基准坐标
            double sf   = ad - date;

            if (sf > 0)
            {
                double s = Math.Abs(sf);
                double z = s / DateSave.Instance().Production.High_Date;
                // double afaf = TableManage.TablePosItem("运动平台", "调高基准点坐标").c;

                double CurrentZA     = TableManage.TableDriver("运动平台").CurrentZ;
                double NeedCurrentZA = CurrentZA - z;
                //TableManage.TableDriver("运动平台").AbsMove(TableAxisName.Z,
                //            NeedCurrentZA, TableManage.tablesDoc.m_tableDictionary["运动平台"].axisZData.dSpeed);

                if (CurrentZA + 5 < NeedCurrentZA && CurrentZA - 5 > NeedCurrentZA)
                {
                    high = NeedCurrentZA;
                }
                else
                {
                    high = 0.0;
                }

                //RunClass.Meth.Asix_one_Run("运动平台", "调高基准点坐标", 2, 60000);
            }
            else
            {
                double s = Math.Abs(sf);
                double z = s / DateSave.Instance().Production.High_Date;
                // double afaf = TableManage.TablePosItem("运动平台", "调高基准点坐标").c;

                double CurrentZA     = TableManage.TableDriver("运动平台").CurrentZ;
                double NeedCurrentZA = CurrentZA + z;

                if (CurrentZA + 5 < NeedCurrentZA && CurrentZA - 5 > NeedCurrentZA)
                {
                    high = NeedCurrentZA;
                }
                else
                {
                    high = 0.0;
                }
                //RunClass.Meth.Asix_one_Run("运动平台", "调高基准点坐标", 2, 60000);
            }
            return(high);
        }
Exemplo n.º 11
0
    public static int CompareDateHours(this DateSave dateSave)
    {
        int yearsDiff = DateSystem.Year - dateSave.Year;
        int monthDiff = DateSystem.Month - dateSave.Month;
        int weekDiff  = DateSystem.Week - dateSave.Week;
        int dayDiff   = DateSystem.Day - dateSave.Day;
        int hourDiff  = DateSystem.Hour - dateSave.Hour;

        return((yearsDiff * 8064) + (monthDiff * 672) + (weekDiff * 168) + (dayDiff * 24) + hourDiff);
    }
Exemplo n.º 12
0
    void Start()
    {
        staticText = pointLabel;
        blocks     = new List <Block>();

        //Start point generation coroutine with timer
        StartCoroutine(generateWithTime());
        //Load last save time and block data
        DateSave.setTimeToWait(timeToWait);
        Invoke("invokeDelay", 0.1f);
    }
Exemplo n.º 13
0
 public FullSave(PlayerSave player, PosSave pos, List <DormSave> dorm, HomeSave parHome, VoreSaves vore, List <TeleportSave> teleportSaves)
 {
     this.playerPart    = player;
     this.posPart       = pos;
     this.dormPart      = dorm;
     this.datePart      = DateSystem.Save;
     this.homePart      = parHome;
     this.voreSaves     = vore;
     this.questSave     = QuestsSystem.Save;
     this.playerFlags   = PlayerFlags.Save();
     this.teleportSaves = teleportSaves;
     this.gameManager   = GameManager.Save();
 }
Exemplo n.º 14
0
        public bool Y_Axis_befor_Clinder_down(string IsCheck)    //  Y轴前模组顶升下
        {
            bool runOK = false;
            int  stime = 6000;

            IOManage.OUTPUT("Y轴前模组顶升气缸上升").SetOutBit(false);
            IOManage.OUTPUT("Y轴前模组顶升气缸下降").SetOutBit(true);
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (IOManage.INPUT("Y轴前模组顶升气缸上升").Off&& IOManage.INPUT("Y轴前模组顶升气缸下降").On)
                {
                    runOK = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    runOK = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    runOK = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    runOK = true;
                    break;
                }
                if (IsCheck == "不检测")
                {
                    runOK = true;
                    break;
                }
            }
            return(runOK);
        }
Exemplo n.º 15
0
        // X轴右模组定位缩回,
        public bool X_Axis_right_Clinder_Location_in(string IsCheck)      // X轴右模组定位缩回,
        {
            int  stime = 6000;
            bool runOK = false;

            IOManage.OUTPUT("X轴右定位气缸伸出").SetOutBit(false);
            IOManage.OUTPUT("X轴右定位气缸缩回").SetOutBit(true);
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (IOManage.INPUT("X轴右定位气缸伸出").Off&& IOManage.INPUT("X轴右定位气缸缩回").On)
                {
                    runOK = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    runOK = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    runOK = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    runOK = true;
                    break;
                }
                if (IsCheck == "不检测")
                {
                    runOK = true;
                    break;
                }
            }
            return(runOK);
        }
Exemplo n.º 16
0
        public bool Z_Baffle_In(string IsCheck)//Z轴挡板缩回
        {
            int  stime = 6000;
            bool runOK = false;

            IOManage.OUTPUT("Z轴挡板伸出").SetOutBit(false);
            IOManage.OUTPUT("Z轴挡板缩回").SetOutBit(true);
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (IOManage.INPUT("Z轴挡板伸出").Off&& IOManage.INPUT("Z轴挡板缩回").On)
                {
                    runOK = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    runOK = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    runOK = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    runOK = true;
                    break;
                }
                if (IsCheck == "不检测")
                {
                    runOK = true;
                    break;
                }
            }
            return(runOK);
        }
Exemplo n.º 17
0
        public bool BTooling_PlateStop_Up(string IsCheck)//工装板阻挡上升
        {
            int  stime = 6000;
            bool runOK = false;

            IOManage.OUTPUT("工装板阻挡气缸上升").SetOutBit(true);
            IOManage.OUTPUT("工装板阻挡气缸下降").SetOutBit(false);
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (IOManage.INPUT("工装板阻挡气缸上升").On&& IOManage.INPUT("工装板阻挡气缸下降").Off)
                {
                    runOK = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    runOK = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    runOK = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    runOK = true;
                    break;
                }
                if (IsCheck == "不检测")
                {
                    runOK = true;
                    break;
                }
            }
            return(runOK);
        }
Exemplo n.º 18
0
        public bool Copper_Mouth_Down(string IsCheck)//铜嘴下降
        {
            int  stime = 6000;
            bool runOK = false;

            IOManage.OUTPUT("铜嘴压板气缸上升").SetOutBit(false);
            IOManage.OUTPUT("铜嘴压板气缸下降").SetOutBit(true);
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (IOManage.INPUT("铜嘴压板气缸上升").Off&& IOManage.INPUT("铜嘴压板气缸下降").On)
                {
                    runOK = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    runOK = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    runOK = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    runOK = true;
                    break;
                }
                if (IsCheck == "不检测")
                {
                    runOK = true;
                    break;
                }
            }
            return(runOK);
        }
Exemplo n.º 19
0
        public bool Asix_Two_Run(string PlatformName, string Position, int stime)
        {
            bool     sta       = false;
            DateTime starttime = DateTime.Now;

            TableManage.TableDriver(PlatformName).AbsMove(TableAxisName.X,
                                                          TableManage.TablePosItem(PlatformName, Position).dPosX,
                                                          TableManage.tablesDoc.m_tableDictionary[PlatformName].axisXData.dSpeed);
            TableManage.TableDriver(PlatformName).AbsMove(TableAxisName.Y,
                                                          TableManage.TablePosItem(PlatformName, Position).dPosY,
                                                          TableManage.tablesDoc.m_tableDictionary[PlatformName].axisYData.dSpeed);
            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (TableManage.TableDriver(PlatformName).MoveDone(TableAxisName.X) && TableManage.TableDriver(PlatformName).MoveDone(TableAxisName.Y))
                {
                    sta = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 20
0
        public bool WaitINPut_Check(string IONum, string CheckSta, int stime)    //一个检测
        {
            bool     sta       = false;
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;

                if (IOManage.INPUT(IONum).On&& CheckSta.ToLower() == "true")
                {
                    sta = true;
                    break;
                }
                if (IOManage.INPUT(IONum).Off&& CheckSta.ToLower() == "false")
                {
                    sta = true;
                    break;
                }
                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 21
0
 //Save the current state of the game
 void OnApplicationQuit()
 {
     DateSave.save(System.DateTime.Now);
 }
Exemplo n.º 22
0
        public bool OutPut_Two_Run(string Work_str, bool Work_sta, string Home_str, bool Home_sta, string Work_Str, bool Work_Senson, string Home_Str, bool Home_Senson, int stime) //2个输出
        {
            IOManage.OUTPUT(Work_str).SetOutBit(Work_sta);
            IOManage.OUTPUT(Home_str).SetOutBit(Home_sta);
            bool     sta       = false;
            bool     sta1      = false;
            DateTime starttime = DateTime.Now;

            while (true)
            {
                DateTime endtime  = DateTime.Now;
                TimeSpan spantime = endtime - starttime;
                if (Work_Senson == true)
                {
                    if (IOManage.INPUT(Work_Str).On)
                    {
                        sta = true;
                    }
                }
                else
                {
                    if (IOManage.INPUT(Work_Str).Off)
                    {
                        sta = true;
                    }
                }
                if (Home_Senson == true)
                {
                    if (IOManage.INPUT(Home_Str).On)
                    {
                        sta1 = true;
                    }
                }
                else
                {
                    if (IOManage.INPUT(Home_Str).Off)
                    {
                        sta1 = true;
                    }
                }
                if (sta1 == true && sta == true)
                {
                    break;
                }

                if (spantime.TotalMilliseconds > stime)
                {
                    sta = false;
                    break;
                }
                if (DateSave.Instance().Production.IsStop == true)
                {
                    sta = true;
                    break;
                }
                if (DateSave.Instance().Production.EStop == true)
                {
                    sta = true;
                    break;
                }
            }
            return(sta);
        }
Exemplo n.º 23
0
        //下料移栽
        public override void Process()
        {
            try
            {
                lock (lockObj)
                {
                    bool bAutoTrag      = false;
                    bool bManualTrag    = false;
                    bool bTragCondition = false;
                    if (taskInfo.bTaskAlarm)
                    {
                        if (MainModule.FormMain.bResetPress)
                        {
                            taskInfo.bTaskAlarm = false;
                            Thread.Sleep(10);
                            m_taskTime.Start();
                        }
                        return;
                    }
                    if (!MainModule.FormMain.bAuto)
                    {
                        return;
                    }
                    bTragCondition = true;
                    bAutoTrag      = MainModule.FormMain.bAuto && (!taskInfo.bTaskFinish) && (!taskInfo.bTaskOnGoing);
                    bManualTrag    = m_manualStart;
                    switch (taskInfo.iTaskStep)
                    {
                    case (int)flowCharNew.任务开始:    //任务开始
                        if ((bAutoTrag | bManualTrag) && bTragCondition)
                        {
                            m_taskTime.Start();
                            m_taskGroup.AddRunMessage("打标任务0,任务开始。");
                            taskInfo.bTaskOnGoing = true;
                            taskInfo.iTaskStep    = (int)flowCharNew.接进料流程;
                            Weld_Log.Instance().Enqueue(LOG_LEVEL.LEVEL_3, "[IO输出]," + "任务开始");
                            //taskInfo.iTaskStep = (int)flowCharNew.与线体PLC对接进料信号;
                        }
                        break;

                    case (int)flowCharNew.接进料流程:
                        if (RunClass.Instance().StartRun == false && DateSave.Instance().Production.StationMaterial == false)
                        {
                            Weld_Sta = "焊接进料流程";
                            //DateSave.Instance().Production.StationMaterial = true;
                            Weld_Log.Instance().Enqueue(LOG_LEVEL.LEVEL_3, "[IO输出]," + "焊接进料流程");
                            starttime = DateTime.Now;
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接进料流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接进料流程。");
                            taskInfo.iTaskStep = (int)flowCharNew.接进料流程完成检测;
                        }
                        else
                        {
                            taskInfo.iTaskStep = (int)flowCharNew.接前流程;
                        }
                        //  taskInfo.iTaskStep = 9;

                        break;

                    case (int)flowCharNew.接进料流程完成检测:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            Weld_Log.Instance().Enqueue(LOG_LEVEL.LEVEL_3, "[IO输出]," + "焊接进料流程完成");
                            m_taskGroup.AddRunMessage("焊接流程,焊接进料流程完成。");
                            taskInfo.iTaskStep = (int)flowCharNew.接前流程;
                        }
                        //   taskInfo.iTaskStep = (int)flowCharNew.焊接进料流程完成检测;
                        break;

                    case (int)flowCharNew.接前流程:
                        if (RunClass.Instance().StartRun == false)
                        {
                            Weld_Sta = "焊接前流程";
                            Weld_Log.Instance().Enqueue(LOG_LEVEL.LEVEL_3, "[IO输出]," + "焊接前流程");
                            starttime = DateTime.Now;
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接前流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接前流程。");
                        }

                        //   taskInfo.iTaskStep = 9;
                        taskInfo.iTaskStep = (int)flowCharNew.接前流程完成检测;
                        break;

                    case (int)flowCharNew.接前流程完成检测:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            Weld_Log.Instance().Enqueue(LOG_LEVEL.LEVEL_3, "[IO输出]," + "焊接前流程完成");
                            m_taskGroup.AddRunMessage("焊接流程,焊接前流程完成。");
                            taskInfo.iTaskStep = (int)flowCharNew.接中流程;
                        }
                        //    taskInfo.iTaskStep = (int)flowCharNew.焊接前流程完成检测;
                        break;

                    case (int)flowCharNew.接中流程:
                        if (DateSave.Instance().Production.LeftRun == true)
                        {
                        }
                        else
                        {
                            if (RunClass.Instance().StartRun == false)
                            {
                                Weld_Sta = "焊接流程";
                                DateSave.Instance().Production.RightRun = true;
                                RunClass.Instance().RunClass_IsFinish = false;
                                RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接流程.csv");
                                m_taskGroup.AddRunMessage("焊接流程,焊接流程。");
                            }
                            taskInfo.iTaskStep = (int)flowCharNew.接中流程完成检测;
                        }

                        break;

                    case (int)flowCharNew.接中流程完成检测:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            m_taskGroup.AddRunMessage("焊接流程,焊接前流程完成。");
                            taskInfo.iTaskStep = (int)flowCharNew.接后流程;
                        }
                        //  taskInfo.iTaskStep = (int)flowCharNew.焊接中流程完成检测;
                        break;

                    case (int)flowCharNew.接后流程:
                        if (RunClass.Instance().StartRun == false)
                        {
                            Weld_Sta = "焊接后流程";
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接后流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接后流程。");
                        }
                        taskInfo.iTaskStep = (int)flowCharNew.接后流程完成检测;

                        break;

                    case (int)flowCharNew.接后流程完成检测:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            m_taskGroup.AddRunMessage("焊接流程,焊接后流程完成检测。");
                            taskInfo.iTaskStep = (int)flowCharNew.接排料流程;
                        }
                        //  taskInfo.iTaskStep = (int)flowCharNew.焊接后流程完成检测;
                        break;

                    case (int)flowCharNew.接排料流程:
                        if (RunClass.Instance().StartRun == false)
                        {
                            Weld_Sta = "焊接排料流程";
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接排料流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接排料流程。");
                        }
                        taskInfo.iTaskStep = (int)flowCharNew.接排料流程完成检测;


                        break;

                    case (int)flowCharNew.接排料流程完成检测:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            DateTime endtime = DateTime.Now;
                            TimeSpan spantime = endtime - starttime;
                            DateSave.Instance().Production.CTtime = spantime.TotalSeconds.ToString();
                            DateSave.Instance().Production.OK_date++;
                            DateSave.Instance().Production.Current_TIME++;
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            m_taskGroup.AddRunMessage("焊接流程,焊接排料流程完成检测。");
                            taskInfo.iTaskStep = (int)flowCharNew.接进料流程;
                            // DateSave.Instance().Production.StationMaterial = false;
                        }
                        //  taskInfo.iTaskStep = (int)flowCharNew.焊接排料流程完成检测;
                        break;

                    case 8:
                        if (RunClass.Instance().StartRun == false)
                        {
                            starttime = DateTime.Now;
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接前流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接前流程。");
                        }

                        taskInfo.iTaskStep = 9;
                        break;

                    case 9:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            m_taskGroup.AddRunMessage("焊接流程,焊接前流程完成。");
                            taskInfo.iTaskStep = 10;
                        }
                        break;

                    case 10:
                        if (DateSave.Instance().Production.LeftRun == true)
                        {
                        }
                        else
                        {
                            if (RunClass.Instance().StartRun == false)
                            {
                                DateSave.Instance().Production.RightRun = true;
                                RunClass.Instance().RunClass_IsFinish = false;
                                RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接流程.csv");
                                m_taskGroup.AddRunMessage("焊接流程,焊接流程。");
                            }
                            taskInfo.iTaskStep = 105;
                        }
                        break;

                    case 105:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            DateSave.Instance().Production.RightRun = false;
                            taskInfo.iTaskStep = 106;
                            m_taskGroup.AddRunMessage("焊接流程,焊接流程完成。");
                        }
                        break;

                    case 106:
                        if (RunClass.Instance().StartRun == false)
                        {
                            RunClass.Instance().RunClass_IsFinish = false;
                            RunClass.Instance().runTask(ReadstfPath + "\\" + DateSave.Instance().Production.ModelNo + "\\" + "焊接后流程.csv");
                            m_taskGroup.AddRunMessage("焊接流程,焊接后流程。");
                        }
                        taskInfo.iTaskStep = 107;
                        break;

                    case 107:
                        if (RunClass.Instance().RunClass_IsFinish == true)
                        {
                            DateTime endtime = DateTime.Now;
                            TimeSpan spantime = endtime - starttime;
                            DateSave.Instance().Production.CTtime = spantime.TotalSeconds.ToString();
                            DateSave.Instance().Production.OK_date++;

                            DateSave.Instance().Production.Current_TIME++;


                            if (RunClass.Instance().Run_OneCase.IsAlive == true)
                            {
                                RunClass.Instance().Run_OneCase.Abort();
                            }
                            m_taskGroup.AddRunMessage("焊接流程,焊接后流程完成。");
                            taskInfo.iTaskStep = 8;
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                //  m_taskGroup.AddAlarmMessage(string.Format("执行下料流程{0}时出现错误!错误信息:{1}", taskInfo.iTaskStep, ex.Message));
            }
        }
Exemplo n.º 24
0
 public static int CompareDateYears(this DateSave dateSave) => DateSystem.Year - dateSave.Year;
Exemplo n.º 25
0
 //Display points after all loading is done (waiting for all start functions to complete)
 private void invokeDelay()
 {
     DateSave.load();
     pointLabel.text = template + totalPoint.ToString();
 }