more cmds
This commit is contained in:
@ -36,12 +36,29 @@ String ThermConfig::exec(String params) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String ThermValues::exec(String params) {
|
||||||
|
m_stream->print("TimeOuts: "); m_stream->print(m_thermometer->m_timeOutFailureCnt); m_stream->println();
|
||||||
|
m_stream->print("Cycles: "); m_stream->print(m_thermometer->m_cylceCnt); m_stream->println();
|
||||||
|
m_stream->print("Period (ms): "); m_stream->print(m_thermometer->m_periodMillis); m_stream->println();
|
||||||
|
m_stream->print("Alpha: "); m_stream->print(m_thermometer->m_alpha); m_stream->println();
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < NUM_OF_CHANNELS; i++) {
|
||||||
|
m_stream->print("index: "); m_stream->print(i); m_stream->print(", ");
|
||||||
|
m_stream->print("cal: "); m_stream->print(m_thermometer->m_calibrateFactor[i], 6); m_stream->print(", ");
|
||||||
|
m_stream->print("t: "); m_stream->print(m_thermometer->m_temperature[i]); m_stream->print(", ");
|
||||||
|
m_stream->print("ts: "); m_stream->print(m_thermometer->m_smoothedTemperature[i]);
|
||||||
|
m_stream->println();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "done";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Thermometer::Thermometer() : m_period(DEFAULT_PERIOD), m_periodMillis(DEFAULT_PERIOD),
|
Thermometer::Thermometer() : m_period(DEFAULT_PERIOD), m_periodMillis(DEFAULT_PERIOD),
|
||||||
m_debug(DEBUG), m_info(INFO),
|
m_debug(DEBUG), m_info(INFO),
|
||||||
thermConfig(this), m_timeOutFailureCnt(0), m_cylceCnt(0), m_alpha(1.0)
|
thermConfig(this), thermValues(this),
|
||||||
|
m_timeOutFailureCnt(0), m_cylceCnt(0), m_alpha(1.0)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < NUM_OF_CHANNELS; i++) {
|
for (unsigned int i = 0; i < NUM_OF_CHANNELS; i++) {
|
||||||
m_lastSmoothedTemperature[i] = INVALID_TEMPERATURE;
|
m_lastSmoothedTemperature[i] = INVALID_TEMPERATURE;
|
||||||
@ -109,6 +126,7 @@ void Thermometer::startSingleConv() {
|
|||||||
|
|
||||||
void Thermometer::begin(CmdServer *cmdServer) {
|
void Thermometer::begin(CmdServer *cmdServer) {
|
||||||
thermConfig.registerYourself(cmdServer);
|
thermConfig.registerYourself(cmdServer);
|
||||||
|
thermValues.registerYourself(cmdServer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,15 @@ private:
|
|||||||
Thermometer *m_thermometer;
|
Thermometer *m_thermometer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ThermValues : public Cmd {
|
||||||
|
public:
|
||||||
|
ThermValues(Thermometer *thermometer) : m_thermometer(thermometer) {};
|
||||||
|
virtual String getCmdName() { return "TVAL"; }
|
||||||
|
virtual String getHelp() { return "Show thermometer measurement values"; }
|
||||||
|
virtual String exec(String params);
|
||||||
|
private:
|
||||||
|
Thermometer *m_thermometer;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -45,11 +54,13 @@ public:
|
|||||||
void begin(CmdServer *cmdServer);
|
void begin(CmdServer *cmdServer);
|
||||||
void exec();
|
void exec();
|
||||||
friend class ThermConfig;
|
friend class ThermConfig;
|
||||||
|
friend class ThermValues;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Metro m_period;
|
Metro m_period;
|
||||||
unsigned long m_periodMillis;
|
unsigned long m_periodMillis;
|
||||||
ThermConfig thermConfig;
|
ThermConfig thermConfig;
|
||||||
|
ThermValues thermValues;
|
||||||
|
|
||||||
bool m_debug;
|
bool m_debug;
|
||||||
bool m_info;
|
bool m_info;
|
||||||
|
Reference in New Issue
Block a user