Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/unit/handlers/coolingSystem.handlers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const createMockEquipment = () => ({
{ equipment: 'TC-7501', is_active: true, miner_side_out_temp: { value: 37.1, unit: '°C' }, tower_side_in_temp: { value: 29.2, unit: '°C' }, tower_side_out_temp: { value: 36.9, unit: '°C' }, tcv_position: { value: 55, unit: '%' } }
],
cooling_towers: [
{ equipment: 'TR-7501', is_running: true, fan_status: 'Running', fan_power: { value: 60, unit: 'kW' }, level: { value: 82, unit: '%' }, vibration: { value: 0.8, unit: 'mm/s', status: 'Normal' } },
{ equipment: 'TR-7502', is_running: true, fan_status: 'Running', fan_power: { value: 45, unit: 'kW' }, level: { value: 85, unit: '%' }, vibration: { value: 0.6, unit: 'mm/s', status: 'Normal' } }
{ equipment: 'TR-7501', is_running: true, fan_status: 'Running', fan_cv: { value: 60, unit: 'CV' }, level: { value: 82, unit: '%' }, vibration: { value: 0.8, unit: 'mm/s', status: 'Normal' } },
{ equipment: 'TR-7502', is_running: true, fan_status: 'Running', fan_cv: { value: 45, unit: 'CV' }, level: { value: 85, unit: '%' }, vibration: { value: 0.6, unit: 'mm/s', status: 'Normal' } }
],
valves: [
{ equipment: 'PCV-7502', position: { value: 12, unit: '%' } },
Expand Down Expand Up @@ -408,7 +408,7 @@ test('buildMinersCircuit2View - builds view from enriched equipment', (t) => {
t.ok(view.heat_exchangers, 'should have heat_exchangers')
t.ok(view.summary, 'should have summary')
// Check enriched data with units
t.ok(view.cooling_towers[0].fan_power.unit, 'fan_power should have unit')
t.ok(view.cooling_towers[0].fan_cv.unit, 'fan_cv should have unit')
t.ok(view.cooling_towers[0].level.unit, 'level should have unit')
// Check tower sensor refs
t.ok(view.cooling_towers[0].level_sensor, 'should have level_sensor ref')
Expand Down
6 changes: 4 additions & 2 deletions workers/lib/server/handlers/coolingSystem.handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,13 @@ function buildMinersCircuit2View (equipment, config) {
is_running: ct.is_running,
fan_status: ct.fan_status,
fan_speed: ct.fan_speed,
fan_power: ct.fan_power,
fan_cv: ct.fan_cv,
fan_id: towerFanId,
level: ct.level,
level_sensor: towerLevelSensor,
vibration: ct.vibration,
vibration_sensor: towerVibrationSensorId,
vibration_threshold: ct.vibration_threshold || null,
capacity_flow: towerConfig.defaults?.tower_capacity || null,
capacity_gcal: towerConfig.defaults?.tower_capacity_gcal || null
}))
Expand Down Expand Up @@ -667,12 +668,13 @@ function buildHvacCircuit2View (equipment, config) {
is_running: ct.is_running,
fan_status: ct.fan_status,
fan_speed: ct.fan_speed,
fan_power: ct.fan_power,
fan_cv: ct.fan_cv,
fan_id: towerFanId || null,
level: ct.level,
level_sensor: towerLevelSensorId || null,
vibration: ct.vibration,
vibration_sensor: towerVibrationSensorId || null,
vibration_threshold: ct.vibration_threshold || null,
capacity_mcal: condenserConfig.defaults?.tower_capacity_mcal || null,
capacity_flow: condenserConfig.defaults?.tower_flow || null
}))
Expand Down
1 change: 1 addition & 0 deletions workers/lib/server/handlers/energySystem.handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function buildLayoutView (equipment, config, stats) {

return {
title: 'Energy Layout',
source_label: energyLayout.source_label || null,
site_total: siteTotal,
site_pm: siteMeter || null,
main_protection: mainRelay || null,
Expand Down
Loading