-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed classes for consistency (#311)
- Loading branch information
1 parent
f3060dd
commit c3c4247
Showing
11 changed files
with
153 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
modules/hcc-model/src/main/java/net/sf/dz3r/device/actuator/economizer/EconomizerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package net.sf.dz3r.device.actuator.economizer; | ||
|
||
import net.sf.dz3r.model.HvacMode; | ||
|
||
/** | ||
* Full set of economizer settings, both permanent and user changeable. | ||
* | ||
* @author Copyright © <a href="mailto:[email protected]">Vadim Tkachenko</a> 2001-2024 | ||
*/ | ||
public class EconomizerConfig extends EconomizerSettings { | ||
|
||
/** | ||
* Which mode this device is active in. This mode may be different from the zone mode; it is the user's | ||
* responsibility to make sure the system doesn't enter a runaway loop. | ||
*/ | ||
public final HvacMode mode; | ||
|
||
public final Double P; | ||
|
||
public final Double I; | ||
|
||
public final Double saturationLimit; | ||
|
||
/** | ||
* All except {@code enabled} argument constructor (defaults to {@code true}, for common sense. | ||
* | ||
* @param keepHvacOn See {@link #keepHvacOn}. Think twice before setting this to {@code true}. | ||
* @param P Internal {@link net.sf.dz3r.controller.pid.PidController} P component. | ||
* @param I Internal {@link net.sf.dz3r.controller.pid.PidController} I component. | ||
* @param saturationLimit Internal {@link net.sf.dz3r.controller.pid.PidController} saturation limit. | ||
*/ | ||
public EconomizerConfig(HvacMode mode, | ||
Double changeoverDelta, Double targetTemperature, | ||
Boolean keepHvacOn, | ||
Double P, Double I, Double saturationLimit) { | ||
this(mode, true, changeoverDelta, targetTemperature, keepHvacOn, P, I, saturationLimit); | ||
} | ||
|
||
/** | ||
* All argument constructor. | ||
* | ||
* @param keepHvacOn See {@link #keepHvacOn}. Think twice before setting this to {@code true}. | ||
* @param P Internal {@link net.sf.dz3r.controller.pid.PidController} P component. | ||
* @param I Internal {@link net.sf.dz3r.controller.pid.PidController} I component. | ||
* @param saturationLimit Internal {@link net.sf.dz3r.controller.pid.PidController} saturation limit. | ||
*/ | ||
public EconomizerConfig(HvacMode mode, | ||
Boolean enabled, | ||
Double changeoverDelta, Double targetTemperature, | ||
Boolean keepHvacOn, | ||
Double P, Double I, Double saturationLimit) { | ||
super(enabled, changeoverDelta, targetTemperature, keepHvacOn); | ||
|
||
this.mode = mode; | ||
|
||
this.P = P; | ||
this.I = I; | ||
this.saturationLimit = saturationLimit; | ||
|
||
checkArgs(); | ||
} | ||
|
||
protected void checkArgs() { | ||
|
||
if (mode == null) { | ||
throw new IllegalArgumentException("mode can't be null"); | ||
} | ||
|
||
if (changeoverDelta < 0) { | ||
throw new IllegalArgumentException("changeoverDelta must be non-negative"); | ||
} | ||
} | ||
|
||
/** | ||
* Merge this instance with an update. | ||
* | ||
* @param from Adjustment instance. Non-null values take precedence over this object's values. | ||
*/ | ||
public EconomizerConfig merge(EconomizerConfig from) { | ||
|
||
return new EconomizerConfig( | ||
from.mode != null ? from.mode : mode, | ||
from.enabled != null ? from.enabled : enabled, | ||
from.changeoverDelta != null ? from.changeoverDelta : changeoverDelta, | ||
from.targetTemperature != null ? from.targetTemperature : targetTemperature, | ||
from.keepHvacOn != null ? from.keepHvacOn : keepHvacOn, | ||
from.P != null ? from.P : P, | ||
from.I != null ? from.I : I, | ||
from.saturationLimit != null ? from.saturationLimit : saturationLimit); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "{mode=" + mode | ||
+ ", enabled=" + enabled | ||
+ ", changeoverDelta=" + changeoverDelta | ||
+ ", targetTemperature=" + targetTemperature | ||
+ ", keepHvacOn=" + keepHvacOn | ||
+ ", P=" + P | ||
+ ", I=" + I | ||
+ ", saturationLimit=" + saturationLimit | ||
+ "}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 23 additions & 74 deletions
97
...es/hcc-model/src/main/java/net/sf/dz3r/device/actuator/economizer/EconomizerSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,53 @@ | ||
package net.sf.dz3r.device.actuator.economizer; | ||
|
||
import net.sf.dz3r.model.HvacMode; | ||
|
||
/** | ||
* Full set of economizer settings. | ||
* Set of user changeable economizer settings. | ||
* | ||
* @author Copyright © <a href="mailto:[email protected]">Vadim Tkachenko</a> 2001-2024 | ||
*/ | ||
public class EconomizerSettings extends EconomizerTransientSettings { | ||
public class EconomizerSettings { | ||
|
||
public final Boolean enabled; | ||
|
||
/** | ||
* Which mode this device is active in. This mode may be different from the zone mode; it is the user's | ||
* responsibility to make sure the system doesn't enter a runaway loop. | ||
* Temperature difference between indoor and outdoor temperature necessary to turn the device on. | ||
*/ | ||
public final HvacMode mode; | ||
|
||
public final Double P; | ||
|
||
public final Double I; | ||
|
||
public final Double saturationLimit; | ||
public final Double changeoverDelta; | ||
|
||
/** | ||
* All except {@code enabled} argument constructor (defaults to {@code true}, for common sense. | ||
* | ||
* @param keepHvacOn See {@link #keepHvacOn}. Think twice before setting this to {@code true}. | ||
* @param P Internal {@link net.sf.dz3r.controller.pid.PidController} P component. | ||
* @param I Internal {@link net.sf.dz3r.controller.pid.PidController} I component. | ||
* @param saturationLimit Internal {@link net.sf.dz3r.controller.pid.PidController} saturation limit. | ||
* When this temperature is reached, the device is shut off. | ||
*/ | ||
public EconomizerSettings(HvacMode mode, | ||
Double changeoverDelta, Double targetTemperature, | ||
Boolean keepHvacOn, | ||
Double P, Double I, Double saturationLimit) { | ||
this(mode, true, changeoverDelta, targetTemperature, keepHvacOn, P, I, saturationLimit); | ||
} | ||
public final Double targetTemperature; | ||
|
||
/** | ||
* All argument constructor. | ||
* | ||
* @param keepHvacOn See {@link #keepHvacOn}. Think twice before setting this to {@code true}. | ||
* @param P Internal {@link net.sf.dz3r.controller.pid.PidController} P component. | ||
* @param I Internal {@link net.sf.dz3r.controller.pid.PidController} I component. | ||
* @param saturationLimit Internal {@link net.sf.dz3r.controller.pid.PidController} saturation limit. | ||
* {@code true} means that turning on the device will NOT turn the HVAC off. | ||
* You probably want to keep this at {@code false}, unless the indoor temperature is measured at HVAC return | ||
* and fresh air is injected into HVAC return. | ||
*/ | ||
public EconomizerSettings(HvacMode mode, | ||
Boolean enabled, | ||
Double changeoverDelta, Double targetTemperature, | ||
Boolean keepHvacOn, | ||
Double P, Double I, Double saturationLimit) { | ||
super(enabled, changeoverDelta, targetTemperature, keepHvacOn); | ||
|
||
this.mode = mode; | ||
public final Boolean keepHvacOn; | ||
|
||
this.P = P; | ||
this.I = I; | ||
this.saturationLimit = saturationLimit; | ||
public EconomizerSettings(Boolean enabled, Double changeoverDelta, Double targetTemperature, Boolean keepHvacOn) { | ||
|
||
checkArgs(); | ||
this.enabled = enabled; | ||
this.changeoverDelta = changeoverDelta; | ||
this.targetTemperature = targetTemperature; | ||
this.keepHvacOn = keepHvacOn; | ||
} | ||
|
||
protected void checkArgs() { | ||
|
||
if (mode == null) { | ||
throw new IllegalArgumentException("mode can't be null"); | ||
} | ||
|
||
if (changeoverDelta < 0) { | ||
throw new IllegalArgumentException("changeoverDelta must be non-negative"); | ||
} | ||
} | ||
|
||
/** | ||
* Merge this instance with an update. | ||
* | ||
* @param from Adjustment instance. Non-null values take precedence over this object's values. | ||
*/ | ||
public EconomizerSettings merge(EconomizerSettings from) { | ||
public EconomizerSettings(EconomizerConfig source) { | ||
|
||
return new EconomizerSettings( | ||
from.mode != null ? from.mode : mode, | ||
from.enabled != null ? from.enabled : enabled, | ||
from.changeoverDelta != null ? from.changeoverDelta : changeoverDelta, | ||
from.targetTemperature != null ? from.targetTemperature : targetTemperature, | ||
from.keepHvacOn != null ? from.keepHvacOn : keepHvacOn, | ||
from.P != null ? from.P : P, | ||
from.I != null ? from.I : I, | ||
from.saturationLimit != null ? from.saturationLimit : saturationLimit); | ||
this.enabled = source.enabled; | ||
this.changeoverDelta = source.changeoverDelta; | ||
this.targetTemperature = source.targetTemperature; | ||
this.keepHvacOn = source.keepHvacOn; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "{mode=" + mode | ||
+ ", enabled=" + enabled | ||
return "{enabled=" + enabled | ||
+ ", changeoverDelta=" + changeoverDelta | ||
+ ", targetTemperature=" + targetTemperature | ||
+ ", keepHvacOn=" + keepHvacOn | ||
+ ", P=" + P | ||
+ ", I=" + I | ||
+ ", saturationLimit=" + saturationLimit | ||
+ "}"; | ||
} | ||
} |
53 changes: 0 additions & 53 deletions
53
...del/src/main/java/net/sf/dz3r/device/actuator/economizer/EconomizerTransientSettings.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.