spliting in progress

This commit is contained in:
2026-04-30 15:46:07 +02:00
parent 5f1175c5e3
commit 6bac7a5e7b
7 changed files with 179 additions and 63 deletions
+49
View File
@@ -0,0 +1,49 @@
#include "ePowerSwitchFrontend.h"
#include "../device/ePowerSwitchEquipment.h"
#include "ePowerSwitchFrontendConfig.h"
#include "tmfe.h"
int main(int argc, char *argv[]) {
if (argv[0][0] == '.') {
TMFE::Instance()->Msg(MERROR, __FUNCTION__,
"Relative paths are strongly discouraged; "
"please use an absolute path.");
}
std::string frontendName;
std::string equipmentName;
if (argc == 1) {
frontendName = DEFAULT_FRONTEND_NAME;
TMFE::Instance()->Msg(MINFO, __FUNCTION__,
"No frontend name provided; %s will be used",
DEFAULT_FRONTEND_NAME);
equipmentName = DEFAULT_EQUIPMENT_NAME;
TMFE::Instance()->Msg(MINFO, __FUNCTION__,
"No equipment name provided; %s will be used",
DEFAULT_EQUIPMENT_NAME);
}
if (argc == 2) {
frontendName = std::string(argv[1]);
argv++;
argc--;
TMFE::Instance()->Msg(MINFO, __FUNCTION__,
"No equipment name provided; %s will be use",
DEFAULT_EQUIPMENT_NAME);
} else if (argc == 3) {
frontendName = std::string(argv[1]);
equipmentName = std::string(argv[2]);
argv += 2;
argc -= 2;
}
auto front = new ePowerSwitchFrontend(frontendName, equipmentName);
front->FeMain(argc, argv);
}
ePowerSwitchFrontend::ePowerSwitchFrontend(std::string frontendName,
std::string equipmentName) {
FeSetName(frontendName.c_str());
FeAddEquipment(new ePowerSwitchEquipment(equipmentName.c_str(), __FILE__));
}