Skip to content

Commit

Permalink
Removed fan_stat from SCC apps. Fixed multiple frontend issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
hlngo committed Jul 6, 2017
1 parent 173d1fc commit a8600e9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/openeis-ui/openeis/ui/static/openeis-ui/js/app.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions openeis/applications/cycling_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def required_input(cls):
'Zone Temperature Set Point', count_min=0),
cls.fanstatus_name:
InputDescriptor('SupplyFanStatus',
'Supply fan status', count_min=1),
'Supply fan status', count_min=0),
cls.comprstatus_name:
InputDescriptor('CompressorStatus',
'Compressor status', count_min=0)
Expand Down Expand Up @@ -380,7 +380,8 @@ def run(self, current_time, points):
def data_builder(value_tuple, point_name):
value_list = []
for item in value_tuple:
value_list.append(item[1])
if item[1] is not None:
value_list.append(item[1])
return value_list

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

if len(zone_temp_data) == 0:
return diagnostic_result
zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
fanstat = None
comprstat = None
Expand Down Expand Up @@ -745,6 +748,7 @@ def cycling_dx(self, on_indices, off_indices, diagnostic_result):
"Avg Off Cycle": avg_off,
"Energy penalty": 0
}

if avg_on > 0 and avg_off > 0:
cycle_time = avg_on + avg_off
const_time = 1.0
Expand Down
3 changes: 3 additions & 0 deletions openeis/applications/schedule_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ def run(self, current_time, points):
if key.startswith(self.zone_temp_name) and value is not None:
zone_temp_data.append(value)

if len(zone_temp_data) == 0:
return diagnostic_result

zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
diagnostic_result = self.schedule_detector.on_new_data(current_time, zonetemp, diagnostic_result)

Expand Down
16 changes: 10 additions & 6 deletions openeis/applications/setpoint_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def run(self, current_time, points):
if key.startswith(self.zone_temp_name) and value is not None:
zone_temp_data.append(value)

if len(zone_temp_data) == 0:
return diagnostic_result

zonetemp = (sum(zone_temp_data) / len(zone_temp_data))
fanstat = None
if len(fan_stat_data)>0:
Expand Down Expand Up @@ -412,17 +415,18 @@ def get_output_obj(self, datetime, rec_type=type_data,

def on_new_data(self, timestamp, fanstat, zonetemp, diagnostic_result):
self.inconsistent_data_flag = 0
fanstat_value = int(fanstat)
fanstat_value = None
if fanstat is not None:
fanstat_value = int(fanstat)
zonetemp_val = float(zonetemp)
#Insert raw data for plotting
row = self.get_output_obj(timestamp, type_data,
FanStatus=fanstat_value, ZoneTemp=zonetemp_val )
diagnostic_result.insert_table_row('SetpointDetector', row)
#Dx
if not fanstat_value:
diagnostic_result.log('Supply fan is off. Data for {} '
'will not used'.format(str(timestamp)), logging.DEBUG)
return diagnostic_result
if fanstat_value is None:
diagnostic_result.log('Supply fan is off. {}'.format(str(timestamp)), logging.DEBUG)
#return diagnostic_result

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

Expand Down

0 comments on commit a8600e9

Please sign in to comment.