/** * Set the QNH setting of the V7 vario */ static inline bool SetQNH(Port &port, OperationEnvironment &env, const AtmosphericPressure &qnh) { char buffer[100]; unsigned QNHinPascal = uround(qnh.GetPascal()); sprintf(buffer, "PLXV0,QNH,W,%u", QNHinPascal); return PortWriteNMEA(port, buffer, env); }
static bool test_qnh_round2() { AtmosphericPressure sp = AtmosphericPressure::Standard().QNHAltitudeToStaticPressure(fixed(100)); AtmosphericPressure pres = AtmosphericPressure::FindQNHFromPressure(sp, fixed(120)); fixed h0 = pres.StaticPressureToQNHAltitude(pres); if (verbose) { printf("%g %g\n", FIXED_DOUBLE(pres.GetPascal()), FIXED_DOUBLE(h0)); } return fabs(h0)<fixed(1); }