Command line mode
Brought to you by:
mdeweerd
I like the conversion functions very much (e.g. BIN->CSV, BIN->NMEA, BIN->GMAP, CSV->NMEA, CSV->GMAP, NMEA->GMAP, ...).
But as it is quite cumbersome to use the GUI, when often making conversions from/to different files, I would very much appreciate a command line mode.
E.g. for a CSV->GMAP conversion: run_rxtx abc.csv xyz.html
Logged In: YES
user_id=149951
Originator: NO
Personally, I prefer command line operations too. IN the case of BT747, I find the GUI quite efficient, but of course you can not script it.
If you can code, I invite you to initiate some work on a command line interface. In the source, there is a file called 'src/bt747/j2se_view/SimpleExample.java' that does not have a user interface and yet it downloads a log and converts. You could write the code required to handle the command line and adapt the example accordingly.
I am focussing on other interfaces that are interesting too such as having an application for the mobile phone using J2ME.
I like gpsbabel because i can script it... but gpsbabel can't download the mtk log in raw format. It can read, but no save the raw format.
For a log download: run_rxtx download /erase BT747_20080914.log
Hi 'alphp'
Can you tell me what you want to say exactly with your message?
1) Is this the way you want the cmd to look like;
2) Is this what you implemented.
If somebody does the basic command line argument interpretation in Java, I'll (help to) hookup the call to the BT747 backend. The code could have comments as a placeholder for the actions to do. Example:
// Download log. Parameters:
// download type =
// path to bin = binPath
// path to output =
// output base name =
// If download successfull:
if (isDoErase) {
//
}
I am doing all of the coding alone and currently focussing on the Mobile Phone version.
I've done a first implemetnation of a command line interface. The parameter setup was taken from mtkbabel.
To launch on windows, use BT747cmd.bat . On other systems, modify the '..._j2se_...' startup script (classpath, path to main class in java call).
The command line interface code is in .../src_j2se/bt747/j2se_view/BT747cmd.java . For the rest, it uses the same layers as the GUI.
More options can be added, do suggest.
To download: go to the 'debug_releases' section and get 'V1.57.5'
The command line mode is now functional ('beta') and needs testing.
It allows to do the requested conversions.
First of all: Many thanks!
I tried version 1.57.6 and I wanted to convert "abc.csv" to "xyz.html".
So I entered (in Windows-XP) "BT747cmd.bat -b abc.csv -f xyz --outtype GMAP".
But I got:
*********** Currently in BETA **************
BT747 Cmd V1.57.6 build BT747_mdeweerd.710.20080930203717468
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.io.File cannot be cast to java.lang.String
at joptsimple.OptionSet.argumentOf(OptionSet.java:79)
at bt747.j2se_view.BT747cmd.handleOptions(Unknown Source)
at bt747.j2se_view.BT747cmd.<init>(Unknown Source)
at bt747.j2se_view.BT747cmd$4.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
*********** Currently in BETA **************
I uploaded 1.57.7 that correct this (it seemed to work for me). For the moment you need a valid connection - I'll solve that for a next release.
Many thanks for quick correction.
Now I tested with version 1.57.7, but no file "xyz.html" is created with
BT747cmd.bat -b abc.csv -f xyz --outtype GMAP -p COM15
BT747cmd.bat -b abc.csv -f xyz --outtype GMAP -p COM15 -t
BT747cmd.bat -b abc.csv -f xyz --outtype GMAP -p COM15 -w
Output is:
*********** Currently in BETA **************
BT747 Cmd V1.57.7 build BT747_mdeweerd.710M.20080930223735578
Info: trying to open COM15
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
>PMTK182,7,00000006,00000002 true
Adding gps.GPSstate@253498
>PMTK182,2,2 true
>PMTK182,2,12 true
>PMTK182,2,8 true
4844 - Timeout: 4844-1344>3500
>PMTK182,2,10 true
>PMTK182,2,6 true
>HOLUX241,5 true
>PMTK182,2,9,9F true
>PMTK182,2,2 true
8469 - Timeout: 8469-4969>3500
>PMTK182,7,00000006,00000002 true
11969 - Timeout: 11969-8469>3500
Opened file ./abc.csv in mode 1 r
Opened file ./abc.csv in mode 1 r
*********** Currently in BETA **************
I updated the code so that a connection is no longer required (V1.57.8).
I tried the same command line and I got a result in my case (after creating abc.csv).
I you do not get a result, then this may be because the input CSV does not have valid positions according to the filter.
If you want, you can share that file with me (email or attachment here if there is no privacy issue) so that I can check and - if needed - adjust the program's behaviour to expectations.
What do you mean by "valid positions according to the filter"?
My command line does not define any filter.
No I tested with version 1.58, but still no file "xyz.html"
is generated for the attached file "abc.csv" by the command
BT747cmd.bat -b abc.csv -f xyz --outtype GMAP
Output is:
*********** Currently in BETA **************
BT747 Cmd V1.58 build BT747_mdeweerd.716.20081001215740031 GPL V3 LICENSE
Converting to GMAP
Time to convert data (ms): 531 ms
*********** Currently in BETA **************
By valid positions is meant:
- Records that have a date after 1/1/1983 and at most the current date;
- Records that do not have 'Estimated mode' set.
As there was a bug in the J2SE date conversion while reading the CSV file, the date condition was not met and no records were 'selected.
I solved that in 1.58.1 following the reproduction of your problem. When converting to 'CSV', I get the same input file with some rounding differences and one record missing that is 'Estimated mode' actually. You can notice that the location of that record is wrong.
Many thanks for solving the date conversion problem.
Now I tested with version 1.58.2 and
BT747cmd.bat -b abc.csv -f xyz --outtype GMAP
worked very well.
In the next few days I will test more command line options.
Last message did not indicate a problem or new request.