From 63e67b38ac0a1d36418a4b2c1599797e77a000d8 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 19 Jun 2020 13:28:44 +0200 Subject: [PATCH] Append all points --- TracksList.qml | 64 ++++++++--- i18n/editor_cs_CZ.ts | 255 ++++++++++++++++++++++--------------------- i18n/editor_en_US.ts | 255 ++++++++++++++++++++++--------------------- 3 files changed, 305 insertions(+), 269 deletions(-) diff --git a/TracksList.qml b/TracksList.qml index 551fcae..7012c71 100644 --- a/TracksList.qml +++ b/TracksList.qml @@ -17,6 +17,26 @@ Rectangle { updateComputedValues() } + function trackPointTemplate(tid, pid) { + return { + "tid": tid, + "pid": pid, + "type": "line", + "flags": -1, + "distance": -1, + "addTime": 0, + "computed_angle": -1, + "computed_distance": -1, + "angle": -1, + "radius": -1, + "speed_max": -1, + "alt_min": -1, + "alt_max": -1, + "ptr": -1, + }; + } + + function updateComputedValues() { if (computedData === undefined) { return; @@ -719,7 +739,8 @@ Rectangle { }) - + // FIXME check selection + console.log("selection") tracksPointTable.selection.clear(); for (var i = 0; i < sel.length; i++) { @@ -788,6 +809,29 @@ Rectangle { } } + MenuItem { + //% "Append all points" + text: qsTrId("tracks-list-points-table-add-all") + enabled: (pointsModel.count > 0) + visible: (tracksModel.count == 0) + + onTriggered: { + var maxId = 0; + for (var i = 0; i < tracksModel.count; i++) { + var item = tracksModel.get(i); + maxId = Math.max(item.tid, maxId); + } + for (var j = 0; j < pointsModel.count; j++) { + var p = pointsModel.get(j) + var obj = trackPointTemplate((maxId+1+j), p.pid) + tracksModel.append(obj) + } + tracksPointTable.selection.clear(); + tracksModel.tracksChanged(); + + } + } + function addPoint(pos) { var maxId = 0; for (var i = 0; i < tracksModel.count; i++) { @@ -846,22 +890,7 @@ Rectangle { } } - var obj = { - "tid": (maxId+1), - "pid": p.pid, - "type": "line", - "flags": -1, - "distance": -1, - "addTime": 0, - "computed_angle": -1, - "computed_distance": -1, - "angle": -1, - "radius": -1, - "speed_max": -1, - "alt_min": -1, - "alt_max": -1, - "ptr": -1, - }; + var obj = trackPointTemplate((maxId+1), p.pid) if ((pos === -1) || (pos >= tracksModel.count)) { tracksModel.append(obj) @@ -881,6 +910,7 @@ Rectangle { tracksModel.tracksChanged(); } + MenuItem { //% "Remove point" text: qsTrId("tracks-list-points-table-remove") diff --git a/i18n/editor_cs_CZ.ts b/i18n/editor_cs_CZ.ts index b966ff4..c63eeac 100644 --- a/i18n/editor_cs_CZ.ts +++ b/i18n/editor_cs_CZ.ts @@ -9,192 +9,192 @@ Vlastnosti kategorie %1 - + Time gate max score [points] Time gate max score Časová brána - maximální skóre [body] - + Time gate tolerance [sec] Time gate tolerance Časová brána - tolerance [s] - + Time gate penalty [points per sec] Time gate penalty Časová brána - penalizace [body/s] - + Space gate max score [points] Space gate max score Prostorová brána - maximální skóre [body] - + Turn point max score [points] Turn point max score Otočný bod - maximální skóre [body] - + Marker max score [points] Marker max score Znaky - maximální skóre [body] - + Photos max score [points] Photos max score Fotky - maximální skóre [body] - + Time window size [sec] Time window size Startovací okno [s] - + Time window penalty [%] Time window penalty Startovácí okno - penalizace [%] - + Altitude penalty [points per meter] Altitude penalty Nedodžení výsky - penalizace [body/m] - + Gyre penalty [%] Gyre penalty [%%] Kroužení -. penalizace [%] - + Oposite direction penalty [%] Oposite direction penalty [%%] Let v protisměru - penalizace [%] - + Out of sector pentaly [%] Out of sector pentaly [points] Vylétnutí ze sektrou [%] - + Speed max score [points] Rychlostní úsek- maximální skóre[body] - + Speed penalty [points per km/h] Speed max score [points] Nedodržení rychlosti - penalizace [body/km/h] - + Speed tolerance [km/h] Speed tolerance Rychlost - tolerance [km/h] - + Preparation time [hh:mm:ss] Preparation time [sec] Čas na přípravu [hh:mm:ss] - + Radius [m] default_radius [m] Poloměr [m] - + Minimum Altitude [m] default_alt_min [m] Minimální výška [m] - + Maximum Altitude [m] default_alt_max [m] Maximální výška [m] - + Flags default_flags Atributy - - + + Section speed start Začátek úseku měření rychlosti - - + + Section speed end Konec úseku měření rychlosti - - + + Section alt start Začátek úseku měření výšky - - + + Section alt end Konec úseku měření výšky - - + + Section space start Začátek úseku měření koridoru - - + + Section space end Konec úseku měření koridoru - - + + Secret Turn Point Tajný otočný bod - - + + Secret Time Gate Tajná časová brána - - + + Secret Space Gate Secret Time Gate Tajná prostorová brána - + Ok Ok - + Cancel Zrušit @@ -367,36 +367,34 @@ By installing, copying or other use of Software User declares he/she has read th &Zrušit - - + + Altitude min Minimální výška - - + + Altitude max Maximální výška - Speed min - Minimální rychlost + Minimální rychlost - Speed max - Maximální rychlost + Maximální rychlost - - + + Turn Point Otočný bod - - + + Time gate Časová brána @@ -406,215 +404,215 @@ By installing, copying or other use of Software User declares he/she has read th Editor trati - + &File &Soubor - + &New &Nový - + &Load &Otevřít - + &Recently opened Recent projects &Naposledy otevřené - + &Save &Uložit - + Save &as... Save as... U&ložit jako... - + Load &GFW Load GFW Otevřít &GFW - + &Import &Importovat - + E&xport E&xportovat - + E&xit &Ukončit - + &Edit Edit &Úpravy - + Clone Klonování - + Zoom to points Přiblížit na body - + Zoom in Přiblížit - + Zoom out Oddálit - + Show track always Zobrazovat trať vždy - + Ruler Pravítko - + Automaticaly snap to center Automaticky na střed - + &Map &Mapa - + &None &Žádná - + &Local &Stazene mapy - + &OSM Mapnik &OSM Mapnik - + Google &Roadmap Google &Roadmap - + Google &Terrain Google &Terrain - + Google &Satellite Google &Satellite - + Custom tile layer Vlastní mapová vrstva - + Airspace Off Vzdušné prostory vypnuty - + Airspace (skylines.aero) Airspace (prosoar.de) Vzdušné prostory (skylines.aero) - + Airspace (local) Vzdušné prostory (stažené) - + Show &gfw image Load &gfw image Zobrazit gf&w obrázek - + &Help &Nápověda - + &About &O programu - + Custom map tile configuration Set Map URL Nastavení vlastního mapového podkladu - + Enter URL Set URL Zadejte adresu - + Error Chyba - + Are you sure? Jste si jistý? - + Your changes have not been saved. Změny nebyly uloženy. - + Cannot load defaults Nelze načíst výchozí hodnoty - + speed rychlost - + altitude výška - + space prostor @@ -774,167 +772,172 @@ By installing, copying or other use of Software User declares he/she has read th Tratě - + None Žádný - + Line Přímka - + Mid-point Arc A Mid-point Arc Oblouk A - + Mid-point Arc B Edge-point Arc Oblouk B - + Polyline Křivka - + Preferences Nastavení - + Statistics Statistika - + Id Id - + Point Bod - + Type Typ - + Angle [deg] Angle Úhel [st] - + Distance to previous point [m] Distance to next point [m] Vzdálenost k předcházejícímu bodu [m] - + Distance to start point [m] Vzdálenost k VBT [m] - + Time to next point [s] Additional Time [s] Čas dodatečný k následujícímu bodu [s] - + Radius [m] Radius Poloměr [m] - + Flags Atributy - + Min Alt [m] Min Alt Minimální výška [m] - + Max Alt [m] Max Alt Maximální výška [m] - + Arc/Poly Oblouk/Křivka - + Add point before selected Přidat bod před vybraný - + Add point after selected Přidat bod za vybraný - + Add point Přidat bod - + Append 10 points Add 10 points Na konec vložit 10 bodů + + + Append all points + Vložit všechny body + - + Remove point Odstranit bod - + Reset flags Obnovit atributy - - + + Space gate Prostorová brána - + Id Id - + Polygon Polygon - + Score Body - + Add polygon Přidat polygon - + Remove polygon Odstranit polygon diff --git a/i18n/editor_en_US.ts b/i18n/editor_en_US.ts index bdd6fa2..576aa2d 100644 --- a/i18n/editor_en_US.ts +++ b/i18n/editor_en_US.ts @@ -9,192 +9,192 @@ Category properties %1 - + Time gate max score [points] Time gate max score Time gate max score [points] - + Time gate tolerance [sec] Time gate tolerance Time gate tolerance [sec] - + Time gate penalty [points per sec] Time gate penalty Time gate penalty [points per sec] - + Space gate max score [points] Space gate max score Space gate max score [points] - + Turn point max score [points] Turn point max score Turn point max score [points] - + Marker max score [points] Marker max score Marker max score [points] - + Photos max score [points] Photos max score Photos max score [points] - + Time window size [sec] Time window size Time window size [sec] - + Time window penalty [%] Time window penalty Time window penalty [%] - + Altitude penalty [points per meter] Altitude penalty Altitude penalty [points per meter] - + Gyre penalty [%] Gyre penalty [%%] Gyre penalty [%] - + Oposite direction penalty [%] Oposite direction penalty [%%] Oposite direction penalty [%] - + Out of sector pentaly [%] Out of sector pentaly [points] Out of sector pentaly [%] - + Speed max score [points] Speed section - max score [points] - + Speed penalty [points per km/h] Speed max score [points] Speed penalty [points per km/h] - + Speed tolerance [km/h] Speed tolerance Speed tolerance [km/h] - + Preparation time [hh:mm:ss] Preparation time [sec] Preparation time [hh:mm:ss] - + Radius [m] default_radius [m] Radius[m] - + Minimum Altitude [m] default_alt_min [m] Minimum Altitude [m] - + Maximum Altitude [m] default_alt_max [m] Maximum Altitude [m] - + Flags default_flags Flags - - + + Section speed start Section speed start - - + + Section speed end Section speed end - - + + Section alt start Section alt start - - + + Section alt end Section alt end - - + + Section space start Section space start - - + + Section space end Section space end - - + + Secret Turn Point Secret Turn Point - - + + Secret Time Gate Secret Time Gate - - + + Secret Space Gate Secret Time Gate Secret Space Gate - + Ok Ok - + Cancel Cancel @@ -366,36 +366,34 @@ By installing, copying or other use of Software User declares he/she has read th &Cancel - - + + Altitude min Altitude min - - + + Altitude max Altitude max - Speed min - Speed min + Speed min - Speed max - Speed max + Speed max - - + + Turn Point Turn Point - - + + Time gate Time Gate @@ -405,215 +403,215 @@ By installing, copying or other use of Software User declares he/she has read th Trajectory Editor - + &File &File - + &New &New - + &Load &Load - + &Recently opened Recent projects &Recently opened - + &Save &Save - + Save &as... Save as... Save &as... - + Load &GFW Load GFW Load &GFW - + &Import &Import - + E&xport E&xport - + E&xit E&xit - + &Edit Edit &Edit - + Clone Clone - + Zoom to points Zoom to points - + Zoom in Zoom in - + Zoom out Zoom out - + Show track always Show track always - + Ruler Ruler - + Automaticaly snap to center Autosnap to center - + &Map &Map - + &None &None - + &Local &Local - + &OSM Mapnik &OSM Mapnik - + Google &Roadmap Google &Roadmap - + Google &Terrain Google &Terrain - + Google &Satellite Google &Satellite - + Custom tile layer Custom tile layer - + Airspace Off Airspace Off - + Airspace (skylines.aero) Airspace (prosoar.de) Airspace (skylines.aero) - + Airspace (local) Airspace (local) - + Show &gfw image Load &gfw image Show &gfw image - + &Help &Help - + &About &About - + Custom map tile configuration Set Map URL Custom map tile configuration - + Enter URL Set URL Enter URL - + Error Error - + Are you sure? Are you sure? - + Your changes have not been saved. Your changes have not been saved. - + Cannot load defaults Cannot load defaults - + speed speed - + altitude altitude - + space space @@ -771,167 +769,172 @@ By installing, copying or other use of Software User declares he/she has read th Tracks - + None None - + Line Line - + Mid-point Arc A Mid-point Arc Mid-point Arc A - + Mid-point Arc B Edge-point Arc Mid-point Arc B - + Polyline Polyline - + Preferences Preferences - + Statistics Statistics - + Id Id - + Point Point - + Type Type - + Angle [deg] Angle Angle [deg] - + Distance to previous point [m] Distance to next point [m] Distance to previous point [m] - + Distance to start point [m] Distance to start point [m] - + Time to next point [s] Additional Time [s] Time to next point [s] - + Radius [m] Radius Radius [m] - + Flags Flags - + Min Alt [m] Min Alt Min Alt [m] - + Max Alt [m] Max Alt Max Alt [m] - + Arc/Poly Arc/Poly - + Add point before selected Add point before selected - + Add point after selected Add point after selected - + Add point Add point - + Append 10 points Add 10 points Append 10 points + + + Append all points + Append all points + - + Remove point Remove point - + Reset flags Reset flags - - + + Space gate Space gate - + Id Id - + Polygon Polygon - + Score Score - + Add polygon Add polygon - + Remove polygon Remove polygon