int FadeChannel_Test::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: address(); break; case 1: group(); break; case 2: start(); break; case 3: target(); break; case 4: current(); break; case 5: calculateCurrent(); break; default: ; } _id -= 6; } return _id; }
void MASASolenoid::update(uint32_t time){ if ((state == OPEN) && ((timeOnMillis) > MAX_TIME_ON)){ close(); if (timeCoolingStartMillis==0) timeCoolingStartMillis = time; state = COOLING; //timeCoolingMillis = time-timeCoolingStartMillis; timeOnMillis = 0; timeOnStartMillis = 0; } if ((state == COOLING) && ((timeCoolingMillis) > COOL_OFF_TIME)) { state = CLOSED; timeCoolingMillis = 0; timeCoolingStartMillis = 0; } calculateCurrent(); if (state==OPEN) timeOnMillis = time - timeOnStartMillis; if (state==COOLING)timeCoolingMillis = time - timeCoolingStartMillis; }
uchar FadeChannel::nextStep(uint ms) { if (elapsed() < UINT_MAX) setElapsed(elapsed() + ms); return calculateCurrent(fadeTime(), elapsed()); }