API Reference

Expedition.dll_wrapper

class Expedition.dll_wrapper.ExpeditionDLL(exp_install_dir)[source]

Bases: object

Wrapper for the Expedition DLL

This class provides a Python interface to the Expedition DLL.

add_mark_to_active_route(name: str, lat: float, lon: float, locked: bool = True, save: bool = True)[source]

Add a mark to the active route :param name: mark name :param lat: latitude :param lon: longitude :param locked: locked (default True) :param save: whether to save (default True) :return:

create_active_route(name: str, save: bool = True)[source]

Create an active route :param name: route name :param save: whether to save (default True) :return:

static from_default_location()[source]

Create an instance of the ExpeditionDLL class using the default installation location :return: an instance of the ExpeditionDLL class

get_ais_dangerous_cpa() Tuple[bool, str][source]

Get dangerous AIS CPA state and target name. :return: tuple (dangerous, target_name)

get_boat_colour(boat: int) Tuple[int, int, int][source]

Get the colour of a boat :param boat: :return: r, g, b colour values

get_boat_position(boat: int) Tuple[float, float] | None[source]

Get the position of a boat :param boat: the number of the boat :return: tuple of latitude and longitude

get_exp_var_name(var: Var) str[source]

Get the name of an Expedition variable :param var: enumeration of the variable :return: the name of the variable

get_exp_var_value(var: Var, boat=0) float | None[source]

Get the value of an Expedition variable :param var: enumeration of the variable :param boat: the boat number to get the variable for (default 0) :return: value of the variable

get_exp_var_value_by_name(name: str, boat=0)[source]

Get the value of an Expedition variable by name :param name: the name of the variable :param boat: the boat number to get the variable for (default 0) :return: value of the variable

get_exp_vars(var_list: List[Var], boat=0) List[float] | None[source]

Get the values of a list of Expedition variables :param var_list: list of variables to get :param boat: boat number to get the variables for (default 0) :return: list of values

get_exp_vars_dict(var_list: List[Var], boat=0) Dict[Var, float] | None[source]

Get the values of a list of Expedition variables :param var_list: list of variables to get :param boat: boat number to get the variables for (default 0) :return: dictionary of values

get_number_of_boats() int[source]

Get the number of boats in the Expedition :return: maximum boat number

get_sys_bool(var: SysBooleanVar) bool | None[source]

Get the value of a system boolean variable :param var: system boolean variable enumeration :return: value

get_sys_var(var: SysVar) float | None[source]

Get the value of a system variable :param var: system variable enumeration :return: value

get_var_precision(var: Var) int[source]

Get precision for a user variable. :param var: variable id (0-31 or Var.User0-Var.User31) :return: precision value

get_variation(lat: float, lon: float, date: datetime | None = None) float | None[source]

Get magnetic variation (degrees) at a position.

Uses ExpDLL GetVariation (OLE DATE utc per ExpDLL.h). If that fails, reads Var.MagVar after setting position on a scratch boat (Expedition must be running).

property number_of_vars: int

Get the number of Expedition variables :return: The number of Expedition variables

ping_mark(name: str, lat: float, lon: float, save: bool)[source]

Ping a mark :param name: name of the mark :param lat: latitude :param lon: longitude :param save: save the mark :return:

set_boat_colour(boat: int, r: int, g: int, b: int)[source]

Set the colour of a boat :param boat: :param r: red :param g: green :param b: blue :return:

set_boat_name(boat: int, name: str)[source]

Set the name of a boat :param boat: :param name: :return:

set_boat_position(boat: int, lat_lon: Tuple[float, float])[source]

Set the position of a boat :param boat: the number of the boat :param lat_lon: tuple of latitude and longitude :return:

set_exp_user_var_name(var: Var, name)[source]

Set the name of a user variable :param var: enumeration of the variable :param name: the name of the variable :return: None

set_exp_var_by_name(name: str, value: float, boat=0)[source]

Set the value of an Expedition variable by name :param name: the name of the variable :param value: the value to set :param boat: the boat number to set the variable for (default 0)

set_exp_var_value(var: Var, value: float, boat=0)[source]

Set the value of an Expedition variable :param var: enumeration of the variable :param value: the value to set :param boat: the boat number to set the variable for (default 0)

set_exp_vars(var_list: List[Var], value_list: List[float], boat=0)[source]

Set the values of a list of Expedition variables :param var_list: list of variables to set :param value_list: values to set :param boat: boat number to set the variables for (default 0) :return: None

set_exp_vars_dict(var_dict: Dict[Var, float], boat=0)[source]

Set the values of a dictionary of Expedition variables :param var_dict: dictionary of variables to set :param boat: boat number to set the variables for (default 0) :return: None

set_mob(lat: float, lon: float)[source]

Set the MOB position :param lat: latitude :param lon: longitude :return:

set_var_precision(var: Var, precision: int)[source]

Set precision for a user variable. :param var: variable id (0-31 or Var.User0-Var.User31) :param precision: decimal precision :return: None

Expedition.enums

class Expedition.enums.SysBooleanVar(*values)[source]

Bases: IntEnum

Enumeration of system boolean variables.

lAISDangerousCPA = 47
lAltId = 36
lAutoPalette = 2
lAutoPan = 0
lCalcAwaMastRotation = 33
lCalcCurrent = 25
lCalcDewPoint = 8
lCalcLeeway = 22
lCalcLeewayComponents = 23
lCalcPitchRollRate = 24
lCalcTw = 26
lCalcTwHeel = 29
lCalcTwd = 28
lCalcUseCog = 31
lCalcUsePitchRollRates = 32
lCalcUseSog = 30
lCalcYawRate = 27
lDarkTheme = 55
lDay = 54
lFahrenheit = 4
lFourWands = 6
lGate = 56
lHaveGate = 57
lHoldDrift = 51
lHoldSet = 50
lHoldTwd = 48
lHoldTws = 49
lKeypad = 5
lLaylineROT = 16
lLaylineTimeBelowZero = 17
lLocalTime = 1
lLogBoats = 21
lLogPlayback = 52
lMOB = 46
lMagneticMode = 3
lMax = 60
lNumPersistent = 34
lPingAtBow = 58
lPortMode = 9
lQuit = 35
lSimpleRibbon = 12
lSlave = 19
lSpare2 = 11
lSpare3 = 14
lSpare4 = 20
lStartDownwind = 45
lStartEnds = 15
lStartMagnify = 43
lStartRoll = 44
lStartTimeGPS = 39
lStartTimePort = 41
lStartTimeReaching = 40
lStartTimeStarboard = 42
lThreadMutex = 59
lTouch = 18
lTrackLoad = 13
lUpdateDerived = 38
lUseInstAsTarg = 37
lUserFlag = 53
lVersionUpdate = 10
lXteStandard = 7
class Expedition.enums.SysIntVar(*values)[source]

Bases: Enum

Enumeration of system integer variables.

DampingFilter = 5
Depth = 1
Distance = 3
Gps = 6
GpsPort = 7
MarkRounding = 12
Max = 13
NumPersistent = 11
Palette = 8
PredictorMinutes = 10
Pressure = 9
Speed = 2
Start = 4
Theme = 0
class Expedition.enums.SysVar(*values)[source]

Bases: IntEnum

Enumeration of system variables.

AboveLine = 51
AisAgeLimit = 77
AltInterval = 4
AltTwa = 7
BoatLength = 0
BoatWidth = 2
BowLat = 62
BowLon = 63
BowToGps = 1
CalAccel = 72
CalBsp = 70
CalLeeway = 71
CalRot = 73
CalTwa = 68
CalTws = 69
CurrentRotLimit = 11
DisplayEast = 90
DisplayNorth = 88
DisplayScale = 92
DisplaySouth = 89
DisplayWest = 91
GSpotLat = 79
GSpotLon = 80
GateLat = 60
GateLon = 61
GpsOffset = 3
HoldDrift = 15
HoldSet = 14
HoldTwd = 12
HoldTws = 13
LaserLat = 29
LaserLon = 30
LegBrgM = 34
LegBrgT = 35
LegRng = 33
LogHz = 5
MouseBearing = 58
MouseRange = 59
MouseTime = 54
MouseTimeP = 55
MouseTimePolar = 57
MouseTimeS = 56
NumSysChannels = 93
PrevMarkBrg = 66
PrevMarkLat = 31
PrevMarkLon = 32
PrevMarkRng = 67
RemoteLinePortLat = 83
RemoteLinePortLon = 84
RemoteLineStrbLat = 85
RemoteLineStrbLon = 86
StartDampCurrent = 9
StartDampWind = 8
StartDistToPort = 52
StartDistToStrb = 53
StartLPDist = 46
StartLPLatL = 47
StartLPLonL = 48
StartLSDist = 43
StartLSLatL = 44
StartLSLonL = 45
StartRPDist = 40
StartRPLatL = 41
StartRPLonL = 42
StartRSDist = 37
StartRSLatL = 38
StartRSLonL = 39
StartReachLat = 49
StartReachLon = 50
StartTime = 36
SternLat = 64
SternLon = 65
TestStartTime = 87
TimeEvents = 76
TimeGpsYYMMDD = 78
TimeLogPlayer = 74
TimeTests = 75
TimerRoll = 10
TwdPeriod = 6
ValNumPersistent = 16
Wand0 = 25
Wand1 = 26
Wand2 = 27
Wand3 = 28
WandLat0 = 17
WandLat1 = 19
WandLat2 = 21
WandLat3 = 23
WandLon0 = 18
WandLon1 = 20
WandLon2 = 22
WandLon3 = 24
XteLat = 81
XteLon = 82
class Expedition.enums.Var(*values)[source]

Bases: IntEnum

Enumeration of Expedition variables.

AirDensity = 387
AirDensityPredicted = 388
AirTemp = 14
Alt0 = 117
Alt1 = 118
Alt2 = 119
Alt3 = 120
Alt4 = 121
Alt5 = 122
Alt6 = 123
Alt7 = 124
Alt8 = 125
Alt9 = 126
Amps = 364
Amps1 = 393
Amps2 = 394
Amps3 = 395
Amps4 = 396
Awa = 2
Aws = 3
Backstay = 171
Baro = 16
Blade = 330
Board = 73
BoardP = 77
BoardS = 78
Bobstay = 292
Boom = 260
BoomAngle = 317
BrgFromBoat0 = 289
Bsp = 1
BspTransverse = 285
CANLoad = 382
CalAccel = 403
CalBrake = 402
CalROT = 401
ChargeState = 365
ChargeState1 = 397
ChargeState2 = 398
ChargeState3 = 399
ChargeState4 = 400
Cog = 50
Course = 9
Cunningham = 318
D0port = 294
D0starboard = 295
D1port = 296
D1starbboard = 297
DeflectorLower = 337
DeflectorP = 281
DeflectorS = 291
DeflectorUpper = 336
DeltaBspSog = 231
DeltaCourseCog = 357
DeltaHdgCog = 232
DeltaMarkBrgCog = 276
DeltaPolBsp = 279
DeltaPolarRoll = 344
DeltaTargBsp = 8
DeltaTargRoll = 280
DeltaTargTwa = 104
Depth = 17
DepthAft = 351
DewPt = 370
DiffRefStn = 52
DistFinish = 80
DownhaulLoad = 23
DownhaulLoad2 = 151
Drift = 12
EXCANFastPacketErrors = 383
EngineOilPressure = 74
EngineOilTemp = 360
EngineTemp = 359
ErrorCode = 60
ExSysGpsTimeDelta = 256
FoilP = 327
FoilS = 328
ForestayInner = 286
ForestayInnerHalyard = 319
ForestayLen = 25
ForestayLoad = 22
ForestayPlusTackLoad = 371
FourierTwd = 235
FourierTws = 236
FuelLevel = 363
FuelLevel2 = 381
GateBiasLen = 378
GateBrg = 367
GateDistOnPort = 212
GateDistOnStrb = 210
GateRng = 366
GateSpotTimeOnPort = 214
GateSpotTimeOnStrb = 213
GateSquareWind = 377
GateTime = 287
GateTimeOnPort = 209
GateTimeOnStrb = 211
GpsAge = 44
GpsAltitude = 45
GpsDistToRaceNote = 138
GpsGeoidSeparation = 46
GpsHDOP = 40
GpsHPE = 167
GpsMethod = 39
GpsMode = 47
GpsNumber = 43
GpsPDOP = 41
GpsTime = 146
GpsTimeToRaceNote = 139
GpsVDOP = 42
Gradient = 372
Gwd = 94
Gws = 95
Hdg = 13
HeadingToSteer = 262
HeadingToSteerPol = 263
Heave = 257
J1 = 323
J2 = 324
J3 = 325
J4 = 326
JibFurl = 320
JibHalyard = 321
KeelAngle = 71
KeelHeight = 72
Lat = 48
LayBear = 98
LayDist = 96
LayDistOnPort = 36
LayDistOnStrb = 33
LayPortBear = 35
LayPortBearDn = 217
LayPortBearMean = 345
LayPortBearSD = 347
LayPortBearUp = 215
LayPortRatio = 233
LayStrbBear = 38
LayStrbBearDn = 218
LayStrbBearMean = 346
LayStrbBearSD = 348
LayStrbBearUp = 216
LayStrbRatio = 234
LayTime = 97
LayTimeGPS = 358
LayTimeOnPort = 37
LayTimeOnStrb = 34
LeadPort = 169
LeadStbd = 170
LineSquareWind = 83
LogBsp = 140
LogSog = 141
Lon = 49
Lwy = 10
MagVar = 93
MainHalyard = 342
MainSheet = 69
MarkBrg = 106
MarkDrift = 160
MarkGpsTime = 107
MarkLat = 161
MarkLon = 162
MarkRng = 105
MarkSet = 159
MarkTime = 88
MarkTwa = 108
Mast = 26
Mast2 = 343
MastAngle = 24
MastCant = 322
MaxLayPortBear = 225
MaxLayStrbBear = 227
MinLayPortBear = 226
MinLayStrbBear = 228
MouseTime = 405
MouseTimePolar = 406
Mwa = 258
Mws = 259
NearestTide = 239
NextMarkAwa = 132
NextMarkAws = 133
NextMarkBrg = 112
NextMarkLat = 315
NextMarkLon = 316
NextMarkPolTime = 127
NextMarkRng = 111
NextMarkTimeOnPort = 89
NextMarkTimeOnStrb = 90
NextMarkTwa = 113
NumChannels = 414
OppTrack = 79
OppTrackCog = 309
OppTrackMarkBrg = 386
OptVmc = 101
OptVmcHdg = 102
OptVmcTwa = 103
Outhaul = 293
Pitch = 19
PitchRate = 277
PolCustom0 = 240
PolCustom0PC = 244
PolCustom0Targ = 248
PolCustom1 = 241
PolCustom1PC = 245
PolCustom1Targ = 249
PolCustom2 = 242
PolCustom2PC = 246
PolCustom2Targ = 250
PolCustom3 = 243
PolCustom3PC = 247
PolCustom3Targ = 251
PolVmc = 100
PolVmcToMark = 70
PolarBsp = 57
PolarBspN = 63
PolarBspPercent = 58
PolarBspPercentN = 64
PolarBspPercentS = 384
PolarBspS = 353
PolarRoll = 59
PolarTws = 306
PolarTwsDelta = 307
PolarTwsPC = 308
PortAftTank = 408
PortFwdTank = 407
PortLoadCell = 28
PortRunner = 62
PredDrift = 110
PredMSLP = 314
PredSeaTemp = 413
PredSet = 109
PredTwd = 312
PredTws = 313
RH = 168
ROT = 32
RPM1 = 75
RPM2 = 76
RadarBrg = 115
RadarRng = 114
Rake = 29
Reacher = 329
RngFromBoat0 = 290
Roll = 18
RollRate = 278
Rudder = 20
RudderFwd = 7
RudderP = 282
RudderPitchP = 374
RudderPitchS = 375
RudderS = 283
RudderToe = 284
SailEvent = 404
SailMark = 270
SailNext = 271
SailNow = 269
SeaTemp = 15
Set = 11
Shadow = 149
ShadowOppTack = 150
Sog = 51
Solent = 332
SpinnakerP = 340
SpinnakerS = 341
StartBspOnPort = 266
StartBspOnStrb = 267
StartBspToPort = 264
StartBspToStrb = 265
StartBurnPC = 352
StartDistBelowLine = 207
StartDistBelowLineGun = 208
StartDistBelowLineStern = 116
StartDistToLine = 84
StartGpsTimeToBurn = 143
StartGpsTimeToLine = 142
StartGunBspPolPC = 355
StartGunBspTargPC = 354
StartLPTime = 137
StartLSTime = 136
StartLayPortBear = 130
StartLayStrbBear = 131
StartLayTimeP = 157
StartLayTimeS = 158
StartLineBiasDeg = 128
StartLineBiasLen = 129
StartLineTimeSP = 356
StartPortEndLat = 163
StartPortEndLon = 164
StartRPTime = 135
StartRSTime = 134
StartRchBspToLine = 87
StartRchDistToLine = 86
StartRchTimeToLine = 85
StartStrbEndLat = 165
StartStrbEndLon = 166
StartTimeBurnPortX = 155
StartTimeBurnStrbX = 156
StartTimeToBurn = 206
StartTimeToGun = 204
StartTimeToLine = 205
StartTimeToPort = 81
StartTimeToPortBurn = 349
StartTimeToPortPinch = 310
StartTimeToPortSimple = 302
StartTimeToStrb = 82
StartTimeToStrbBurn = 350
StartTimeToStrbPinch = 311
StartTimeToStrbSimple = 303
Staysail = 331
StbdAftTank = 410
StbdFwdTank = 409
StbdLoadCell = 27
StrbRunner = 61
Tab = 21
Tack = 333
TackAngle = 152
TackAnglePolar = 153
TackLossVMGMetres = 274
TackLossVMGSec = 273
TackP = 334
TackS = 335
TargAwa = 154
TargBsp = 238
TargBspN = 54
TargBspPercent = 261
TargBspPercentS = 385
TargBspS = 145
TargRoll = 56
TargTwa = 237
TargTwaLwy = 65
TargTwaN = 53
TargTwaS = 144
TargTwd = 304
TargTwdDelta = 305
TargVmg = 55
TestTime = 376
TideLayPortTime = 223
TideLayPortTimeOnPort = 219
TideLayPortTimeOnStbd = 220
TideLayStbdTime = 224
TideLayStbdTimeOnPort = 221
TideLayStbdTimeOnStbd = 222
TransmissionOilPressure = 362
TransmissionOilTemp = 361
Traveller = 68
TripLog = 275
Twa = 4
Twd = 6
TwdLayMark = 229
TwdLayMarkOpp = 230
TwdLess90 = 148
TwdMax = 412
TwdMin = 411
TwdPlus90 = 147
TwdTwisted = 272
Twdg = 369
Twg = 368
Twist = 268
Tws = 5
TwsWithGradient = 373
User0 = 172
User1 = 173
User10 = 182
User11 = 183
User12 = 184
User13 = 185
User14 = 186
User15 = 187
User16 = 188
User17 = 189
User18 = 190
User19 = 191
User2 = 174
User20 = 192
User21 = 193
User22 = 194
User23 = 195
User24 = 196
User25 = 197
User26 = 198
User27 = 199
User28 = 200
User29 = 201
User3 = 175
User30 = 202
User31 = 203
User4 = 176
User5 = 177
User6 = 178
User7 = 179
User8 = 180
User9 = 181
Utc = 0
V0port = 298
V0starbboard = 299
V1port = 300
V1starbboard = 301
Vang = 67
Vmc = 92
VmcPercent = 99
Vmg = 31
VmgPercent = 66
Volts = 30
Volts1 = 389
Volts2 = 390
Volts3 = 391
Volts4 = 392
WaterLevel = 379
WaterLevel2 = 380
WaveMaxHeight = 254
WaveMaxPeriod = 255
WaveSigHeight = 252
WaveSigPeriod = 253
WinchP = 338
WinchS = 339
Xte = 91
ZeroAhead = 288