private void DoTest() { WaitForMorning(); TrackerState = State.Testing; var daylight = false; var time = DateTime.Now.Date; while (true) { var sun = SunEquations.CalcSun(Configuration.Latitude, Configuration.Longitude, time); if (sun.dark == false) { daylight = true; } if (daylight) { if (sun.dark) { break; } TrackTo(sun); } time = time.AddMinutes(10); } WaitForMorning(); TrackerState = State.Standby; }
private void DefaultSettings() { //45.936527, -75.091259 Lac Simon Latitude = (float)SunEquations.DegreesMinuteSecondDecimalDegrees("45.56.12"); Longitude = (float)SunEquations.DegreesMinuteSecondDecimalDegrees("-75.5.32"); MaximumElevation = 85; MinimumElevation = 15; EastAzimuth = 120; WestAzimuth = 250; VerticalLength = 8; HorizontalLength = 12; VerticalSpeed = 35; HorizontalSpeed = 35; DualAxis = false; Save(); }
private void CheckSunTimerFunction(object state) { try { var sun = SunEquations.CalcSun(Configuration.Latitude, Configuration.Longitude, DateTime.Now); SunAzimuth = sun.azimuth; SunElevation = sun.elevation; if (sun.dark && TrackerState != State.Dark) { WaitForMorning(); TrackerState = State.Dark; } // move array when sun moves 5 degrees past current position if (!sun.dark) { TrackerState = State.Tracking; TrackTo(sun); } } catch (Exception) { DebugLogger.TryLog("Worker threw an exception"); } }