Elaboradar  0.1

◆ read_vpr_heating()

int elaboradar::Assets::read_vpr_heating ( ) const

Read the value of $VPR_HEATING (counter of consecutive vpr calculated, see scientific documentation)

Restituisce
0 if the file does not exist or cannot be read
The value of $VPR_HEATING

Definizione alla linea 250 del file assets.cpp.

251 {
252  LOG_CATEGORY("radar.vpr");
253  File in(logging_category);
254  if (!in.open_from_env("VPR_HEATING", "rt"))
255  return 0;
256 
257  int heating;
258  if (fscanf(in, "%i ", &heating) != 1)
259  {
260  LOG_ERROR("Cannot read $VPR_HEATING=%s: %s", in.name(), strerror(errno));
261  return 0;
262  }
263 
264  return heating;
265 }
Open a file taking its name from a given env variable.
Definition: utils.h:22

Referenzia radarelab::File::open_from_env().