Subversion Repositories heating

Rev

Rev 44 | Rev 47 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 44 Rev 46
Line 61... Line 61...
61
	rm = 0;
61
	rm = 0;
62
	outSensor = 0;
62
	outSensor = 0;
63
	rstop = false;
63
	rstop = false;
64
	rrun = false;
64
	rrun = false;
65
	HeatConf = nullptr;
65
	HeatConf = nullptr;
-
 
66
	HtmlServer = nullptr;
66
 
67
 
67
	for (int i = 0; i < 100; i++)
68
	for (int i = 0; i < 100; i++)
68
		s1[i] = -1;
69
		s1[i] = -1;
69
 
70
 
70
	initialized = false;
71
	initialized = false;
Line 93... Line 94...
93
	trun();
94
	trun();
94
}
95
}
95
 
96
 
96
void heating::pthrHtml()
97
void heating::pthrHtml()
97
{
98
{
98
html *HtmlServer;
-
 
99
HCONF *akt = HeatConf;
99
HCONF *akt = HeatConf;
100
html::HTCONF ht;
100
html::HTCONF ht;
101
 
101
 
-
 
102
	if (HtmlServer != nullptr)
-
 
103
		return;
-
 
104
 
102
	HtmlServer = new html();
105
	HtmlServer = new html();
103
	HtmlServer->setGlobals(glb_night, glb_minimal, onoff);
106
	HtmlServer->setGlobals(glb_night, glb_minimal, onoff);
104
	
107
	
105
	while (akt)
108
	while (akt)
106
	{
109
	{
Line 118... Line 121...
118
		akt = akt->next;
121
		akt = akt->next;
119
	}
122
	}
120
 
123
 
121
	HtmlServer->run();
124
	HtmlServer->run();
122
	delete HtmlServer;
125
	delete HtmlServer;
-
 
126
	HtmlServer = nullptr;
123
}
127
}
124
 
128
 
125
void heating::run()
129
void heating::run()
126
{
130
{
127
int i;
131
int i;
128
double tmp;
132
double tmp;
129
HCONF *akt;
133
HCONF *akt;
130
html HtmlServer;
-
 
131
 
134
 
132
	rstop = false;
135
	rstop = false;
133
	rrun = true;
136
	rrun = true;
134
	i = 0;
137
	i = 0;
135
 
138
 
Line 146... Line 149...
146
	// Here we read the previous colected temperatures and evaluate them.
149
	// Here we read the previous colected temperatures and evaluate them.
147
	while (!rstop)
150
	while (!rstop)
148
	{
151
	{
149
		akt = HeatConf;
152
		akt = HeatConf;
150
 
153
 
-
 
154
		if (HtmlServer->hasChanged())
-
 
155
		{
-
 
156
			html::HTCONF *hta;
-
 
157
 
-
 
158
			glb_minimal = HtmlServer->getGlbAbsent();
-
 
159
			glb_night = HtmlServer->getGlbNight();
-
 
160
			onoff = HtmlServer->getRunMode();
-
 
161
			hta = HtmlServer->getHConfig();
-
 
162
 
-
 
163
			while (hta)
-
 
164
			{
-
 
165
				akt = HeatConf;
-
 
166
 
-
 
167
				while (akt)
-
 
168
				{
-
 
169
					if (akt->rnum == hta->rnum)
-
 
170
					{
-
 
171
						akt->soll = hta->soll;
-
 
172
						akt->night = hta->night;
-
 
173
						akt->minimal = hta->minimal;
-
 
174
						akt->start = hta->start1;
-
 
175
						akt->end = hta->end1;
-
 
176
						akt->wstart = hta->start2;
-
 
177
						akt->wend = hta->end2;
-
 
178
						break;
-
 
179
					}
-
 
180
 
-
 
181
					akt = akt->next;
-
 
182
				}
-
 
183
 
-
 
184
				hta = hta->next;
-
 
185
			}
-
 
186
 
-
 
187
			akt = HeatConf;
-
 
188
		}
-
 
189
 
151
		while (akt)
190
		while (akt)
152
		{
191
		{
153
			tmp = getTemp(akt->tempsensor);
192
			tmp = getTemp(akt->tempsensor);
154
 
193
 
155
			if (tmp < 99.0 && tmp > -99.0)
194
			if (tmp < 99.0 && tmp > -99.0)