mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-12 20:15:37 +02:00
Beginning of scheduler code
This commit is contained in:
46
misc_modules/scheduler/src/actions/start_recorder.h
Normal file
46
misc_modules/scheduler/src/actions/start_recorder.h
Normal 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);
|
||||
}
|
||||
}
|
53
misc_modules/scheduler/src/actions/tune_vfo.h
Normal file
53
misc_modules/scheduler/src/actions/tune_vfo.h
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user