Skip to content

Commit

Permalink
Merge branch 'master' into add-missing-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjozork authored Oct 30, 2020
2 parents a4c51dc + b3b3469 commit ee37b34
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ var A320_Neo_ECAM_Common;
return (this.mainArcRadius * 1);
}
get outerIndicatorOffset() {
return (this.viewBoxSize.x * 0.04);
return (this.viewBoxSize.x * 0.03);
}
get outerIndicatorRadius() {
return (this.viewBoxSize.x * 0.035);
return (this.viewBoxSize.x * 0.03);
}
get outerDynamicArcRadius() {
return (this.mainArcRadius * 1.15);
Expand Down Expand Up @@ -125,6 +125,7 @@ var A320_Neo_ECAM_Common;
}
init(_gaugeDefinition) {
this.cursorOffset = _gaugeDefinition.cursorOffset;
this.startAngle = _gaugeDefinition.startAngle;
this.arcSize = _gaugeDefinition.arcSize;
this.minValue = _gaugeDefinition.minValue;
this.maxValue = _gaugeDefinition.maxValue;
Expand Down Expand Up @@ -207,6 +208,7 @@ var A320_Neo_ECAM_Common;
}
if (this.outerIndicatorFunction != null) {
this.outerIndicatorObject = document.createElementNS(Avionics.SVG.NS, "path");
this.outerIndicatorObject.id = "OuterIndicatorOffset";
const radius = this.outerIndicatorRadius;
var d = [
"M", (this.mainArcRadius + this.outerIndicatorOffset), "0",
Expand All @@ -219,12 +221,30 @@ var A320_Neo_ECAM_Common;
this.rootSVG.appendChild(cursorGroup);
const textPosX = this.viewBoxSize.x * _gaugeDefinition.currentValuePos.x;
const textPosY = this.viewBoxSize.x * _gaugeDefinition.currentValuePos.y;
const textPosXdec = (this.currentValuePrecision == 1) ? textPosX - 19 : textPosX;
const textPosYdec = (this.currentValuePrecision == 1) ? textPosY + 7 : textPosY;
this.currentValueText = document.createElementNS(Avionics.SVG.NS, "text");
this.currentValueText.id = "CurrentValue";
this.currentValueText.setAttribute("x", textPosX.toString());
this.currentValueText.setAttribute("x", textPosXdec.toString());
this.currentValueText.setAttribute("y", textPosY.toString());
this.currentValueText.setAttribute("alignment-baseline", "central");
this.rootSVG.appendChild(this.currentValueText);
const textPosXdecimal = textPosX;
const textPosYdecimal = textPosYdec;
this.currentValueTextdecimal = document.createElementNS(Avionics.SVG.NS, "text");
this.currentValueTextdecimal.id = "CurrentValue";
this.currentValueTextdecimal.setAttribute("x", textPosXdecimal.toString());
this.currentValueTextdecimal.setAttribute("y", textPosYdecimal.toString());
this.currentValueTextdecimal.setAttribute("alignment-baseline", "text-bottom");
this.rootSVG.appendChild(this.currentValueTextdecimal);
const textPosXdecP = textPosX - 9;
this.currentValueTextdecimalP = document.createElementNS(Avionics.SVG.NS, "text");
this.currentValueTextdecimalP.id = "CurrentValue";
this.currentValueTextdecimalP.setAttribute("x", textPosXdecP.toString());
this.currentValueTextdecimalP.setAttribute("y", textPosY.toString());
//this.currentValueTextdecimalP.textContent = ".";
this.currentValueTextdecimalP.setAttribute("alignment-baseline", "central");
this.rootSVG.appendChild(this.currentValueTextdecimalP);
if (_gaugeDefinition.currentValueBorderWidth > 0) {
const borderWidth = this.viewBoxSize.x * _gaugeDefinition.currentValueBorderWidth;
const borderHeight = this.currentValueBorderHeight * 1.2;
Expand Down Expand Up @@ -334,6 +354,8 @@ var A320_Neo_ECAM_Common;
this.currentValueText.setAttribute("class", style);
if (!this.isActive) {
this.currentValueText.textContent = "XX";
this.currentValueTextdecimal.textContent = "";
this.currentValueTextdecimalP.textContent = "";
}
}
}
Expand Down Expand Up @@ -386,8 +408,6 @@ var A320_Neo_ECAM_Common;
this.extraMessageString = extraMessage;
style += (this.extraMessageString.length > 0) ? "active" : "inactive";
this.extraMessageText.textContent = this.extraMessageString;
this.extraMessageText.setAttribute("class", style);
this.extraMessageBorder.setAttribute("class", style);
}
}
}
Expand Down Expand Up @@ -433,15 +453,24 @@ var A320_Neo_ECAM_Common;
const strValue = this.currentValue.toFixed(this.currentValuePrecision);
this.currentValueText.textContent = strValue;
this.currentValueText.setAttribute("class", style);
if (this.currentValuePrecision > 0) {
const strValueArray = strValue.split(".");
this.currentValueText.textContent = strValueArray[0];
this.currentValueTextdecimal.textContent = strValueArray[1];
this.currentValueTextdecimal.setAttribute("class", style + " decimal");
this.currentValueTextdecimalP.textContent = ".";
this.currentValueTextdecimalP.setAttribute("class", style + " decimalpoint");
}
}
}
}
refreshOuterIndicator(_value, _force = false) {
if ((_value != this.outerIndicatorValue) || _force) {
this.outerIndicatorValue = _value;
if (this.outerIndicatorObject != null) {
const clampedValue = Utils.Clamp(_value, this.minValue, this.maxValue);
const angle = this.valueToAngle(clampedValue, false);
const valueThrottlePosition = (_value <= this.minValue) ? this.cursorOffset + this.minValue : _value + this.cursorOffset;
const clampedValueThrottlePosition = Utils.Clamp(valueThrottlePosition , this.minValue, this.maxValue);
const angle = this.valueToAngle(clampedValueThrottlePosition, false);
this.outerIndicatorObject.setAttribute("transform", "rotate(" + angle + ")");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ a320-neo-upper-ecam #EnginesPanel #GaugeInfo .SLOT2_UNIT {
color: var(--displayCyan);
}


a320-neo-upper-ecam #EnginesPanel #LineStyleInfos {
position: absolute;
left: -2%;
Expand Down Expand Up @@ -106,6 +105,12 @@ a320-neo-upper-ecam #EnginesPanel #LineStyleInfos .Inactive {
fill: var(--displayAmber);
letter-spacing: 5px;
}
a320-neo-upper-ecam #EnginesPanel #LineStyleInfos .decimal {
font-size: 38px !important;
}
a320-neo-upper-ecam #EnginesPanel #LineStyleInfos .activeEngine {
background-color: rgba(255,255,255,0.5) !important;
}


a320-neo-upper-ecam #InfoTopPanel {
Expand Down Expand Up @@ -141,6 +146,8 @@ a320-neo-upper-ecam #InfoTopPanel #Status #ThrottleValue {
a320-neo-upper-ecam #InfoTopPanel #Status #ThrottleValue::after {
content: "%";
color: var(--displayCyan);
font-size: 38px;
padding-left: 4px;
}
a320-neo-upper-ecam #InfoTopPanel #Status #ThrottleState.active {
color: var(--displayCyan);
Expand All @@ -156,6 +163,9 @@ a320-neo-upper-ecam #InfoTopPanel #Status #ThrottleValue.inactive {
color: var(--displayAmber);
letter-spacing: 5px;
}
a320-neo-upper-ecam #InfoTopPanel #Status #ThrottleValue span {
font-size: 38px;
}
a320-neo-upper-ecam #InfoTopPanel #Status #FlexTemperature {
color: var(--displayCyan);
top: 24%;
Expand Down Expand Up @@ -335,6 +345,12 @@ a320-neo-ecam-gauge #RootSVG #CurrentValue {
font-size: 20px !important;
fill: var(--displayBackground);
}
a320-neo-ecam-gauge #RootSVG #CurrentValue.decimal {
font-size: 15px !important;
}
a320-neo-ecam-gauge #RootSVG #CurrentValue.gaugedecimalpoint {
fill: var(--displayGreen);
}
a320-neo-ecam-gauge #RootSVG #CurrentValueBorder {
fill: none;
stroke: lightblue;
Expand Down Expand Up @@ -374,3 +390,8 @@ a320-neo-ecam-gauge #RootSVG #GraduationsGroup line.OuterMarker {
stroke: var(--displayAmber);
stroke-width: 6px;
}
a320-neo-ecam-gauge #RootSVG #OuterIndicatorOffset {
stroke: var(--displayCyan) !important;
stroke-width: 1.5px !important;
fill: none;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee37b34

Please sign in to comment.