Skip to content

Commit

Permalink
1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
cype committed Sep 29, 2022
1 parent 0aba836 commit ccae018
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
15 changes: 6 additions & 9 deletions assets/js/external_apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ function getEVUs(MunicipalityNumber) {


function getTarifData(EvuData) {
console.log(EvuData[0])

if ("nrElcom" in EvuData[0]) {
console.log("asdf")
if (EvuData[0].hasOwnProperty("nrElcom")) {

query = "https://bfe-cors.geotest.ch/https://opendata.vese.ch/pvtarif/api/getData/evu?evuId=" + EvuData[0].nrElcom + "&year=22&licenseKey=110xketkdbydpa8ph7s36nmeqxrq5eg8f1xbzz1g";

Expand All @@ -92,7 +90,7 @@ function getTarifData(EvuData) {

}

if ("nrElcom" in EvuData[1]) {
if (EvuData.length > 1 && EvuData[1].hasOwnProperty("nrElcom")) {

query = "https://bfe-cors.geotest.ch/https://opendata.vese.ch/pvtarif/api/getData/evu?evuId=" + EvuData[1].nrElcom + "&year=22&licenseKey=110xketkdbydpa8ph7s36nmeqxrq5eg8f1xbzz1g";

Expand All @@ -114,9 +112,7 @@ function getTarifData(EvuData) {

});

}


}
}

function fillContent1(data) {
Expand Down Expand Up @@ -183,8 +179,9 @@ function resetTarifInfo() {
document.getElementById('stromtarifEWlink2').href = "http://www.pvtarif.ch";
}

document.getElementById('tarif2').style = "visibility: hidden;"

if ($.contains(document.body, document.getElementById("tarif2"))) {
document.getElementById('tarif2').style = "visibility: hidden;"
}
}


Expand Down
16 changes: 8 additions & 8 deletions assets/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var updateRoofInfo = function(map, marker, roof) {
$('#eignung3').html(suitability.substr(0, 1).toUpperCase() + suitability.substr(1));

if ($.contains(document.body, document.getElementById("stromertrag"))) {
$('#stromertrag').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.17*0.8)/100)*100));
$('#stromertrag').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.2*0.8)/100)*100));
}

//**** NEW
Expand Down Expand Up @@ -170,10 +170,10 @@ var updateRoofInfo = function(map, marker, roof) {

var finanzertrag;

if (roof.attributes.finanzertrag < 1000) {
finanzertrag = formatNumber(Math.round(roof.attributes.finanzertrag/10)*10);
if (roof.attributes.gstrahlung*0.2*0.8/10 < 1000) {
finanzertrag = formatNumber(Math.round(roof.attributes.gstrahlung*0.2*0.8/10/10)*10);
} else {
finanzertrag = formatNumber(Math.round(roof.attributes.finanzertrag/100)*100);
finanzertrag = formatNumber(Math.round(roof.attributes.gstrahlung*0.2*0.8/10/100)*100);
}

if ($.contains(document.body, document.getElementById("finanzertrag"))) {
Expand Down Expand Up @@ -203,7 +203,7 @@ var updateRoofInfo = function(map, marker, roof) {
}

TitelSolarstromText += '<strong>'
+ formatNumber(Math.round((roof.attributes.gstrahlung*0.17*0.8)/100)*100)
+ formatNumber(Math.round((roof.attributes.gstrahlung*0.20*0.8)/100)*100)
+ '</strong> '
+ translator.get('solarstromTitel')
+ '<strong> '
Expand Down Expand Up @@ -237,9 +237,9 @@ var updateRoofInfo = function(map, marker, roof) {

}

$('#pv100').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.17*0.8)/100)*100*1));
$('#pv75').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.17*0.8)/100)*100*0.75));
$('#pv50').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.17*0.8)/100)*100*0.5));
$('#pv100').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.2*0.8)/100)*100*1));
$('#pv75').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.2*0.8)/100)*100*0.75));
$('#pv50').html(formatNumber(Math.round((roof.attributes.gstrahlung*0.2*0.8)/100)*100*0.5));

// check if no waermeertrag and if no dg_waermebedarf
var titleHeat = '';
Expand Down
2 changes: 1 addition & 1 deletion assets/js/translations.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ <h2><span class="trn">hint</span></h2>
</ul>
<ul class="copyright">
<li><span class="trn">copyrightMain</span></li>
<li>v 1.9.1</li>
<li>v 1.10</li>
<li><span class="trn">contact</span></li>
<li class="trn">impressumAnalyse</li>
<li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
Expand Down
12 changes: 10 additions & 2 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,18 @@ <h3 class="trn">stromtarifTitel</h3>
<table class="table-with-border kernkraftwerke-extended" cellpadding="5">
<tr>
<th class="cell-meta" style="vertical-align:top">
<a href="" target="_blank" id="stromtarifEWlink"><span id="stromtarifEW"></span></a>
<a href="" target="_blank" id="stromtarifEWlink1"><span id="stromtarifEW1"></span></a>
</th>
<td>
<span id="stromtarifEWZahl">0.00</span> <span id="stromtarifEWEinheit">
<span id="stromtarifEWZahl1">0.00</span> <span id="stromtarifEWEinheit1">
</td>
</tr>
<tr id="tarif2">
<th class="cell-meta" style="vertical-align:top">
<a href="" target="_blank" id="stromtarifEWlink2"><span id="stromtarifEW2"></span></a>
</th>
<td>
<span id="stromtarifEWZahl2">0.00</span> <span id="stromtarifEWEinheit2">
</td>
</tr>
<tr>
Expand Down

0 comments on commit ccae018

Please sign in to comment.