Biblioteca Java - Blame information for rev 4
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
4 | mihai | 1 | package oop.controltemperatura; |
2 | |||
3 | |||
4 | public class Controler { | ||
5 | AgregatIncalizre ai; | ||
6 | AngregatRacire ar; | ||
7 | SenzorTemperatura st; | ||
8 | Termostat tr; | ||
9 | TermostatUI ui; | ||
10 | |||
11 | public Controler(AgregatIncalizre ai, AngregatRacire ar, SenzorTemperatura st, Termostat tr, TermostatUI ui) { | ||
12 | this.ai = ai; | ||
13 | this.ar = ar; | ||
14 | this.st = st; | ||
15 | this.tr = tr; | ||
16 | this.ui = ui; | ||
17 | } | ||
18 | |||
19 | void control(){ | ||
20 | while(true){ | ||
21 | try{Thread.sleep(1000);}catch(Exception e){} | ||
22 | System.out.println("Temeratura="+st.citeste()); | ||
23 | int t = st.citeste(); | ||
24 | ui.afiseazaTemperatura(""+t); | ||
25 | if(st.citeste()>tr.citesteMax()){ | ||
26 | ai.stop(); | ||
27 | ar.start(); | ||
28 | ui.afiseazaStare("RACIRE"); | ||
29 | } | ||
30 | else if(st.citeste()<tr.citesteMin()){ | ||
31 | ai.start(); | ||
32 | ar.stop(); | ||
33 | ui.afiseazaStare("(INCALZIRE"); | ||
34 | } | ||
35 | else{ | ||
36 | ai.stop(); | ||
37 | ar.stop(); | ||
38 | ui.afiseazaStare("OPRIT"); | ||
39 | } | ||
40 | }//.while | ||
41 | } | ||
42 | } |