FACT++  1.0
function process_status (   result)

Definition at line 129 of file index.js.

References date0, gray(), strike(), temp, valid(), and var().

Referenced by refresh_text().

130 {
131  var temp = 1;
132  var dew = 2;
133  var gusts = 3;
134  var voltmed = 4;
135  var curmed = 5;
136  var curmax = 6;
137  var drive = 7;
138  var zd = 8;
139  var az = 9;
140 
141  var tokens = result.split('\n');
142 
143  var date1 = new Date();
144 
145  if (tokens[0].length!=13)
146  {
147  if (date0 != null)
148  strike("time", date0.getTime()+60000>date1.getTime());
149  // FIXME: Reset display to "---" values -- no connection
150  return;
151  }
152 
153  var date2 = new Date();
154  date2.setTime(tokens[0]);
155 
156  strike("time", date2.getTime()+60000>date1.getTime());
157 
158  date0 = date2;
159 
160  gray("drive", tokens[drive]);
161  gray("temp", tokens[temp]);
162  gray("volt", tokens[voltmed]);
163  gray("current", tokens[curmed]);
164 
165  document.getElementById("time").innerHTML =
166  "· "+date0.toUTCString()+" ·";//getUTCFullYear()+"/"+date0.getUTCMonth()+"/"+date0.getUTCDate()+" "+date0.getUTCHours()+":"+date0.getUTCMinutes()+":"+date0.getUTCSeconds()+"."+date0.getUTCMilliseconds();
167 
168  document.getElementById("system").innerHTML =
169  "---";
170 
171  if (valid(tokens[drive])) document.getElementById("drive").innerHTML =
172  tokens[drive]+" ["+tokens[zd]+" "+tokens[az]+"]";
173 
174  if (valid(tokens[temp]))
175  {
176  document.getElementById("temp").innerHTML =
177  tokens[temp]+"°C ["+tokens[dew]+"°C]";
178  document.getElementById("aux").innerHTML =
179  tokens[gusts]+" km/h";
180 
181  document.getElementById("temp_row").style.background="#fff8f0";
182  if (parseFloat(tokens[temp])-parseFloat(tokens[dew])>0.3)
183  document.getElementById("temp_row").style.background="#fffff0";
184  if (parseFloat(tokens[temp])-parseFloat(tokens[dew])>0.7)
185  document.getElementById("temp_row").style.background="#f0fff0";
186 
187  document.getElementById("aux_row").style.background="#fff8f0";
188  if (parseFloat(tokens[gusts])<50)
189  document.getElementById("aux_row").style.background="#fffff0";
190  if (parseFloat(tokens[gusts])<35)
191  document.getElementById("aux_row").style.background="#f0fff0";
192  }
193  else
194  {
195  document.getElementById("temp_row").style.background="#ffffff";
196  document.getElementById("aux_row").style.background="#ffffff";
197  }
198 
199 
200  if (valid(tokens[voltmed]))
201  {
202  document.getElementById("bias").innerHTML =
203  tokens[curmed]+"&micro;A / "+tokens[curmax]+"&micro;A"+
204  " ["+tokens[voltmed]+"V]";
205 
206  if (parseFloat(tokens[voltmed])>1)
207  document.getElementById("bias_row").style.background="#f0f0f0";
208  else
209  document.getElementById("bias_row").style.background="#fff0f0";
210  }
211  else
212  {
213  document.getElementById("bias_row").style.background="#ffffff";
214  }
215 
216  document.getElementById("localtime").innerHTML = "&middot;&nbsp;"+date1.toLocaleString()+"&nbsp;&middot;";//ISOlocalDateStr();//ltoString();
217 /*
218  if (tokens[1]=="Taking Data")
219  document.getElementById("row1").style.background="#d0f0d0";
220  else
221  document.getElementById("row1").style.background="#ffffff";
222 
223  if (tokens[2]=="Tracking")
224  document.getElementById("row2").style.background="#d0f0d0";
225  else
226  document.getElementById("row2").style.background="#ffffff";
227 
228  document.getElementById("volt").style.textColor="#808080";
229  document.getElementById("row2").style.textColor="#808080";
230  */
231 }
var date0
Definition: index.js:127
function strike(id, status)
Definition: index.js:96
po::typed_value< T > * var(T *ptr=0)
function gray(id, str)
Definition: index.js:108
float temp
Definition: HeadersPFmini.h:56
function valid(str)
Definition: index.js:85

+ Here is the call graph for this function:

+ Here is the caller graph for this function: