Man
Overboard.
Are any plugin developers consuming the plugin message "OCPN_MAN_OVERBOARD" that is generated when a user drops a man
overboard marker ?
If not, I would like to suggest a change so that instead of returning the guid of temporary man overboard
route, it returns the guid of the man overboard waypoint.
In the spirit of interoperability, I have been experimenting with raising alerts on other devices for Man Overboard
events.
FFS, I guess someone thought it may have been a great idea at the time, but the unintended consequences of the
current implementation are mind boggling, to say the least.
A user hits the
MOB icon, and a waypoint is dropped at the present position, another waypoint dropped a mile ahead and a
route generated. I'll leave it for others to debate the merits of creating the second waypoint a mile away, based on the present course, rather than taking into consideration
wind direction or tidal current, but I'll just point out that no other
chartplotter, handheld
gps, or any other device that I have ever used does this.
But I digress.
If a plugin wishes to be alerted when a
MOB event occurs, it simply requests Plugin Messaging and waits for a plugin message with the id of "OCPN_MAN_OVERBOARD". The json message contains the GUID of the temporary MOB route. So now the plugin has to request the route using the GetRoute_Plugin API. So far, not too onerous, but well on the path to stupidity.
The plugin now has to iterate through the list of waypoints to find the actual waypoint that indicates the man overboard position. This is where it gets really stupid. Like all waypoints, a unique guid is generated for the mob waypoint, so one cannot determine which of the two waypoints is the mob waypoint by distinguishing the guid.
So let's try the man overboard waypoint mark name. That's not going to
work either because it is localized. No one can expect a plugin to perform a comparison for "人員落水" in every language that OpenCPN supports.
So the only method for a plugin to determine which of the two waypoints from the MOB temporary route is the actual man overboard position is, believe it or not, to match on the waypoint symbol name "mob".
While it would be nice to suggest that the actual man overboard waypoint is given a invariant, well known guid, that won't
work if multiple man overboard waypoints are dropped. So my simple suggestion is that the Plugin Message "OCPN_MAN_OVERBOARD" just returns the man overboard waypoint, not the temporary route.
It would also be nice if this worked in both directions, meaning we need an API so that a plugin can drop a MOB waypoint, perhaps in response to a user pressing some big red button on their
boat which may be wired to some electronic circuitry on their RaspberryPi, or in response to receiving an alert from one of those new fangled MOB devices.
Just my $0.02 worth.