namespace eval OOspec {} {
}
# OceanOptics spectrometer over python
proc stdConfig::OOspec {} {
  controller std "\n" 15 
  prop startcmd "*IDN?"
  
  pollperiod 15 15

  obj OOspec  -none
   kids OOSpectrometer {
    node peak1 rd
    prop read OOspec::measure
    node peak2 upd
    node peak3 upd
    node peak4 upd
    node peak5 upd
    node peak6 upd
    node peak7 upd
    node peak8 upd
   }

}




proc OOspec::measure {} {
    sct send "AQUIRE"
    return OOspec::update
  }


proc OOspec::update {} {
  set output [sct result]
  set items [split $output " "]
 
  updateval [sct parent]/peak1 [lindex $items 0]
  updateval [sct parent]/peak2 [lindex $items 1]
  updateval [sct parent]/peak3 [lindex $items 2]
  updateval [sct parent]/peak4 [lindex $items 3]
  updateval [sct parent]/peak5 [lindex $items 4]
  updateval [sct parent]/peak6 [lindex $items 5]
  updateval [sct parent]/peak7 [lindex $items 6]
  updateval [sct parent]/peak8 [lindex $items 7]
    return idle
}
