public StateIn(StateIn _src) { if (_src == null) { state = 0; } else { state = _src.state; } }
public StateIn StateRead() { if (th != null) { LastError = "Нельзя получать значения при включенном вращении"; return(null); } LastError0 = null; StateIn ret = StateRead0(); LastError = LastError0; return(ret); }
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 }); }