# HG changeset patch # User Thomas Junk # Date 1568037288 -7200 # Node ID 5356fd2ea3f667fd8ee5c22c08e49a89cd253120 # Parent 6365466ead832cf8bff98fc551bc13d0c0e162c9 Identify: legend shows reference values from Nash Sutcliffe diff -r 6365466ead83 -r 5356fd2ea3f6 client/src/components/identify/Identify.vue --- a/client/src/components/identify/Identify.vue Mon Sep 09 14:43:49 2019 +0200 +++ b/client/src/components/identify/Identify.vue Mon Sep 09 15:54:48 2019 +0200 @@ -241,7 +241,9 @@ data() { return { refGaugeStatus: "", - gaugeStatus: "" + gaugeStatus: "", + gaugeCoeffs: null, + refGaugeCoeffs: null }; }, computed: { @@ -262,10 +264,17 @@ gaugeStatusText() { const nsc24 = this.config.gm_forecast_vs_reality_nsc_24h; const nsc72 = this.config.gm_forecast_vs_reality_nsc_72h; + const coeffWarn = this.gaugeCoeffs ? this.gaugeCoeffs[2].value : ""; + const coeffDanger = this.gaugeCoeffs ? this.gaugeCoeffs[0].value : ""; const messagesPerState = { - OK: this.$gettext("Nash-Sutcliffe") + `>${nsc24} /24h >${nsc72} / 72h`, - WARNING: this.$gettext("Nash-Sutcliffe") + ` < ${nsc72} / 72h`, - DANGER: this.$gettext("Nash-Sutcliffe") + ` < ${nsc24} / 72h`, + OK: + this.$gettext("Nash-Sutcliffe") + + `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)`, + WARNING: + this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)`, + DANGER: + this.$gettext("Nash-Sutcliffe") + + ` (${coeffDanger} < ${nsc24} / 72h)`, NEUTRAL: this.$gettext("Nash-Sutcliffe not available") }; return messagesPerState[this.gaugeStatus]; @@ -276,10 +285,19 @@ refGaugeStatusText() { const nsc24 = this.config.gm_forecast_vs_reality_nsc_24h; const nsc72 = this.config.gm_forecast_vs_reality_nsc_72h; + const coeffWarn = this.refGaugeCoeffs ? this.refGaugeCoeffs[2].value : ""; + const coeffDanger = this.refGaugeCoeffs + ? this.refGaugeCoeffs[0].value + : ""; const messagesPerState = { - OK: this.$gettext("Nash-Sutcliffe") + `>${nsc24} /24h >${nsc72} / 72h`, - WARNING: this.$gettext("Nash-Sutcliffe") + ` < ${nsc72} / 72h`, - DANGER: this.$gettext("Nash-Sutcliffe") + ` < ${nsc24} / 72h`, + OK: + this.$gettext("Nash-Sutcliffe") + + `(${coeffDanger} >${nsc24} /24h ${coeffWarn} >${nsc72} / 72h)`, + WARNING: + this.$gettext("Nash-Sutcliffe") + ` (${coeffWarn} < ${nsc72} / 72h)`, + DANGER: + this.$gettext("Nash-Sutcliffe") + + ` (${coeffDanger} < ${nsc24} / 72h)`, NEUTRAL: this.$gettext("Nash-Sutcliffe not available") }; return messagesPerState[this.refGaugeStatus]; @@ -298,6 +316,7 @@ this.$store .dispatch("gauges/getNashSutcliffeForISRS", isrs) .then(response => { + this.gaugeCoeffs = response.coeffs; this.gaugeStatus = classifications.calcForecastVsRealityForNSC( response ); @@ -311,6 +330,7 @@ this.$store .dispatch("gauges/getNashSutcliffeForISRS", isrs) .then(response => { + this.refGaugeCoeffs = response.coeffs; this.refGaugeStatus = classifications.calcForecastVsRealityForNSC( response );