60 lines
1.4 KiB
C++
60 lines
1.4 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 contructor
|
|
*
|
|
* @param equipmentName name show on midas for the equipment
|
|
* @param equipmentFileName file name for automatic tagged message
|
|
*/
|
|
ePowerSwitchEquipment(std::string equipmentName,
|
|
const char *equipmentFileName);
|
|
|
|
/**
|
|
* @brief call periodicly by midas
|
|
*/
|
|
void HandlePeriodic();
|
|
|
|
private:
|
|
std::vector<mEpicsCa<int> *> outletCommandRecords;
|
|
std::vector<int> outletLastState;
|
|
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 socket
|
|
*/
|
|
void refreshAllSockets();
|
|
|
|
/**
|
|
* @brief detect and modify the current socket pool in case of change
|
|
*/
|
|
void updateSocketNumber();
|
|
};
|
|
|
|
class ePowerSwitchFrontend : public TMFrontend {
|
|
public:
|
|
/**
|
|
* @brief contructor
|
|
*
|
|
* @param frontendName name show on midas for the frontend
|
|
* @param equipmentName name show on midas for the equipment
|
|
*/
|
|
ePowerSwitchFrontend(std::string frontendName, std::string equipmentName);
|
|
};
|
|
|
|
#endif |