+ ++m_sec_sequence.current();
+ break;
+ case eSecCommand::MEASURE_IDLE_INPUTPOWER:
+ m_idleInputpower = readInputpower();
+ eDebug("[SEC] idleInputpower is %d", m_idleInputpower);
+ ++m_sec_sequence.current();
+ break;
+ case eSecCommand::MEASURE_RUNNING_INPUTPOWER:
+ m_runningInputpower = readInputpower();
+ eDebug("[SEC] runningInputpower is %d", m_runningInputpower);
+ ++m_sec_sequence.current();
+ break;
+ case eSecCommand::SET_TIMEOUT:
+ m_timeoutCount = m_sec_sequence.current()++->val;
+ eDebug("[SEC] set timeout %d", m_timeoutCount);
+ break;
+ case eSecCommand::UPDATE_CURRENT_ROTORPARAMS:
+ m_data[5] = m_data[3];
+ m_data[6] = m_data[4];
+ eDebug("[SEC] update current rotorparams %d %04x %d", m_timeoutCount, m_data[5], m_data[6]);
+ ++m_sec_sequence.current();
+ break;
+ case eSecCommand::IF_TIMEOUT_GOTO:
+ if (!m_timeoutCount)
+ setSecSequencePos(m_sec_sequence.current()->steps);
+ else
+ ++m_sec_sequence.current();
+ break;
+ case eSecCommand::IF_INPUTPOWER_DELTA_GOTO:
+ {
+ eSecCommand::rotor &cmd = m_sec_sequence.current()->measure;
+ const char *txt = cmd.direction ? "running" : "stopped";
+ eDebug("[SEC] waiting for rotor %s", txt);
+ eDebug("[SEC] %s %d, idle %d, delta %d",
+ txt,
+ m_runningInputpower,
+ m_idleInputpower,
+ cmd.deltaA);
+ if ( (cmd.direction && abs(m_runningInputpower - m_idleInputpower) >= cmd.deltaA)
+ || (!cmd.direction && abs(m_runningInputpower - m_idleInputpower) <= cmd.deltaA) )
+ {
+ ++cmd.okcount;
+ eDebug("[SEC] rotor %s step %d ok", txt, cmd.okcount);
+ if ( cmd.okcount > 1 )
+ {
+ eDebug("[SEC] rotor is %s", txt);
+ if (setSecSequencePos(cmd.steps))
+ break;
+ }
+ }
+ else
+ {
+ eDebug("[SEC] rotor not %s... reset counter.. increase timeout", txt);
+ --m_timeoutCount;
+ cmd.okcount=0;
+ }
+ ++m_sec_sequence.current();