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
6
pub fn put_concrete_inputs_container(container: PreStateContainer)
23
6
{
24
6
  put_current_temp(container.api_current_temp);
25
6
  put_desired_temp(container.api_desired_temp);
26
6
}
27

            
28
/// setter for component's incoming port values and GUMBO state variables
29
6
pub fn put_concrete_inputs_container_wGSV(container: PreStateContainer_wGSV)
30
6
{
31
6
  put_lastCmd(container.In_lastCmd);
32
6
  put_current_temp(container.api_current_temp);
33
6
  put_desired_temp(container.api_desired_temp);
34
6
}
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
244
pub fn put_current_temp(value: Isolette_Data_Model::Temp)
58
244
{
59
244
  *extern_api::IN_current_temp.lock().unwrap_or_else(|e| e.into_inner()) = Some(value)
60
244
}
61

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

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

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

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