armindoantunes / gh615

Automatically exported from code.google.com/p/gh615
0 stars 0 forks source link

firmware detection (and laps) #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Cont from issue 20 (I cant reopen the issue 20 so I create a new one)
...
I figured you switch to the new fw :)
-----------------------
Detection works but I seem to endup with the base class instead:

DEBUG _connectSerial(514): serial connection on /dev/ttyUSB0
DEBUG _disconnectSerial(522): serial connection closed
Traceback (most recent call last):
  File "gh600_console.py", line 245, in <module>
    main()
  File "gh600_console.py", line 153, in main
    choose()
  File "gh600_console.py", line 68, in choose
    tracks = gh.getAllTracks()
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 648, in
getAllTracks
    allTracks = self.getTracklist()
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 497, in
serial_required_wrapper
    return function(x, *args, **kw)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 645, in
getTracklist
    raise NotImplemented('This is an abstract method, please instantiate a
subclass')
TypeError: 'NotImplementedType' object is not callable
zingo@dual:~/bin/globalsat/gh6xx/globalsat/src$ 

-------------
If I force it to firmware 1 
I get error when trying to generate fitlog output without laps info

0:00:00.800000
2008-08-28 06:59:24.200000
DEBUG _writeSerial(533): writing to serialport: 0200018180
DEBUG _writeSerial(537): waiting at serialport: 4
DEBUG _readSerial(543): serial port returned: 8A000000
INFO getTracks(877): number of tracks 3
DEBUG _disconnectSerial(524): serial connection closed
Traceback (most recent call last):
  File "gh600_console.py", line 247, in <module>
    if __name__ == "__main__":
  File "gh600_console.py", line 154, in main
    if not sys.argv[1:]:
  File "gh600_console.py", line 88, in choose

  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 453, in
exportTracks
    self.exportTrack(track, **kwargs)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 446,
in exportTrack
    self.__export([track], **kwargs)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 470,
in __export
    rendered = t.render(tracks = tracks, track = tracks[0])
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/templates.py", line
508, in render
    exec self.code in context.runtime, context
  File
"/home/zingo/bin/globalsat/gh6xx/globalsat/src/exportTemplates/fitlog.txt",
line 20, in <module>
    <% if track.laps %>
AttributeError: 'Track' object has no attribute 'laps'
zingo@dual:~/bin/globalsat/gh6xx/globalsat/src$

Original issue reported on code.google.com by ZingoAnd...@gmail.com on 31 Aug 2008 at 3:17

GoogleCodeExporter commented 8 years ago
Hm, I thought I had that figured out, I updated the templates in r165 please 
try 
them out, thanks

Original comment by spei...@gmail.com on 31 Aug 2008 at 3:32

GoogleCodeExporter commented 8 years ago
r165 didn't quite make it :(

line 20, in <module>
    <% if hasattr(track,laps) %>
TypeError: hasattr(): attribute name must be string

Traceback (most recent call last):
  File "gh600_console.py", line 245, in <module>
    main()
  File "gh600_console.py", line 153, in main
    choose()
  File "gh600_console.py", line 64, in choose
    ef.exportTracks(tracks, merge = merge)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 451, in
exportTracks
    self.exportTrack(track, **kwargs)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 444, in exportTrack
    self.__export([track], **kwargs)
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/gh600.py", line 468, in __export
    rendered = t.render(tracks = tracks, track = tracks[0])
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/templates.py", line 508, in render
    exec self.code in context.runtime, context
  File "/home/zingo/bin/globalsat/gh6xx/globalsat/src/exportTemplates/fitlog.txt",
line 20, in <module>
    <% if hasattr(track,laps) %>
TypeError: hasattr(): attribute name must be string
zingo@dual:~/bin/globalsat/gh6xx/globalsat/src$ 

Original comment by ZingoAnd...@gmail.com on 31 Aug 2008 at 3:40

GoogleCodeExporter commented 8 years ago
ahh geez, I should really check things before I check them in, please try again.

Original comment by spei...@gmail.com on 31 Aug 2008 at 6:59

GoogleCodeExporter commented 8 years ago
works greate now, thanx for fixing so fast :)

If you add a "-" in the return of modelstring in gh600.py the autodetection 
also work
like...

    def getProductModel(self):

        try:

            response = self._querySerial('whoAmI')

            watch = Utilities.hex2chr(response[6:-4])

            product, model = watch[:-1], watch[-1:]

            return product

        except GH600SerialException: #no response received, assuming command was not
understood => old firmware

            return "GH-615"   #<---- e.g. change "GH615" to "GH-615"

Original comment by ZingoAnd...@gmail.com on 31 Aug 2008 at 10:08

GoogleCodeExporter commented 8 years ago
ohyeah, thanks, fixed, so I am closing here now

Original comment by spei...@gmail.com on 31 Aug 2008 at 10:47