JSON for Import into Flutter/Dart Apple/Android App

Hi, we use your software and when exported at JSON there are numerous errors: missing commas, missing end curly braces, and duplication of keys (race and racestart).

I am developing an app (Android and iOS) and we will upload results to Google Cloud Firestore data base so that my app can update the users on race results. However, the JSON format issue is a no-go unless I fix the file everytime we export. Are we missing something? Thanks in advance.

Hi Bob

What version are you using?

Regards

Jon

If you are using json then you should be using 2.29.5 or later

Jon

Hi, the person who keeps score is using version 2.29.0. I have requested that he update his version.

Hi Bob,

So who creates the JSON file for you?
If its you then you can open the file he has produced (xxx.blw) and simply click File - Save as JSON and it should be fine for you.
Let me know if there is anything wrong with it but - I checked the output of 2.29.5 or later and it looks fine to me - it is also significantly faster and smaller file size

Jon

Hi, where do we get 2.29.5? I made a JSON from the XML but would like to avoid that step. Thanks,

Hi Bob
If you do a search for 2.29.5 on this user group you will find details for downloading the exe only versions. All versions later than 2.29.0 are .exe only. They are not the full installer so you need to install 2.29.0 and replace the Sailwave.exe with the newer versions

It will be included in the next full install but that is not quite ready

Jon

1 Like

Hi, searched high and low and cannot find an active link to the 2.29.5. Can you provide an active link? Thanks

Hi Bob,

Pleas try this link to v2-29-6 - sailwave2-29-6.exe - pCloud - which is a minor update to 2-29-5.
Note it is an executable only, that needs copying to the Sailwave folder and renaming to sailwave.exe after renaming existing sailwave.exe to something like sailwave2-29-0.exe

Kind regards,
Huw

Hi, thanks - the JSON format works well. I am importing the JSON into Flutter and Dart for cross platform app (Android and iOS Apple). I am using the Dart json decode class and it works fine. The problem is when I put this into a ListView the data is very difficult to sort by “comprank” so that the top rank competitors are at the top of the list. If I create a custom class and do quite a bit of work I can sort the data and then present but I was wondering if you could reorder your JSON in the “competitors” area?

What I have done to avoid a lot of coding is simply manually order the JSON with the lowest rank at the beginning and the winners at the bottom. Then my Dart code is very simple and the output is acceptable to the members of our club. I manually edited the json file so that the key for the competitor was the same as the rank so that it was easy for me to visually sort. Here is an example. If you could change the output of your JSON export it would be a great help!
“competitors” : {
“15” : {
“comptotal” : “119”,
“compnett” : “87”,
“comprank” : “15”,
“compsailno” : “Red”,
“compclass” : “Sunfish”,
“compfleet” : “Handicap”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.6”,
“compmedicalflag” : “0”,
“comphelmname” : “Noah Everaet”,
“comphigh” : “0”
},
“14” : {
“comptotal” : “118”,
“compnett” : “86”,
“compboat” : “Teak Keel Ahh”,
“comprank” : “14”,
“compsailno” : “13611”,
“compclass” : “Catalina 22”,
“compclub” : “HSA”,
“compfleet” : “Handicap”,
“compnotes” : “Catalina 22”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “96.3”,
“compmedicalflag” : “0”,
“comphelmname” : “Dominike Everaet”,
“comphigh” : “0”
},
“13” : {
“comptotal” : “109”,
“compnett” : “77”,
“comprank” : “13”,
“compsailno” : “3729”,
“compnotes” : “Mariner 19 CB”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “95.8”,
“compmedicalflag” : “0”,
“comphelmname” : “Matthew Milks”,
“comphigh” : “0”
},
“12” : {
“comptotal” : “108”,
“compnett” : “76”,
“comprank” : “12”,
“compsailno” : “5967”,
“compclass” : “Capri 18”,
“compnotes” : “Carpi 18”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “100.7”,
“compmedicalflag” : “0”,
“comphelmname” : “Bob Fletcher”,
“comphigh” : “0”
},
“11” : {
“comptotal” : “104”,
“compnett” : “72”,
“comprank” : “11”,
“compsailno” : “7140”,
“compclass” : “Star”,
“compnotes” : “Star”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “83.2”,
“compmedicalflag” : “0”,
“comphelmname” : “Bob Taylor”,
“compcrewname” : “Carolyn McDermott”,
“comphigh” : “0”
},
“10” : {
“comptotal” : “103”,
“compnett” : “71”,
“comprank” : “10”,
“compsailno” : “80884”,
“compclass” : “Sunfish”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.60”,
“compmedicalflag” : “0”,
“comphelmname” : “Brendan Draper”,
“comphigh” : “0”
},
“9” : {
“comptotal” : “103”,
“compnett” : “71”,
“comprank” : “9”,
“compsailno” : “81227”,
“compclass” : “Sunfish”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.60”,
“compmedicalflag” : “0”,
“comphelmname” : “Ken Wright”,
“comphigh” : “0”
},
“8” : {
“comptotal” : “100”,
“compnett” : “68”,
“comprank” : “8”,
“compsailno” : “2381”,
“compfleet” : “Handicap”,
“compnotes” : “San Juan 21”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “96.1”,
“compmedicalflag” : “0”,
“comphelmname” : “Curt Donahue”,
“comphigh” : “0”
},
“7” : {
“comptotal” : “77”,
“compnett” : “45”,
“comprank” : “7”,
“compsailno” : “78557”,
“compclass” : “Sunfish”,
“compfleet” : “Handicap”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.6”,
“compmedicalflag” : “0”,
“comphelmname” : “Mike Stratton”,
“comphigh” : “0”
},
“6” : {
“comptotal” : “72”,
“compnett” : “40”,
“comprank” : “6”,
“compsailno” : “3562”,
“compclass” : “Capri 14.2”,
“compnotes” : “Capri 14.2”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.4”,
“compmedicalflag” : “0”,
“comphelmname” : “Diane Pierok”,
“compcrewname” : “Ken Wright”,
“comphigh” : “0”
},
“5” : {
“comptotal” : “70”,
“compnett” : “38”,
“comprank” : “5”,
“compsailno” : “76434”,
“compclass” : “Sunfish”,
“compfleet” : “Handicap”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.6”,
“compmedicalflag” : “0”,
“comphelmname” : “Brian Callahan”,
“comphigh” : “0”
},
“4” : {
“comptotal” : “67”,
“compnett” : “35”,
“comprank” : “4”,
“compsailno” : “289”,
“compclass” : “Montgomery 15”,
“compnotes” : “Montgomery 15”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “108.2”,
“compmedicalflag” : “0”,
“comphelmname” : “Stephen Cook”,
“comphigh” : “0”
},
“3” : {
“comptotal” : “53”,
“compnett” : “21”,
“comprank” : “3”,
“compsailno” : “78557”,
“compclass” : “Sunfish”,
“compfleet” : “Handicap”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.6”,
“compmedicalflag” : “0”,
“comphelmname” : “Dominiek Everaet”,
“comphigh” : “0”
},
“2” : {
“comptotal” : “52”,
“compnett” : “20”,
“comprank” : “2”,
“compsailno” : “3916”,
“compclass” : “Capri 14.2”,
“compnotes” : “Capri 14.2”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.4”,
“compmedicalflag” : “0”,
“comphelmname” : “Jerry Brewster”,
“compcrewname” : “Darilynn Brewster”,
“comphigh” : “0”
},
“1” : {
“comptotal” : “12”,
“compnett” : “7”,
“comprank” : “1”,
“compsailno” : “4410”,
“compclass” : “Sunfish”,
“compnotes” : “Sunfish”,
“compexclude” : “0”,
“compalias” : “0”,
“comprating” : “99.60”,
“compmedicalflag” : “0”,
“comphelmname” : “Laura Peters”,
“comphigh” : “0”
}
},

Hi, I was able to use nested For Loops in my JSON parse part of the code in my app to sort the results by Rank. If you all ever get a chance if you changed to competitor output in the JSON to be ranked it would be a great help when we parts the file.

Hi Bob,

It’s probably more coding than you want to do, but you can use the Windows messaging built into Sailwave to extract the data and format it as you want
I’ve just been working on a program for Irish Sailing which extracts the data from Sailwave and puts it into a JSON format that they specified and then uploads it to their server

A sample of the file is attached
Jon

Data.JSON (19.2 KB)

Hi, thanks for the advice. One of the club members inputs the race data and gives me the JSON file. I was able to next For Loops to parse the JSON file results and rank them on the app. I am using Google’s cross platform tech stack called, Flutter (framework) and Dart which is an object oriented language similar in some aspects to C++. Really cool tech stack: can develop for Windows, macOs, iOS, Android, Linux and Web applications in one code base. I am just doing an app for the club for iOS and Android.

I’m no expert in Dart but I believe the sort function can easily do what you want sort method - List class - dart:core library - Dart API, no need for for…next loops.

It is much more complicated than you realize. Dart JSON decode is one method to get the data. There are numerous issues of getting the objects out of the JSON, which default to dynamic data type, and get them into a listview. Dart decode puts the JSON data into a dart map of key value pairs. However, you have to use the dart feature of map to list to get the index size of the data set. Using the index I can for loop through the JSON data and grab what I need. Using the index and sorting out the rank within two nested for loops solved the problem quite easily. It would be better if the JSON file from Sailwave had some documentation such as an API wiki and provided the key of the key value pair as the rank. No matter, figured out it out and all is well.