1
// Do not edit this file as it will be overwritten if codegen is rerun
2

            
3
use crate::bridge::extern_c_api as extern_api;
4
use data::*;
5

            
6
use proptest::prelude::*;
7

            
8
/// container for component's incoming port values
9
pub struct PreStateContainer {
10
  pub api_current_temp: Isolette_Data_Model::Temp,
11
  pub api_desired_temp: Isolette_Data_Model::Set_Points
12
}
13

            
14
/// container for component's incoming port values and GUMBO state variables
15
pub struct PreStateContainer_wGSV {
16
  pub In_lastCmd: Isolette_Data_Model::On_Off,
17
  pub api_current_temp: Isolette_Data_Model::Temp,
18
  pub api_desired_temp: Isolette_Data_Model::Set_Points
19
}
20

            
21
/// setter for component's incoming port values
22
pub fn put_concrete_inputs_container(container: PreStateContainer)
23
{
24
  put_current_temp(container.api_current_temp);
25
  put_desired_temp(container.api_desired_temp);
26
}
27

            
28
/// setter for component's incoming port values and GUMBO state variables
29
pub fn put_concrete_inputs_container_wGSV(container: PreStateContainer_wGSV)
30
{
31
  put_lastCmd(container.In_lastCmd);
32
  put_current_temp(container.api_current_temp);
33
  put_desired_temp(container.api_desired_temp);
34
}
35

            
36
/// setter for component's incoming port values
37
pub fn put_concrete_inputs(
38
  current_temp: Isolette_Data_Model::Temp,
39
  desired_temp: Isolette_Data_Model::Set_Points)
40
{
41
  put_current_temp(current_temp);
42
  put_desired_temp(desired_temp);
43
}
44

            
45
/// setter for component's incoming port values and GUMBO state variables
46
pub fn put_concrete_inputs_wGSV(
47
  In_lastCmd: Isolette_Data_Model::On_Off,
48
  current_temp: Isolette_Data_Model::Temp,
49
  desired_temp: Isolette_Data_Model::Set_Points)
50
{
51
  put_lastCmd(In_lastCmd);
52
  put_current_temp(current_temp);
53
  put_desired_temp(desired_temp);
54
}
55

            
56
/// setter for IN DataPort
57
4
pub fn put_current_temp(value: Isolette_Data_Model::Temp)
58
4
{
59
4
  *extern_api::IN_current_temp.lock().unwrap_or_else(|e| e.into_inner()) = Some(value)
60
4
}
61

            
62
/// setter for IN DataPort
63
4
pub fn put_desired_temp(value: Isolette_Data_Model::Set_Points)
64
4
{
65
4
  *extern_api::IN_desired_temp.lock().unwrap_or_else(|e| e.into_inner()) = Some(value)
66
4
}
67

            
68
/// getter for OUT DataPort
69
4
pub fn get_heat_control() -> Isolette_Data_Model::On_Off
70
4
{
71
4
  return extern_api::OUT_heat_control.lock().unwrap_or_else(|e| e.into_inner()).expect("Not expecting None")
72
4
}
73

            
74
/// getter for GUMBO State Variable
75
4
pub fn get_lastCmd() -> Isolette_Data_Model::On_Off
76
4
{
77
4
  unsafe {
78
4
    match &crate::app {
79
4
      Some(inner) => inner.lastCmd,
80
      None => panic!("The app is None")
81
    }
82
  }
83
4
}
84

            
85
/// setter for GUMBO State Variable
86
4
pub fn put_lastCmd(value: Isolette_Data_Model::On_Off)
87
4
{
88
4
  unsafe {
89
4
    match &mut crate::app {
90
4
      Some(inner) => inner.lastCmd = value,
91
      None => panic!("The app is None")
92
    }
93
  }
94
4
}