// Check http://www.ewscdata.com/ewscdata_data_formats for updates

// JSON Message Formats expected
// Version 1.2.3
// May 30, 2021
// donal@splasheye.com


// Change Log
//
// August 07, 2020
// Added driver node into athlete_data message
//
// June 26, 2020
// Added officialsCountry to Officials message
// Added driverCountry to Boat Path Data message
//
// March 10, 2021
// Added athleteDivision to Athlete Data message
// Added round to Athlete Data message
// Added round to Jump Measurement Score message
// Added athleteGroup to startlist_athletes dictionary in Start List message
// Added athleteDivision to startlist_athletes dictionary in Start List message
//
// March 29, 2021
// Changed athlete_data to pass_data
//
// May 14, 2021
// Added connect_confirm
// Added status_request
// Added status_response
// Added connectedapplication_check
// Added connectedapplication_response
//
/////////////////////////////////////////////////////////
// manual_connection_parameter
/////////////////////////////////////////////////////////
{
   "loggingdetail": "no", // if yes then message contents will be logged
   "mode": "Tournament", // Tournament or Standalone - normally Tournament
   "eventid": "20E016", // The official Tournament Id
   "eventsubid": "North Lake", // Blank UNLESS you there are multiple scoring systems in use at a single event
   "provider": "SplashEye", // The manufacturer of the application that is connecting
   "application": "Lion Simulator", // The application name of the application that is connecting
   "version": "4.5.6", // The version of the application that is connecting
   "username": "lionsim@splasheye.com" // The current user of the connecting application
}

/////////////////////////////////////////////////////////
// manual_connection_parameter
/////////////////////////////////////////////////////////
{
   “eventId”: “20E016”, 
   “eventSubId”: “North Lake”, 
   'pin': '8612'
}


/////////////////////////////////////////////////////////
// pass_data 
/////////////////////////////////////////////////////////
// athlete currently on the water (or next on the water)
{
  "athleteId": "800168993",
  "athleteName": "Connolly, Donal",
  "athleteGender": "M",
  "athleteEvent": "Slalom", // Slalom/Trick/Jump
  "athleteDivision": "45+",
  "athleteCountry": "IRE",
  "athleteRegion": "FL", // Normally blank in Europe. Normally State in USA
  "round": 1,
  "passNumber": 1,
  "speed": 49,
  "rope": "14.25",
  "split": "0",
  "driver": {
    "officialId": "400095206",
    "officialName": "Warner, Dan",
    "officialCountry": "USA",
    "officialRegion": "CT"
  }
}

/////////////////////////////////////////////////////////
// officials_data
/////////////////////////////////////////////////////////
// list of officials for the current skiing - at a minimum the driver.
//driver
//boatJudge
//chiefJudge
//scorer
//towerJudge1a
//towerJudge1b
//towerJudge2a
//towerJudge2b
// others as they are needed 
{
   "driver": {
      "officialId": "OFFIRE123",
      "officialName": "CONNOLLY Donal",
      "officialCountry": "IRE",
      "officialRegion": "FL"
   },
   "boatJudge": {
      "officialId": "",
      "officialName": "ALLEN David",
      "officialCountry": "USA",
      "officialRegion": "MA"
   }
}

/////////////////////////////////////////////////////////
// boat_data
/////////////////////////////////////////////////////////
{
   "boatId": "",
   "boatManufacturer": "MasterCraft",
   "boatModel": "Prostar 190",
   "boatYear": "2019",
   "boatColor": "Blue on White",
   "boatComment": "Using the 5 blade prop"
}

/////////////////////////////////////////////////////////
// boat_times
/////////////////////////////////////////////////////////
// Slalom
{
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Slalom",
   "passNumber": 1,
   "speed": "55",
   "rope": "14.25",
   "b1": 1.69,
   "b2": 4.25,
   "b3": 6.79,
   "b4": 9.33,
   "b5": 11.87,
   "b6": 14.42,
   "endgate": 16.09
}
// Jump
{
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Jump",
   "passNumber": 1,
   "speed": "57",
   "rope": "",
   "nt": 3.3,
   "mt": 5.18,
   "et": 2.4
}


/////////////////////////////////////////////////////////
// boatpath_data
/////////////////////////////////////////////////////////
// Slalom
{ 
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Slalom",
   "driverId": "",
   "driverName": "BOTAS Ricardo",
   "driverCountry": "ESP",
   "boatId": "",
   "boatManufacturer": "MasterCraft",
   "boatModel": "Prostar 190",
   "boatYear": "2019",
   "boatColor": "Blue on White",
   "boatComment": "Using the 5 blade prop",
   "passNumber": 1,
   "speed": "55",
   "rope": "14.25",
   "reride": "Mandatory",
   "gate": { 
      "deviation": 5.1,
      "cumulative": 0
   },
   "b1": { 
      "deviation": 15.1,
      "cumulative": 15.1
   },
   "b2": { 
      "deviation": -4.8,
      "cumulative": 10.3
   },
   "b3": { 
      "deviation": -12.2,
      "cumulative": -1.9
   },
   "b4": { 
      "deviation": -6.3,
      "cumulative": -8.2
   },
   "b5": { 
      "deviation": 8.4,
      "cumulative": 0.2
   },
   "b6": { 
      "deviation": 19.5,
      "cumulative": 19.7
   },
   "detail": [ 
      { 
         "position": -5500,
         "deviation": 5.9
      },
      { 
         "position": -5002,
         "deviation": 9.3
      },
      { 
         "position": -4504,
         "deviation": 8.4
      },
      { 
         "position": 25874,
         "deviation": 13.5
      }
   ]
}
// Jump
{ 
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Jump",
   "driverId": "",
   "driverName": "BOTAS Ricardo",
   "boatId": null,
   "boatManufacturer": "MasterCraft",
   "boatModel": "Prostar 190",
   "boatYear": "2019",
   "boatColor": "Blue on White",
   "boatComment": "Using the 5 blade prop",
   "passNumber": 1,
   "speed": "57",
   "rope": "",
   "reride": "Mandatory",
   "start": { 
      "deviation": 5.1,
      "cumulative": 0
   },
   "st": { 
      "deviation": 15.1,
      "cumulative": 0
   },
   "nt": { 
      "deviation": -4.8,
      "cumulative": 0
   },
   "mt": { 
      "deviation": -12.2,
      "cumulative": 0
   },
   "et": { 
      "deviation": -6.3,
      "cumulative": 0
   },
   "ec": { 
      "deviation": 8.4,
      "cumulative": 0
   },
   "detail": [ 
      { 
         "position": 0,
         "deviation": 7.3
      },
      { 
         "position": 27888,
         "deviation": 18.5
      }
   ]
}


/////////////////////////////////////////////////////////
// jumpmeasurement_score
/////////////////////////////////////////////////////////
{
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Jump",
   "round": “2:,
   "passNumber": 1,
   "score": {
      "distanceMetres": 50.2,
      "distanceFeet": 165
   }
}

/////////////////////////////////////////////////////////
// scoring_score
/////////////////////////////////////////////////////////
{
   "athleteId": "ATHIRE123",
   "athleteName": "CONNOLLY Donal",
   "athleteEvent": "Jump",
   "passNumber": 1,
   "speed": "57",
   "rope": "",
   "score": "5.00@58/12.00"
}


/////////////////////////////////////////////////////////
// start_list
/////////////////////////////////////////////////////////
{
   "startlistName": "Open Men Slalom Final",
   "round": “2”,
   "eventName": "Slalom",
   "division": "Open men",
   "group": "1",
   "lake": "South Lake",
   "current_athlete_index": 3,
   "current_athlete_name": "BRIDGES Harry",
   "startlist_athletes": [
      {
         "athleteId": "IRE000001",
         "athleteName": "CONNOLLY Donal",
         "athleteDivision": "M3",
         "athleteGroup": "1",
         "athleteCountry": "IRE",
         "athleteRegion": "",
         "position_starting": 1,
         "position_seed": 5,
         "position_current": 1,
         "score_seed": "1.00@55/13",
         "score_current": "2.00@55/12m"
      },
      {
         "athleteId": "FRA120001",
         "athleteName": "GALVIN Barry",
         "athleteDivision": "M3",
         "athleteGroup": "1",
         "athleteCountry": "FRA",
         "athleteRegion": "",
         "position_starting": 2,
         "position_seed": 4,
         "position_current": 3,
         "score_seed": "2.00@55/13",
         "score_current": "4.00@55/13m"
      },
      {
         "athleteId": "GER068501",
         "athleteName": "SKELTON Robin",
         "athleteDivision": "M3",
         "athleteGroup": "1",
         "athleteCountry": "GER",
         "athleteRegion": "",
         "position_starting": 3,
         "position_seed": 3,
         "position_current": 2,
         "score_seed": "3.00@55/13",
         "score_current": "5.60@55/13m"
      },
      {
         "athleteId": "USA213101",
         "athleteName": "BRIDGES Harry",
         "athleteDivision": "M3",
         "athleteGroup": "1",
         "athleteCountry": "USA",
         "athleteRegion": "FL",
         "position_starting": 4,
         "position_seed": 1,
         "position_current": 0,
         "score_seed": "4.00@55/13",
         "score_current": ""
      },
      {
         "athleteId": "GBR985601",
         "athleteName": "WINTER Freddie",
         "athleteDivision": "M3",
         "athleteGroup": "1",
         "athleteCountry": "GBR",
         "athleteRegion": "",
         "position_starting": 5,
         "position_seed": 1,
         "position_current": 0,
         "score_seed": "5.00@55/13",
         "score_current": ""
      }
   ]
}


/////////////////////////////////////////////////////////
// status_request
/////////////////////////////////////////////////////////
Send or emit an empty string as the data

/////////////////////////////////////////////////////////
// status_response
/////////////////////////////////////////////////////////
{
   "eventid": "20E016", // The official Tournament Id
   "eventsubid": "North Lake", // Blank UNLESS you there are multiple scoring systems in use at a single event
   "pin": "1234",
   "version": “v 1.1.7 May 14,2021”
}

/////////////////////////////////////////////////////////
// connectedapplication_check
/////////////////////////////////////////////////////////
Send or emit an empty string as the data

/////////////////////////////////////////////////////////
// connectedapplication_response
/////////////////////////////////////////////////////////
{
   “application”: “WSTIMS”
}

