Subversion Repositories heating

Rev

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

Rev 5 Rev 9
Line 16... Line 16...
16
 * Author: Andreas Theofilu <andreas@theosys.at>
16
 * Author: Andreas Theofilu <andreas@theosys.at>
17
 */
17
 */
18
#include <iostream>
18
#include <iostream>
19
#include <fstream>
19
#include <fstream>
20
#include <string>
20
#include <string>
-
 
21
#include <vector>
21
#include <cstdio>
22
#include <cstdio>
22
#include <cstring>
23
#include <cstring>
23
#include <ctime>
24
#include <ctime>
24
#include <cstdlib>
25
#include <cstdlib>
25
#include <csignal>
26
#include <csignal>
Line 465... Line 466...
465
			heat->switchOnOff(false);
466
			heat->switchOnOff(false);
466
 
467
 
467
		return 1;
468
		return 1;
468
	}
469
	}
469
 
470
 
470
	// TODO: SET SOLL:<room>:<soll>; --> Solltemperatur direkt setzen
471
	// SET SOLL:<room>:<soll>; --> Solltemperatur direkt setzen
-
 
472
	if (vname.compare("SET SOLL") == 0)
-
 
473
	{
-
 
474
		std::vector<std::string> s = help.split(vcontent, ':');
-
 
475
 
-
 
476
		if (s.size() != 2)
-
 
477
			return 0;
-
 
478
 
-
 
479
		int room = atoi(s.at(0).c_str());
-
 
480
		double soll = atof(s.at(1).c_str());
-
 
481
		
-
 
482
		if (!room || soll < 10.0 || soll > 30.0)
-
 
483
			return 0;
-
 
484
		
-
 
485
		heat->setSoll(room, soll);
-
 
486
	}
-
 
487
 
471
	// TODO: SET NIGHT:<room>:<soll>;
488
	// SET NIGHT:<room>:<soll>;
-
 
489
	if (vname.compare("SET NIGHT") == 0)
-
 
490
	{
-
 
491
		std::vector<std::string> s = help.split(vcontent, ':');
-
 
492
 
-
 
493
		if (s.size() != 2)
-
 
494
			return 0;
-
 
495
 
-
 
496
		int room = atoi(s.at(0).c_str());
-
 
497
		double soll = atof(s.at(1).c_str());
-
 
498
 
-
 
499
		if (room < 0 || soll < 10.0 || soll > 30.0)
-
 
500
			return 0;
-
 
501
 
-
 
502
		heat->setNight(room, soll);
-
 
503
	}
-
 
504
 
472
	// TODO: SET MINIMAL:<room>:<soll>;
505
	// SET MINIMAL:<room>:<soll>;
-
 
506
	if (vname.compare("SET MINIMAL") == 0)
-
 
507
	{
-
 
508
		std::vector<std::string> s = help.split(vcontent, ':');
-
 
509
		
-
 
510
		if (s.size() != 2)
-
 
511
			return 0;
-
 
512
		
-
 
513
		int room = atoi(s.at(0).c_str());
-
 
514
		double soll = atof(s.at(1).c_str());
-
 
515
		
-
 
516
		if (room < 0 || soll < 10.0 || soll > 30.0)
-
 
517
			return 0;
-
 
518
		
-
 
519
		heat->setMinimal(room, soll);
-
 
520
	}
-
 
521
 
473
	// TODO: NIGHT:<soll>;
522
	// NIGHT:<soll>;
-
 
523
	if (vname.compare("NIGHT") == 0)
-
 
524
	{
-
 
525
		double soll = atof(vcontent.c_str());
-
 
526
		heat->setNight(0, soll);
-
 
527
	}
-
 
528
 
474
	// TODO: MINIMAL:<soll>;
529
	// MINIMAL:<soll>;
-
 
530
	if (vname.compare("MINIMAL") == 0)
-
 
531
	{
-
 
532
		double soll = atof(vcontent.c_str());
-
 
533
		heat->setMinimal(0, soll);
-
 
534
	}
-
 
535
 
475
	return 0;
536
	return 0;
476
}
537
}