Elaboradar  0.1
 Tutto Classi Namespace File Funzioni Variabili Tipi enumerati (enum) Gruppi
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 248 del file assets.cpp.

Referenzia radarelab::File::open_from_env().

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