signalk-racer
Version:
Signalk plugin to calculate values of interest to sail racers, such as: Time to Start; Time of Start, Time to Burn; Distance to Line; Next leg TWA.
149 lines (146 loc) • 5.17 kB
JSON
{
"paths": {
"/signalk/v1/api/vessels/self/navigation/racing/setStartLine": {
"put": {
"summary": "Set or Adjust Start Line End",
"description": "Set or adjust the port/stb end of the line. Provide `end`, optionally `position`, `delta`, and/or `rotate`.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"end": { "type": "string", "enum": ["port", "stb"] },"position": {
"oneOf": [
{ "type": "string", "enum": ["bow"] },
{
"type": "object",
"properties": {
"latitude": { "type": "number" },
"longitude": { "type": "number" }
},
"required": ["latitude", "longitude"]
}
],
"description": "Either the string 'bow', or an object with latitude/longitude"
},
"delta": { "type": "number", "description": "Distance in meters to move the end along line bearing" },
"rotate": { "type": "number", "description": "Angle in radians to rotate end around the opposite end" }
},
"required": ["end"]
}
}
}
},
"responses": {
"200": {
"description": "Start line modified"
}
}
}
},
"/signalk/v1/api/vessels/self/navigation/racing/setStartTime": {
"put": {
"summary": "Set, Adjust or Command the Timer",
"description": "Set start time or send commands to the timer ('start', 'reset', 'sync', or 'adjust').",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"command": {
"type": "string",
"enum": ["start", "reset", "sync", "adjust", "set"]
},
"delta": { "type": "number", "description": "Time offset in seconds (for adjust)" },
"startTime": { "type": "string", "format": "date-time", "description": "ISO start time (for set)" }
},
"required": ["command"]
}
}
}
},
"responses": {
"200": {
"description": "Timer command executed"
}
}
}
},
"/signalk/v1/api/vessels/self/navigation/racing/lines": {
"get": {
"summary": "List available named start lines",
"description": "Returns the currently active start line and a list of configured line names with optional descriptions.",
"responses": {
"200": {
"description": "List of line names",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"startLineName": {
"type": "string",
"nullable": true,
"description": "Currently selected line name, or null for default"
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"startLineName": { "type": "string" },
"startLineDescription": {
"type": "string",
"nullable": true
}
},
"required": ["startLineName"]
}
}
},
"required": ["startLineName", "lines"]
}
}
}
}
}
}
},
"/signalk/v1/api/vessels/self/navigation/racing/setStartLineName": {
"put": {
"summary": "Select a named start line to use",
"description": "Set the active start line by name, or set null to revert to the default line.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"startLineName": {
"type": "string",
"nullable": true,
"description": "Line name to activate, or null to use the default"
}
},
"required": ["startLineName"]
}
}
}
},
"responses": {
"200": {
"description": "Active line updated"
},
"400": {
"description": "Invalid line name (not found)"
}
}
}
}
}
}