git.haldean.org sousvide / 0026d37
Formatting fixes, better fake temp support. Will Haldean Brown 8 years ago
2 changed file(s) with 9 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
7373 </tr>
7474 <tr>
7575 <td class="label temp_label">Current temperature:</td>
76 <td class="val"><span id="temp"></span>&deg; C</td>
76 <td class="val"><span id="temp"></span> &deg;C</td>
7777 </tr>
7878 <tr>
7979 <td class="label target_label">Target temperature:</td>
8080 <td class="val">
8181 <span id="target_display">
82 <span id="target"></span>&deg; C
82 <span id="target"></span> &deg;C
8383 </span>
8484 <span id="target_change">
8585 <form method="POST" action="/target">
9191 </tr>
9292 <tr>
9393 <td class="label error_label">Error:</td>
94 <td class="val" id="err_td"><span id="abs_err"></span>&deg; C</td>
94 <td class="val" id="err_td"><span id="abs_err"></span> &deg;C</td>
9595 </tr>
9696 <tr>
9797 <td class="label">
3131
3232 func (s *SousVide) InitTherm() error {
3333 var err error
34 if s.Gpio.Stub && !*FakeTemp {
34 if *FakeTemp {
35 return nil
36 }
37
38 if s.Gpio.Stub {
3539 s.Gpio.ThermFd, err = os.OpenFile(
3640 "test_temp.txt", os.O_RDONLY | os.O_SYNC, 0666)
3741 if err != nil {
5660 }
5761
5862 func (s *SousVide) MeasureTemp() error {
59 if s.Gpio.Stub && *FakeTemp {
63 if *FakeTemp {
6064 if s.Heating {
6165 s.Temp += Celsius(10 * rand.Float64())
6266 } else {