FACT++  1.0
template<class T , class S >
int StateMachineBias< T, S >::ExpertLoadMapFile ( const EventImp evt)
inlineprivate

Definition at line 1808 of file biasctrl.cc.

References EventImp::GetSize(), EventImp::GetString(), EventImp::GetText(), Agilent::State::kVoltageOff, BiasMap::Read(), BiasMap::Vgapd(), BiasMap::Voffset(), and BiasMap::Vslope().

Referenced by StateMachineBias< T, S >::StateMachineBias().

1809  {
1810  if (evt.GetSize()==0)
1811  {
1812  T::Warn("ExpertLoadMapFile - No file name given.");
1813  return T::GetCurrentState();
1814  }
1815 
1816  if (fBias.GetStatus()!=State::kVoltageOff)
1817  {
1818  T::Warn("ExpertLoadMapFile - Voltage must have been turned off.");
1819  return T::GetCurrentState();
1820  }
1821 
1822  BiasMap map;
1823 
1824  try
1825  {
1826  map.Read(evt.GetText());
1827  }
1828  catch (const runtime_error &e)
1829  {
1830  T::Warn("Getting reference voltages failed: "+string(e.what()));
1831  return T::GetCurrentState();
1832  }
1833 
1834  if (!fBias.SetReferences(map.Vgapd(), map.Voffset(), map.Vslope()))
1835  {
1836  T::Warn("Setting reference voltages failed.");
1837  return T::GetCurrentState();
1838  }
1839 
1840  fBias.UpdateVA();
1841 
1842  T::Info("Successfully loaded new mapping '"+evt.GetString()+"'");
1843 
1844  return T::GetCurrentState();
1845  }
std::vector< float > Vslope() const
Definition: PixelMap.h:354
const char * GetText() const
Definition: EventImp.h:88
std::string GetString() const
Definition: EventImp.cc:194
std::vector< float > Voffset() const
Definition: PixelMap.h:341
std::vector< float > Vgapd() const
Definition: PixelMap.h:329
bool Read(const std::string &fname)
Definition: PixelMap.h:226
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: