Skip to content

Commit

Permalink
v0.6.5 - Program was crashing when entering a hosted session. Added c…
Browse files Browse the repository at this point in the history
…ode to correct....
  • Loading branch information
Bahnzo committed Jun 26, 2016
1 parent 4777cd8 commit 7e32e11
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 17 deletions.
8 changes: 5 additions & 3 deletions L79Fuel.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def look_for_sim(self):
def look_for_car(self):
global fuel_used
while True:
session_num = self.ir['SessionNum']
session_type = self.ir['SessionInfo']['Sessions'][session_num]['SessionType']
self.set_time()
self.current_stint = 0
driver = self.ir['DriverInfo']['DriverCarIdx']
Expand Down Expand Up @@ -170,7 +172,7 @@ def look_for_car(self):
self.display_fuel_in_car()
self.display_laps_remaining(avg)
sleep(0.0016) # 16ms
if self.ir['WeekendInfo']['EventType'] == 'Race':
if session_type == 'Race':
self.race.emit()
sleep(0.0016)
break
Expand All @@ -179,7 +181,7 @@ def look_for_car(self):
else:
if self.ir.startup() == 0:
break
if self.ir['WeekendInfo']['EventType'] == 'Race':
if session_type == 'Race':
self.race.emit()
sleep(0.0016)
break
Expand Down Expand Up @@ -366,7 +368,7 @@ def __init__(self, parent=None):
else:
self.move(self.settings.value('fuel_pos'))
#self.ok_button.hide()
self.version_label.setText('v0.6.4')
self.version_label.setText('v0.6.5')
self.lcd_palette = self.laps_completed_lcd.palette()
self.thread = Worker()
self.thread.status[str].connect(self.set_status)
Expand Down
4 changes: 2 additions & 2 deletions L79Race.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, parent=None):
self.get_settings_values()
self.ok_button.hide()
#self.frame.setStyleSheet('background-color:grey')
self.version_label.setText('v0.6.4')
self.version_label.setText('v0.6.5')
self.thread = Worker()
self.thread.name_p4[list].connect(self.display_drivers)
self.thread.status[str].connect(self.show_status)
Expand Down Expand Up @@ -274,7 +274,7 @@ def find_sim(self):
else:
self.status.emit('Looking For iRacing')
self.set_time()
#self.race_over.emit()
self.race_over.emit()
sleep(1)

def determine_session(self):
Expand Down
45 changes: 35 additions & 10 deletions iRacePal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, parent=None):

self.settings = QSettings('settings.ini', QSettings.IniFormat) # create .ini file to save settings
self.settings.setFallbacksEnabled(False) # never use registry, only .ini file
self.version_label.setText('v0.6.4')
self.version_label.setText('v0.6.5')
self.get_settings_value()
self.thread = Worker()
self.thread.status[str].connect(self.set_status)
Expand Down Expand Up @@ -100,15 +100,40 @@ def look_for_sim(self):
sleep(0.050)

def determine_session(self):
if self.ir['WeekendInfo']['EventType'] == 'Race':
self.ir.shutdown()
self.race.emit()
elif self.ir['WeekendInfo']['EventType'] == 'Test':
self.ir.shutdown()
self.practice.emit()
elif self.ir['WeekendInfo']['EventType'] == 'Practice':
self.ir.shutdown()
self.practice.emit()
session_num = self.ir['SessionNum']
session_type = self.ir['SessionInfo']['Sessions'][session_num]['SessionType']
try:
if session_type == 'Race':
self.ir.shutdown()
self.race.emit()
elif session_type == 'Test':
self.ir.shutdown()
self.practice.emit()
elif session_type == 'Practice':
self.ir.shutdown()
self.practice.emit()
elif session_type == 'Open Qualify':
self.ir.shutdown()
self.race.emit()
else:
self.ir.shutdown()
self.practice.emit()
'''
if self.ir['WeekendInfo']['EventType'] == 'Race':
self.ir.shutdown()
self.practice.emit()
else:
self.ir.shutdown()
self.race.emit()
elif self.ir['WeekendInfo']['EventType'] == 'Test':
self.ir.shutdown()
self.practice.emit()
elif self.ir['WeekendInfo']['EventType'] == 'Practice':
self.ir.shutdown()
self.practice.emit()
'''
except Exception as e:
logging.error(e)

def main():
app = QApplication(sys.argv)
Expand Down
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
iRacePal v0.6.4
iRacePal v0.6.5
============================================

This tool consists of three different windows.
Expand Down Expand Up @@ -109,4 +109,6 @@ v0.6.3 - Fixed error with getting lap info while in pit.

v0.6.4 - Added oil temps to race and practice screens. If water temps get over 254F (or equivalent in C) background
turns yellow to warn driver of impending overheating. Turns red at 266F (Same temp that gauge will flash in car). Only
tested with the Xfinity car, so I have no idea if/how much difference there is in other cars. Will test later.
tested with the Xfinity car, so I have no idea if/how much difference there is in other cars. Will test later.

v0.6.5 - Program was crashing when entering a hosted session. Added code to correct....

0 comments on commit 7e32e11

Please sign in to comment.