Esempio n. 1
0
 public StateIn(StateIn _src)
 {
     if (_src == null)
     {
         state = 0;
     }
     else
     {
         state = _src.state;
     }
 }
Esempio n. 2
0
        public StateIn StateRead()
        {
            if (th != null)
            {
                LastError = "Нельзя получать значения при включенном вращении";
                return(null);
            }
            LastError0 = null;
            StateIn ret = StateRead0();

            LastError = LastError0;
            return(ret);
        }
Esempio n. 3
0
 void Run()
 {
     LastError0 = null;
     for (int i = 0; i < Iters; i++)
     {
         LastError0 = null;
         Reset0("9966");
         if (LastError0 == null)
         {
             break;
         }
         if (terminate)
         {
             return;
         }
     }
     if (LastError0 != null)
     {
         LastError = LastError0;
         return;
     }
     Thread.Sleep(1000);
     if (terminate)
     {
         return;
     }
     for (int i = 0; i < Iters; i++)
     {
         LastError0 = null;
         setParameterFrequency0(frequency);
         if (LastError0 == null)
         {
             break;
         }
         if (terminate)
         {
             return;
         }
     }
     if (LastError0 != null)
     {
         LastError = LastError0;
         return;
     }
     for (int i = 0; i < Iters; i++)
     {
         LastError0 = null;
         StateWrite0(new StateOut()
         {
             STF = true, RH = true
         });
         if (LastError0 == null)
         {
             break;
         }
         if (terminate)
         {
             return;
         }
     }
     if (LastError0 != null)
     {
         LastError = LastError0;
         return;
     }
     Thread.Sleep(50);
     if (terminate)
     {
         return;
     }
     for (; ;)
     {
         if (terminate)
         {
             break;
         }
         sIn = StateRead0();
         if (IsABC)
         {
             if (sIn == null || !sIn.ABC)
             {
                 LastError = "Ошибка ABC";
                 break;
             }
         }
         if (terminate)
         {
             break;
         }
         Thread.Sleep(RTimeout);
         if (terminate)
         {
             break;
         }
     }
     StateWrite0(new StateOut()
     {
         STF = false, RH = false
     });
 }