X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Farducontrol.h;h=555280985767a7e37ea512607a0337359ac11618;hb=1e655686513ef60e1972fc9ca9bcf7b434a09e40;hp=75b9dc8cb8f4d283e4b0e0aa3b775192fa1357d4;hpb=b746099bd0ed4aac2484b5125135d2c21c3c4082;p=r2c2.git diff --git a/source/libr2c2/arducontrol.h b/source/libr2c2/arducontrol.h index 75b9dc8..5552809 100644 --- a/source/libr2c2/arducontrol.h +++ b/source/libr2c2/arducontrol.h @@ -317,6 +317,28 @@ private: bool pop_info(MfxInfo &); }; + class MonitorTask: public Task + { + private: + float voltage; + float current; + float base_level; + float peak_level; + Msp::Time::TimeStamp next_poll; + unsigned next_type; + + public: + MonitorTask(); + + virtual bool get_work(PendingCommand &); + virtual void process_reply(const char *, unsigned); + + float get_voltage() const { return voltage; } + float get_current() const { return current; } + void reset_peak(); + float get_peak() const { return peak_level-base_level; } + }; + class ControlThread: public Msp::Thread { private: @@ -365,6 +387,7 @@ private: S88Task s88; MfxAnnounceTask mfx_announce; MfxSearchTask mfx_search; + MonitorTask monitor; ControlThread thread; static ProtocolInfo protocol_info[2];