Sim: Attempt to fix error on first FG loadup

This commit is contained in:
Joshua Davidson 2019-02-12 10:49:28 -05:00
parent e0d9c90c81
commit 2d3159e3dc
9 changed files with 37 additions and 9 deletions

View file

@ -5,7 +5,6 @@
<PropertyList>
<sim>
<author>it0uchpods Design Group: Joshua Davidson (it0uchpods), Jonathan Redpath (legoboyvdlp), Thorsten Herrmann (TH-555)</author>
<status>Pre V1.0</status>
@ -403,7 +402,11 @@
<z-offset-max-m type="float">300.0</z-offset-max-m>
</current-view>
<minimum-fg-version>2018.1.0</minimum-fg-version>
<minimum-fg-version>2018.1.0</minimum-fg-version>
<signals n="0">
<hack-canvas type="bool">0</hack-canvas>
</signals>
</sim>
<consumables>

View file

@ -192,7 +192,7 @@ var canvas_IESI = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
IESI_display = canvas.new({
"name": "IESI",
"size": [1024, 1024],

View file

@ -3072,7 +3072,7 @@ var canvas_lowerECAM_test = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
lowerECAM_display = canvas.new({
"name": "lowerECAM",
"size": [1024, 1024],

View file

@ -1742,7 +1742,7 @@ var canvas_MCDU_2 = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
MCDU1_display = canvas.new({
"name": "MCDU1",
"size": [1024, 864],

View file

@ -287,7 +287,7 @@ var canvas_ND_2_test = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
setprop("instrumentation/efis[0]/inputs/plan-wpt-index", -1);
setprop("instrumentation/efis[1]/inputs/plan-wpt-index", -1);

View file

@ -1283,7 +1283,7 @@ var canvas_PFD_2_mismatch = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
PFD1_display = canvas.new({
"name": "PFD1",
"size": [1024, 1024],

View file

@ -1159,7 +1159,7 @@ var canvas_upperECAM_test = {
},
};
setlistener("sim/signals/fdm-initialized", func {
setlistener("/sim/signals/hack-canvas", func {
upperECAM_display = canvas.new({
"name": "upperECAM",
"size": [1024, 1024],

View file

@ -206,6 +206,31 @@ var systemsInit = func {
setlistener("/sim/signals/fdm-initialized", func {
systemsInit();
canvas.Text._lastText = canvas.Text["_lastText"];
canvas.Text.setText = func(text) {
if (text == me._lastText and text != nil and size(text) == size(me._lastText)) {return me;}
me._lastText = text;
me.set("text", typeof(text) == 'scalar' ? text : "");
};
canvas.Element._lastVisible = nil;
canvas.Element.show = func {
if (1 == me._lastVisible) {return me;}
me._lastVisible = 1;
me.setBool("visible", 1);
};
canvas.Element.hide = func {
if (0 == me._lastVisible) {return me;}
me._lastVisible = 0;
me.setBool("visible", 0);
};
canvas.Element.setVisible = func(vis) {
if (vis == me._lastVisible) {return me;}
me._lastVisible = vis;
me.setBool("visible", vis);
};
setprop("/sim/signals/hack-canvas", 1);
});
var systemsLoop = maketimer(0.1, func {

View file

@ -1 +1 @@
4760
4761