Skip to content

Commit

Permalink
update according to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Oct 21, 2023
1 parent 50cc007 commit 9fae2e9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CelestiaComponent/CelestiaAppCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ void CelestiaAppCore::Show##flag##Labels(bool value) \

void CelestiaAppCore::DateFormat(int32_t dateFormat)
{
core->setDateFormat(static_cast<astro::Date::Format>(dateFormat));
core->setDateFormat(static_cast<celestia::astro::Date::Format>(dateFormat));
}

float CelestiaAppCore::AmbientLightLevel()
Expand Down
14 changes: 7 additions & 7 deletions CelestiaComponent/CelestiaDMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace winrt::CelestiaComponent::implementation
{
CelestiaDMS::CelestiaDMS(int32_t degrees, int32_t minutes, double seconds) : CelestiaDMST<CelestiaDMS>()
{
decimal = astro::degMinSecToDecimal(static_cast<int>(degrees), static_cast<int>(minutes), static_cast<double>(seconds));
decimal = celestia::astro::degMinSecToDecimal(static_cast<int>(degrees), static_cast<int>(minutes), static_cast<double>(seconds));
}

CelestiaDMS::CelestiaDMS(double decimal) : CelestiaDMST<CelestiaDMS>(), decimal(decimal)
Expand All @@ -32,7 +32,7 @@ namespace winrt::CelestiaComponent::implementation
int degrees;
int minutes;
double seconds;
astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
celestia::astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
return static_cast<int32_t>(degrees);
}

Expand All @@ -41,7 +41,7 @@ namespace winrt::CelestiaComponent::implementation
int degrees;
int minutes;
double seconds;
astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
celestia::astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
return static_cast<int32_t>(minutes);
}

Expand All @@ -50,7 +50,7 @@ namespace winrt::CelestiaComponent::implementation
int degrees;
int minutes;
double seconds;
astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
celestia::astro::decimalToDegMinSec(decimal, degrees, minutes, seconds);
return seconds;
}

Expand All @@ -59,7 +59,7 @@ namespace winrt::CelestiaComponent::implementation
int hours;
int minutes;
double seconds;
astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
celestia::astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
return static_cast<int32_t>(hours);
}

Expand All @@ -68,7 +68,7 @@ namespace winrt::CelestiaComponent::implementation
int hours;
int minutes;
double seconds;
astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
celestia::astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
return static_cast<int32_t>(minutes);
}

Expand All @@ -77,7 +77,7 @@ namespace winrt::CelestiaComponent::implementation
int hours;
int minutes;
double seconds;
astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
celestia::astro::decimalToHourMinSec(decimal, hours, minutes, seconds);
return seconds;
}

Expand Down
12 changes: 6 additions & 6 deletions CelestiaComponent/CelestiaHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ namespace winrt::CelestiaComponent::implementation
int era = c.Era();
int year = c.Year();
if (era < 1) year = 1 - year;
astro::Date astroDate(year, c.Month(), c.Day());
celestia::astro::Date astroDate(year, c.Month(), c.Day());
astroDate.hour = c.Hour();
astroDate.minute = c.Minute();
astroDate.seconds = static_cast<double>(c.Second()) + static_cast<double>(c.Nanosecond()) / 1000000000.0;
return astro::UTCtoTDB(astroDate);
return celestia::astro::UTCtoTDB(astroDate);
}

Windows::Foundation::DateTime CelestiaHelper::DateTimeFromJulianDay(double julianDay)
Expand All @@ -42,7 +42,7 @@ namespace winrt::CelestiaComponent::implementation
c.ChangeClock(Windows::Globalization::ClockIdentifiers::TwentyFourHour());
c.ChangeCalendarSystem(Windows::Globalization::CalendarIdentifiers::Gregorian());
c.ChangeTimeZone(L"UTC");
astro::Date astroDate = astro::TDBtoUTC(julianDay);
celestia::astro::Date astroDate = celestia::astro::TDBtoUTC(julianDay);
int year = astroDate.year;

int era = 1;
Expand Down Expand Up @@ -121,15 +121,15 @@ namespace winrt::CelestiaComponent::implementation
{
auto obj = get_self<CelestiaVector>(ecliptic);
auto v = Eigen::Vector3d(obj->X(), obj->Y(), obj->Z());
auto transformed = astro::eclipticToEquatorial(v);
auto transformed = celestia::astro::eclipticToEquatorial(v);
return make<CelestiaVector>(transformed.x(), transformed.y(), transformed.z());
}

CelestiaComponent::CelestiaVector CelestiaHelper::EquatorialToGalactic(CelestiaComponent::CelestiaVector const& equatorial)
{
auto obj = get_self<CelestiaVector>(equatorial);
auto v = Eigen::Vector3d(obj->X(), obj->Y(), obj->Z());
auto transformed = astro::equatorialToGalactic(v);
auto transformed = celestia::astro::equatorialToGalactic(v);
return make<CelestiaVector>(transformed.x(), transformed.y(), transformed.z());
}

Expand All @@ -147,6 +147,6 @@ namespace winrt::CelestiaComponent::implementation

double CelestiaHelper::AUToKilometers(double au)
{
return astro::AUtoKilometers(au);
return celestia::astro::AUtoKilometers(au);
}
}
2 changes: 1 addition & 1 deletion CelestiaComponent/CelestiaSimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace winrt::CelestiaComponent::implementation
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::KM:
distance = distanceValue;
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::AU:
distance = astro::AUtoKilometers(distanceValue);
distance = celestia::astro::AUtoKilometers(distanceValue);
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::Radii:
distance = radius * distanceValue;
}
Expand Down

0 comments on commit 9fae2e9

Please sign in to comment.