#----- ILM level meter

proc makeIlm args {
  scanargs $args var -channels 1 -port 0
  makenv lev ilm -port $port $channels
  clientput "makeILM $port"
  if {$channels == 1} {
    appendVars lev/%/HeLevel/11
  } else {
    appendVars lev/%/HeLevel/11
  }
  helium_register _lev /lev
}

proc makeIpsLev args {
  scanargs $args var -controller _mf -port 0 -slot DB3
  clientput "makeIpsLev $port $controller"
  makenv lev -driver ipslev -port $port -controller $controller $slot
  GraphAdd lev % He_level brown
  GraphAdd lev.n2 % N2_level black
  helium_register _mf /lev
}

proc helevel {} {
  if {"[sicsdescriptor lev]" == "ILM"} {
    return [result lev]
  } else {
    return [result tt he]
  }
}

publishLazy helevel
