コード例 #1
0
ファイル: Hmi.cs プロジェクト: skyclub66/HMI
 public unsafe static void Hmi_ClearTimer()
 {
     *Hmi.myapp.systimerbuf = 0;
     Hmi.myapp.systimerbuf[1] = 0;
     for (int i = 0; i < 8; i++)
     {
         systimer_type *ptr = (systimer_type *)(Hmi.myapp.systimerbuf + (i * 5 + 4));
         ptr->id          = 255;
         ptr->hexbufindex = 65535;
     }
 }
コード例 #2
0
 public unsafe static void timerm_5ms(uint tt)
 {
     try
     {
         myappinf expr_0C_cp_0 = GuiTimer.myapp;
         expr_0C_cp_0.systime.systemruntime = expr_0C_cp_0.systime.systemruntime + tt;
         myappinf expr_23_cp_0 = GuiTimer.myapp;
         expr_23_cp_0.systime.movetime = expr_23_cp_0.systime.movetime + tt;
         myappinf expr_3A_cp_0 = GuiTimer.myapp;
         expr_3A_cp_0.systime.guitime_20 = expr_3A_cp_0.systime.guitime_20 + tt;
         if (GuiTimer.myapp.systime.guitime_20 >= 20u)
         {
             try
             {
                 if (*GuiTimer.myapp.systimerbuf > 0)
                 {
                     for (int i = 0; i < (int)(*GuiTimer.myapp.systimerbuf); i++)
                     {
                         systimer_type *ptr = (systimer_type *)(GuiTimer.myapp.systimerbuf + (i * 5 + 4));
                         if (ptr->val < 65534 && ptr->val > 0)
                         {
                             systimer_type *expr_B2 = ptr;
                             expr_B2->val = (ushort)(expr_B2->val + 1);
                         }
                     }
                 }
             }
             catch
             {
                 MessageOpen.Show("merry conflict!");
             }
             GuiTimer.myapp.systime.guitime_20 = 0u;
         }
         if (GuiTimer.myapp.systime.touchdowntime > 0u)
         {
             myappinf expr_121_cp_0 = GuiTimer.myapp;
             expr_121_cp_0.systime.touchdowntime = expr_121_cp_0.systime.touchdowntime + tt;
         }
     }
     catch (Exception ex)
     {
         MessageOpen.Show("timerm_5ms Runerror:" + ex.Message);
     }
 }
コード例 #3
0
ファイル: Hmi.cs プロジェクト: skyclub66/HMI
        public unsafe static byte Hmi_GetTimerHexbufIndex()
        {
            byte result;

            if (*Hmi.myapp.systimerbuf > 0)
            {
                if (Hmi.myapp.systimerbuf[1] >= *Hmi.myapp.systimerbuf)
                {
                    Hmi.myapp.systimerbuf[1] = 0;
                }
                for (byte b = Hmi.myapp.systimerbuf[1]; b < *Hmi.myapp.systimerbuf; b += 1)
                {
                    systimer_type *ptr = (systimer_type *)(Hmi.myapp.systimerbuf + (b * 5 + 4));
                    if (ptr->val == 65534)
                    {
                        Hmi.Hmi_SetHexIndex((int)ptr->hexbufindex);
                        ptr->val = 65535;
                        Hmi.myapp.systimerbuf[1] = (byte)(b + 1);
                        result = 1;
                        return(result);
                    }
                }
                for (byte b = 0; b < Hmi.myapp.systimerbuf[1]; b += 1)
                {
                    systimer_type *ptr = (systimer_type *)(Hmi.myapp.systimerbuf + (b * 5 + 4));
                    if (ptr->val == 65534)
                    {
                        Hmi.Hmi_SetHexIndex((int)ptr->hexbufindex);
                        ptr->val = 65535;
                        Hmi.myapp.systimerbuf[1] = (byte)(b + 1);
                        result = 1;
                        return(result);
                    }
                }
            }
            result = 0;
            return(result);
        }