link start!
This commit is contained in:
+109
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BBooleanPoint
|
||||
* javax.baja.status.BStatusBoolean
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.control.BBooleanPoint;
|
||||
import javax.baja.status.BStatusBoolean;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BBooleanChangeOfStateAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property alarmValue = BBooleanChangeOfStateAlgorithm.newProperty((int)0, (boolean)true, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BBooleanChangeOfStateAlgorithm;
|
||||
|
||||
public boolean getAlarmValue() {
|
||||
return this.getBoolean(alarmValue);
|
||||
}
|
||||
|
||||
public void setAlarmValue(boolean bl) {
|
||||
this.setBoolean(alarmValue, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BBooleanPoint;
|
||||
}
|
||||
|
||||
public BFacets getSlotFacets(Slot slot) {
|
||||
if (slot == alarmValue) {
|
||||
return this.getPointFacets();
|
||||
}
|
||||
return super.getSlotFacets(slot);
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusBoolean bStatusBoolean = (BStatusBoolean)bStatusValue;
|
||||
if (bStatusBoolean.getStatus().isNull()) {
|
||||
return true;
|
||||
}
|
||||
return bStatusBoolean.getValue() ^ this.getAlarmValue();
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
map.put("numericValue", BInteger.make((int)((BStatusBoolean)bStatusValue).getEnum().getOrdinal()));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BBooleanChangeOfStateAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BBooleanChangeOfStateAlgorithm = BBooleanChangeOfStateAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BBooleanChangeOfStateAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BBooleanPoint
|
||||
* javax.baja.status.BStatusBoolean
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.control.BBooleanPoint;
|
||||
import javax.baja.status.BStatusBoolean;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BBooleanCommandFailureAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property feedbackValue = BBooleanCommandFailureAlgorithm.newProperty((int)8, (BValue)new BStatusBoolean(), null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BBooleanCommandFailureAlgorithm;
|
||||
|
||||
public BStatusBoolean getFeedbackValue() {
|
||||
return (BStatusBoolean)this.get(feedbackValue);
|
||||
}
|
||||
|
||||
public void setFeedbackValue(BStatusBoolean bStatusBoolean) {
|
||||
this.set(feedbackValue, (BValue)bStatusBoolean, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BBooleanPoint;
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (property == feedbackValue) {
|
||||
this.executePoint();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusBoolean bStatusBoolean = (BStatusBoolean)bStatusValue;
|
||||
return bStatusBoolean.getValue() ^ this.getFeedbackValue().getValue() ^ true;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
map.put("numericValue", BInteger.make((int)((BStatusBoolean)bStatusValue).getEnum().getOrdinal()));
|
||||
map.put("feedbackValue", BString.make((String)this.getFeedbackValue().valueToString((Context)this.getPointFacets())));
|
||||
map.put("feedbackNumeric", BInteger.make((int)this.getFeedbackValue().getEnum().getOrdinal()));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BBooleanCommandFailureAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BBooleanCommandFailureAlgorithm = BBooleanCommandFailureAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BBooleanCommandFailureAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BEnumPoint
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.status.BStatusEnum
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BDynamicEnum
|
||||
* javax.baja.sys.BEnumRange
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.control.BEnumPoint;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.status.BStatusEnum;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BDynamicEnum;
|
||||
import javax.baja.sys.BEnumRange;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BEnumChangeOfStateAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property alarmValues = BEnumChangeOfStateAlgorithm.newProperty((int)0, (BValue)BEnumRange.DEFAULT, (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:EnumAlarmRangeFE")));
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BEnumChangeOfStateAlgorithm;
|
||||
|
||||
public BEnumRange getAlarmValues() {
|
||||
return (BEnumRange)this.get(alarmValues);
|
||||
}
|
||||
|
||||
public void setAlarmValues(BEnumRange bEnumRange) {
|
||||
this.set(alarmValues, (BValue)bEnumRange, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BEnumPoint;
|
||||
}
|
||||
|
||||
public BFacets getSlotFacets(Slot slot) {
|
||||
if (slot == alarmValues) {
|
||||
return BFacets.make((BFacets)this.getPointFacets(), (BFacets)super.getSlotFacets(slot));
|
||||
}
|
||||
return super.getSlotFacets(slot);
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusEnum bStatusEnum = (BStatusEnum)bStatusValue;
|
||||
BDynamicEnum bDynamicEnum = bStatusEnum.getValue();
|
||||
int n = bDynamicEnum.getOrdinal();
|
||||
int[] nArray = this.getAlarmValues().getOrdinals();
|
||||
int n2 = 0;
|
||||
while (n2 < nArray.length) {
|
||||
if (n == nArray[n2]) {
|
||||
return false;
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
map.put("numericValue", BInteger.make((int)((BStatusEnum)bStatusValue).getValue().getOrdinal()));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BEnumChangeOfStateAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BEnumChangeOfStateAlgorithm = BEnumChangeOfStateAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BEnumChangeOfStateAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BEnumPoint
|
||||
* javax.baja.status.BStatusEnum
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BDynamicEnum
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.control.BEnumPoint;
|
||||
import javax.baja.status.BStatusEnum;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BDynamicEnum;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BEnumCommandFailureAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property feedbackValue = BEnumCommandFailureAlgorithm.newProperty((int)8, (BValue)new BStatusEnum(), null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BEnumCommandFailureAlgorithm;
|
||||
|
||||
public BStatusEnum getFeedbackValue() {
|
||||
return (BStatusEnum)this.get(feedbackValue);
|
||||
}
|
||||
|
||||
public void setFeedbackValue(BStatusEnum bStatusEnum) {
|
||||
this.set(feedbackValue, (BValue)bStatusEnum, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BEnumPoint;
|
||||
}
|
||||
|
||||
public BFacets getSlotFacets(Slot slot) {
|
||||
if (slot == feedbackValue) {
|
||||
return this.getPointFacets();
|
||||
}
|
||||
return super.getSlotFacets(slot);
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (property == feedbackValue) {
|
||||
this.executePoint();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusEnum bStatusEnum = (BStatusEnum)bStatusValue;
|
||||
BDynamicEnum bDynamicEnum = bStatusEnum.getValue();
|
||||
BDynamicEnum bDynamicEnum2 = this.getFeedbackValue().getValue();
|
||||
boolean bl = false;
|
||||
if (bDynamicEnum.getOrdinal() == bDynamicEnum2.getOrdinal()) {
|
||||
bl = true;
|
||||
}
|
||||
boolean bl2 = bl;
|
||||
return bl2;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
map.put("numericValue", BInteger.make((int)((BStatusEnum)bStatusValue).getValue().getOrdinal()));
|
||||
map.put("feedbackValue", BString.make((String)this.getFeedbackValue().valueToString((Context)this.getPointFacets())));
|
||||
map.put("feedbackNumeric", BInteger.make((int)this.getFeedbackValue().getEnum().getOrdinal()));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BEnumCommandFailureAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BEnumCommandFailureAlgorithm = BEnumCommandFailureAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BEnumCommandFailureAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,473 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BNumericPoint
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.status.BStatusNumeric
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BBoolean
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BDouble
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BFloat
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.units.BUnit
|
||||
* javax.baja.util.BFormat
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.alarm.ext.BLimitEnable;
|
||||
import javax.baja.alarm.ext.BOffnormalAlgorithm;
|
||||
import javax.baja.control.BNumericPoint;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.status.BStatusNumeric;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BBoolean;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BDouble;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BFloat;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.units.BUnit;
|
||||
import javax.baja.util.BFormat;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BOutOfRangeAlgorithm
|
||||
extends BOffnormalAlgorithm {
|
||||
public static final Property highLimit = BOutOfRangeAlgorithm.newProperty((int)0, (int)0, null);
|
||||
public static final Property lowLimit = BOutOfRangeAlgorithm.newProperty((int)0, (int)0, null);
|
||||
public static final Property deadband = BOutOfRangeAlgorithm.newProperty((int)0, (int)0, (BFacets)BFacets.make((String)"min", (BIDataValue)BFloat.make((float)0.0f)));
|
||||
public static final Property highLimitText = BOutOfRangeAlgorithm.newProperty((int)0, (BValue)BFormat.DEFAULT, (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property lowLimitText = BOutOfRangeAlgorithm.newProperty((int)0, (BValue)BFormat.DEFAULT, (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property limitEnable = BOutOfRangeAlgorithm.newProperty((int)0, (BValue)new BLimitEnable(), null);
|
||||
public static final Type TYPE;
|
||||
OutOfRangeState current;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BOutOfRangeAlgorithm;
|
||||
|
||||
public double getHighLimit() {
|
||||
return this.getDouble(highLimit);
|
||||
}
|
||||
|
||||
public void setHighLimit(double d) {
|
||||
this.setDouble(highLimit, d, null);
|
||||
}
|
||||
|
||||
public double getLowLimit() {
|
||||
return this.getDouble(lowLimit);
|
||||
}
|
||||
|
||||
public void setLowLimit(double d) {
|
||||
this.setDouble(lowLimit, d, null);
|
||||
}
|
||||
|
||||
public double getDeadband() {
|
||||
return this.getDouble(deadband);
|
||||
}
|
||||
|
||||
public void setDeadband(double d) {
|
||||
this.setDouble(deadband, d, null);
|
||||
}
|
||||
|
||||
public BFormat getHighLimitText() {
|
||||
return (BFormat)this.get(highLimitText);
|
||||
}
|
||||
|
||||
public void setHighLimitText(BFormat bFormat) {
|
||||
this.set(highLimitText, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BFormat getLowLimitText() {
|
||||
return (BFormat)this.get(lowLimitText);
|
||||
}
|
||||
|
||||
public void setLowLimitText(BFormat bFormat) {
|
||||
this.set(lowLimitText, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BLimitEnable getLimitEnable() {
|
||||
return (BLimitEnable)this.get(limitEnable);
|
||||
}
|
||||
|
||||
public void setLimitEnable(BLimitEnable bLimitEnable) {
|
||||
this.set(limitEnable, (BValue)bLimitEnable, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
private final boolean isHighLimitEnabled() {
|
||||
return this.getLimitEnable().isHighLimitEnabled();
|
||||
}
|
||||
|
||||
private final boolean isLowLimitEnabled() {
|
||||
return this.getLimitEnable().isLowLimitEnabled();
|
||||
}
|
||||
|
||||
public void started() {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (bAlarmState == BAlarmState.highLimit) {
|
||||
this.current = new HighAlarmState();
|
||||
}
|
||||
if (bAlarmState == BAlarmState.lowLimit) {
|
||||
this.current = new LowAlarmState();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BNumericPoint;
|
||||
}
|
||||
|
||||
public BFacets getSlotFacets(Slot slot) {
|
||||
if (slot == highLimit || slot == lowLimit) {
|
||||
return this.getPointFacets();
|
||||
}
|
||||
if (slot == deadband) {
|
||||
BFacets bFacets = this.getPointFacets();
|
||||
BUnit bUnit = (BUnit)bFacets.getFacet("units");
|
||||
if (bUnit != null) {
|
||||
bFacets = BFacets.make((BFacets)bFacets, (String)"units", (BIDataValue)bUnit.getDifferentialUnit());
|
||||
}
|
||||
return BFacets.make((BFacets)bFacets, (BFacets)super.getSlotFacets((Slot)deadband));
|
||||
}
|
||||
return super.getSlotFacets(slot);
|
||||
}
|
||||
|
||||
public BAlarmState checkAlarms(BStatusValue bStatusValue, long l, long l2) {
|
||||
BStatusNumeric bStatusNumeric = (BStatusNumeric)bStatusValue;
|
||||
if (bStatusNumeric.getStatus().isNull()) {
|
||||
if (this.current instanceof NormalState) {
|
||||
return null;
|
||||
}
|
||||
if (l2 > 0L && this.current instanceof HighAlarmState) {
|
||||
this.current = new ValidateReturnFromHighState(l2);
|
||||
} else if (l2 > 0L && this.current instanceof LowAlarmState) {
|
||||
this.current = new ValidateReturnFromLowState(l2);
|
||||
} else {
|
||||
this.current = new NormalState();
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return this.evaluate(bStatusNumeric.getValue(), l, l2);
|
||||
}
|
||||
|
||||
private final BAlarmState evaluate(double d, long l, long l2) {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (!(this.current instanceof ValidationState)) {
|
||||
this.current = bAlarmState == BAlarmState.highLimit ? new HighAlarmState() : (bAlarmState == BAlarmState.lowLimit ? new LowAlarmState() : new NormalState());
|
||||
}
|
||||
return this.current.evaluate(d, l, l2);
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
BFacets bFacets = this.getPointFacets();
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
map.put("deadband", BString.make((String)BDouble.toString((double)this.getDeadband(), (Context)bFacets)));
|
||||
if (this.current instanceof HighAlarmState) {
|
||||
if (!this.getHighLimitText().equals((Object)BFormat.DEFAULT)) {
|
||||
map.put("msgText", BString.make((String)this.getHighLimitText().getFormat()));
|
||||
}
|
||||
map.put("highLimit", BString.make((String)BDouble.toString((double)this.getHighLimit(), (Context)bFacets)));
|
||||
if (this.isLowLimitEnabled()) {
|
||||
map.put("lowLimit", BString.make((String)BDouble.toString((double)this.getLowLimit(), (Context)bFacets)));
|
||||
}
|
||||
} else if (this.current instanceof LowAlarmState) {
|
||||
if (!this.getLowLimitText().equals((Object)BFormat.DEFAULT)) {
|
||||
map.put("msgText", BString.make((String)this.getLowLimitText().getFormat()));
|
||||
}
|
||||
if (this.isHighLimitEnabled()) {
|
||||
map.put("highLimit", BString.make((String)BDouble.toString((double)this.getHighLimit(), (Context)bFacets)));
|
||||
}
|
||||
map.put("lowLimit", BString.make((String)BDouble.toString((double)this.getLowLimit(), (Context)bFacets)));
|
||||
}
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
void transition(OutOfRangeState outOfRangeState) {
|
||||
this.current = outOfRangeState;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.current = new NormalState();
|
||||
}
|
||||
|
||||
public BOutOfRangeAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BOutOfRangeAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BOutOfRangeAlgorithm = BOutOfRangeAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BOutOfRangeAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class HighAlarmState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "HighAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d >= BOutOfRangeAlgorithm.this.getHighLimit() - BOutOfRangeAlgorithm.this.getDeadband()) {
|
||||
if (!BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
} else if (d < BOutOfRangeAlgorithm.this.getLowLimit() && BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
if (l == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateReturnFromHighState(l));
|
||||
} else if (d < BOutOfRangeAlgorithm.this.getHighLimit() - BOutOfRangeAlgorithm.this.getDeadband()) {
|
||||
if (l2 == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateReturnFromHighState(l2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class LowAlarmState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "LowAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d <= BOutOfRangeAlgorithm.this.getLowLimit() + BOutOfRangeAlgorithm.this.getDeadband()) {
|
||||
if (!BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
} else if (d > BOutOfRangeAlgorithm.this.getHighLimit() && BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
if (l2 == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateReturnFromLowState(l2));
|
||||
} else if (d > BOutOfRangeAlgorithm.this.getLowLimit() + BOutOfRangeAlgorithm.this.getDeadband()) {
|
||||
if (l2 == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateReturnFromLowState(l2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class NormalState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "Normal";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d < BOutOfRangeAlgorithm.this.getLowLimit() && BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
if (l == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.lowLimit;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateLowAlarmState(l));
|
||||
} else if ((!(d >= BOutOfRangeAlgorithm.this.getLowLimit()) || !(d <= BOutOfRangeAlgorithm.this.getHighLimit())) && d > BOutOfRangeAlgorithm.this.getHighLimit() && BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
if (l == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.highLimit;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateHighAlarmState(l));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromHighState
|
||||
extends ValidationState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromHighState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (l2 > 0L && !BOutOfRangeAlgorithm.this.isTimerExpired()) {
|
||||
return null;
|
||||
}
|
||||
if (d > BOutOfRangeAlgorithm.this.getHighLimit() - BOutOfRangeAlgorithm.this.getDeadband() && BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new HighAlarmState());
|
||||
} else if (d < BOutOfRangeAlgorithm.this.getHighLimit() - BOutOfRangeAlgorithm.this.getDeadband() && BOutOfRangeAlgorithm.this.isTimerExpired()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateReturnFromHighState(long l) {
|
||||
BOutOfRangeAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromLowState
|
||||
extends ValidationState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromLowState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d <= BOutOfRangeAlgorithm.this.getLowLimit() + BOutOfRangeAlgorithm.this.getDeadband() && BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new LowAlarmState());
|
||||
} else if (d > BOutOfRangeAlgorithm.this.getLowLimit() + BOutOfRangeAlgorithm.this.getDeadband() && BOutOfRangeAlgorithm.this.isTimerExpired()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateReturnFromLowState(long l) {
|
||||
BOutOfRangeAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class ValidationState
|
||||
extends OutOfRangeState {
|
||||
private ValidationState() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class OutOfRangeState {
|
||||
public abstract String tag();
|
||||
|
||||
public abstract BAlarmState evaluate(double var1, long var3, long var5);
|
||||
|
||||
public OutOfRangeState() {
|
||||
BOutOfRangeAlgorithm.this.cancelTimer();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateLowAlarmState
|
||||
extends ValidationState {
|
||||
public String tag() {
|
||||
return "ValidateLowAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d < BOutOfRangeAlgorithm.this.getLowLimit() && BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
if (BOutOfRangeAlgorithm.this.isTimerExpired()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.lowLimit;
|
||||
}
|
||||
} else if (d > BOutOfRangeAlgorithm.this.getHighLimit() && BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
if (l == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.highLimit;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateHighAlarmState(l));
|
||||
} else if (d >= BOutOfRangeAlgorithm.this.getLowLimit()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateLowAlarmState(long l) {
|
||||
BOutOfRangeAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateHighAlarmState
|
||||
extends ValidationState {
|
||||
public String tag() {
|
||||
return "ValidateHighAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d, long l, long l2) {
|
||||
if (d < BOutOfRangeAlgorithm.this.getLowLimit() && BOutOfRangeAlgorithm.this.isLowLimitEnabled()) {
|
||||
if (l == 0L) {
|
||||
BOutOfRangeAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.lowLimit;
|
||||
}
|
||||
BOutOfRangeAlgorithm.this.transition(new ValidateLowAlarmState(l));
|
||||
} else if (d > BOutOfRangeAlgorithm.this.getHighLimit() && BOutOfRangeAlgorithm.this.isHighLimitEnabled()) {
|
||||
if (BOutOfRangeAlgorithm.this.isTimerExpired()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.highLimit;
|
||||
}
|
||||
} else if (d <= BOutOfRangeAlgorithm.this.getHighLimit()) {
|
||||
BOutOfRangeAlgorithm.this.transition(new NormalState());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateHighAlarmState(long l) {
|
||||
BOutOfRangeAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.status.BStatus
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.status.BStatus;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BStatusAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property alarmValues = BStatusAlgorithm.newProperty((int)0, (BValue)BStatus.ok, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BStatusAlgorithm;
|
||||
|
||||
public BStatus getAlarmValues() {
|
||||
return (BStatus)this.get(alarmValues);
|
||||
}
|
||||
|
||||
public void setAlarmValues(BStatus bStatus) {
|
||||
this.set(alarmValues, (BValue)bStatus, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
if (!this.isNormal(bStatusValue)) {
|
||||
map.put("offnormalValue", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
}
|
||||
map.put("numericValue", BInteger.make((int)bStatusValue.getStatus().getBits()));
|
||||
map.put("presentValue", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
boolean bl = false;
|
||||
if ((bStatusValue.getStatus().getBits() & this.getAlarmValues().getBits()) == 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BStatusAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BStatusAlgorithm = BStatusAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BStatusAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BStringPoint
|
||||
* javax.baja.status.BStatusString
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* org.apache.oro.text.regex.MalformedPatternException
|
||||
* org.apache.oro.text.regex.Pattern
|
||||
* org.apache.oro.text.regex.PatternMatcher
|
||||
* org.apache.oro.text.regex.Perl5Compiler
|
||||
* org.apache.oro.text.regex.Perl5Matcher
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;
|
||||
import javax.baja.control.BStringPoint;
|
||||
import javax.baja.status.BStatusString;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.PatternMatcher;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BStringChangeOfStateAlgorithm
|
||||
extends BTwoStateAlgorithm {
|
||||
public static final Property expression = BStringChangeOfStateAlgorithm.newProperty((int)0, (String)".*", null);
|
||||
public static final Property normalOnMatch = BStringChangeOfStateAlgorithm.newProperty((int)0, (boolean)true, null);
|
||||
public static final Property caseSensitive = BStringChangeOfStateAlgorithm.newProperty((int)0, (boolean)true, null);
|
||||
public static final Type TYPE;
|
||||
private PatternMatcher matcher;
|
||||
private Pattern pattern;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateAlgorithm;
|
||||
|
||||
public String getExpression() {
|
||||
return this.getString(expression);
|
||||
}
|
||||
|
||||
public void setExpression(String string) {
|
||||
this.setString(expression, string, null);
|
||||
}
|
||||
|
||||
public boolean getNormalOnMatch() {
|
||||
return this.getBoolean(normalOnMatch);
|
||||
}
|
||||
|
||||
public void setNormalOnMatch(boolean bl) {
|
||||
this.setBoolean(normalOnMatch, bl, null);
|
||||
}
|
||||
|
||||
public boolean getCaseSensitive() {
|
||||
return this.getBoolean(caseSensitive);
|
||||
}
|
||||
|
||||
public void setCaseSensitive(boolean bl) {
|
||||
this.setBoolean(caseSensitive, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BStringPoint;
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (property.equals((Object)expression) || property.equals((Object)caseSensitive)) {
|
||||
this.init();
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
public void started() {
|
||||
this.init();
|
||||
super.started();
|
||||
}
|
||||
|
||||
private final void init() {
|
||||
this.matcher = new Perl5Matcher();
|
||||
Perl5Compiler perl5Compiler = new Perl5Compiler();
|
||||
int n = 16;
|
||||
if (!this.getCaseSensitive()) {
|
||||
n |= 1;
|
||||
}
|
||||
try {
|
||||
this.pattern = perl5Compiler.compile(this.getExpression(), n);
|
||||
}
|
||||
catch (MalformedPatternException malformedPatternException) {
|
||||
log.error("Invalid expression: '" + this.getExpression() + '\'', (Throwable)malformedPatternException);
|
||||
this.pattern = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusString bStatusString = (BStatusString)bStatusValue;
|
||||
if (bStatusString.getStatus().isNull()) {
|
||||
return true;
|
||||
}
|
||||
if (this.pattern == null) {
|
||||
return true;
|
||||
}
|
||||
if (this.getNormalOnMatch()) {
|
||||
return this.matcher.contains(bStatusString.getValue().toString(), this.pattern);
|
||||
}
|
||||
return this.matcher.contains(bStatusString.getValue().toString(), this.pattern) ^ true;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.matcher = new Perl5Matcher();
|
||||
}
|
||||
|
||||
public BStringChangeOfStateAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateAlgorithm = BStringChangeOfStateAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BStringChangeOfStateAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BStringPoint
|
||||
* javax.baja.log.Log
|
||||
* javax.baja.status.BStatusString
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* org.apache.oro.text.regex.MalformedPatternException
|
||||
* org.apache.oro.text.regex.Pattern
|
||||
* org.apache.oro.text.regex.PatternMatcher
|
||||
* org.apache.oro.text.regex.Perl5Compiler
|
||||
* org.apache.oro.text.regex.Perl5Matcher
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.fault.BTwoStateFaultAlgorithm;
|
||||
import javax.baja.control.BStringPoint;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.status.BStatusString;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.PatternMatcher;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BStringChangeOfStateFaultAlgorithm
|
||||
extends BTwoStateFaultAlgorithm {
|
||||
public static final Property expression = BStringChangeOfStateFaultAlgorithm.newProperty((int)0, (String)".*", null);
|
||||
public static final Property normalOnMatch = BStringChangeOfStateFaultAlgorithm.newProperty((int)0, (boolean)true, null);
|
||||
public static final Property caseSensitive = BStringChangeOfStateFaultAlgorithm.newProperty((int)0, (boolean)true, null);
|
||||
public static final Type TYPE;
|
||||
protected static Log log;
|
||||
private PatternMatcher matcher;
|
||||
private Pattern pattern;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateFaultAlgorithm;
|
||||
|
||||
public String getExpression() {
|
||||
return this.getString(expression);
|
||||
}
|
||||
|
||||
public void setExpression(String string) {
|
||||
this.setString(expression, string, null);
|
||||
}
|
||||
|
||||
public boolean getNormalOnMatch() {
|
||||
return this.getBoolean(normalOnMatch);
|
||||
}
|
||||
|
||||
public void setNormalOnMatch(boolean bl) {
|
||||
this.setBoolean(normalOnMatch, bl, null);
|
||||
}
|
||||
|
||||
public boolean getCaseSensitive() {
|
||||
return this.getBoolean(caseSensitive);
|
||||
}
|
||||
|
||||
public void setCaseSensitive(boolean bl) {
|
||||
this.setBoolean(caseSensitive, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BStringPoint;
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (property.equals((Object)expression) || property.equals((Object)caseSensitive)) {
|
||||
this.init();
|
||||
}
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
public void started() {
|
||||
this.init();
|
||||
super.started();
|
||||
}
|
||||
|
||||
private final void init() {
|
||||
this.matcher = new Perl5Matcher();
|
||||
Perl5Compiler perl5Compiler = new Perl5Compiler();
|
||||
int n = 16;
|
||||
if (!this.getCaseSensitive()) {
|
||||
n |= 1;
|
||||
}
|
||||
try {
|
||||
this.pattern = perl5Compiler.compile(this.getExpression(), n);
|
||||
}
|
||||
catch (MalformedPatternException malformedPatternException) {
|
||||
log.error("Invalid expression: '" + this.getExpression() + '\'', (Throwable)malformedPatternException);
|
||||
this.pattern = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusString bStatusString = (BStatusString)bStatusValue;
|
||||
if (bStatusString.getStatus().isNull()) {
|
||||
return true;
|
||||
}
|
||||
if (this.pattern == null) {
|
||||
return true;
|
||||
}
|
||||
if (this.getNormalOnMatch()) {
|
||||
return this.matcher.contains(bStatusString.getValue().toString(), this.pattern);
|
||||
}
|
||||
return this.matcher.contains(bStatusString.getValue().toString(), this.pattern) ^ true;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
map.put("status", BString.make((String)bStatusValue.getStatus().toString(null)));
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.matcher = new Perl5Matcher();
|
||||
}
|
||||
|
||||
public BStringChangeOfStateFaultAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BStringChangeOfStateFaultAlgorithm = BStringChangeOfStateFaultAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BStringChangeOfStateFaultAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
log = Log.getLog((String)"control");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.offnormal;
|
||||
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.alarm.ext.BOffnormalAlgorithm;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BTwoStateAlgorithm
|
||||
extends BOffnormalAlgorithm {
|
||||
public static final Type TYPE;
|
||||
TwoState current;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$offnormal$BTwoStateAlgorithm;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void started() {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (bAlarmState == BAlarmState.offnormal) {
|
||||
this.current = new OffnormalState();
|
||||
}
|
||||
}
|
||||
|
||||
public BAlarmState checkAlarms(BStatusValue bStatusValue, long l, long l2) {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (this.current instanceof ValidateOffnormalState) {
|
||||
return this.current.evaluate(this.isNormal(bStatusValue), l);
|
||||
}
|
||||
if (this.current instanceof ValidateReturnFromOffnormalState) {
|
||||
return this.current.evaluate(this.isNormal(bStatusValue), l2);
|
||||
}
|
||||
if (bAlarmState == BAlarmState.offnormal) {
|
||||
this.current = new OffnormalState();
|
||||
return this.current.evaluate(this.isNormal(bStatusValue), l2);
|
||||
}
|
||||
this.current = new NormalState();
|
||||
return this.current.evaluate(this.isNormal(bStatusValue), l);
|
||||
}
|
||||
|
||||
protected abstract boolean isNormal(BStatusValue var1);
|
||||
|
||||
protected boolean isCurrentOffnormal() {
|
||||
return this.current instanceof OffnormalState;
|
||||
}
|
||||
|
||||
private final void transition(TwoState twoState) {
|
||||
this.current = twoState;
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.current = new NormalState();
|
||||
}
|
||||
|
||||
public BTwoStateAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$offnormal$BTwoStateAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$offnormal$BTwoStateAlgorithm = BTwoStateAlgorithm.class("[Ljavax.baja.alarm.ext.offnormal.BTwoStateAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class OffnormalState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "OffnormalState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl, long l) {
|
||||
if (bl) {
|
||||
if (l == 0L) {
|
||||
BTwoStateAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BTwoStateAlgorithm.this.transition(new ValidateReturnFromOffnormalState(l));
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private OffnormalState() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateOffnormalState
|
||||
extends ValidateState {
|
||||
public String tag() {
|
||||
return "ValidateOffnormalState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl, long l) {
|
||||
if (bl) {
|
||||
BTwoStateAlgorithm.this.transition(new NormalState());
|
||||
return null;
|
||||
}
|
||||
if (BTwoStateAlgorithm.this.isTimerExpired()) {
|
||||
BTwoStateAlgorithm.this.transition(new OffnormalState());
|
||||
return BAlarmState.offnormal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateOffnormalState(long l) {
|
||||
BTwoStateAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class TwoState {
|
||||
public abstract String tag();
|
||||
|
||||
public abstract BAlarmState evaluate(boolean var1, long var2);
|
||||
|
||||
public TwoState() {
|
||||
BTwoStateAlgorithm.this.cancelTimer();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromOffnormalState
|
||||
extends ValidateState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromOffnormalState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl, long l) {
|
||||
if (bl) {
|
||||
if (BTwoStateAlgorithm.this.isTimerExpired()) {
|
||||
BTwoStateAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
} else {
|
||||
BTwoStateAlgorithm.this.transition(new OffnormalState());
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValidateReturnFromOffnormalState(long l) {
|
||||
BTwoStateAlgorithm.this.startTimer(l);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class NormalState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "Normal";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl, long l) {
|
||||
if (!bl) {
|
||||
if (l == 0L) {
|
||||
BTwoStateAlgorithm.this.transition(new OffnormalState());
|
||||
return BAlarmState.offnormal;
|
||||
}
|
||||
BTwoStateAlgorithm.this.transition(new ValidateOffnormalState(l));
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private NormalState() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class ValidateState
|
||||
extends TwoState {
|
||||
private ValidateState() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user