Ejemplo n.º 1
0
        public movement.MoonDiskStatus RunMoonModule(movement.movementCase mC, double NotchesMoonDisk, double SynoticPhaseThisMoonDiskMinutes, TimeSpan ts, DateTime findPhaseUTC, double LunationsElapsedReal)
        {
            supporting     oMoonK                    = new supporting();
            MoonDiskStatus oMoonDiskStatus           = new MoonDiskStatus();
            makeDisks      oMakeMoonDisk             = new makeDisks();
            Double         SynoticPhase_Minutes_Real = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("SynoticPhase_Minutes_Real"));
            DateTime       KnownFullMoon_UTC_used    = Convert.ToDateTime(ConfigurationSettings.AppSettings.Get("KnownFullMoon_UTC_used"));

            oMoonDiskStatus.LunationsElapsed  = ts.TotalMinutes / SynoticPhaseThisMoonDiskMinutes;
            oMoonDiskStatus.FastOrSlowMinutes = (double)(oMoonDiskStatus.LunationsElapsed - LunationsElapsedReal) * SynoticPhase_Minutes_Real;
            oMoonDiskStatus.TargetDateUTC     = findPhaseUTC;
            oMoonDiskStatus.RefDateUTC        = KnownFullMoon_UTC_used;

            double GearNotches = mC.GetFinalGearPosition(mC);

            double FullMoonOffSet     = NotchesMoonDisk / 4.0;
            double MoonDiskFullTravel = FullMoonOffSet + GearNotches;

            if (MoonDiskFullTravel > NotchesMoonDisk)
            {
                double MoonDiskFactor        = MoonDiskFullTravel / NotchesMoonDisk;
                double OneMoonDiskRevolution = MoonDiskFactor - Math.Floor(MoonDiskFactor);
                MoonDiskFullTravel = OneMoonDiskRevolution * NotchesMoonDisk;
            }

            // for 135 notched disk, here is the legend:
            //new   - full      - new
            //1     - 33.75     - 67.5
            //67.5  - 101.25    - 135

            // for 90 notched disk, here is the legend:
            //new   - full      - new
            //1     - 22.5      - 45
            //45    - 67.5      - 90

            oMoonDiskStatus.NotchPositionOnMoonDisk = MoonDiskFullTravel;

            // close to 0 or 100 percent = Full Moon
            // close to 50 percent = New Moon
            if (MoonDiskFullTravel > FullMoonOffSet * 2)
            {
                MoonDiskFullTravel = MoonDiskFullTravel - FullMoonOffSet * 2;
            }
            double OfCompletePhase = (MoonDiskFullTravel / (FullMoonOffSet * 2)) * 100;

            oMoonDiskStatus.AgeOfMoonDays      = oMoonK.AgeOfMoon(OfCompletePhase, SynoticPhaseThisMoonDiskMinutes);
            oMoonDiskStatus.ofCompletePhasePct = Math.Round(OfCompletePhase, 2);
            double NewCompleteOfPhase = OfCompletePhase + 50;

            if (NewCompleteOfPhase > 100)
            {
                NewCompleteOfPhase = NewCompleteOfPhase - 100;
            }
            oMoonDiskStatus.QuarterStatus      = oMoonK.GetPhaseQuarterStatus(NewCompleteOfPhase);
            oMoonDiskStatus.Notches            = NotchesMoonDisk;
            oMoonDiskStatus.listGearProperties = mC.ListAllProperties(mC, false, "SavedList.txt");
            oMoonDiskStatus.PrecisionYrs       = GetPrecision((double)SynoticPhaseThisMoonDiskMinutes);

            return(oMoonDiskStatus);
        }
Ejemplo n.º 2
0
        public void MakeCompleteMoonDisk()
        {
            movement.supporting     oMoonK          = new movement.supporting();
            movement.MoonRealStatus oMoonRealStatus = new movement.MoonRealStatus();
            movement.makeDisks      mD = new movement.makeDisks();
            movement.movementCase   mC = new movement.movementCase();
            movement.MoonDiskStatus oMoonDiskStatus = new movement.MoonDiskStatus();

            double NotchesMoonDisk = 0;
            double SynoticPhaseThisMoonDiskMinutes = 0;

            DateTime dT = DateTime.Now;
            //DateTime dT = Convert.ToDateTime("Dec 22, 2018 9:48 am");
            //DateTime dT = Convert.ToDateTime("June 13, 2018 12:00 am");
            //DateTime dT = Convert.ToDateTime("Dec. 27, 2118 05:08 PM");
            //DateTime dT = Convert.ToDateTime("Dec. 26, 2140 12:00 AM");
            DateTime findPhaseUTC = dT.ToUniversalTime();

            Double   SynoticPhase_Minutes_Real = Convert.ToDouble(ConfigurationSettings.AppSettings.Get("SynoticPhase_Minutes_Real"));
            DateTime KnownFullMoon_UTC_used    = Convert.ToDateTime(ConfigurationSettings.AppSettings.Get("KnownFullMoon_UTC_used"));

            TimeSpan ts = findPhaseUTC.Subtract(KnownFullMoon_UTC_used);

            // first, get the real moonphase:
            oMoonRealStatus = oMoonK.GetRealMoonPhase(SynoticPhase_Minutes_Real, ts, findPhaseUTC);

            mC = mD.MakeMoonDisk("MakeMoonDisk135Hourly.txt");        // get moonphase for 135 notch disk
            //mC = mD.MakeMoonDisk("MakeMoonDisk90Daily.txt");          // get moonphase for 90 notch disk
            //mC = mD.MakeMoonDisk("MakeMoonDisk59Daily.txt");            // get moonphase for 59 notch disk
            NotchesMoonDisk = oMoonK.GetFinalDiskNotches(mC);

            SynoticPhaseThisMoonDiskMinutes = oMoonK.CalcSynoticPhaseThisMoonDiskMinutes(NotchesMoonDisk,
                                                                                         mC,
                                                                                         movement.supporting._BaseDriverTransmission.smooth,
                                                                                         movement.supporting._BaseDriverStepMethod.runUnder);

            switch (mC.BaseGears[0].DiskBaseUnitDriver)
            {// now get the movement working
            case gears.BaseGear._DiskBaseUnitDriver.hourly:
                mC.incNotches(ref mC, (int)Math.Floor(ts.TotalHours));
                break;

            case gears.BaseGear._DiskBaseUnitDriver.daily:
                mC.incNotches(ref mC, (int)Math.Floor(ts.TotalDays));
                break;
            }
            // get all final moon phase parameters for type of movement and accuracy
            oMoonDiskStatus = oMoonK.RunMoonModule(mC, NotchesMoonDisk, SynoticPhaseThisMoonDiskMinutes, ts, findPhaseUTC, oMoonRealStatus.LunationsElapsed);
        }