示例#1
0
	def onDecr(self, evt):
		# Not available for near-bc time
		if int(self.year.GetValue()) <= 1:
			return

		idx = self.rectcb.GetCurrentSelection()

		y, m, d, h, mi, s = int(self.year.GetValue()), int(self.month.GetValue()), int(self.day.GetValue()), int(self.hour.GetValue()), int(self.minute.GetValue()), int(self.sec.GetValue())
		if idx == PrimDirsListFrame.SEC1 or idx == PrimDirsListFrame.SEC5 or idx == PrimDirsListFrame.SEC10:
			ssub = 1
			if idx == PrimDirsListFrame.SEC5:
				ssub = 5
			if idx == PrimDirsListFrame.SEC10:
				ssub = 10
			y, m, d, h, mi, s = util.subtractSecs(y, m, d, h, mi, s, ssub)
		else:
			msub = 1
			if idx == PrimDirsListFrame.MIN5:
				msub = 5
			if idx == PrimDirsListFrame.MIN10:
				msub = 10
			y, m, d, h, mi = util.subtractMins(y, m, d, h, mi, msub)

		self.year.SetValue(str(y))
		self.month.SetValue(str(m).zfill(2))
		self.day.SetValue(str(d).zfill(2))
		self.hour.SetValue(str(h))
		self.minute.SetValue(str(mi).zfill(2))
		self.sec.SetValue(str(s).zfill(2))
示例#2
0
	def getDateSecond(self, tim, place, newmoonorig):
		h, m, s = util.decToDeg(tim.time) 
		y, mo, d = tim.year, tim.month, tim.day
		y, mo, d, h, m = util.addMins(y, mo, d, h, m, 1)

		tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)

		while True:
			h, m, s = util.decToDeg(tim.time) 
			y, mo, d = tim.year, tim.month, tim.day
			y, mo, d, h, m, s = util.subtractSecs(y, mo, d, h, m, s, 1)
			if y == 0:
				y = 1
				tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)
				return True, tim, True

			tim = chart.Time(y, mo, d, h, m, s, False, tim.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)

			sun = planets.Planet(tim.jd, astrology.SE_SUN, self.flags)
			moon = planets.Planet(tim.jd, astrology.SE_MOON, self.flags)
			lonsun = sun.data[planets.Planet.LONG]
			lonmoon = moon.data[planets.Planet.LONG]

			d, m, s = util.decToDeg(lonsun)
			lonsun = d+m/60.0+s/3600.0
			d, m, s = util.decToDeg(lonmoon)
			lonmoon = d+m/60.0+s/3600.0

			diff = lonmoon-lonsun
			newmoon, ready = self.isNewMoon(diff)
			if newmoon != newmoonorig or ready:
				return True, tim, ready

		return False, tim
	def onDecr(self, evt):
		# Not available for near-bc time
		if int(self.year.GetValue()) <= 1:
			return

		idx = self.rectcb.GetCurrentSelection()

		y, m, d, h, mi, s = int(self.year.GetValue()), int(self.month.GetValue()), int(self.day.GetValue()), int(self.hour.GetValue()), int(self.minute.GetValue()), int(self.sec.GetValue())
		if idx == PrimDirsListFrame.SEC1 or idx == PrimDirsListFrame.SEC5 or idx == PrimDirsListFrame.SEC10:
			ssub = 1
			if idx == PrimDirsListFrame.SEC5:
				ssub = 5
			if idx == PrimDirsListFrame.SEC10:
				ssub = 10
			y, m, d, h, mi, s = util.subtractSecs(y, m, d, h, mi, s, ssub)
		else:
			msub = 1
			if idx == PrimDirsListFrame.MIN5:
				msub = 5
			if idx == PrimDirsListFrame.MIN10:
				msub = 10
			y, m, d, h, mi = util.subtractMins(y, m, d, h, mi, msub)

		self.year.SetValue(str(y))
		self.month.SetValue(str(m).zfill(2))
		self.day.SetValue(str(d).zfill(2))
		self.hour.SetValue(str(h))
		self.minute.SetValue(str(mi).zfill(2))
		self.sec.SetValue(str(s).zfill(2))
示例#4
0
 def onDecrSec(self, event):
     y, m, d, h, mi, s = util.subtractSecs(self.chart.time.origyear,
                                           self.chart.time.origmonth,
                                           self.chart.time.origday,
                                           self.chart.time.hour,
                                           self.chart.time.minute,
                                           self.chart.time.second, 1)
     self.show(y, m, d, h, mi, s)
示例#5
0
    def getDateSecond(self, tim, place, newmoonorig):
        h, m, s = util.decToDeg(tim.time)
        y, mo, d = tim.year, tim.month, tim.day
        y, mo, d, h, m = util.addMins(y, mo, d, h, m, 1)

        tim = chart.event.DateTime(y, mo, d, h, m, s, False, tim.cal,
                                   chart.event.DateTime.GREENWICH, True, 0, 0,
                                   False, place, False)

        while True:
            h, m, s = util.decToDeg(tim.time)
            y, mo, d = tim.year, tim.month, tim.day
            y, mo, d, h, m, s = util.subtractSecs(y, mo, d, h, m, s, 1)
            if y == 0:
                y = 1
                tim = chart.event.DateTime(y, mo, d, h, m, s, False, tim.cal,
                                           chart.event.DateTime.GREENWICH,
                                           True, 0, 0, False, place, False)
                return True, tim, True

            tim = chart.event.DateTime(y, mo, d, h, m, s, False, tim.cal,
                                       chart.event.DateTime.GREENWICH, True, 0,
                                       0, False, place, False)

            sun = planets.Planet(tim.jd, astrology.SE_SUN, self.flags)
            moon = planets.Planet(tim.jd, astrology.SE_MOON, self.flags)
            lonsun = sun.data[planets.Planet.LONG]
            lonmoon = moon.data[planets.Planet.LONG]

            d, m, s = util.decToDeg(lonsun)
            lonsun = d + m / 60.0 + s / 3600.0
            d, m, s = util.decToDeg(lonmoon)
            lonmoon = d + m / 60.0 + s / 3600.0

            diff = lonmoon - lonsun
            newmoon, ready = self.isNewMoon(diff)
            if newmoon != newmoonorig or ready:
                return True, tim, ready

        return False, tim
	def onDecrSec(self, event):
		y, m, d, h, mi, s = util.subtractSecs(self.chart.time.origyear, self.chart.time.origmonth, self.chart.time.origday, self.chart.time.hour, self.chart.time.minute, self.chart.time.second, 1)
		self.show(y, m, d, h, mi, s)