Skip to content

Commit

Permalink
Fix array index type error (float instead of int) for fuel array slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
dallongo committed Jun 1, 2016
1 parent 184eb05 commit e66f843
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ The dash configuration is controlled via the `pyDash.settings.json` file (create
Support for rFactor 1 is provided by the shared memory map plugin available at https://github.com/dallongo/rFactorSharedMemoryMap.

### Releases
#### 2016-05-31 (v2.0.0.1)

* Fix array index type error (float instead of int) for fuel array slicing

#### 2016-05-30 (v2.0.0.0)

* Merged `pyDashR3E` and `pyDashRF1` into single application
Expand Down
2 changes: 1 addition & 1 deletion pyDash.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""

APP_NAME = 'pyDash'
APP_VER = '2.0.0.0'
APP_VER = '2.0.0.1'
APP_DESC = 'Python sim racing dashboard control'
APP_AUTHOR = 'Dan Allongo ([email protected])'
APP_URL = 'https://github.com/dallongo/pySRD9c'
Expand Down
3 changes: 2 additions & 1 deletion pyDashR3E.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
It uses mmap to read from a shared memory handle.
Release History:
2016-05-31: Fix array index type error (float instead of int) for fuel array slicing
2016-05-30: Weighted moving average used for fuel estimates and temperature averages
2016-05-29: Information messages printed to log
2016-05-28: Improved session detection
Expand Down Expand Up @@ -148,7 +149,7 @@ def pyDashR3E(pid, log_print, read_settings, dash):
if(compare_fuel > 0 and compare_fuel > smm.fuel_left):
samples['fuel'].append(compare_fuel - smm.fuel_left)
if(len(samples['fuel']) > 3*settings['fuel']['samples']):
samples['fuel'] = samples['fuel'][-3*settings['fuel']['samples']:]
samples['fuel'] = samples['fuel'][int(-3*settings['fuel']['samples']):]
wn = 0
wd = 0
for i in xrange(0,len(samples['fuel'])):
Expand Down
3 changes: 2 additions & 1 deletion pyDashRF1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
It uses mmap to read from a shared memory handle.
Release History:
2016-05-31: Fix array index type error (float instead of int) for fuel array slicing
2016-05-30: Weighted moving average used for fuel estimates
2016-05-29: Information messages printed to log
2016-05-28: Improved session detection
Expand Down Expand Up @@ -130,7 +131,7 @@ def pyDashRF1(pid, log_print, read_settings, dash):
if(settings['fuel']['enabled'] and compare_fuel > 0 and compare_fuel > smm.fuel):
samples['fuel'].append(compare_fuel - smm.fuel)
if(len(samples['fuel']) > 3*settings['fuel']['samples']):
samples['fuel'] = samples['fuel'][-3*settings['fuel']['samples']:]
samples['fuel'] = samples['fuel'][int(-3*settings['fuel']['samples']):]
wn = 0
wd = 0
for i in xrange(0,len(samples['fuel'])):
Expand Down
8 changes: 4 additions & 4 deletions pyinstaller/pyDash.version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(2, 0, 0, 0),
prodvers=(2, 0, 0, 0),
filevers=(2, 0, 0, 1),
prodvers=(2, 0, 0, 1),
# Contains a bitmask that specifies the valid bits 'flags'
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -32,10 +32,10 @@ VSVersionInfo(
u'040904b0',
[StringStruct(u'CompanyName', u'Dan Allongo ([email protected])'),
StringStruct(u'ProductName', u'pyDash'),
StringStruct(u'ProductVersion', u'2, 0, 0, 0'),
StringStruct(u'ProductVersion', u'2, 0, 0, 1'),
StringStruct(u'InternalName', u'pyDash'),
StringStruct(u'OriginalFilename', u'pyDash.exe'),
StringStruct(u'FileVersion', u'2, 0, 0, 0'),
StringStruct(u'FileVersion', u'2, 0, 0, 1'),
StringStruct(u'FileDescription', u'Python sim racing dashboard'),
StringStruct(u'LegalCopyright', u'GPL v2'),
StringStruct(u'LegalTrademarks', u'https://github.com/dallongo/pySRD9c'),])
Expand Down

0 comments on commit e66f843

Please sign in to comment.