Skip to content

Commit

Permalink
ran tests. looks good. will be testing more tomorrow. EXE is still ou…
Browse files Browse the repository at this point in the history
…t of sync
  • Loading branch information
Wenbert Del Rosario committed Oct 10, 2010
1 parent f0b4cc2 commit a704359
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,26 @@ def process_file(self):
self.minutes = int(pieces[4])
self.tide = float(pieces[5]) * 0.01 #convert tide to meters

self.hour -= 1 #minus 1 hour for all.


#check for the first day of the month bug
if i < 6 and adjustment == 1:
self.day -= 1
self.hour -= 1
#self.hour -= 1
self.check_hour_of_day()
self.check_day_of_month()

#check for the first day of the month bug
#for 2 hour adjustment
if i < 12 and adjustment == 2:
for n in range(0, 2): #do twice
self.day -= 1
self.hour -= 1
self.check_hour_of_day()
self.check_day_of_month()
self.day -= 1
self.hour -= 1
self.check_hour_of_day()
self.check_day_of_month()

if i > 12 and adjustment == 2:
self.hour -= 1

#if after the 2nd day / succeeding days
#144 lines == 1 day (with 10 minutes for 24 hours)
Expand All @@ -67,9 +72,16 @@ def process_file(self):

#check for trigger_start
if trigger_start:
start += 1
self.day -= 1
self.check_day_of_month()
if adjustment == 1:
start += 1
self.day -= 1
self.check_hour_of_day()
self.check_day_of_month()
else:
start += 1
self.day -= 1
self.check_hour_of_day()
self.check_day_of_month()

if start > 5 and adjustment == 1:
start = 0
Expand Down Expand Up @@ -125,6 +137,8 @@ def check_hour_of_day(self):
Check if the hour is -1. If -1, set to 23 and if -2, set to 22
"""
self.hour = 24 + self.hour
if self.hour == 24:
self.hour == 0

def check_day_of_month(self):
"""
Expand Down

0 comments on commit a704359

Please sign in to comment.