コード例 #1
0
ファイル: Commake.cs プロジェクト: skyclub66/HMI
 private static unsafe byte Commake_Comyouxian(PosLaction *pos)
 {
     if (Strmake.Strmake_Makestr(Comstrbuf + pos->star, "runmod=", 7) == 1)
     {
         byte val = (byte)(Comstrbuf[pos->star + 7] - 0x30);
         switch (val)
         {
         case 0:
         case 1:
         case 2:
             Sysatt.Sysatt_SetXitongval(0x15, val);
             Commake_SendBacksuc();
             return(1);
         }
         return(0);
     }
     if (Strmake.Strmake_Makestr(Comstrbuf + pos->star, "com_st", 6) == 1)
     {
         if (Strmake.Strmake_Makestr(Comstrbuf + pos->star, "com_star", 8) == 1)
         {
             NorComSta.runmod = 1;
             return(1);
         }
         if (Strmake.Strmake_Makestr(Comstrbuf + pos->star, "com_stop", 8) == 1)
         {
             NorComSta.runmod = 0;
             return(1);
         }
     }
     return(0);
 }
コード例 #2
0
ファイル: Attmake.cs プロジェクト: skyclub66/HMI
 public static unsafe byte Attmake_Makeatt(byte *buf, runattinf *b1, runattinf *b2, byte yunsuan)
 {
     if ((b2->attlei != attshulei.Sstr.typevalue) && (b2->attlei != attshulei.Sstr.typevalue))
     {
         if (yunsuan == 1)
         {
             if (b1->val == b2->val)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 2)
         {
             if (b1->val < b2->val)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 3)
         {
             if (b1->val > b2->val)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 4)
         {
             if (b1->val <= b2->val)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 5)
         {
             if (b1->val >= b2->val)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 6)
         {
             if (b1->val != b2->val)
             {
                 return(1);
             }
             return(0);
         }
     }
     else if (((b2->attlei == attshulei.Sstr.typevalue) && (b1->attlei == attshulei.Sstr.typevalue)) && ((yunsuan == 1) || (yunsuan == 6)))
     {
         if (Strmake.Strmake_Makestr(b1->Pz, b2->Pz, 0) == 1)
         {
             if (yunsuan == 1)
             {
                 return(1);
             }
             return(0);
         }
         if (yunsuan == 1)
         {
             return(0);
         }
         return(1);
     }
     return(0);
 }