Skip to content

Commit a8600e9

Browse files
committed
Removed fan_stat from SCC apps. Fixed multiple frontend issues.
1 parent 173d1fc commit a8600e9

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

lib/openeis-ui/openeis/ui/static/openeis-ui/js/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openeis/applications/cycling_detector.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def required_input(cls):
304304
'Zone Temperature Set Point', count_min=0),
305305
cls.fanstatus_name:
306306
InputDescriptor('SupplyFanStatus',
307-
'Supply fan status', count_min=1),
307+
'Supply fan status', count_min=0),
308308
cls.comprstatus_name:
309309
InputDescriptor('CompressorStatus',
310310
'Compressor status', count_min=0)
@@ -380,7 +380,8 @@ def run(self, current_time, points):
380380
def data_builder(value_tuple, point_name):
381381
value_list = []
382382
for item in value_tuple:
383-
value_list.append(item[1])
383+
if item[1] is not None:
384+
value_list.append(item[1])
384385
return value_list
385386

386387
for key, value in device_dict.items():
@@ -396,6 +397,8 @@ def data_builder(value_tuple, point_name):
396397
if data_name == self.comprstatus_name:
397398
compr_stat_data = data_builder(value, data_name)
398399

400+
if len(zone_temp_data) == 0:
401+
return diagnostic_result
399402
zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
400403
fanstat = None
401404
comprstat = None
@@ -745,6 +748,7 @@ def cycling_dx(self, on_indices, off_indices, diagnostic_result):
745748
"Avg Off Cycle": avg_off,
746749
"Energy penalty": 0
747750
}
751+
748752
if avg_on > 0 and avg_off > 0:
749753
cycle_time = avg_on + avg_off
750754
const_time = 1.0

openeis/applications/schedule_detector.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ def run(self, current_time, points):
158158
if key.startswith(self.zone_temp_name) and value is not None:
159159
zone_temp_data.append(value)
160160

161+
if len(zone_temp_data) == 0:
162+
return diagnostic_result
163+
161164
zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
162165
diagnostic_result = self.schedule_detector.on_new_data(current_time, zonetemp, diagnostic_result)
163166

openeis/applications/setpoint_detector.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ def run(self, current_time, points):
200200
if key.startswith(self.zone_temp_name) and value is not None:
201201
zone_temp_data.append(value)
202202

203+
if len(zone_temp_data) == 0:
204+
return diagnostic_result
205+
203206
zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
204207
fanstat = None
205208
if len(fan_stat_data)>0:
@@ -412,17 +415,18 @@ def get_output_obj(self, datetime, rec_type=type_data,
412415

413416
def on_new_data(self, timestamp, fanstat, zonetemp, diagnostic_result):
414417
self.inconsistent_data_flag = 0
415-
fanstat_value = int(fanstat)
418+
fanstat_value = None
419+
if fanstat is not None:
420+
fanstat_value = int(fanstat)
416421
zonetemp_val = float(zonetemp)
417422
#Insert raw data for plotting
418423
row = self.get_output_obj(timestamp, type_data,
419424
FanStatus=fanstat_value, ZoneTemp=zonetemp_val )
420425
diagnostic_result.insert_table_row('SetpointDetector', row)
421426
#Dx
422-
if not fanstat_value:
423-
diagnostic_result.log('Supply fan is off. Data for {} '
424-
'will not used'.format(str(timestamp)), logging.DEBUG)
425-
return diagnostic_result
427+
if fanstat_value is None:
428+
diagnostic_result.log('Supply fan is off. {}'.format(str(timestamp)), logging.DEBUG)
429+
#return diagnostic_result
426430

427431
diagnostic_result = self.detect_stpt_main(zonetemp_val, timestamp, diagnostic_result)
428432
return diagnostic_result
@@ -443,7 +447,7 @@ def detect_stpt_main(self, zone_temp, current_time, diagnostic_result):
443447
peak_array, valley_array = align_pv(filtered_timeseries, peaks, valleys, self.timestamp_array)
444448
if (np.prod(peak_array.shape) < self.minimum_data_count or
445449
np.prod(valley_array.shape) < self.minimum_data_count):
446-
diagnostic_result.debug('Set point detection is inconclusive. Not enough data.', logging.DEBUG)
450+
diagnostic_result.log('Set point detection is inconclusive. Not enough data.', logging.DEBUG)
447451
self.initialize()
448452
return diagnostic_result
449453

0 commit comments

Comments
 (0)