skylines icon indicating copy to clipboard operation
skylines copied to clipboard

Bad labels when aircraft model is not set

Open pyrog opened this issue 7 years ago • 12 comments

If aircraft model is not set, use aircraft model written in the IGC file. If nothing, use a letter or a number (especially when the map display several flights) ?

flight label null

pyrog avatar Nov 14 '16 15:11 pyrog

The IGC file's model, competition ID and registration are only used on upload to initialize the flight object. If we would use them as a "fallback", the user would not have the possibility to delete the competition ID or registration. See #511.

Harry-R avatar Nov 14 '16 20:11 Harry-R

The IGC file's model, competition ID and registration are only used on upload to initialize the flight object.

Really? Theses values are provided by the API 😉

http://localhost:5000/api/flights/2

{
  "flight": {
    "id": 2,
    "timeCreated": "2016-11-14T13:27:21.682483+00:00",
    "pilot": null,
    "pilotName": "",
    "copilot": null,
    "copilotName": null,
    "club": null,
    "model": null,
    "registration": null,
    "competitionId": null,
    "scoreDate": "2016-09-28",
    "takeoffTime": "2016-09-28T15:10:00.519000+00:00",
    "scoreStartTime": "2016-09-28T15:15:00.909000+00:00",
    "scoreEndTime": "2016-09-28T15:33:33.282000+00:00",
    "landingTime": "2016-09-28T15:41:04.440000+00:00",
    "takeoffAirport": null,
    "landingAirport": null,
    "distance": 6606,
    "triangleDistance": 976,
    "rawScore": 6.89971560747524,
    "score": 6.89971560747524,
    "speed": 3.02749770852429,
    "privacyLevel": 0,
    "igcFile": {
      "owner": {
        "id": 1,
        "name": "Example Manager"
      },
      "filename": "2016-09-28-15-06.igc",
      "registration": null,
      "competitionId": null,
      "model": "whizz 22",
      "date": "2016-09-28"
    }
  }
}

pyrog avatar Nov 14 '16 20:11 pyrog

Yes, if you have a look at the IGC file's data (last part of your JSON), you can see, that the competitionID and registration are null, there. So the flight's competitionID and registration are initialized with null, too.

Harry-R avatar Nov 14 '16 20:11 Harry-R

Hm okay, it seems, that the IGC file's model is used, if the user did not select a model from the list. But the model has nothing to do with your label problem, the labels are only about the competition ID and the registration.

Harry-R avatar Nov 14 '16 21:11 Harry-R

the labels are only about the competition ID and the registration.

Currently yes 😄

But if the pilots don't provide competitionID, registration and model, what should we display ? I suggest to use igcFile.model or

If nothing, use a letter or a number (especially when the map display several flights) ?

Paragliders don't have competitionID and registration in France. And currently there isn't any paragliders models in the DB.

pyrog avatar Nov 14 '16 21:11 pyrog

And what to do, if you have other pilots with the same model? What do you think about displaying the pilot's initials or the name's first 3 or 4 letters? I think, this is a better identifier than the model.

Harry-R avatar Nov 14 '16 21:11 Harry-R

And what to do, if you have other pilots with the same model?

We could use a letter or a number, or even a symbol (◻︎ ◁ ✤ ✩ ❉ ❄︎ ☁︎ …) 😉

I think, this is a better identifier than the model.

👍

pyrog avatar Nov 14 '16 21:11 pyrog

We could use a letter or a number, or even a symbol (◻︎ ◁ ✤ ✩ ❉ ❄︎ ☁︎ …) 😉

if the callsign is explicitly empty then we should not show any callsign. in that case the flight should be identifiable by its color only.

What do you think about displaying the pilot's initials or the name's first 3 or 4 letters? I think, this is a better identifier than the model.

that might be a good default value upon flight upload if no competition ID was set. then again what if the pilot never wants a competition ID, he would have to remove it again and again if we use this as the default. (this is the default for live tracking btw)

Turbo87 avatar Nov 16 '16 17:11 Turbo87

in that case the flight should be identifiable by its color only.

See Color-blindness

then again what if the pilot never wants a competition ID, he would have to remove it again and again if we use this as the default.

The idea is to set a default label, not to set the competition ID 😉

pyrog avatar Nov 16 '16 18:11 pyrog

The idea is to set a default label, not to set the competition ID

the label is specifically showing the competition ID. if you want a label, set a competition ID. I'm not a fan of making it any more complicated than that.

Turbo87 avatar Nov 16 '16 18:11 Turbo87

the label is specifically showing the competition ID

Sorry, but the current code display competition_id, if not, it display registration. The initial purpose of my comment was to avoid displaying null.

if you want a label, set a competition ID

The label is interesting when we displaying many flights at the same time to distinguish them. See flights/48503

capture d ecran 2016-11-16 a 19 36 27

pyrog avatar Nov 16 '16 18:11 pyrog

hmm, that's not quite how it should be. it was supposed to display only competition ID or "nothing" if none is set for the flight. since the registration has different length limits it shouldn't be displayed at that location.

displaying null is obviously a bug, but IMHO the registration shouldn't be displayed either

Turbo87 avatar Nov 16 '16 19:11 Turbo87