| Free mast for Merlin Rocket - has a bend! Guildford |
![]() |
| Rossiter Pintail Mortagne sur Gironde, near Bordeaux |
![]() |
| Bruce Roberts classic 45 Valencia, Spain |
![]() |
List classes of boat for sale |
Update Ratings |
Post Reply
|
Page <12 |
| Author | |
kevinwhead
Newbie
Joined: 23 Nov 13 Location: United Kingdom Online Status: Offline Posts: 4 |
Post Options
Quote Reply
Topic: Update RatingsPosted: 19 Feb 14 at 9:31pm |
|
Excellent - that works fine.
Shame its so difficult to find. Thanks for the Info. Kevin W, SCSC
|
|
![]() |
|
Eskdale
Newbie
Joined: 18 Feb 14 Online Status: Offline Posts: 5 |
Post Options
Quote Reply
Posted: 19 Feb 14 at 12:11am |
|
There is an easy way built into Sailwave
Go to Setup - Scoring System - Rating system tab At the bottom there is a tick box Auto set competitor ratings see screen shot below ![]() When you score the series this will read the ratings file and update the competitors automatically Hope this helps If you need any help let me know Jon |
|
![]() |
|
kevinwhead
Newbie
Joined: 23 Nov 13 Location: United Kingdom Online Status: Offline Posts: 4 |
Post Options
Quote Reply
Posted: 18 Feb 14 at 10:14pm |
|
Hum, still requires going into each class one at a time. The alternative is that you go into "Edit Competitor", and re-select the class to what it already is (picking up a change in the process), If the Edit Next tickbox is set then this makes it easier to work down the whole fleet.
My other solution was to write some Java which would read the blw file and re-write it ! import java.io.*; import java.lang.*; import java.util.Vector; public class StartHere { public static void main(String[] args) { Vector<Ratings> Ratings = new Vector<Ratings>(); System.out.println("Hello World"); String RatingsFile = ""; String OutputFile = ""; String inputStr = ""; if(args[0].compareTo("Normal")==0) { RatingsFile = "C:/Dropbox/Kevin/Sailing/PH_Sailwave/NormalHandicaps/NormalRatingsXXAutumn2013.csv"; OutputFile = "C:/Dropbox/Kevin/Sailing/PH_Sailwave/PH Everybody 2014 Normal.blw"; } else if(args[0].compareTo("Personal")==0) { RatingsFile = "C:/Dropbox/Kevin/Sailing/PH_Sailwave/PersonalHandicaps/PHratingsXXAutumn2013.csv"; OutputFile = "C:/Dropbox/Kevin/Sailing/PH_Sailwave/PH Everybody 2014 PH.blw"; } else { System.out.println("Usage is ConvertBLW Normal/Personal"); } if(RatingsFile.compareTo("")!=0) { try{ InputStream is = new FileInputStream(RatingsFile); int size = is.available(); int iField = 0; String TextFieldOne = ""; String TextFieldTwo = ""; String TextFieldThree = ""; for(int iReadLine=0; iReadLine< size; iReadLine++){ char nextchar=(char)is.read(); if(nextchar==','){ if( iField==0) { TextFieldOne = inputStr; inputStr = ""; } else if( iField==1) { TextFieldTwo = inputStr; inputStr = ""; } iField += 1; }else if (nextchar=='\r') { TextFieldThree = inputStr; inputStr = ""; iField = 0; System.out.println("."); }else if (nextchar=='\n') { Ratings ptrRating = new Ratings(TextFieldOne, TextFieldTwo, TextFieldThree); Ratings.add(ptrRating); }else{ System.out.print(nextchar); inputStr = inputStr.concat(Character.toString(nextchar)); } } // end for is.close(); }catch(IOException e){ System.out.print("Exception failed to read ratings file"); } // now read and convert the blw file try{ int iField = 0; boolean bFoundClass = false; boolean bFoundRating = false; String inputLine = ""; String StringNewRating = ""; String StrCompClass = "\"compclass\""; String StrCompRating = "\"comprating\""; InputStream is = new FileInputStream("C:/Dropbox/Kevin/Sailing/PH_Sailwave/PH Everybody 2014.blw"); int size = is.available(); OutputStream iout = new FileOutputStream(OutputFile); for (int iReadLine=0; iReadLine< size; iReadLine++){ char nextchar=(char)is.read(); inputLine = inputLine.concat(Character.toString(nextchar)); if (nextchar==','){ if (iField==0) { // looking for start of first field if (inputStr.compareTo(StrCompClass)==0) { bFoundClass = true; }else if (inputStr.compareTo(StrCompRating)==0) { bFoundRating = true; } }else if (iField==1) { if (bFoundClass == true) { // look through the vectors of ratings to find this one int iRatings = Ratings.size(); int iLength = inputStr.length()-1; String StrClass = inputStr.substring(1,iLength); boolean boolFound = false; for (int i=0; (i<iRatings && boolFound==false); i++){ Ratings ptrRating = (Ratings) Ratings.elementAt(i); StringNewRating = ptrRating.Match(StrClass); if (StringNewRating.compareTo("")!=0){ boolFound = true; // break out of loop } } // end for if (boolFound == false) { System.out.println("There is no Rating entry for " + inputStr + " FIX THIS NOW!"); } bFoundClass = false; } } iField += 1; inputStr = ""; }else if (nextchar=='\n') { // write the line back out if (bFoundRating == true) { // overwrite inputLine with a nobled version String StrTail = inputLine.substring(18); if (inputLine.charAt(17)=='"') { StrTail = inputLine.substring(17); } inputLine = "\"comprating\",\""; inputLine = inputLine.concat(StringNewRating); inputLine = inputLine.concat(StrTail); bFoundRating = false; } int iBytes = inputLine.length(); for (int i=0; i<iBytes; i++){ int iChar = inputLine.charAt(i); try { iout.write(iChar); } catch (IOException e) { e.printStackTrace(); } } // end for iField = 0; inputStr = ""; inputLine = ""; } else { inputStr = inputStr.concat(Character.toString(nextchar)); } System.out.print(nextchar); } // end for is.close(); iout.flush(); iout.close(); }catch(IOException e){ System.out.print("Exception failed to read the blw file correctly"); } finally { } } System.out.println("Goodbye World"); } } |
|
![]() |
|
sailingsue
Newbie
Joined: 16 Feb 14 Online Status: Offline Posts: 2 |
Post Options
Quote Reply
Posted: 16 Feb 14 at 9:28pm |
|
Just found a way to work around the problem...
On the Tools menu, use 'Set Competitor Field...' Then for example: CLASS=TOPPER Field to change 'Rating' Set this value '1313' Replace existing This will change all the competitors with Toppers to PY 1313 Hope this helps. If anyone finds a better fix then post here! SS
|
|
![]() |
|
sailingsue
Newbie
Joined: 16 Feb 14 Online Status: Offline Posts: 2 |
Post Options
Quote Reply
Posted: 16 Feb 14 at 8:37pm |
|
I have the same question... I have a all the club racers in a sailwave file which I use to populate future series, but I can't find a way to update the PY numbers using the new 2014 ratings file. Have you found a solution anywhere else?
Hope someone can help
|
|
![]() |
|
kevinwhead
Newbie
Joined: 23 Nov 13 Location: United Kingdom Online Status: Offline Posts: 4 |
Post Options
Quote Reply
Posted: 23 Nov 13 at 7:11pm |
|
What do you have to do to get sailwave to update all the sailors Ratings when a new Ratings file is presented? I have got the global options pointing at the new Ratings file because if I click on any one helm and select their existing Class then the rating is updated. But I really don't want to go through every helm one by one and do this. There was a menu option that appeared a couple of years back; Tools / Update Ratings - but this has been removed in the more recent versions! Help.
|
|
![]() |
|
Post Reply
|
Page <12 |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |