diff --git a/Models/Instruments/Common/res/du-test.svg b/Models/Instruments/Common/res/du-test.svg index 79a4b661..d0a9b4c6 100644 --- a/Models/Instruments/Common/res/du-test.svg +++ b/Models/Instruments/Common/res/du-test.svg @@ -41,9 +41,9 @@ inkscape:window-height="1030" id="namedview371" showgrid="true" - inkscape:zoom="0.25" - inkscape:cx="1402.5446" - inkscape:cy="508.4561" + inkscape:zoom="0.70710678" + inkscape:cx="927.599" + inkscape:cy="590.48297" inkscape:window-x="1592" inkscape:window-y="-8" inkscape:window-maximized="1" @@ -55,13 +55,22 @@ type="xygrid" id="grid5153" /> + = elapsedtime) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; setlistener("sim/signals/fdm-initialized", func { diff --git a/Models/Instruments/ND/canvas/ND.nas b/Models/Instruments/ND/canvas/ND.nas index f23feb85..b9d42a43 100644 --- a/Models/Instruments/ND/canvas/ND.nas +++ b/Models/Instruments/ND/canvas/ND.nas @@ -109,9 +109,11 @@ var canvas_nd_base = { if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) { ND_1.page.hide(); ND_1_test.page.show(); + ND_1_test.update(); } else if (getprop("/instrumentation/du/du1-test-time") + getprop("/instrumentation/du/du1-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { ND_1.page.hide(); ND_1_test.page.show(); + ND_1_test.update(); } else { ND_1_test.page.hide(); ND_1.page.show(); @@ -125,9 +127,11 @@ var canvas_nd_base = { if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) { ND_2.page.hide(); ND_2_test.page.show(); + ND_2_test.update(); } else if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) { ND_2.page.hide(); ND_2_test.page.show(); + ND_2_test.update(); } else { ND_2_test.page.hide(); ND_2.page.show(); @@ -187,6 +191,11 @@ var canvas_ND_1_test = { }; canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } me.page = canvas_group; @@ -198,6 +207,21 @@ var canvas_ND_1_test = { return m; }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + if (getprop("/instrumentation/du/du2-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else if (getprop("/instrumentation/du/du1-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; var canvas_ND_2_test = { @@ -207,6 +231,11 @@ var canvas_ND_2_test = { }; canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } me.page = canvas_group; @@ -218,6 +247,21 @@ var canvas_ND_2_test = { return m; }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + if (getprop("/instrumentation/du/du5-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else if (getprop("/instrumentation/du/du6-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; setlistener("sim/signals/fdm-initialized", func { diff --git a/Models/Instruments/PFD/PFD.nas b/Models/Instruments/PFD/PFD.nas index ce51e7dd..4e162e55 100644 --- a/Models/Instruments/PFD/PFD.nas +++ b/Models/Instruments/PFD/PFD.nas @@ -87,25 +87,20 @@ var canvas_PFD_base = { var svg_keys = me.getKeys(); foreach(var key; svg_keys) { me[key] = canvas_group.getElementById(key); - var svg_keys = me.getKeys(); - foreach (var key; svg_keys) { - me[key] = canvas_group.getElementById(key); + var clip_el = canvas_group.getElementById(key ~ "_clip"); + if (clip_el != nil) { + clip_el.setVisible(0); + var tran_rect = clip_el.getTransformedBounds(); - var clip_el = canvas_group.getElementById(key ~ "_clip"); - if (clip_el != nil) { - clip_el.setVisible(0); - var tran_rect = clip_el.getTransformedBounds(); - - var clip_rect = sprintf("rect(%d,%d, %d,%d)", - tran_rect[1], # 0 ys - tran_rect[2], # 1 xe - tran_rect[3], # 2 ye - tran_rect[0]); #3 xs - # coordinates are top,right,bottom,left (ys, xe, ye, xs) ref: l621 of simgear/canvas/CanvasElement.cxx - me[key].set("clip", clip_rect); - me[key].set("clip-frame", canvas.Element.PARENT); - } + var clip_rect = sprintf("rect(%d,%d, %d,%d)", + tran_rect[1], # 0 ys + tran_rect[2], # 1 xe + tran_rect[3], # 2 ye + tran_rect[0]); #3 xs + # coordinates are top,right,bottom,left (ys, xe, ye, xs) ref: l621 of simgear/canvas/CanvasElement.cxx + me[key].set("clip", clip_rect); + me[key].set("clip-frame", canvas.Element.PARENT); } } @@ -165,9 +160,11 @@ var canvas_PFD_base = { if (getprop("/instrumentation/du/du1-test-time") + getprop("/instrumentation/du/du1-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) { PFD_1.page.hide(); PFD_1_test.page.show(); + PFD_1_test.update(); } else if (getprop("/instrumentation/du/du2-test-time") + getprop("/instrumentation/du/du2-test-amount") >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { PFD_1.page.hide(); PFD_1_test.page.show(); + PFD_1_test.update(); } else { PFD_1_test.page.hide(); PFD_1.page.show(); @@ -181,9 +178,11 @@ var canvas_PFD_base = { if (getprop("/instrumentation/du/du6-test-time") + getprop("/instrumentation/du/du6-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) { PFD_2.page.hide(); PFD_2_test.page.show(); + PFD_2_test.update(); } else if (getprop("/instrumentation/du/du5-test-time") + getprop("/instrumentation/du/du5-test-amount") >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) { PFD_2.page.hide(); PFD_2_test.page.show(); + PFD_2_test.update(); } else { PFD_2_test.page.hide(); PFD_2.page.show(); @@ -1001,6 +1000,11 @@ var canvas_PFD_1_test = { }; canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } me.page = canvas_group; @@ -1012,6 +1016,21 @@ var canvas_PFD_1_test = { return m; }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + if (getprop("/instrumentation/du/du1-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") != 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else if (getprop("/instrumentation/du/du2-test-time") + 1 >= elapsedtime and getprop("/modes/cpt-du-xfr") == 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; var canvas_PFD_2_test = { @@ -1021,6 +1040,11 @@ var canvas_PFD_2_test = { }; canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } me.page = canvas_group; @@ -1032,6 +1056,21 @@ var canvas_PFD_2_test = { return m; }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + if (getprop("/instrumentation/du/du6-test-time") + 1 >= elapsedtime and getprop("/modes/fo-du-xfr") != 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else if (getprop("/instrumentation/du/du5-test-time") + 1 >= elapsedtime and getprop("/modes/fo-du-xfr") == 1) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; setlistener("sim/signals/fdm-initialized", func { diff --git a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas index 8282f3a6..f5fb3c71 100644 --- a/Models/Instruments/Upper-ECAM/Upper-ECAM.nas +++ b/Models/Instruments/Upper-ECAM/Upper-ECAM.nas @@ -69,6 +69,7 @@ var canvas_upperECAM_base = { upperECAM_cfm_eis2.page.hide(); upperECAM_iae_eis2.page.hide(); upperECAM_test.page.show(); + upperECAM_test.update(); } else { upperECAM_test.page.hide(); if (getprop("/options/eng") == "CFM") { @@ -816,6 +817,11 @@ var canvas_upperECAM_test = { }; canvas.parsesvg(canvas_group, file, {"font-mapper": font_mapper}); + + var svg_keys = me.getKeys(); + foreach(var key; svg_keys) { + me[key] = canvas_group.getElementById(key); + } me.page = canvas_group; @@ -827,6 +833,18 @@ var canvas_upperECAM_test = { return m; }, + getKeys: func() { + return ["Test_white","Test_text"]; + }, + update: func() { + if (getprop("/instrumentation/du/du3-test-time") + 1 >= elapsedtime) { + me["Test_white"].show(); + me["Test_text"].hide(); + } else { + me["Test_white"].hide(); + me["Test_text"].show(); + } + }, }; setlistener("sim/signals/fdm-initialized", func {