completed AC parameter query functionalities

This commit is contained in:
strawmanbobi
2019-02-17 16:14:06 +08:00
parent 128e266fcc
commit 3cf48715c6
3 changed files with 29 additions and 1 deletions

View File

@@ -42,6 +42,8 @@ public class IRDecode {
private native int irACGetSupportedSwing(int acMode); private native int irACGetSupportedSwing(int acMode);
private native int irACGetSupportedWindDirection(int acMode);
private static IRDecode mInstance; private static IRDecode mInstance;
public static IRDecode getInstance() { public static IRDecode getInstance() {
@@ -118,4 +120,9 @@ public class IRDecode {
} }
return retSupportedSwing; return retSupportedSwing;
} }
public int getACSupportedWindDirection(int acMode) {
// how many directions supported by specific AC
return irACGetSupportedWindDirection(acMode);
}
} }

View File

@@ -156,10 +156,20 @@ public class DecodeLogic {
LoggerUtil.getInstance().trace(TAG, "supported swing [" + i + "] = " + supportedSwing[i]); LoggerUtil.getInstance().trace(TAG, "supported swing [" + i + "] = " + supportedSwing[i]);
} }
} }
int supportedWindDirection = irDecode.getACSupportedWindDirection(mode);
if (DEBUG) {
LoggerUtil.getInstance().trace(TAG,
"supported wind directions for mode : " + mode +
" = " + supportedWindDirection);
}
acParameters.setTempMax(temperatureRange.getTempMax()); acParameters.setTempMax(temperatureRange.getTempMax());
acParameters.setTempMin(temperatureRange.getTempMin()); acParameters.setTempMin(temperatureRange.getTempMin());
acParameters.setSupportedWindSpeed(supportedWindSpeed); acParameters.setSupportedWindSpeed(supportedWindSpeed);
acParameters.setSupportedSwing(supportedSwing); acParameters.setSupportedSwing(supportedSwing);
acParameters.setSupportedWindSpeed(supportedWindSpeed);
} }
} }
irDecode.closeBinary(); irDecode.closeBinary();

View File

@@ -16,14 +16,17 @@ public class ACParameters {
private int [] supportedModes; private int [] supportedModes;
private int []supportedWindSpeed; private int []supportedWindSpeed;
private int []supportedSwing; private int []supportedSwing;
private int []supportedWindDirections;
public ACParameters(int tempMin, int tempMax, int[] supportedModes, public ACParameters(int tempMin, int tempMax, int[] supportedModes,
int[] supportedWindSpeed, int[] supportedSwing) { int[] supportedWindSpeed,
int[] supportedSwing, int[] supportedWindDirections) {
this.tempMin = tempMin; this.tempMin = tempMin;
this.tempMax = tempMax; this.tempMax = tempMax;
this.supportedModes = supportedModes; this.supportedModes = supportedModes;
this.supportedWindSpeed = supportedWindSpeed; this.supportedWindSpeed = supportedWindSpeed;
this.supportedSwing = supportedSwing; this.supportedSwing = supportedSwing;
this.supportedWindDirections = supportedWindDirections;
} }
public ACParameters() { public ACParameters() {
@@ -69,4 +72,12 @@ public class ACParameters {
public void setSupportedSwing(int[] supportedSwing) { public void setSupportedSwing(int[] supportedSwing) {
this.supportedSwing = supportedSwing; this.supportedSwing = supportedSwing;
} }
public int[] getSupportedWindDirections() {
return supportedWindDirections;
}
public void setSupportedWindDirections(int[] supportedWindDirections) {
this.supportedWindDirections = supportedWindDirections;
}
} }