#----- haake -------------
proc makeHaake {{name thermostat} {with2sensors 0}} {
  makenv th haake
  th with2sensors $with2sensors
  Layout haake $name
}

proc haakeLayout {{name ""} args} {
  if {[string compare [sicsdescriptor th] notfound] == 0} return 
  set reset 1
  if {! [result th running]} {
    Style Warning
    Label pump not running
    NoNewline
  }
  if {[result th relais]} {
    Style Warning
    Label relais off
    NoNewline
    set reset 0
  }
  if {[result th overtemp]} {
    Style Warning
    Label over temperature
    NoNewline
    set reset 0
  }
  if {[result th lowlevel]} {
    Style Warning
    Label level too low
    NoNewline
    set reset 0
  }
  if {[result th pumpalarm]} {
    Style Warning
    Label pump alarm
    NoNewline
    set reset 0
  }
  if {[result th externalarm]} {
    Style Warning
    Label external alarm
    NoNewline
    set reset 0
  }
  if {[result th coolalarm]} {
    Style Warning
    Label cooling alarm
    NoNewline
    set reset 0
  }
  if {[result th sensor1alarm]} {
    Style Warning
    Label internal sensor alarm
    NoNewline
    set reset 0
  }
  if {[result th sensor2alarm]} {
    Style Warning
    Label external sensor alarm
    set reset 0
  }
  Newline
  CheckBox "pump running" "th running"
  CheckBox "confirm alarm" "th reset/$reset"
  Tip "check this if an external sample sensor is used"
  if {[result th with2sensors] >= 0} {
    CheckBox "has sample sensor" "th with2sensors"
  }
  if {[result th with2sensors] == 1} {
    CheckBox "control on sample" "th extcontrol"
  }
  Newline
  Tip "set temperature \[Celsius\]"
  Input "$name set T" "run th/[result th targetValue]"
}
