Beginning of scheduler code

This commit is contained in:
AlexandreRouma
2021-11-14 18:30:58 +01:00
parent d20b41401f
commit 0ab4d16f9d
11 changed files with 419 additions and 37 deletions

View File

@ -0,0 +1,46 @@
#pragma once
#include <sched_action.h>
namespace sched_action {
class StartRecorderClass : public ActionClass {
public:
StartRecorderClass() {}
~StartRecorderClass() {}
void trigger() {
}
void showEditMenu() {
}
void loadFromConfig(json config) {
if (config.contains("recorder")) { recorderName = config["recorder"]; }
}
json saveToConfig() {
json config;
config["recorder"] = recorderName;
return config;
}
std::string getName() {
return "Start \"" + recorderName + "\"";
}
bool isValid() {
return valid;
}
private:
std::string recorderName;
bool valid = false;
};
Action StartRecorder() {
return Action(new StartRecorderClass);
}
}

View File

@ -0,0 +1,53 @@
#pragma once
#include <sched_action.h>
#include <utils/freq_formatting.h>
namespace sched_action {
class TuneVFOClass : public ActionClass {
public:
TuneVFOClass() {}
~TuneVFOClass() {}
void trigger() {
}
void prepareEditMenu() {}
void validateEditMenu() {}
void showEditMenu() {
}
void loadFromConfig(json config) {
if (config.contains("vfo")) { vfoName = config["vfo"]; }
if (config.contains("frequency")) { frequency = config["frequency"]; }
}
json saveToConfig() {
json config;
config["vfo"] = vfoName;
config["frequency"] = frequency;
return config;
}
std::string getName() {
return "Tune \"" + vfoName + "\" to " + utils::formatFreq(frequency);
}
bool isValid() {
return valid;
}
private:
std::string vfoName;
double frequency;
bool valid = false;
};
Action TuneVFO() {
return Action(new TuneVFOClass);
}
}