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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Altenbernd
SHserver
Commits
5261d110
Commit
5261d110
authored
1 month ago
by
Peter Altenbernd
Browse files
Options
Downloads
Patches
Plain Diff
Für Info-Anzeige m_granted, sleep wieder raus
parent
ee775bd4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
heatControl.cpp
+11
-0
11 additions, 0 deletions
heatControl.cpp
heatControl.h
+4
-2
4 additions, 2 deletions
heatControl.h
solarControl.cpp
+16
-18
16 additions, 18 deletions
solarControl.cpp
with
31 additions
and
20 deletions
heatControl.cpp
+
11
−
0
View file @
5261d110
...
...
@@ -130,6 +130,8 @@ QString HeatControl::name() const
*/
void
HeatControl
::
grant
(
bool
ON
)
{
m_granted
=
ON
;
if
(
ON
)
m_switch
->
ON
();
else
...
...
@@ -306,6 +308,15 @@ QString HeatControl::output() const
}
/*
*
*/
bool
HeatControl
::
granted
()
const
{
return
m_granted
;
}
/*
*
...
...
This diff is collapsed.
Click to expand it.
heatControl.h
+
4
−
2
View file @
5261d110
...
...
@@ -48,8 +48,6 @@ public:
virtual
QString
output
()
const
;
signals
:
protected
:
friend
class
TestSHserver
;
SHsensor
*
m_temp
;
...
...
@@ -67,6 +65,8 @@ protected:
int
m_pos
;
// Hash-Adresse, zugleich ID
bool
m_granted
;
// für aktuelle Anzeige in solarControl
enum
class
Suspension
{
NONE
,
MinTemp
,
MaxTemp
};
Suspension
m_suspended
;
// eine zeitlang true, wenn Temperatur erreicht ist
QDateTime
m_expireTime
;
...
...
@@ -110,6 +110,8 @@ public:
QDateTime
expireTime
()
const
;
bool
granted
()
const
;
private
:
static
HeatControl
*
C
[
SHNodeIdSize
*
SHSensorIdSize
];
static
QFile
m_file
;
...
...
This diff is collapsed.
Click to expand it.
solarControl.cpp
+
16
−
18
View file @
5261d110
#include
<QTimer>
#include
"solarControl.h"
#include
"webSocketMsg.h"
#include
<unistd.h>
...
...
@@ -120,34 +119,33 @@ void SolarControl::process() {
}
// qDebug() << "=> used=" << used;
// if ((supply > 0 and netto < 0) or (supply <= 0 and netto != supply))
// qDebug() << "brutto / netto FEHLER" << supply << netto;
s_output
+=
" -> "
+
QString
::
number
(
used
)
+
"/"
+
QString
::
number
(
supply
);
qDebug
()
<<
"===> SolarControl::process"
<<
s_output
<<
" <==="
;
// if ((supply > 0 and netto < 0) or (supply <= 0 and netto != supply))
// qDebug() << "brutto / netto FEHLER" << supply << netto;
// einen Moment auf die Aktuatoren warten:
if
(
not
SHsensor
::
isTesting
())
sleep
(
1.5
*
SHsensor
::
POLLING_INTERVALL
);
// Info-Anzeige:
// aktuelle Verbraucher
QStringList
infoList
;
QStringList
infoList
;
// aktuelle Verbraucher
for
(
auto
swtch
:
m_S
)
if
(
swtch
->
state
()
==
SHactuator
::
State
::
ON
and
swtch
->
demand
()
>
0
)
{
infoList
<<
swtch
->
name
()
<<
QString
::
number
(
swtch
->
demand
());
for
(
auto
swtch
:
m_S
)
{
bool
dynamic
=
(
swtch
->
mode
()
==
HeatControl
::
Mode
::
Auto
or
swtch
->
mode
()
==
HeatControl
::
Mode
::
Smart
);
bool
dynamic
=
(
swtch
->
mode
()
==
HeatControl
::
Mode
::
Auto
or
swtch
->
mode
()
==
HeatControl
::
Mode
::
Smart
);
if
(
dynamic
)
{
if
(
swtch
->
granted
())
infoList
<<
swtch
->
name
()
<<
QString
::
number
(
swtch
->
demand
());
}
else
{
if
(
swtch
->
state
()
==
SHactuator
::
State
::
ON
and
swtch
->
demand
()
>
0
)
{
infoList
<<
swtch
->
name
()
<<
QString
::
number
(
swtch
->
demand
());
if
(
not
dynamic
)
// für Anzeige nicht dynamische Verbraucher dazu rechnen
// für Anzeige nicht dynamische Verbraucher dazu rechnen
supply
+=
swtch
->
demand
();
}
}
}
// Anzeige setzen:
SHsensor
::
setSolarInfo
(
supply
/* brutto */
,
netto
,
infoList
);
qDebug
()
<<
"===> SolarControl::process"
<<
s_output
<<
" <==="
;
}
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