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
22d02b9e
Commit
22d02b9e
authored
1 year ago
by
Peter Altenbernd
Browse files
Options
Downloads
Patches
Plain Diff
Serielle Schnittstelle raus. Buxfix Name Stromzähler. Reale Demands.
parent
5ec67300
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
server.cpp
+12
-10
12 additions, 10 deletions
server.cpp
server.h
+3
-3
3 additions, 3 deletions
server.h
shsensor.cpp
+20
-19
20 additions, 19 deletions
shsensor.cpp
with
35 additions
and
32 deletions
server.cpp
+
12
−
10
View file @
22d02b9e
...
@@ -37,7 +37,7 @@ Server::Server(QString TCPhostName, QObject *parent) :
...
@@ -37,7 +37,7 @@ Server::Server(QString TCPhostName, QObject *parent) :
// serielle Schnittstelle ansehen und starten:
// serielle Schnittstelle ansehen und starten:
startSerial
();
//
startSerial();
// Sensoren:
// Sensoren:
// temparature
// temparature
...
@@ -69,21 +69,21 @@ Server::Server(QString TCPhostName, QObject *parent) :
...
@@ -69,21 +69,21 @@ Server::Server(QString TCPhostName, QObject *parent) :
// Kamin;2;1; Off;22.5;18.5;07:15;23:00
// Kamin;2;1; Off;22.5;18.5;07:15;23:00
// Bad unten:
// Bad unten:
SHactuator
*
sBath300
=
new
SHactuator
(
NodeIDBadUnten
,
3
0
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.93"
);
SHactuator
*
sBath300
=
new
SHactuator
(
NodeIDBadUnten
,
3
2
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.93"
);
HeatControl
*
controlBath300
=
new
HeatControl
(
t_bath
,
sBath300
,
22.5
,
18.5
,
QTime
(
7
,
10
),
QTime
(
21
,
0
));
HeatControl
*
controlBath300
=
new
HeatControl
(
t_bath
,
sBath300
,
22.5
,
18.5
,
QTime
(
7
,
10
),
QTime
(
21
,
0
));
// Arbeitszimmer
// Arbeitszimmer
SHactuator
*
sWrom750
=
new
SHactuator
(
NodeIdSolarheatWR
,
75
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.24"
);
SHactuator
*
sWrom750
=
new
SHactuator
(
NodeIdSolarheatWR
,
7
4
5
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.24"
);
HeatControl
*
controlWRom750
=
new
HeatControl
(
t_wrom
,
sWrom750
,
22.5
,
18.5
,
QTime
(
7
,
10
),
QTime
(
21
,
0
));
HeatControl
*
controlWRom750
=
new
HeatControl
(
t_wrom
,
sWrom750
,
22.5
,
18.5
,
QTime
(
7
,
10
),
QTime
(
21
,
0
));
// Wohn- und Esszimmer
// Wohn- und Esszimmer
SHactuator
*
sLRom1000
=
new
SHactuator
(
NodeIdSolarheat
,
1
000
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.68"
);
SHactuator
*
sLRom1000
=
new
SHactuator
(
NodeIdSolarheat
,
1
115
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.68"
);
HeatControl
*
controlKamn1000
=
new
HeatControl
(
t_lrom
,
sLRom1000
,
22.5
,
18.5
,
QTime
(
7
,
12
),
QTime
(
23
,
0
));
HeatControl
*
controlKamn1000
=
new
HeatControl
(
t_lrom
,
sLRom1000
,
22.5
,
18.5
,
QTime
(
7
,
12
),
QTime
(
23
,
0
));
SHactuator
*
sWall900
=
new
SHactuator
(
NodeIDWallLR
,
9
0
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.30"
);
SHactuator
*
sWall900
=
new
SHactuator
(
NodeIDWallLR
,
9
1
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.30"
);
HeatControl
*
controlWall900
=
new
HeatControl
(
t_lrom
,
sWall900
,
22.5
,
18.5
,
QTime
(
7
,
14
),
QTime
(
23
,
0
));
HeatControl
*
controlWall900
=
new
HeatControl
(
t_lrom
,
sWall900
,
22.5
,
18.5
,
QTime
(
7
,
14
),
QTime
(
23
,
0
));
SHactuator
*
sWall450
=
new
SHactuator
(
NodeIDWallM
,
45
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.96"
);
SHactuator
*
sWall450
=
new
SHactuator
(
NodeIDWallM
,
45
5
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.96"
);
HeatControl
*
controlWall450
=
new
HeatControl
(
t_lrom
,
sWall450
,
22.5
,
18.5
,
QTime
(
7
,
16
),
QTime
(
23
,
0
));
HeatControl
*
controlWall450
=
new
HeatControl
(
t_lrom
,
sWall450
,
22.5
,
18.5
,
QTime
(
7
,
16
),
QTime
(
23
,
0
));
SHactuator
*
sFlor150
=
new
SHactuator
(
NodeIdSolarheatFloor
,
15
0
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.63"
);
SHactuator
*
sFlor150
=
new
SHactuator
(
NodeIdSolarheatFloor
,
15
5
,
SHactuator
::
SensorType
::
Switch
,
"http://192.168.178.63"
);
HeatControl
*
controlFlor150
=
new
HeatControl
(
t_lrom
,
sFlor150
,
22.5
,
18.5
,
QTime
(
7
,
16
),
QTime
(
23
,
0
));
HeatControl
*
controlFlor150
=
new
HeatControl
(
t_lrom
,
sFlor150
,
22.5
,
18.5
,
QTime
(
7
,
16
),
QTime
(
23
,
0
));
// Heißwasser:
// Heißwasser:
...
@@ -232,7 +232,7 @@ void Server::sendToClient(const QJsonObject & jsonObj)
...
@@ -232,7 +232,7 @@ void Server::sendToClient(const QJsonObject & jsonObj)
#ifdef OLD
/*
/*
*
*
*/
*/
...
@@ -295,7 +295,7 @@ void Server::startSerial() {
...
@@ -295,7 +295,7 @@ void Server::startSerial() {
// SHsensor::displayMem("Server::startSerial ENDE");
// SHsensor::displayMem("Server::startSerial ENDE");
}
}
#endif // OLD
...
@@ -481,7 +481,7 @@ void Server::onReadyReadSensorValueTCP()
...
@@ -481,7 +481,7 @@ void Server::onReadyReadSensorValueTCP()
#ifdef OLD
/*
/*
*
*
*/
*/
...
@@ -520,6 +520,8 @@ void Server::onReadyReadSensorValueSerial()
...
@@ -520,6 +520,8 @@ void Server::onReadyReadSensorValueSerial()
// SHsensor::displayMem("Server::onReadyReadSensorValueSerial ENDE");
// SHsensor::displayMem("Server::onReadyReadSensorValueSerial ENDE");
}
}
#endif // OLD
/*
/*
...
...
This diff is collapsed.
Click to expand it.
server.h
+
3
−
3
View file @
22d02b9e
...
@@ -28,7 +28,7 @@ private:
...
@@ -28,7 +28,7 @@ private:
QTcpSocket
m_gatewayTCPsocket
;
QTcpSocket
m_gatewayTCPsocket
;
// Serielle Schnittstelle zu angeschlossenem Gateway (USB)
// Serielle Schnittstelle zu angeschlossenem Gateway (USB)
QSerialPort
*
m_serial
=
nullptr
;
//
QSerialPort *m_serial = nullptr;
// HTTP Requests für Tasmota
// HTTP Requests für Tasmota
QNetworkAccessManager
*
m_tasmota
;
// -> To send us a request.
QNetworkAccessManager
*
m_tasmota
;
// -> To send us a request.
...
@@ -42,7 +42,7 @@ private:
...
@@ -42,7 +42,7 @@ private:
void
startWebSocketServer
();
void
startWebSocketServer
();
void
sendToClient
(
const
QJsonObject
&
jsonObj
);
void
sendToClient
(
const
QJsonObject
&
jsonObj
);
void
startSerial
();
//
void startSerial();
// Peters Zauber-Steuerung
// Peters Zauber-Steuerung
...
@@ -55,7 +55,7 @@ private:
...
@@ -55,7 +55,7 @@ private:
private
slots
:
private
slots
:
void
onReadyReadSensorValueTCP
();
// TCP Socket interface to Smart Home Gateway
void
onReadyReadSensorValueTCP
();
// TCP Socket interface to Smart Home Gateway
void
onReadyReadSensorValueSerial
();
// Serial interface to Smart Home Gateway
//
void onReadyReadSensorValueSerial(); // Serial interface to Smart Home Gateway
void
showSensorValues
();
void
showSensorValues
();
void
tasmotaReply
(
QNetworkReply
*
reply
);
// HTTP Requests für Tasmota
void
tasmotaReply
(
QNetworkReply
*
reply
);
// HTTP Requests für Tasmota
...
...
This diff is collapsed.
Click to expand it.
shsensor.cpp
+
20
−
19
View file @
22d02b9e
...
@@ -675,25 +675,26 @@ QString SHsensor::getValue(int nid, int sid)
...
@@ -675,25 +675,26 @@ QString SHsensor::getValue(int nid, int sid)
QString
SHsensor
::
name
(
int
nid
)
QString
SHsensor
::
name
(
int
nid
)
{
{
static
QString
N
[
SHNodeIdSize
]
=
{
static
QString
N
[
SHNodeIdSize
]
=
{
"Gateway"
,
"Gateway"
,
"HW_40"
,
// Heißwasser Stufe 1
"HW_40"
,
// Heißwasser Stufe 1
"Kamin"
,
// große Heizung im Wohnzimmer, Stufe 2 gibt es nicht mehr
"Kamin"
,
// große Heizung im Wohnzimmer, Stufe 2 gibt es nicht mehr
"Sonne"
,
// Lichtsensor
"Sonne"
,
// Lichtsensor
"HW_60"
,
// Heißwasser Stufe 2
"HW_60"
,
// Heißwasser Stufe 2
"Tür"
,
// Fußboden-Heizung im Wohnzimmer
"Tür"
,
// Fußboden-Heizung im Wohnzimmer
"Klima"
,
// Klimaanlage
"Klima"
,
// Klimaanlage
"Arbeit"
,
// Heizung im Arbeitszimmer
"Arbeit"
,
// Heizung im Arbeitszimmer
"Wasch"
,
// Waschmaschine
"Wasch"
,
// Waschmaschine
"Wohn"
,
// Thermometer im Wohnzimmer
"Wohn"
,
// Thermometer im Wohnzimmer
"Repeater2"
,
// Repeater
"Repeater2"
,
// Repeater
"eCar"
,
// E-Auto
"eCar"
,
// E-Auto
"T-Bad"
,
// Thermometer Bad
"T-Bad"
,
// Thermometer Bad
"Büro"
,
// Thermometer im Arbeitszimmer
"Büro"
,
// Thermometer im Arbeitszimmer
"WandLR"
,
// Wohnzimmer-Wand links+rechts
"WandLR"
,
// Wohnzimmer-Wand links+rechts
"WandM"
,
// Wohnzimmer-Wand mitte
"WandM"
,
// Wohnzimmer-Wand mitte
"Bad"
,
// Heizung Bad unten
"Bad"
,
// Heizung Bad unten
"Dummy"
// zum Testen neuer Knoten -- immer ganz hinten
"Strom"
,
// Zentraler Strommesser
};
"Dummy"
// zum Testen neuer Knoten -- immer ganz hinten
};
if
(
nid
<
0
or
nid
>=
SHNodeIdSize
)
if
(
nid
<
0
or
nid
>=
SHNodeIdSize
)
return
"#ERR-NAME#"
;
return
"#ERR-NAME#"
;
...
...
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