mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-30 09:37:53 -04:00
Radiosonde-vaisala-add-temp-humidity
Also added the fields "DateTime" which just shows the raw timestamp that portapack assigned the last packet received, in the format: YYYYMMDDHHMMSS ... And "Frame" which shows the packet # (or frame) for correlating with other software / verify that there are new packets being received. Also moved a string function for returning rounded-up decimals, originally inside the whipcalc tool app, into the string_format functions library, because I used that function on TEMP and HUMIDITY values inisde the radiosonde app. Finally, the whole UI has its widgets moved a bit, giving space for these new parameters.
This commit is contained in:
parent
c626d83c3b
commit
13abb620f6
8 changed files with 409 additions and 134 deletions
|
@ -224,3 +224,13 @@ std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precisi
|
|||
|
||||
return string;
|
||||
}
|
||||
|
||||
double get_decimals(double num, int16_t mult, bool round) {
|
||||
num -= int(num); //keep decimals only
|
||||
num *= mult; //Shift decimals into integers
|
||||
if (!round) return num;
|
||||
int16_t intnum = int(num); //Round it up if necessary
|
||||
num -= intnum; //Get decimal part
|
||||
if (num > .5) intnum++; //Round up
|
||||
return intnum;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue