diff --git a/V4/demo/demo.cpp b/V4/demo/demo.cpp index 1cb10a2..ba45699 100644 --- a/V4/demo/demo.cpp +++ b/V4/demo/demo.cpp @@ -131,5 +131,5 @@ int main() { auto duration = std::chrono::duration_cast(stop - start); std::cout << "Mach for CI " << ci << ": " << aioMach << std::endl << std::endl; - std::cout << "END All-In-One, " << duration.count() << std::endl ; + std::cout << "END All-In-One, " << duration.count() << "ns" << std::endl ; } \ No newline at end of file diff --git a/V4/demo/demo.exe b/V4/demo/demo.exe index 4621d25..d3920d5 100644 Binary files a/V4/demo/demo.exe and b/V4/demo/demo.exe differ diff --git a/V4/demo/demo.ilk b/V4/demo/demo.ilk index 626a0c9..4ef3bf3 100644 Binary files a/V4/demo/demo.ilk and b/V4/demo/demo.ilk differ diff --git a/V4/demo/demo.obj b/V4/demo/demo.obj index c37320e..654a55e 100644 Binary files a/V4/demo/demo.obj and b/V4/demo/demo.obj differ diff --git a/V4/demo/demo.pdb b/V4/demo/demo.pdb index 13a873d..0f0eeee 100644 Binary files a/V4/demo/demo.pdb and b/V4/demo/demo.pdb differ diff --git a/V4/demo/vc140.pdb b/V4/demo/vc140.pdb index 07efeb5..1f73603 100644 Binary files a/V4/demo/vc140.pdb and b/V4/demo/vc140.pdb differ diff --git a/V4/econSpd.h b/V4/econSpd.h index 90114ad..6cbce69 100644 --- a/V4/econSpd.h +++ b/V4/econSpd.h @@ -35,10 +35,10 @@ float roundTo(float value, char decimals) { } /// @brief Bounding function for altitudes in accordance with data granularity -/// @param altitude Altitude in FL +/// @param altitude Altitude in ft /// @return Lower bound in FL, upper bound in FL, ratio between bounds that equates to flightLevel -std::tuple boundAltitude(float altitude) { - int flightLevel = (int)(altitude / 1000) * 10; +std::tuple boundAltitude(int altitude) { + int flightLevel = (int)round(altitude / 100.0); float lower = flightLevel - ((flightLevel - MIN_FL) % FL_STP); float upper = (flightLevel - MIN_FL) % FL_STP != 0 ? lower + FL_STP : lower; @@ -51,11 +51,11 @@ std::tuple boundAltitude(float altitude) { /// @param weight Weight in kilogrammes /// @return Lower bound in t, upper bound in t, ratio between bounds that equates to weight std::tuple boundWeight(int weight) { - int wgt = (int)(weight / 1000); + int wgt = (int)round(weight / 1000.0); float lower = wgt - ((wgt - MIN_WGT) % WGT_STP); float upper = (wgt - MIN_WGT) % WGT_STP != 0 ? lower + WGT_STP : lower; - float ratio = (wgt - lower) / WGT_STP; + float ratio = ((weight / 1000.0) - lower) / WGT_STP; return {(int)lower, (int)upper, ratio}; }