コード例 #1
0
        public static Declination FromSeconds(long secs)
        {
            var dec = new Declination();

            dec._totalSeconds = secs;
            return(dec);
        }
コード例 #2
0
        // Change the seconds component only
        public override bool ChangeSecond(int newSecs)
        {
            long tsecs = _totalSeconds;
            int  hours, mins, secs;

            GetTime(out hours, out mins, out secs);
            var newTime = new Declination(hours, mins, newSecs);

            _totalSeconds = newTime._totalSeconds;
            CheckHours();
            return(tsecs != _totalSeconds);
        }
コード例 #3
0
        public Declination ParseFromMeade(String s)
        {
            Declination result = new Declination();
            // LOGV2(DEBUG_GENERAL, F("Declination.Parse(%s)"), s.c_str());

            // Use the DayTime code to parse it...
            DayTime dt = DayTime.ParseFromMeade(s);

            // ...and then correct for hemisphere
            //result._totalSeconds = dt.TotalSeconds + (NORTHERN_HEMISPHERE? -(ArcSecondsPerHemisphere / 2) : (ArcSecondsPerHemisphere / 2));
            //LOGV3(DEBUG_GENERAL, F("Declination.Parse(%s) -> %s"), s.c_str(), result.ToString());
            result._totalSeconds = dt.TotalSeconds;
            return(result);
        }
コード例 #4
0
        // Change the degree component
        public bool ChangeDegree(int newDegree)
        {
            long tsecs = _totalSeconds;
            int  hours, mins, secs;

            GetTime(out hours, out mins, out secs);
            var newDec = new Declination(newDegree, mins, secs);

            if ((newDegree == 0) && (_totalSeconds != 0))
            {
                _totalSeconds = Math.Sign(_totalSeconds) * newDec._totalSeconds;
            }
            else
            {
                _totalSeconds = newDec._totalSeconds;
            }
            CheckHours();
            return(tsecs != _totalSeconds);
        }
コード例 #5
0
 public Declination(Declination other) : base(other)
 {
 }