FreeEMS Issues - Loader
View Issue Details
0000816LoaderUser Interfacepublic2013-01-20 14:252013-01-23 06:22
Fred 
malcom2073 
normalminoralways
resolvedfixed 
AllAllAll
0.1.0-SNAPSHOT 
0.1.0 
Bug
medium
0000816: Device listing has duplicates
Use a map!!! And implement a proper method to show what's available:

For Linux:

fred@cheetah:~/workspaces/freeems-loader$ ls -l /dev/ttyS[0-9] /dev/ttyUSB[0-9]
ls: cannot access /dev/ttyUSB[0-9]: No such file or directory
crw-rw---- 1 root dialout 4, 64 Dec 27 01:26 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Dec 27 01:26 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Dec 27 01:26 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Dec 27 01:26 /dev/ttyS3

For Winblows:

COM0 - COM 20 (just as a temporary measure before detecting them)
No tags attached.

Notes
(0002541)
Fred   
2013-01-20 14:26   
For Mac:

freeair:~ fred$ ls -l /dev/cu.* /dev/tty.*
crw-rw-rw- 1 root wheel 11, 3 Dec 30 04:27 /dev/cu.Bluetooth-Modem
crw-rw-rw- 1 root wheel 11, 1 Dec 30 04:27 /dev/cu.Bluetooth-PDA-Sync
crw-rw-rw- 1 root wheel 11, 2 Dec 30 04:27 /dev/tty.Bluetooth-Modem
crw-rw-rw- 1 root wheel 11, 0 Dec 30 04:27 /dev/tty.Bluetooth-PDA-Sync
(0002542)
sean94z   
2013-01-20 14:27   
Golden! thx
(0002543)
sean94z   
2013-01-20 14:31   
IIRC with windows the thing to do is read from the registry.
(0002544)
Fred   
2013-01-20 14:33   
Yes, but FOR FUCKS SAKE don't get distracted AGAIN by that. Just...

http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html [^]

IE, list some likely numbers...
(0002545)
sean94z   
2013-01-20 14:37   
Ah yeah, nice write up. That's what I did with the bit bang stuff(simple simon loop).
(0002546)
sean94z   
2013-01-20 14:53   
http://doc.qt.digia.com/qt/qmap.html [^]
(0002555)
sean94z   
2013-01-22 21:04   
Fixed, please review when you have time :)

86a62efbdab566f693806cae66d4361d2a74c12c
(0002556)
Fred   
2013-01-22 21:14   
Two things:

1) ttyUSB should enter the list first over and above ttyS
2) this search should be done on each click of the drop down list so as to find CURRENT devices. I just plugged a new one in and can't see it listed because it's done at boot time, not on demand. Though the code does work correctly, just not when it should.
(0002557)
sean94z   
2013-01-22 21:16   
1) lol i made note of that thx for the reminder
2) cool I was tempted to add a refresh bottom but that seemed tacky i'll implement it the way you suggested.
(0002558)
Fred   
2013-01-22 21:18   
If the default device is OK this code should never run ;-)
(0002559)
Fred   
2013-01-22 21:20   
First run default can be empty as long as there is logic to prevent errors from emptiness and/or ask user to put something there, etc. Or perhaps a "please choose" in grey, and/or disable action buttons until chosen.
(0002560)
sean94z   
2013-01-22 23:20   
omg, having to create a subclass to get a callback when the dropdown is clicked....
(0002562)
Fred   
2013-01-23 06:22   
We'll make a programmer out of you yet!