Files
ePowerSwitch/include/ePowerSwitchFront.h
T
2026-04-30 08:44:40 +02:00

60 lines
1.5 KiB
C++

#ifndef EPOWERSWITCH_FRONTEND_H
#define EPOWERSWITCH_FRONTEND_H
#include "m_epics_ca.h"
#include "tmfe.h"
#include <vector>
class ePowerSwitchEquipment : public TMFeEquipment {
public:
/**
* @brief constructor
*
* @param equipmentName name show on Midas for the equipment
* @param equipmentFileName file name for automatically tagged message
*/
ePowerSwitchEquipment(std::string equipmentName,
const char *equipmentFileName);
/**
* @brief called periodically by Midas
*/
void HandlePeriodic();
private:
std::vector<mEpicsCa<std::string> *> outletSetRecords;
std::vector<mEpicsCa<std::string> *> outletGetRecords;
mEpicsCa<int> outletNumberRecord;
int numberOfOutlet;
/**
* @brief refresh information about the given socket ID
*
* @param socketId which socket to refresh
*/
void refreshSocket(int socketId);
/**
* @brief refresh information about all the available sockets
*/
void refreshAllSockets();
/**
* @brief detect and modify the current socket pool in case of change
*/
void updateSocketNumber();
};
class ePowerSwitchFrontend : public TMFrontend {
public:
/**
* @brief constructor
*
* @param frontendName name shown on Midas for the frontend
* @param equipmentName name shown on Midas for the equipment
*/
ePowerSwitchFrontend(std::string frontendName, std::string equipmentName);
};
#endif