• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Examples and Tutorials
  • FishTank.h

Making an Automation System with HMI GUI

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

Making an Automation System with HMI GUI

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top