FishTank.h
/** * (c)2017 CDP Technologies AS */ #ifndef TANKCONTROLLIB_FISHTANK_H #define TANKCONTROLLIB_FISHTANK_H #include <CDPSystem/Base/CDPComponent.h> #include <Signal/CDPSignal.h> #include <CDPParameter/CDPParameter.h> #include <CDPAlarm/CDPAlarm.h> namespace TankControlLib { class FishTank : public CDPComponent { public: FishTank(); ~FishTank() override; void Create(const char* fullName) override; void CreateModel() override; void Configure(const char* componentXML) override; void ProcessNull() override; void ProcessFilling(); void ProcessFeeding(); void ProcessFeedingStopped(); void ProcessAutoStarting(); bool TransitionFeedingToFeedingStopped(); bool TransitionAutoStartingToFeeding(); bool TransitionFeedingStoppedToFilling(); bool TransitionFillingToFeedingStopped(); bool TransitionFeedingStoppedToFeeding(); bool TransitionFeedingStoppedToAutoStarting(); bool TransitionAutoStartingToFeedingStopped(); bool TransitionNullToFeedingStopped(); int MessageAutoStartFeeding(void* message); int MessageStartFeeding(void* message); int MessageStop(void* message); int MessageStartFilling(void* message); int MessageSpeedUp(void* message); int MessageSpeedDown(void* message); protected: CDPParameter AlarmLevelLow; CDPParameter AlarmLevelExtremeLow; CDPParameter MaxValue; CDPParameter FillingSpeed; CDPSignal<bool> FeedingInProgress; CDPSignal<bool> FillScrewActive; CDPSignal<bool> AlarmLow; CDPSignal<bool> AlarmExtremeLow; CDPSignal<bool> BlowerActive; CDPSignal<double> TankLevel; CDPSignal<double> ScrewSpeed; CDPSignal<double> FillAmount; CDPSignal<double> FeedAmount; CDPSignal<double> RemainingTime; CDPSignal<double> StartTime; CDPSignal<bool> ScrewActive; CDPSignal<bool> PauseButton; CDPSignal<bool> MaxLevelAlarm; CDPSignal<double> TimeFeeded; CDPSignal<int> AlarmStatus; using CDPComponent::requestedState; using CDPComponent::ts; using CDPComponent::fs; private: void processAlarms(); bool m_feedingInitialized; }; } // namespace TankControlLib #endif
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.