/* * ProfilerPlaneSimulatorV.hh * * Created on: Oct 19, 2015 * Author: Hovanes Egiyan */ #ifndef PROFILERPLANESIMULATORV_HH_ #define PROFILERPLANESIMULATORV_HH_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ProfilerDetComponent.hh" #include "ProfilerPVs.hh" #include "ProfilerPlaneSliceSimulator.hh" class ProfilerPlaneSimulatorV: public ProfilerDetComponent { protected: // Number of microseconds to sleep static unsigned ppsvSleepTime; public: // Main constructor ProfilerPlaneSimulatorV( ProfilerDetector* det, const bool reversedAxis ); // Copy constructor ProfilerPlaneSimulatorV( const ProfilerPlaneSimulatorV& p ); // Destructor virtual ~ProfilerPlaneSimulatorV(); // Assignment operator ProfilerPlaneSimulatorV& operator=( const ProfilerPlaneSimulatorV& p ); // Implement the method for creating the slices virtual void createSlices(); // Method to start a new plane simulator thread. Should be called from the detector // only after the PVs are connected. virtual void startMainThread(); // Simulated the random values. virtual void simulateValues(); // Publish values to EPICS. virtual void publishValues() = 0; virtual ProfilerPVs* setPVs( ProfilerPVs* pv ); // Static method that is invoked by the new thread for this plan simulation static void* threadFunc( void* argPtr ); // get amount for sleep time before updates. Overrides the method from ProfilerPlaneV // since we need to update the values faster than the profiler reads them. virtual unsigned getSleepTime() const { return ppsvSleepTime; } virtual unsigned setSleepTime( const unsigned time ) { return (ppsvSleepTime = time); } }; #endif /* PROFILERPLANESIMULATORV_HH_ */