//
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only.  Not for
// government, commercial, or other organizational use.
//
// File: Controler.h
//
// Code generated for Simulink model 'Controler'.
//
// Model version                  : 5.115
// Simulink Coder version         : 24.2 (R2024b) 21-Jun-2024
// C/C++ source code generated on : Tue Aug 12 11:26:01 2025
//
// Target selection: ert.tlc
// Embedded hardware selection: Intel->x86-64 (Linux 64)
// Code generation objectives:
//    1. Execution efficiency
//    2. RAM efficiency
// Validation result: Not run
//
#ifndef Controler_h_
#define Controler_h_
#include <cmath>
#include "rtwtypes.h"
#include "rt_nonfinite.h"
#include "Controler_types.h"

extern "C"
{

#include "rtGetNaN.h"

}

// Class declaration for model Controler
class Controler final
{
  // public data and function members
 public:
  // Block signals and states (default storage) for system '<Root>'
  struct DW {
    real_T Integrator_DSTATE;          // '<S95>/Integrator'
    real_T Filter_DSTATE;              // '<S90>/Filter'
    real_T Integrator_DSTATE_o;        // '<S41>/Integrator'
    real_T Filter_DSTATE_m;            // '<S36>/Filter'
  };

  // External inputs (root inport signals with default storage)
  struct ExtU {
    real_T u;                          // '<Root>/u'
    real_T v;                          // '<Root>/v'
    real_T w;                          // '<Root>/w'
    real_T phi;                        // '<Root>/phi'
    real_T theta;                      // '<Root>/theta'
    real_T psi;                        // '<Root>/psi'
    real_T x;                          // '<Root>/x'
    real_T y;                          // '<Root>/y'
    real_T z;                          // '<Root>/z'
    real_T dx;                         // '<Root>/dx'
    real_T dy;                         // '<Root>/dy'
    real_T dz;                         // '<Root>/dz'
    real_T speed_cmd;                  // '<Root>/speed_cmd'
    real_T heading_cmd;                // '<Root>/heading_cmd'
    real_T depth_cmd;                  // '<Root>/depth_cmd'
  };

  // External outputs (root outports fed by signals with default storage)
  struct ExtY {
    real_T MainThrusterSpeedCmd;       // '<Root>/MainThrusterSpeedCmd'
    real_T DirectUpperRudderServoAngleCmd;
                                     // '<Root>/DirectUpperRudderServoAngleCmd'
    real_T DirectLowerRudderServoAngleCmd;
                                     // '<Root>/DirectLowerRudderServoAngleCmd'
    real_T DirectLeftRudderServoAngleCmd;
                                      // '<Root>/DirectLeftRudderServoAngleCmd'
    real_T DirectRightRudderServoAngleCmd;
                                     // '<Root>/DirectRightRudderServoAngleCmd'
    real_T heading_error;              // '<Root>/heading_error'
    real_T pitch_error;                // '<Root>/pitch_error'
    real_T depth_error;                // '<Root>/depth_error'
  };

  // Parameters (default storage)
  struct P {
    struct_n3jlyiLoC0PV1TieyhpPwD pid_depth;// Variable: pid_depth
                                               //  Referenced by:
                                               //    '<S34>/Derivative Gain'
                                               //    '<S38>/Integral Gain'
                                               //    '<S44>/Filter Coefficient'
                                               //    '<S46>/Proportional Gain'

    struct_n3jlyiLoC0PV1TieyhpPwD pid_heading;// Variable: pid_heading
                                                 //  Referenced by:
                                                 //    '<S88>/Derivative Gain'
                                                 //    '<S92>/Integral Gain'
                                                 //    '<S98>/Filter Coefficient'
                                                 //    '<S100>/Proportional Gain'

  };

  // Real-time Model Data Structure
  struct RT_MODEL {
    const char_T * volatile errorStatus;
    const char_T* getErrorStatus() const;
    void setErrorStatus(const char_T* const volatile aErrorStatus);
  };

  // Copy Constructor
  Controler(Controler const&) = delete;

  // Assignment Operator
  Controler& operator= (Controler const&) & = delete;

  // Move Constructor
  Controler(Controler &&) = delete;

  // Move Assignment Operator
  Controler& operator= (Controler &&) = delete;

  // Real-Time Model get method
  Controler::RT_MODEL * getRTM();

  // External inputs
  ExtU rtU;

  // External outputs
  ExtY rtY;

  // model initialize function
  static void initialize();

  // model step function
  void step();

  // Constructor
  Controler();

  // Destructor
  ~Controler();

  // private data and function members
 private:
  // Block states
  DW rtDW;

  // Tunable parameters
  static P rtP;

  // Real-Time Model
  RT_MODEL rtM;
};

//-
//  These blocks were eliminated from the model due to optimizations:
//
//  Block '<S1>/Gain' : Eliminated nontunable gain of 1
//  Block '<S1>/Gain1' : Eliminated nontunable gain of 1


//-
//  The generated code includes comments that allow you to trace directly
//  back to the appropriate location in the model.  The basic format
//  is <system>/block_name, where system is the system number (uniquely
//  assigned by Simulink) and block_name is the name of the block.
//
//  Note that this particular code originates from a subsystem build,
//  and has its own system numbers different from the parent model.
//  Refer to the system hierarchy for this subsystem below, and use the
//  MATLAB hilite_system command to trace the generated code back
//  to the parent model.  For example,
//
//  hilite_system('SimModel0621_S4/Controler')    - opens subsystem SimModel0621_S4/Controler
//  hilite_system('SimModel0621_S4/Controler/Kp') - opens and selects block Kp
//
//  Here is the system hierarchy for this model
//
//  '<Root>' : 'SimModel0621_S4'
//  '<S1>'   : 'SimModel0621_S4/Controler'
//  '<S2>'   : 'SimModel0621_S4/Controler/MATLAB Function1'
//  '<S3>'   : 'SimModel0621_S4/Controler/PID Controller1'
//  '<S4>'   : 'SimModel0621_S4/Controler/PID Controller3'
//  '<S5>'   : 'SimModel0621_S4/Controler/PID Controller1/Anti-windup'
//  '<S6>'   : 'SimModel0621_S4/Controler/PID Controller1/D Gain'
//  '<S7>'   : 'SimModel0621_S4/Controler/PID Controller1/External Derivative'
//  '<S8>'   : 'SimModel0621_S4/Controler/PID Controller1/Filter'
//  '<S9>'   : 'SimModel0621_S4/Controler/PID Controller1/Filter ICs'
//  '<S10>'  : 'SimModel0621_S4/Controler/PID Controller1/I Gain'
//  '<S11>'  : 'SimModel0621_S4/Controler/PID Controller1/Ideal P Gain'
//  '<S12>'  : 'SimModel0621_S4/Controler/PID Controller1/Ideal P Gain Fdbk'
//  '<S13>'  : 'SimModel0621_S4/Controler/PID Controller1/Integrator'
//  '<S14>'  : 'SimModel0621_S4/Controler/PID Controller1/Integrator ICs'
//  '<S15>'  : 'SimModel0621_S4/Controler/PID Controller1/N Copy'
//  '<S16>'  : 'SimModel0621_S4/Controler/PID Controller1/N Gain'
//  '<S17>'  : 'SimModel0621_S4/Controler/PID Controller1/P Copy'
//  '<S18>'  : 'SimModel0621_S4/Controler/PID Controller1/Parallel P Gain'
//  '<S19>'  : 'SimModel0621_S4/Controler/PID Controller1/Reset Signal'
//  '<S20>'  : 'SimModel0621_S4/Controler/PID Controller1/Saturation'
//  '<S21>'  : 'SimModel0621_S4/Controler/PID Controller1/Saturation Fdbk'
//  '<S22>'  : 'SimModel0621_S4/Controler/PID Controller1/Sum'
//  '<S23>'  : 'SimModel0621_S4/Controler/PID Controller1/Sum Fdbk'
//  '<S24>'  : 'SimModel0621_S4/Controler/PID Controller1/Tracking Mode'
//  '<S25>'  : 'SimModel0621_S4/Controler/PID Controller1/Tracking Mode Sum'
//  '<S26>'  : 'SimModel0621_S4/Controler/PID Controller1/Tsamp - Integral'
//  '<S27>'  : 'SimModel0621_S4/Controler/PID Controller1/Tsamp - Ngain'
//  '<S28>'  : 'SimModel0621_S4/Controler/PID Controller1/postSat Signal'
//  '<S29>'  : 'SimModel0621_S4/Controler/PID Controller1/preInt Signal'
//  '<S30>'  : 'SimModel0621_S4/Controler/PID Controller1/preSat Signal'
//  '<S31>'  : 'SimModel0621_S4/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel'
//  '<S32>'  : 'SimModel0621_S4/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone'
//  '<S33>'  : 'SimModel0621_S4/Controler/PID Controller1/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled'
//  '<S34>'  : 'SimModel0621_S4/Controler/PID Controller1/D Gain/Internal Parameters'
//  '<S35>'  : 'SimModel0621_S4/Controler/PID Controller1/External Derivative/Error'
//  '<S36>'  : 'SimModel0621_S4/Controler/PID Controller1/Filter/Disc. Forward Euler Filter'
//  '<S37>'  : 'SimModel0621_S4/Controler/PID Controller1/Filter ICs/Internal IC - Filter'
//  '<S38>'  : 'SimModel0621_S4/Controler/PID Controller1/I Gain/Internal Parameters'
//  '<S39>'  : 'SimModel0621_S4/Controler/PID Controller1/Ideal P Gain/Passthrough'
//  '<S40>'  : 'SimModel0621_S4/Controler/PID Controller1/Ideal P Gain Fdbk/Disabled'
//  '<S41>'  : 'SimModel0621_S4/Controler/PID Controller1/Integrator/Discrete'
//  '<S42>'  : 'SimModel0621_S4/Controler/PID Controller1/Integrator ICs/Internal IC'
//  '<S43>'  : 'SimModel0621_S4/Controler/PID Controller1/N Copy/Disabled'
//  '<S44>'  : 'SimModel0621_S4/Controler/PID Controller1/N Gain/Internal Parameters'
//  '<S45>'  : 'SimModel0621_S4/Controler/PID Controller1/P Copy/Disabled'
//  '<S46>'  : 'SimModel0621_S4/Controler/PID Controller1/Parallel P Gain/Internal Parameters'
//  '<S47>'  : 'SimModel0621_S4/Controler/PID Controller1/Reset Signal/Disabled'
//  '<S48>'  : 'SimModel0621_S4/Controler/PID Controller1/Saturation/Enabled'
//  '<S49>'  : 'SimModel0621_S4/Controler/PID Controller1/Saturation Fdbk/Disabled'
//  '<S50>'  : 'SimModel0621_S4/Controler/PID Controller1/Sum/Sum_PID'
//  '<S51>'  : 'SimModel0621_S4/Controler/PID Controller1/Sum Fdbk/Disabled'
//  '<S52>'  : 'SimModel0621_S4/Controler/PID Controller1/Tracking Mode/Disabled'
//  '<S53>'  : 'SimModel0621_S4/Controler/PID Controller1/Tracking Mode Sum/Passthrough'
//  '<S54>'  : 'SimModel0621_S4/Controler/PID Controller1/Tsamp - Integral/TsSignalSpecification'
//  '<S55>'  : 'SimModel0621_S4/Controler/PID Controller1/Tsamp - Ngain/Passthrough'
//  '<S56>'  : 'SimModel0621_S4/Controler/PID Controller1/postSat Signal/Forward_Path'
//  '<S57>'  : 'SimModel0621_S4/Controler/PID Controller1/preInt Signal/Internal PreInt'
//  '<S58>'  : 'SimModel0621_S4/Controler/PID Controller1/preSat Signal/Forward_Path'
//  '<S59>'  : 'SimModel0621_S4/Controler/PID Controller3/Anti-windup'
//  '<S60>'  : 'SimModel0621_S4/Controler/PID Controller3/D Gain'
//  '<S61>'  : 'SimModel0621_S4/Controler/PID Controller3/External Derivative'
//  '<S62>'  : 'SimModel0621_S4/Controler/PID Controller3/Filter'
//  '<S63>'  : 'SimModel0621_S4/Controler/PID Controller3/Filter ICs'
//  '<S64>'  : 'SimModel0621_S4/Controler/PID Controller3/I Gain'
//  '<S65>'  : 'SimModel0621_S4/Controler/PID Controller3/Ideal P Gain'
//  '<S66>'  : 'SimModel0621_S4/Controler/PID Controller3/Ideal P Gain Fdbk'
//  '<S67>'  : 'SimModel0621_S4/Controler/PID Controller3/Integrator'
//  '<S68>'  : 'SimModel0621_S4/Controler/PID Controller3/Integrator ICs'
//  '<S69>'  : 'SimModel0621_S4/Controler/PID Controller3/N Copy'
//  '<S70>'  : 'SimModel0621_S4/Controler/PID Controller3/N Gain'
//  '<S71>'  : 'SimModel0621_S4/Controler/PID Controller3/P Copy'
//  '<S72>'  : 'SimModel0621_S4/Controler/PID Controller3/Parallel P Gain'
//  '<S73>'  : 'SimModel0621_S4/Controler/PID Controller3/Reset Signal'
//  '<S74>'  : 'SimModel0621_S4/Controler/PID Controller3/Saturation'
//  '<S75>'  : 'SimModel0621_S4/Controler/PID Controller3/Saturation Fdbk'
//  '<S76>'  : 'SimModel0621_S4/Controler/PID Controller3/Sum'
//  '<S77>'  : 'SimModel0621_S4/Controler/PID Controller3/Sum Fdbk'
//  '<S78>'  : 'SimModel0621_S4/Controler/PID Controller3/Tracking Mode'
//  '<S79>'  : 'SimModel0621_S4/Controler/PID Controller3/Tracking Mode Sum'
//  '<S80>'  : 'SimModel0621_S4/Controler/PID Controller3/Tsamp - Integral'
//  '<S81>'  : 'SimModel0621_S4/Controler/PID Controller3/Tsamp - Ngain'
//  '<S82>'  : 'SimModel0621_S4/Controler/PID Controller3/postSat Signal'
//  '<S83>'  : 'SimModel0621_S4/Controler/PID Controller3/preInt Signal'
//  '<S84>'  : 'SimModel0621_S4/Controler/PID Controller3/preSat Signal'
//  '<S85>'  : 'SimModel0621_S4/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel'
//  '<S86>'  : 'SimModel0621_S4/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone'
//  '<S87>'  : 'SimModel0621_S4/Controler/PID Controller3/Anti-windup/Disc. Clamping Parallel/Dead Zone/Enabled'
//  '<S88>'  : 'SimModel0621_S4/Controler/PID Controller3/D Gain/Internal Parameters'
//  '<S89>'  : 'SimModel0621_S4/Controler/PID Controller3/External Derivative/Error'
//  '<S90>'  : 'SimModel0621_S4/Controler/PID Controller3/Filter/Disc. Forward Euler Filter'
//  '<S91>'  : 'SimModel0621_S4/Controler/PID Controller3/Filter ICs/Internal IC - Filter'
//  '<S92>'  : 'SimModel0621_S4/Controler/PID Controller3/I Gain/Internal Parameters'
//  '<S93>'  : 'SimModel0621_S4/Controler/PID Controller3/Ideal P Gain/Passthrough'
//  '<S94>'  : 'SimModel0621_S4/Controler/PID Controller3/Ideal P Gain Fdbk/Disabled'
//  '<S95>'  : 'SimModel0621_S4/Controler/PID Controller3/Integrator/Discrete'
//  '<S96>'  : 'SimModel0621_S4/Controler/PID Controller3/Integrator ICs/Internal IC'
//  '<S97>'  : 'SimModel0621_S4/Controler/PID Controller3/N Copy/Disabled'
//  '<S98>'  : 'SimModel0621_S4/Controler/PID Controller3/N Gain/Internal Parameters'
//  '<S99>'  : 'SimModel0621_S4/Controler/PID Controller3/P Copy/Disabled'
//  '<S100>' : 'SimModel0621_S4/Controler/PID Controller3/Parallel P Gain/Internal Parameters'
//  '<S101>' : 'SimModel0621_S4/Controler/PID Controller3/Reset Signal/Disabled'
//  '<S102>' : 'SimModel0621_S4/Controler/PID Controller3/Saturation/Enabled'
//  '<S103>' : 'SimModel0621_S4/Controler/PID Controller3/Saturation Fdbk/Disabled'
//  '<S104>' : 'SimModel0621_S4/Controler/PID Controller3/Sum/Sum_PID'
//  '<S105>' : 'SimModel0621_S4/Controler/PID Controller3/Sum Fdbk/Disabled'
//  '<S106>' : 'SimModel0621_S4/Controler/PID Controller3/Tracking Mode/Disabled'
//  '<S107>' : 'SimModel0621_S4/Controler/PID Controller3/Tracking Mode Sum/Passthrough'
//  '<S108>' : 'SimModel0621_S4/Controler/PID Controller3/Tsamp - Integral/TsSignalSpecification'
//  '<S109>' : 'SimModel0621_S4/Controler/PID Controller3/Tsamp - Ngain/Passthrough'
//  '<S110>' : 'SimModel0621_S4/Controler/PID Controller3/postSat Signal/Forward_Path'
//  '<S111>' : 'SimModel0621_S4/Controler/PID Controller3/preInt Signal/Internal PreInt'
//  '<S112>' : 'SimModel0621_S4/Controler/PID Controller3/preSat Signal/Forward_Path'

#endif                                 // Controler_h_

//
// File trailer for generated code.
//
// [EOF]
//
