Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SHserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Altenbernd
SHserver
Commits
f8648d78
Commit
f8648d78
authored
Sep 27, 2023
by
Peter Altenbernd
Browse files
Options
Downloads
Patches
Plain Diff
Bugfixes HotwaterControl
parent
4d33cccb
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
heatControl.cpp
+17
-19
17 additions, 19 deletions
heatControl.cpp
heatControl.h
+3
-1
3 additions, 1 deletion
heatControl.h
hotwaterControl.cpp
+37
-7
37 additions, 7 deletions
hotwaterControl.cpp
hotwaterControl.h
+7
-0
7 additions, 0 deletions
hotwaterControl.h
solarControl.cpp
+2
-2
2 additions, 2 deletions
solarControl.cpp
with
66 additions
and
29 deletions
heatControl.cpp
+
17
−
19
View file @
f8648d78
...
...
@@ -144,33 +144,22 @@ void HeatControl::grant(bool ON)
*/
void
HeatControl
::
suspend
(
bool
maxTemp
)
{
// qDebug() << "XXXXX HeatControl::suspend(" << maxTemp << ")" << name();
// if (not maxTemp) // setzt auf MinTemp, falls Zeit um
// checkSusExpiration();
Suspension
suspendedOld
=
m_suspended
;
if
(
maxTemp
)
m_suspended
=
Suspension
::
MaxTemp
;
else
// if (m_suspended != Suspension::MaxTemp) // nicht überschreiben
m_suspended
=
Suspension
::
MinTemp
;
// Zeit wird nur neu gesetzt, wenn sich der Zustand ändert:
if
(
suspendedOld
!=
m_suspended
)
{
QDateTime
now
=
SHsensor
::
currentTime
();
// QTime newExpireTime = SHsensor::currentTime().addSecs(60*suspensionTime());
QDateTime
newExpireTime
=
now
.
addSecs
(
60
*
suspensionTime
());
// if (now < m_startTimeDay and newExpireTime > m_startTimeDay) // es ist noch Nacht, aber potenzielle expireTime liegt im Tag
// m_expireTime = m_startTimeDay; // => Setze expireTime auf Tagesbeginn
// else
m_expireTime
=
newExpireTime
;
}
// qDebug() << "-> HeatControl::suspend" << (int) m_suspended << m_expireTime << "XXXXXXXXXXXXXX";
}
...
...
@@ -329,6 +318,15 @@ bool HeatControl::suspended() const
/*
*
*/
QDateTime
HeatControl
::
expireTime
()
const
{
return
m_expireTime
;
}
/*
*
*/
...
...
This diff is collapsed.
Click to expand it.
heatControl.h
+
3
−
1
View file @
f8648d78
...
...
@@ -45,7 +45,7 @@ public:
void
checkMaxTempSus
(
bool
supplyPossible
);
void
checkMinTempSus
(
bool
supplyPossible
);
QString
output
()
const
;
virtual
QString
output
()
const
;
signals
:
...
...
@@ -107,6 +107,8 @@ public:
static
void
remoteOn
(
int
pos
);
static
void
resumeMode
(
int
pos
);
QDateTime
expireTime
()
const
;
private
:
static
HeatControl
*
C
[
SHNodeIdSize
*
SHSensorIdSize
];
static
QFile
m_file
;
...
...
This diff is collapsed.
Click to expand it.
hotwaterControl.cpp
+
37
−
7
View file @
f8648d78
...
...
@@ -15,20 +15,37 @@ HotwaterControl::HotwaterControl(SHactuator *swtch, QObject *parent) :
}
/*
*
*/
bool
HotwaterControl
::
maxReache
d
()
const
unsigned
int
HotwaterControl
::
relevantDeman
d
()
const
{
unsigned
int
ivalue
;
if
(
m_switch
->
switchState
()
==
SHactuator
::
State
::
ON
)
{
QString
svalue
=
m_consumer
->
value
();
bool
ok
;
int
f
value
=
svalue
.
to
Floa
t
(
&
ok
);
i
value
=
svalue
.
to
UIn
t
(
&
ok
);
if
(
not
ok
)
return
true
;
// diskuabel!
ivalue
=
0
;
// diskuabel!
}
else
if
(
suspended
())
ivalue
=
0
;
else
ivalue
=
m_switch
->
powerDemand
();
return
ivalue
;
}
return
(
fvalue
<=
0
);
// ggf. <= 10 o.Ä.
/*
*
*/
bool
HotwaterControl
::
maxReached
()
const
{
return
(
relevantDemand
()
<=
0
);
// ggf. <= 10 o.Ä.
}
...
...
@@ -51,3 +68,16 @@ int HotwaterControl::suspensionTime() const
/*
*
*/
QString
HotwaterControl
::
output
()
const
{
return
" "
+
name
()
+
"("
+
QString
::
number
(
relevantDemand
())
+
"):"
;
}
This diff is collapsed.
Click to expand it.
hotwaterControl.h
+
7
−
0
View file @
f8648d78
...
...
@@ -13,10 +13,17 @@ private:
friend
class
TestSHserver
;
SHsensor
*
m_consumer
;
// weil Tasmota
// bool m_usePresetDemand = true; // veranschlagten Wert setzen, bis ON
unsigned
int
relevantDemand
()
const
;
virtual
bool
maxReached
()
const
override
;
virtual
bool
minReached
()
const
override
;
virtual
int
suspensionTime
()
const
override
;
virtual
QString
output
()
const
override
;
};
...
...
This diff is collapsed.
Click to expand it.
solarControl.cpp
+
2
−
2
View file @
f8648d78
...
...
@@ -88,8 +88,6 @@ void SolarControl::process() {
s_output
+=
"ON"
;
}
else
{
swtch
->
grant
(
false
);
// switch off
swtch
->
checkMaxTempSus
(
supplyPossible
);
// ggf. auf MaxTemp Suspension setzen
if
(
swtch
->
suspended
())
// Zeit ggf. abgelaufen
...
...
@@ -100,6 +98,8 @@ void SolarControl::process() {
if
(
swtch
->
suspended
())
// check reset im Zustand MinTemp (weil die Rahmenbedingungen sich geändert haben)
swtch
->
checkResetSus
(
supplyPossible
);
swtch
->
grant
(
false
);
// switch off
s_output
+=
swtch
->
susName
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment