Class: Aurora::Compressor::GenericCompressor

Inherits:
Aurora::Component show all
Defined in:
lib/aurora/compressor.rb

Direct Known Subclasses

VSDrive

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Aurora::Component

#inspect

Constructor Details

#initialize(abc, stages) ⇒ GenericCompressor

Returns a new instance of GenericCompressor.



16
17
18
19
# File 'lib/aurora/compressor.rb', line 16

def initialize(abc, stages)
  super(abc)
  @stages = stages
end

Instance Attribute Details

#cooling_liquid_line_temperatureObject (readonly)

Returns the value of attribute cooling_liquid_line_temperature.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def cooling_liquid_line_temperature
  @cooling_liquid_line_temperature
end

#heat_of_extractionObject (readonly)

Returns the value of attribute heat_of_extraction.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def heat_of_extraction
  @heat_of_extraction
end

#heat_of_rejectionObject (readonly)

Returns the value of attribute heat_of_rejection.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def heat_of_rejection
  @heat_of_rejection
end

#heating_liquid_line_temperatureObject (readonly)

Returns the value of attribute heating_liquid_line_temperature.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def heating_liquid_line_temperature
  @heating_liquid_line_temperature
end

#saturated_condensor_discharge_temperatureObject (readonly)

Returns the value of attribute saturated_condensor_discharge_temperature.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def saturated_condensor_discharge_temperature
  @saturated_condensor_discharge_temperature
end

#speedObject (readonly)

Returns the value of attribute speed.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def speed
  @speed
end

#wattsObject (readonly)

Returns the value of attribute watts.



8
9
10
# File 'lib/aurora/compressor.rb', line 8

def watts
  @watts
end

Instance Method Details

#refresh(registers) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/aurora/compressor.rb', line 36

def refresh(registers)
  outputs = registers[30]
  @speed = if outputs.include?(:cc2)
             2
           elsif outputs.include?(:cc)
             1
           else
             0
           end
  @cooling_liquid_line_temperature = registers[19]

  if abc.refrigeration_monitoring?
    @heating_liquid_line_temperature = registers[1109]
    @saturated_condensor_discharge_temperature = registers[1134]
    @heat_of_extraction = registers[1154]
    @heat_of_rejection = registers[1156]
  end

  return unless abc.energy_monitoring?

  @watts = registers[1146]
end

#registers_to_readObject



29
30
31
32
33
34
# File 'lib/aurora/compressor.rb', line 29

def registers_to_read
  result = [19]
  result.push(1109, 1134, 1154..1157) if abc.refrigeration_monitoring?
  result << (1146..1147) if abc.energy_monitoring?
  result
end

#speed_rangeObject



25
26
27
# File 'lib/aurora/compressor.rb', line 25

def speed_range
  0..@stages
end

#typeObject



21
22
23
# File 'lib/aurora/compressor.rb', line 21

def type
  "#{(@stages == 2) ? "Dual" : "Single"} Stage Compressor"
end