mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-14 05:46:35 +00:00
76_SolarForecast: replace calcRange by cloud2bin
git-svn-id: https://svn.fhem.de/fhem/trunk@28027 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
28a2dd478a
commit
6ef49d9e05
@ -144,6 +144,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
|
"1.0.2" => "05.10.2023 replace calcRange by cloud2bin ",
|
||||||
"1.0.1" => "03.10.2023 fixes in comRef, bug fix Forum: https://forum.fhem.de/index.php?msg=1288637 ",
|
"1.0.1" => "03.10.2023 fixes in comRef, bug fix Forum: https://forum.fhem.de/index.php?msg=1288637 ",
|
||||||
"1.0.0" => "01.10.2023 preparation for check in ",
|
"1.0.0" => "01.10.2023 preparation for check in ",
|
||||||
"0.83.3" => "28.09.2023 fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1288032 ".
|
"0.83.3" => "28.09.2023 fix Illegal division by zero, Forum: https://forum.fhem.de/index.php?msg=1288032 ".
|
||||||
@ -5537,7 +5538,7 @@ sub ___readCandQ {
|
|||||||
delete $data{$type}{$name}{nexthours}{"NextHour".sprintf("%02d",$num)}{cloudrange};
|
delete $data{$type}{$name}{nexthours}{"NextHour".sprintf("%02d",$num)}{cloudrange};
|
||||||
|
|
||||||
if ($acu =~ /on_complex/xs) { # Autokorrektur complex soll genutzt werden
|
if ($acu =~ /on_complex/xs) { # Autokorrektur complex soll genutzt werden
|
||||||
my $range = calcRange ($cc); # Range errechnen
|
my $range = cloud2bin ($cc); # Range errechnen
|
||||||
($hc, $hq) = CircularAutokorrVal ($hash, sprintf("%02d",$fh1), $range, undef); # Korrekturfaktor/Qualität der Stunde des Tages (complex)
|
($hc, $hq) = CircularAutokorrVal ($hash, sprintf("%02d",$fh1), $range, undef); # Korrekturfaktor/Qualität der Stunde des Tages (complex)
|
||||||
$hq //= '-';
|
$hq //= '-';
|
||||||
$hc //= 1; # Korrekturfaktor = 1 (keine Korrektur) # keine Qualität definiert
|
$hc //= 1; # Korrekturfaktor = 1 (keine Korrektur) # keine Qualität definiert
|
||||||
@ -10592,7 +10593,7 @@ sub __Pv_Fc_Complex_Dnum_Hist {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $range = calcRange ($chwcc);
|
my $range = cloud2bin ($chwcc);
|
||||||
|
|
||||||
if(scalar(@efa)) {
|
if(scalar(@efa)) {
|
||||||
debugLog ($paref, 'pvCorrection', "Complex Corrf -> Raw Days ($calcd) for average check: ".join " ",@efa);
|
debugLog ($paref, 'pvCorrection', "Complex Corrf -> Raw Days ($calcd) for average check: ".join " ",@efa);
|
||||||
@ -10612,7 +10613,7 @@ sub __Pv_Fc_Complex_Dnum_Hist {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$histwcc = calcRange ($histwcc); # V 0.50.1
|
$histwcc = cloud2bin ($histwcc); # V 0.50.1
|
||||||
|
|
||||||
if($range == $histwcc) {
|
if($range == $histwcc) {
|
||||||
$pvrl += HistoryVal ($hash, $dayfa, $hour, 'pvrl', 0);
|
$pvrl += HistoryVal ($hash, $dayfa, $hour, 'pvrl', 0);
|
||||||
@ -11217,18 +11218,6 @@ sub _aiMakeIdxRaw {
|
|||||||
return $ridx;
|
return $ridx;
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
|
||||||
# Bewölkungs- bzw. Regenrange berechnen
|
|
||||||
################################################################
|
|
||||||
sub calcRange {
|
|
||||||
my $range = shift;
|
|
||||||
|
|
||||||
#$range = sprintf "%.0f", $range/10;
|
|
||||||
$range = sprintf "%.0f", $range;
|
|
||||||
|
|
||||||
return $range;
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# History-Hash verwalten
|
# History-Hash verwalten
|
||||||
################################################################
|
################################################################
|
||||||
@ -13305,7 +13294,8 @@ return $bin;
|
|||||||
sub cloud2bin {
|
sub cloud2bin {
|
||||||
my $wcc = shift;
|
my $wcc = shift;
|
||||||
|
|
||||||
my $bin = $wcc > 95 ? '95' :
|
my $bin = $wcc == 100 ? '100' :
|
||||||
|
$wcc > 95 ? '95' :
|
||||||
$wcc > 90 ? '90' :
|
$wcc > 90 ? '90' :
|
||||||
$wcc > 85 ? '85' :
|
$wcc > 85 ? '85' :
|
||||||
$wcc > 80 ? '80' :
|
$wcc > 80 ? '80' :
|
||||||
@ -13335,7 +13325,8 @@ return $bin;
|
|||||||
sub rain2bin {
|
sub rain2bin {
|
||||||
my $wrp = shift;
|
my $wrp = shift;
|
||||||
|
|
||||||
my $bin = $wrp > 95 ? '95' :
|
my $bin = $wrp == 100 ? '100' :
|
||||||
|
$wrp > 95 ? '95' :
|
||||||
$wrp > 90 ? '90' :
|
$wrp > 90 ? '90' :
|
||||||
$wrp > 85 ? '85' :
|
$wrp > 85 ? '85' :
|
||||||
$wrp > 80 ? '80' :
|
$wrp > 80 ? '80' :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user