link start!
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BControlPoint
|
||||
* javax.baja.sys.BComplex
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.control.BControlPoint;
|
||||
import javax.baja.sys.BComplex;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BAlarmAlgorithm
|
||||
extends BComponent {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BAlarmAlgorithm;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final BAlarmSourceExt getParentExt() {
|
||||
BComplex bComplex = this.getParent();
|
||||
if (bComplex instanceof BAlarmSourceExt) {
|
||||
return (BAlarmSourceExt)bComplex;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final BControlPoint getParentPoint() {
|
||||
BAlarmSourceExt bAlarmSourceExt = this.getParentExt();
|
||||
if (bAlarmSourceExt != null) {
|
||||
return bAlarmSourceExt.getParentPoint();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void executePoint() {
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
BControlPoint bControlPoint = this.getParentPoint();
|
||||
if (bControlPoint != null) {
|
||||
bControlPoint.execute();
|
||||
}
|
||||
}
|
||||
|
||||
public final BFacets getPointFacets() {
|
||||
try {
|
||||
return this.getParentPoint().getFacets();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return BFacets.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isParentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BAlarmSourceExt;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
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$BAlarmAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BAlarmAlgorithm = BAlarmAlgorithm.class("[Ljavax.baja.alarm.ext.BAlarmAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,829 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BControlPoint
|
||||
* javax.baja.control.BDiscretePoint
|
||||
* javax.baja.control.BPointExtension
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.log.Log
|
||||
* javax.baja.naming.BOrd
|
||||
* javax.baja.naming.BOrdList
|
||||
* javax.baja.status.BStatus
|
||||
* javax.baja.status.BStatusBoolean
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.Action
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.sys.BBoolean
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BInteger
|
||||
* javax.baja.sys.BModule
|
||||
* javax.baja.sys.BRelTime
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Clock
|
||||
* javax.baja.sys.Clock$Ticket
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.ServiceNotFoundException
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Topic
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BFormat
|
||||
* javax.baja.util.Lexicon
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import java.util.HashMap;
|
||||
import javax.baja.alarm.AlarmSupport;
|
||||
import javax.baja.alarm.BAlarmInstructions;
|
||||
import javax.baja.alarm.BAlarmRecord;
|
||||
import javax.baja.alarm.BAlarmService;
|
||||
import javax.baja.alarm.BAlarmTransitionBits;
|
||||
import javax.baja.alarm.BIAlarmSource;
|
||||
import javax.baja.alarm.BSourceState;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.alarm.ext.BAlarmTimestamps;
|
||||
import javax.baja.alarm.ext.BFaultAlgorithm;
|
||||
import javax.baja.alarm.ext.BOffnormalAlgorithm;
|
||||
import javax.baja.control.BControlPoint;
|
||||
import javax.baja.control.BDiscretePoint;
|
||||
import javax.baja.control.BPointExtension;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.naming.BOrdList;
|
||||
import javax.baja.status.BStatus;
|
||||
import javax.baja.status.BStatusBoolean;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BBoolean;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BInteger;
|
||||
import javax.baja.sys.BModule;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.ServiceNotFoundException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Topic;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BFormat;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BAlarmSourceExt
|
||||
extends BPointExtension
|
||||
implements BIAlarmSource {
|
||||
public static final Property alarmInhibit = BAlarmSourceExt.newProperty((int)0, (BValue)new BStatusBoolean(false), null);
|
||||
public static final Property inhibitTime = BAlarmSourceExt.newProperty((int)0, (BValue)BRelTime.DEFAULT, (BFacets)BFacets.make((String)"min", (BIDataValue)BRelTime.make((long)0L)));
|
||||
public static final Property alarmState = BAlarmSourceExt.newProperty((int)1, (BValue)BAlarmState.normal, null);
|
||||
public static final Property timeDelay = BAlarmSourceExt.newProperty((int)0, (BValue)BRelTime.DEFAULT, (BFacets)BFacets.make((String)"min", (BIDataValue)BRelTime.make((long)0L)));
|
||||
public static final Property timeDelayToNormal = BAlarmSourceExt.newProperty((int)0, (BValue)BRelTime.DEFAULT, (BFacets)BFacets.make((String)"min", (BIDataValue)BRelTime.make((long)0L)));
|
||||
public static final Property alarmEnable = BAlarmSourceExt.newProperty((int)0, (BValue)BAlarmTransitionBits.DEFAULT, (BFacets)BFacets.make((String[])new String[]{"showNormal", "showAlert"}, (BIDataValue[])new BBoolean[]{BBoolean.FALSE, BBoolean.FALSE}));
|
||||
public static final Property ackedTransitions = BAlarmSourceExt.newProperty((int)5, (BValue)BAlarmTransitionBits.ALL, null);
|
||||
public static final Property toOffnormalTimes = BAlarmSourceExt.newProperty((int)1, (BValue)new BAlarmTimestamps(), null);
|
||||
public static final Property toFaultTimes = BAlarmSourceExt.newProperty((int)1, (BValue)new BAlarmTimestamps(), null);
|
||||
public static final Property timeInCurrentState = BAlarmSourceExt.newProperty((int)3, (BValue)BRelTime.DEFAULT, null);
|
||||
public static final Property sourceName = BAlarmSourceExt.newProperty((int)0, (BValue)BFormat.make((String)"%parent.displayName%"), null);
|
||||
public static final Property toFaultText = BAlarmSourceExt.newProperty((int)0, (BValue)BFormat.make((String)""), (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property toOffnormalText = BAlarmSourceExt.newProperty((int)0, (BValue)BFormat.make((String)""), (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property toNormalText = BAlarmSourceExt.newProperty((int)0, (BValue)BFormat.make((String)""), (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property hyperlinkOrd = BAlarmSourceExt.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"ordRelativize", (BIDataValue)BBoolean.FALSE, (String)"chooseView", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property soundFile = BAlarmSourceExt.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"targetType", (BIDataValue)BString.make((String)"file:AudioFile")));
|
||||
public static final Property alarmIcon = BAlarmSourceExt.newProperty((int)0, (BValue)BOrd.NULL, (BFacets)BFacets.make((String)"targetType", (BIDataValue)BString.make((String)"file:ImageFile")));
|
||||
public static final Property alarmInstructions = BAlarmSourceExt.newProperty((int)0, (BValue)BAlarmInstructions.DEFAULT, (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:InstructionsFE")));
|
||||
public static final Property faultAlgorithm = BAlarmSourceExt.newProperty((int)0, (BValue)new BFaultAlgorithm(), null);
|
||||
public static final Property offnormalAlgorithm = BAlarmSourceExt.newProperty((int)0, (BValue)new BOffnormalAlgorithm(), null);
|
||||
public static final Property alarmClass = BAlarmSourceExt.newProperty((int)0, (String)"defaultAlarmClass", (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:AlarmClassFE")));
|
||||
public static final Property metaData = BAlarmSourceExt.newProperty((int)0, (BValue)BFacets.DEFAULT, null);
|
||||
public static final Property status = BAlarmSourceExt.newProperty((int)7, (BValue)BStatus.DEFAULT, null);
|
||||
public static final Action timerExpired = BAlarmSourceExt.newAction((int)4, null);
|
||||
public static final Action inhibitTimerExpired = BAlarmSourceExt.newAction((int)4, null);
|
||||
public static final Action ackAlarm = BAlarmSourceExt.newAction((int)4, (BValue)new BAlarmRecord(), null);
|
||||
public static final Topic toOffnormal = BAlarmSourceExt.newTopic((int)0, null);
|
||||
public static final Topic toFault = BAlarmSourceExt.newTopic((int)0, null);
|
||||
public static final Topic toNormal = BAlarmSourceExt.newTopic((int)0, null);
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
private static final int NON_ALARM_BITS = -139;
|
||||
private static Log log;
|
||||
private Clock.Ticket ticket;
|
||||
private Clock.Ticket inhibitTicket;
|
||||
private long timeOfLastStateChange;
|
||||
private AlarmSupport support;
|
||||
private boolean unackedAlarm;
|
||||
private BAbsTime lastOffnormalTime;
|
||||
private BAbsTime lastFaultTime;
|
||||
private BAbsTime lastToNormalTime;
|
||||
private BAbsTime lastAckTime;
|
||||
private boolean atSteadyState;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BAlarmSourceExt;
|
||||
|
||||
public BStatusBoolean getAlarmInhibit() {
|
||||
return (BStatusBoolean)this.get(alarmInhibit);
|
||||
}
|
||||
|
||||
public void setAlarmInhibit(BStatusBoolean bStatusBoolean) {
|
||||
this.set(alarmInhibit, (BValue)bStatusBoolean, null);
|
||||
}
|
||||
|
||||
public BRelTime getInhibitTime() {
|
||||
return (BRelTime)this.get(inhibitTime);
|
||||
}
|
||||
|
||||
public void setInhibitTime(BRelTime bRelTime) {
|
||||
this.set(inhibitTime, (BValue)bRelTime, null);
|
||||
}
|
||||
|
||||
public BAlarmState getAlarmState() {
|
||||
return (BAlarmState)this.get(alarmState);
|
||||
}
|
||||
|
||||
public void setAlarmState(BAlarmState bAlarmState) {
|
||||
this.set(alarmState, (BValue)bAlarmState, null);
|
||||
}
|
||||
|
||||
public BRelTime getTimeDelay() {
|
||||
return (BRelTime)this.get(timeDelay);
|
||||
}
|
||||
|
||||
public void setTimeDelay(BRelTime bRelTime) {
|
||||
this.set(timeDelay, (BValue)bRelTime, null);
|
||||
}
|
||||
|
||||
public BRelTime getTimeDelayToNormal() {
|
||||
return (BRelTime)this.get(timeDelayToNormal);
|
||||
}
|
||||
|
||||
public void setTimeDelayToNormal(BRelTime bRelTime) {
|
||||
this.set(timeDelayToNormal, (BValue)bRelTime, null);
|
||||
}
|
||||
|
||||
public BAlarmTransitionBits getAlarmEnable() {
|
||||
return (BAlarmTransitionBits)this.get(alarmEnable);
|
||||
}
|
||||
|
||||
public void setAlarmEnable(BAlarmTransitionBits bAlarmTransitionBits) {
|
||||
this.set(alarmEnable, (BValue)bAlarmTransitionBits, null);
|
||||
}
|
||||
|
||||
public BAlarmTransitionBits getAckedTransitions() {
|
||||
return (BAlarmTransitionBits)this.get(ackedTransitions);
|
||||
}
|
||||
|
||||
public void setAckedTransitions(BAlarmTransitionBits bAlarmTransitionBits) {
|
||||
this.set(ackedTransitions, (BValue)bAlarmTransitionBits, null);
|
||||
}
|
||||
|
||||
public BAlarmTimestamps getToOffnormalTimes() {
|
||||
return (BAlarmTimestamps)this.get(toOffnormalTimes);
|
||||
}
|
||||
|
||||
public void setToOffnormalTimes(BAlarmTimestamps bAlarmTimestamps) {
|
||||
this.set(toOffnormalTimes, (BValue)bAlarmTimestamps, null);
|
||||
}
|
||||
|
||||
public BAlarmTimestamps getToFaultTimes() {
|
||||
return (BAlarmTimestamps)this.get(toFaultTimes);
|
||||
}
|
||||
|
||||
public void setToFaultTimes(BAlarmTimestamps bAlarmTimestamps) {
|
||||
this.set(toFaultTimes, (BValue)bAlarmTimestamps, null);
|
||||
}
|
||||
|
||||
public BRelTime getTimeInCurrentState() {
|
||||
return (BRelTime)this.get(timeInCurrentState);
|
||||
}
|
||||
|
||||
public void setTimeInCurrentState(BRelTime bRelTime) {
|
||||
this.set(timeInCurrentState, (BValue)bRelTime, null);
|
||||
}
|
||||
|
||||
public BFormat getSourceName() {
|
||||
return (BFormat)this.get(sourceName);
|
||||
}
|
||||
|
||||
public void setSourceName(BFormat bFormat) {
|
||||
this.set(sourceName, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BFormat getToFaultText() {
|
||||
return (BFormat)this.get(toFaultText);
|
||||
}
|
||||
|
||||
public void setToFaultText(BFormat bFormat) {
|
||||
this.set(toFaultText, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BFormat getToOffnormalText() {
|
||||
return (BFormat)this.get(toOffnormalText);
|
||||
}
|
||||
|
||||
public void setToOffnormalText(BFormat bFormat) {
|
||||
this.set(toOffnormalText, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BFormat getToNormalText() {
|
||||
return (BFormat)this.get(toNormalText);
|
||||
}
|
||||
|
||||
public void setToNormalText(BFormat bFormat) {
|
||||
this.set(toNormalText, (BValue)bFormat, null);
|
||||
}
|
||||
|
||||
public BOrd getHyperlinkOrd() {
|
||||
return (BOrd)this.get(hyperlinkOrd);
|
||||
}
|
||||
|
||||
public void setHyperlinkOrd(BOrd bOrd) {
|
||||
this.set(hyperlinkOrd, (BValue)bOrd, null);
|
||||
}
|
||||
|
||||
public BOrd getSoundFile() {
|
||||
return (BOrd)this.get(soundFile);
|
||||
}
|
||||
|
||||
public void setSoundFile(BOrd bOrd) {
|
||||
this.set(soundFile, (BValue)bOrd, null);
|
||||
}
|
||||
|
||||
public BOrd getAlarmIcon() {
|
||||
return (BOrd)this.get(alarmIcon);
|
||||
}
|
||||
|
||||
public void setAlarmIcon(BOrd bOrd) {
|
||||
this.set(alarmIcon, (BValue)bOrd, null);
|
||||
}
|
||||
|
||||
public BAlarmInstructions getAlarmInstructions() {
|
||||
return (BAlarmInstructions)this.get(alarmInstructions);
|
||||
}
|
||||
|
||||
public void setAlarmInstructions(BAlarmInstructions bAlarmInstructions) {
|
||||
this.set(alarmInstructions, (BValue)bAlarmInstructions, null);
|
||||
}
|
||||
|
||||
public BFaultAlgorithm getFaultAlgorithm() {
|
||||
return (BFaultAlgorithm)this.get(faultAlgorithm);
|
||||
}
|
||||
|
||||
public void setFaultAlgorithm(BFaultAlgorithm bFaultAlgorithm) {
|
||||
this.set(faultAlgorithm, (BValue)bFaultAlgorithm, null);
|
||||
}
|
||||
|
||||
public BOffnormalAlgorithm getOffnormalAlgorithm() {
|
||||
return (BOffnormalAlgorithm)this.get(offnormalAlgorithm);
|
||||
}
|
||||
|
||||
public void setOffnormalAlgorithm(BOffnormalAlgorithm bOffnormalAlgorithm) {
|
||||
this.set(offnormalAlgorithm, (BValue)bOffnormalAlgorithm, null);
|
||||
}
|
||||
|
||||
public String getAlarmClass() {
|
||||
return this.getString(alarmClass);
|
||||
}
|
||||
|
||||
public void setAlarmClass(String string) {
|
||||
this.setString(alarmClass, string, null);
|
||||
}
|
||||
|
||||
public BFacets getMetaData() {
|
||||
return (BFacets)this.get(metaData);
|
||||
}
|
||||
|
||||
public void setMetaData(BFacets bFacets) {
|
||||
this.set(metaData, (BValue)bFacets, null);
|
||||
}
|
||||
|
||||
public BStatus getStatus() {
|
||||
return (BStatus)this.get(status);
|
||||
}
|
||||
|
||||
public void setStatus(BStatus bStatus) {
|
||||
this.set(status, (BValue)bStatus, null);
|
||||
}
|
||||
|
||||
public void timerExpired() {
|
||||
this.invoke(timerExpired, null, null);
|
||||
}
|
||||
|
||||
public void inhibitTimerExpired() {
|
||||
this.invoke(inhibitTimerExpired, null, null);
|
||||
}
|
||||
|
||||
public BBoolean ackAlarm(BAlarmRecord bAlarmRecord) {
|
||||
return (BBoolean)this.invoke(ackAlarm, (BValue)bAlarmRecord, null);
|
||||
}
|
||||
|
||||
public void fireToOffnormal(BAlarmRecord bAlarmRecord) {
|
||||
this.fire(toOffnormal, (BValue)bAlarmRecord, null);
|
||||
}
|
||||
|
||||
public void fireToFault(BAlarmRecord bAlarmRecord) {
|
||||
this.fire(toFault, (BValue)bAlarmRecord, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void started() throws Exception {
|
||||
super.started();
|
||||
this.support = new AlarmSupport((BIAlarmSource)this, this.getAlarmClass());
|
||||
this.timeOfLastStateChange = Clock.ticks();
|
||||
this.initScheduler();
|
||||
if (Sys.atSteadyState()) {
|
||||
this.atSteadyState = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void atSteadyState() throws Exception {
|
||||
this.atSteadyState = true;
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
public boolean requiresPointSubscription() {
|
||||
return this.getAlarmEnable().isToOffnormal() || this.getAlarmEnable().isToFault();
|
||||
}
|
||||
|
||||
public void checkPointSubscription() {
|
||||
BControlPoint bControlPoint = this.getParentPoint();
|
||||
if (bControlPoint != null) {
|
||||
bControlPoint.checkExtensionsRequireSubscription();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isParentLegal(BComponent bComponent) {
|
||||
if (bComponent instanceof BControlPoint) {
|
||||
if (!this.getOffnormalAlgorithm().isGrandparentLegal(bComponent)) {
|
||||
return false;
|
||||
}
|
||||
return this.getFaultAlgorithm().isGrandparentLegal(bComponent);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean isSiblingLegal(BComponent bComponent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private final void initScheduler() {
|
||||
if (this.ticket != null) {
|
||||
this.ticket.cancel();
|
||||
}
|
||||
this.ticket = Clock.schedulePeriodically((BComponent)this, (BRelTime)BRelTime.make((long)10000L), (Action)timerExpired, null);
|
||||
}
|
||||
|
||||
public BOrdList getSourceOrd() {
|
||||
return this.support.getSourceOrd();
|
||||
}
|
||||
|
||||
public void doTimerExpired() {
|
||||
this.setTimeInCurrentState(BRelTime.make((long)(Clock.ticks() - this.timeOfLastStateChange)));
|
||||
}
|
||||
|
||||
public void doInhibitTimerExpired() {
|
||||
this.inhibitTicket = null;
|
||||
this.checkPointSubscription();
|
||||
this.executePoint();
|
||||
}
|
||||
|
||||
public BBoolean doAckAlarm(BAlarmRecord bAlarmRecord) {
|
||||
if (!this.isRunning()) {
|
||||
return BBoolean.make((boolean)false);
|
||||
}
|
||||
try {
|
||||
boolean bl = this.support.ackAlarm(bAlarmRecord);
|
||||
this.lastAckTime = bAlarmRecord.getAckTime();
|
||||
BSourceState bSourceState = bAlarmRecord.getAlarmTransition();
|
||||
if (bl) {
|
||||
BAlarmTransitionBits bAlarmTransitionBits = this.getAckedTransitions();
|
||||
this.setAckedTransitions(BAlarmTransitionBits.make(bAlarmTransitionBits, bSourceState.getAlarmTransitionBits(), true));
|
||||
bAlarmTransitionBits = this.getAckedTransitions();
|
||||
bSourceState = bAlarmRecord.getSourceState();
|
||||
if (bSourceState == BSourceState.normal) {
|
||||
this.setAckedTransitions(BAlarmTransitionBits.make(bAlarmTransitionBits, bSourceState.getAlarmTransitionBits(), true));
|
||||
}
|
||||
BAlarmTimestamps bAlarmTimestamps = null;
|
||||
BSourceState bSourceState2 = bAlarmRecord.getAlarmTransition();
|
||||
if (bSourceState2 == BSourceState.offnormal) {
|
||||
bAlarmTimestamps = this.getToOffnormalTimes();
|
||||
} else if (bSourceState2 == BSourceState.fault) {
|
||||
bAlarmTimestamps = this.getToFaultTimes();
|
||||
}
|
||||
if (bAlarmTimestamps != null && !bAlarmTimestamps.getAlarmTime().isNull()) {
|
||||
bAlarmTimestamps.setAckTime(bAlarmRecord.getAckTime());
|
||||
}
|
||||
}
|
||||
if (bl && this.getStatus().isUnackedAlarm()) {
|
||||
this.setStatus(BStatus.makeUnackedAlarm((BStatus)this.getStatus(), (boolean)false));
|
||||
}
|
||||
this.executePoint();
|
||||
return BBoolean.make((boolean)bl);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
return BBoolean.make((boolean)false);
|
||||
}
|
||||
}
|
||||
|
||||
public void onExecute(BStatusValue bStatusValue, Context context) {
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (!this.atSteadyState) {
|
||||
return;
|
||||
}
|
||||
boolean bl = bStatusValue.getStatus().isAlarm();
|
||||
boolean bl2 = bStatusValue.getStatus().isFault();
|
||||
this.checkAlarms(bStatusValue);
|
||||
String string = Lexicon.make((BModule)TYPE.getModule(), (Context)context).getText("alarm.alarmInhibit.facet");
|
||||
BStatus bStatus = bStatusValue.getStatus();
|
||||
if (this.inhibitTicket == null || this.inhibitTicket.isExpired()) {
|
||||
if (this.getAlarmInhibit().getBoolean() || this.isTimerActive()) {
|
||||
this.setStatus(BStatus.make((BStatus)this.getStatus(), (String)string, (boolean)true));
|
||||
} else {
|
||||
this.setStatus(BStatus.make((int)this.getStatus().getBits(), (BFacets)BFacets.makeRemove((BFacets)this.getStatus().getFacets(), (String)string)));
|
||||
}
|
||||
} else if (this.getAlarmInhibit().getBoolean() || this.isTimerActive()) {
|
||||
this.setStatus(BStatus.make((int)this.getStatus().getBits(), (BFacets)BFacets.makeRemove((BFacets)this.getStatus().getFacets(), (String)string)));
|
||||
} else {
|
||||
this.setStatus(BStatus.make((BStatus)this.getStatus(), (String)string, (boolean)true));
|
||||
}
|
||||
BControlPoint bControlPoint = this.getParentPoint();
|
||||
Class clazz = class$javax$baja$alarm$ext$BAlarmSourceExt;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BAlarmSourceExt = BAlarmSourceExt.class("[Ljavax.baja.alarm.ext.BAlarmSourceExt;", false);
|
||||
}
|
||||
BAlarmSourceExt[] bAlarmSourceExtArray = (BAlarmSourceExt[])bControlPoint.getChildren(clazz);
|
||||
int n = bStatusValue.getStatus().getBits() & 0xFFFFFF75;
|
||||
boolean bl3 = false;
|
||||
int n2 = 0;
|
||||
while (n2 < bAlarmSourceExtArray.length) {
|
||||
n |= bAlarmSourceExtArray[n2].getStatus().getBits();
|
||||
if (bAlarmSourceExtArray[n2].getStatus().getb(string, false)) {
|
||||
bl3 = true;
|
||||
}
|
||||
if (bAlarmSourceExtArray[n2] == this) break;
|
||||
++n2;
|
||||
}
|
||||
if (bl3) {
|
||||
bStatusValue.setStatus(BStatus.make((int)n, (BFacets)BFacets.make((BFacets)bStatusValue.getStatus().getFacets(), (String)string, (BIDataValue)BBoolean.TRUE)));
|
||||
} else {
|
||||
bStatusValue.setStatus(BStatus.make((int)n, (BFacets)BFacets.makeRemove((BFacets)bStatusValue.getStatus().getFacets(), (String)string)));
|
||||
}
|
||||
if (bl) {
|
||||
bStatusValue.setStatusInAlarm(true);
|
||||
}
|
||||
if (bl2) {
|
||||
bStatusValue.setStatusFault(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
super.changed(property, context);
|
||||
if (!this.isRunning()) {
|
||||
return;
|
||||
}
|
||||
if (property.equals((Object)alarmClass) && this.support != null) {
|
||||
this.support.setAlarmClass(this.getAlarmClass());
|
||||
} else if (property.equals((Object)timeDelay)) {
|
||||
this.executePoint();
|
||||
} else if (property.equals((Object)alarmInhibit)) {
|
||||
this.checkPointSubscription();
|
||||
if (this.getInhibitTime().getMillis() > 0L) {
|
||||
if (this.inhibitTicket != null) {
|
||||
this.inhibitTicket.cancel();
|
||||
}
|
||||
if (!this.getAlarmInhibit().getBoolean()) {
|
||||
this.inhibitTicket = Clock.schedule((BComponent)this, (BRelTime)this.getInhibitTime(), (Action)inhibitTimerExpired, null);
|
||||
} else if (this.getParent() instanceof BDiscretePoint) {
|
||||
this.inhibitTicket = Clock.schedule((BComponent)this, (BRelTime)BRelTime.make((long)(this.getInhibitTime().getMillis() * (long)3)), (Action)inhibitTimerExpired, null);
|
||||
}
|
||||
} else {
|
||||
this.executePoint();
|
||||
}
|
||||
} else if (property.equals((Object)alarmEnable)) {
|
||||
this.checkPointSubscription();
|
||||
this.executePoint();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isTimerActive() {
|
||||
try {
|
||||
return this.getOffnormalAlgorithm().isTimerExpired() ^ true;
|
||||
}
|
||||
catch (IllegalStateException illegalStateException) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isInhibitTimerActive() {
|
||||
try {
|
||||
boolean bl = false;
|
||||
if (this.inhibitTicket != null && !this.inhibitTicket.isExpired()) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
catch (IllegalStateException illegalStateException) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void checkAlarms(BStatusValue bStatusValue) {
|
||||
boolean bl;
|
||||
BAlarmState bAlarmState = null;
|
||||
BAlarmState bAlarmState2 = this.getAlarmState();
|
||||
if ((BAlarmService)Sys.getService((Type)BAlarmService.TYPE) == null) {
|
||||
return;
|
||||
}
|
||||
if (bStatusValue.getStatus().isDisabled() || bStatusValue.getStatus().isStale()) {
|
||||
return;
|
||||
}
|
||||
boolean bl2 = false;
|
||||
if (this.getInhibitTime().getMillis() == 0L && this.getAlarmInhibit().getBoolean() || (this.inhibitTicket == null || this.inhibitTicket.isExpired()) && this.getAlarmInhibit().getBoolean() || this.inhibitTicket != null && !this.inhibitTicket.isExpired() && !this.getAlarmInhibit().getBoolean()) {
|
||||
bl2 = true;
|
||||
}
|
||||
if (bl = bl2) {
|
||||
if (bAlarmState2 != BAlarmState.normal) {
|
||||
bAlarmState = BAlarmState.normal;
|
||||
}
|
||||
} else {
|
||||
if (this.getAlarmEnable().isToFault()) {
|
||||
bAlarmState = this.getFaultAlgorithm().checkFault(bStatusValue);
|
||||
}
|
||||
if (bAlarmState2 == BAlarmState.fault && !this.getAlarmEnable().isToFault()) {
|
||||
bAlarmState = BAlarmState.normal;
|
||||
}
|
||||
if (bAlarmState != BAlarmState.fault && this.getAlarmEnable().isToOffnormal()) {
|
||||
if (bAlarmState == null) {
|
||||
if (bAlarmState2 != BAlarmState.fault) {
|
||||
bAlarmState = this.getOffnormalAlgorithm().checkAlarmState(bStatusValue, this.getTimeDelay().getMillis(), this.getTimeDelayToNormal().getMillis());
|
||||
}
|
||||
} else if (bAlarmState == BAlarmState.normal && (bAlarmState = this.getOffnormalAlgorithm().checkAlarmState(bStatusValue, this.getTimeDelay().getMillis(), this.getTimeDelayToNormal().getMillis())) == null) {
|
||||
bAlarmState = BAlarmState.normal;
|
||||
}
|
||||
}
|
||||
if (bAlarmState2.isOffnormal() && !this.getAlarmEnable().isToOffnormal()) {
|
||||
bAlarmState = BAlarmState.normal;
|
||||
}
|
||||
}
|
||||
boolean bl3 = true;
|
||||
if (bAlarmState != null) {
|
||||
if (this.getAlarmEnable().isToOffnormal() && bAlarmState.isInAlarm()) {
|
||||
this.setStatus(BStatus.makeAlarm((BStatus)this.getStatus(), (boolean)true));
|
||||
} else if (!bAlarmState.isInAlarm()) {
|
||||
this.setStatus(BStatus.makeAlarm((BStatus)this.getStatus(), (boolean)false));
|
||||
}
|
||||
if (this.getAlarmEnable().isToFault() && bAlarmState == BAlarmState.fault) {
|
||||
this.setStatus(BStatus.makeFault((BStatus)this.getStatus(), (boolean)true));
|
||||
} else if (bAlarmState != BAlarmState.fault) {
|
||||
this.setStatus(BStatus.makeFault((BStatus)this.getStatus(), (boolean)false));
|
||||
}
|
||||
if (bAlarmState == BAlarmState.normal) {
|
||||
bl3 = this.alarmStateTransition(BSourceState.normal, BAlarmState.normal, bStatusValue);
|
||||
if (bAlarmState2.isOffnormal()) {
|
||||
boolean bl4 = false;
|
||||
if (bl3 || this.support.isAckRequired(BSourceState.offnormal)) {
|
||||
bl4 = true;
|
||||
}
|
||||
bl3 = bl4;
|
||||
} else if (bAlarmState2.isInAlarm()) {
|
||||
boolean bl5 = false;
|
||||
if (bl3 || this.support.isAckRequired(BSourceState.fault)) {
|
||||
bl5 = true;
|
||||
}
|
||||
bl3 = bl5;
|
||||
}
|
||||
} else {
|
||||
bl3 = bAlarmState == BAlarmState.fault ? this.alarmStateTransition(BSourceState.fault, BAlarmState.fault, bStatusValue) : this.alarmStateTransition(BSourceState.offnormal, bAlarmState, bStatusValue);
|
||||
}
|
||||
this.setAlarmState(bAlarmState);
|
||||
this.timeOfLastStateChange = Clock.ticks();
|
||||
this.setTimeInCurrentState(BRelTime.DEFAULT);
|
||||
this.unackedAlarm = bl3;
|
||||
} else {
|
||||
if (this.getAlarmEnable().isToOffnormal()) {
|
||||
this.setStatus(BStatus.makeAlarm((BStatus)this.getStatus(), (boolean)bAlarmState2.isInAlarm()));
|
||||
}
|
||||
if (this.getAlarmEnable().isToFault()) {
|
||||
BStatus bStatus = this.getStatus();
|
||||
boolean bl6 = false;
|
||||
if (bAlarmState2 == BAlarmState.fault) {
|
||||
bl6 = true;
|
||||
}
|
||||
this.setStatus(BStatus.makeFault((BStatus)bStatus, (boolean)bl6));
|
||||
}
|
||||
this.setTimeInCurrentState(BRelTime.make((long)(Clock.ticks() - this.timeOfLastStateChange)));
|
||||
}
|
||||
BAlarmTransitionBits bAlarmTransitionBits = this.getAckedTransitions();
|
||||
if (this.getAlarmEnable().isToOffnormal() || this.getAlarmEnable().isToFault()) {
|
||||
if (!(bAlarmTransitionBits.isToOffnormal() && bAlarmTransitionBits.isToFault() && bAlarmTransitionBits.isToNormal() || !bl3)) {
|
||||
this.setStatus(BStatus.makeUnackedAlarm((BStatus)this.getStatus(), (boolean)true));
|
||||
} else {
|
||||
this.setStatus(BStatus.makeUnackedAlarm((BStatus)this.getStatus(), (boolean)false));
|
||||
}
|
||||
}
|
||||
if ((bAlarmState2 == BAlarmState.lowLimit || bAlarmState2 == BAlarmState.highLimit) && bAlarmState == BAlarmState.normal) {
|
||||
this.checkAlarms(bStatusValue);
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean alarmStateTransition(BSourceState bSourceState, BAlarmState bAlarmState, BStatusValue bStatusValue) {
|
||||
HashMap<String, Object> hashMap = new HashMap<String, Object>();
|
||||
Object var5_5 = null;
|
||||
BOrd bOrd = BOrd.NULL;
|
||||
Property property = null;
|
||||
boolean bl = false;
|
||||
bOrd = this.getHyperlinkOrd();
|
||||
if (bSourceState == BSourceState.offnormal) {
|
||||
hashMap.put("offnormalValue", BString.make((String)bStatusValue.valueToString((Context)this.getPointFacets())));
|
||||
hashMap.put("alarmValue", bStatusValue.getValueValue());
|
||||
} else if (bSourceState == BSourceState.fault) {
|
||||
hashMap.put("faultValue", BString.make((String)bStatusValue.valueToString((Context)this.getPointFacets())));
|
||||
hashMap.put("alarmValue", bStatusValue.getValueValue());
|
||||
}
|
||||
hashMap.put("presentValue", BString.make((String)bStatusValue.valueToString((Context)this.getPointFacets())));
|
||||
hashMap.put("fromState", BString.make((String)this.getAlarmState().getTag()));
|
||||
hashMap.put("toState", BString.make((String)bAlarmState.getTag()));
|
||||
hashMap.put("sourceName", BString.make((String)this.getSourceName().format((Object)this)));
|
||||
if (!bOrd.isNull()) {
|
||||
hashMap.put("hyperlinkOrd", BString.make((String)bOrd.toString()));
|
||||
}
|
||||
if (!this.getSoundFile().isNull()) {
|
||||
hashMap.put("soundFile", BString.make((String)this.getSoundFile().toString()));
|
||||
}
|
||||
if (!this.getAlarmIcon().isNull()) {
|
||||
hashMap.put("icon", BString.make((String)this.getAlarmIcon().toString()));
|
||||
}
|
||||
try {
|
||||
if (!this.getAlarmInstructions().equals((Object)BAlarmInstructions.NULL)) {
|
||||
hashMap.put("instructions", BString.make((String)this.getAlarmInstructions().encodeToString()));
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {
|
||||
log.error("Could not encode Alarm Instructions", (Throwable)exception);
|
||||
}
|
||||
BFacets bFacets = this.getMetaData();
|
||||
String[] stringArray = bFacets.list();
|
||||
boolean bl2 = false;
|
||||
while (bl2 < stringArray.length) {
|
||||
hashMap.put(stringArray[bl2], bFacets.get(stringArray[bl2]));
|
||||
bl2 += 1;
|
||||
}
|
||||
if (bSourceState == BSourceState.normal) {
|
||||
hashMap.put("msgText", BString.make((String)this.getToNormalText().getFormat()));
|
||||
if (this.getAlarmState().isInAlarm()) {
|
||||
this.getOffnormalAlgorithm().writeAlarmData(bStatusValue, hashMap);
|
||||
} else {
|
||||
this.getFaultAlgorithm().writeAlarmData(bStatusValue, hashMap);
|
||||
}
|
||||
} else if (bSourceState == BSourceState.offnormal) {
|
||||
hashMap.put("msgText", BString.make((String)this.getToOffnormalText().getFormat()));
|
||||
hashMap.put(BAlarmTimestamps.count.getDefaultDisplayName(null), BInteger.make((int)(this.getToOffnormalTimes().getCount() + 1)));
|
||||
this.getOffnormalAlgorithm().writeAlarmData(bStatusValue, hashMap);
|
||||
property = toOffnormalTimes;
|
||||
} else if (bSourceState == BSourceState.fault) {
|
||||
hashMap.put("msgText", BString.make((String)this.getToFaultText().getFormat()));
|
||||
hashMap.put(BAlarmTimestamps.count.getDefaultDisplayName(null), BInteger.make((int)(this.getToFaultTimes().getCount() + 1)));
|
||||
this.getFaultAlgorithm().writeAlarmData(bStatusValue, hashMap);
|
||||
property = toFaultTimes;
|
||||
} else {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
bl2 = false;
|
||||
try {
|
||||
Object object;
|
||||
bl2 = this.support.isAckRequired(bSourceState);
|
||||
BAlarmRecord bAlarmRecord = null;
|
||||
if (bSourceState == BSourceState.normal) {
|
||||
this.support.toNormal(BFacets.make(hashMap), null);
|
||||
} else if (bSourceState == BSourceState.offnormal) {
|
||||
bAlarmRecord = this.support.newOffnormalAlarm(BFacets.make(hashMap));
|
||||
this.lastOffnormalTime = bAlarmRecord.getTimestamp();
|
||||
this.fireToOffnormal(bAlarmRecord);
|
||||
} else if (bSourceState == BSourceState.fault) {
|
||||
bAlarmRecord = this.support.newFaultAlarm(BFacets.make(hashMap));
|
||||
this.lastFaultTime = bAlarmRecord.getTimestamp();
|
||||
this.fireToFault(bAlarmRecord);
|
||||
}
|
||||
if (bAlarmRecord != null) {
|
||||
if (bSourceState == BSourceState.normal) {
|
||||
object = this.getToOffnormalTimes();
|
||||
if (!((BAlarmTimestamps)((Object)object)).getAlarmTime().isNull()) {
|
||||
((BAlarmTimestamps)((Object)object)).setNormalTime(bAlarmRecord.getNormalTime());
|
||||
}
|
||||
if (!((BAlarmTimestamps)((Object)(object = this.getToFaultTimes()))).getAlarmTime().isNull()) {
|
||||
((BAlarmTimestamps)((Object)object)).setNormalTime(bAlarmRecord.getNormalTime());
|
||||
}
|
||||
}
|
||||
if (property != null) {
|
||||
object = (BAlarmTimestamps)this.get(property);
|
||||
((BAlarmTimestamps)((Object)object)).setAlarmTime(bAlarmRecord.getTimestamp());
|
||||
((BAlarmTimestamps)((Object)object)).setAckTime(BAbsTime.NULL);
|
||||
((BAlarmTimestamps)((Object)object)).setNormalTime(BAbsTime.NULL);
|
||||
((BAlarmTimestamps)((Object)object)).setCount(((BAlarmTimestamps)((Object)object)).getCount() + 1);
|
||||
}
|
||||
}
|
||||
if (bl2) {
|
||||
object = this.getAckedTransitions();
|
||||
this.setAckedTransitions(BAlarmTransitionBits.make(object, bSourceState.getAlarmTransitionBits(), false));
|
||||
}
|
||||
}
|
||||
catch (ServiceNotFoundException serviceNotFoundException) {
|
||||
log.error("AlarmState Transition Failed - AlarmService not found.");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
log.error("AlarmState Transition Failed: " + exception, (Throwable)exception);
|
||||
}
|
||||
return bl2;
|
||||
}
|
||||
|
||||
public void fireToNormal(BAlarmRecord bAlarmRecord) {
|
||||
this.lastToNormalTime = bAlarmRecord.getNormalTime();
|
||||
if (bAlarmRecord.getSourceState().getOrdinal() == 0) {
|
||||
BAlarmTimestamps bAlarmTimestamps = this.getToOffnormalTimes();
|
||||
if (!bAlarmTimestamps.getAlarmTime().isNull()) {
|
||||
bAlarmTimestamps.setNormalTime(bAlarmRecord.getNormalTime());
|
||||
}
|
||||
if (!(bAlarmTimestamps = this.getToFaultTimes()).getAlarmTime().isNull()) {
|
||||
bAlarmTimestamps.setNormalTime(bAlarmRecord.getNormalTime());
|
||||
}
|
||||
}
|
||||
this.fire(toNormal, (BValue)bAlarmRecord, null);
|
||||
}
|
||||
|
||||
public BAbsTime getLastOffnormalTime() {
|
||||
return this.lastOffnormalTime;
|
||||
}
|
||||
|
||||
public BAbsTime getLastFaultTime() {
|
||||
return this.lastFaultTime;
|
||||
}
|
||||
|
||||
public BAbsTime getLastToNormalTime() {
|
||||
return this.lastToNormalTime;
|
||||
}
|
||||
|
||||
public BAbsTime getLastAckTime() {
|
||||
return this.lastAckTime;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
private static final void dump(String string) {
|
||||
System.out.println(string);
|
||||
}
|
||||
|
||||
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.timeOfLastStateChange = 0L;
|
||||
this.unackedAlarm = false;
|
||||
this.lastOffnormalTime = BAbsTime.NULL;
|
||||
this.lastFaultTime = BAbsTime.NULL;
|
||||
this.lastToNormalTime = BAbsTime.NULL;
|
||||
this.lastAckTime = BAbsTime.NULL;
|
||||
this.atSteadyState = false;
|
||||
}
|
||||
|
||||
public BAlarmSourceExt() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$BAlarmSourceExt;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BAlarmSourceExt = BAlarmSourceExt.class("[Ljavax.baja.alarm.ext.BAlarmSourceExt;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BIcon.make((BIcon)BIcon.std((String)"control/controlExtension.png"), (BIcon)BIcon.std((String)"badges/alarm.png"));
|
||||
log = Log.getLog((String)"alarm");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFrozenEnum
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import javax.baja.sys.BFrozenEnum;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BAlarmState
|
||||
extends BFrozenEnum {
|
||||
public static final int NORMAL = 0;
|
||||
public static final int FAULT = 1;
|
||||
public static final int OFFNORMAL = 2;
|
||||
public static final int HIGH_LIMIT = 3;
|
||||
public static final int LOW_LIMIT = 4;
|
||||
public static final BAlarmState normal = new BAlarmState(0);
|
||||
public static final BAlarmState fault = new BAlarmState(1);
|
||||
public static final BAlarmState offnormal = new BAlarmState(2);
|
||||
public static final BAlarmState highLimit = new BAlarmState(3);
|
||||
public static final BAlarmState lowLimit = new BAlarmState(4);
|
||||
public static final Type TYPE;
|
||||
public static final BAlarmState DEFAULT;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BAlarmState;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static final BAlarmState make(int n) {
|
||||
return (BAlarmState)normal.getRange().get(n, false);
|
||||
}
|
||||
|
||||
public static final BAlarmState make(String string) {
|
||||
return (BAlarmState)normal.getRange().get(string);
|
||||
}
|
||||
|
||||
public final boolean isInAlarm() {
|
||||
boolean bl = false;
|
||||
if (this != normal) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public final boolean isOffnormal() {
|
||||
boolean bl = false;
|
||||
if (this != normal && this != fault) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private BAlarmState(int n) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$BAlarmState;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BAlarmState = BAlarmState.class("[Ljavax.baja.alarm.ext.BAlarmState;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.sys.BStruct
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BAlarmTimestamps
|
||||
extends BStruct {
|
||||
public static final Property alarmTime = BAlarmTimestamps.newProperty((int)65, (BValue)BAbsTime.NULL, null);
|
||||
public static final Property ackTime = BAlarmTimestamps.newProperty((int)65, (BValue)BAbsTime.NULL, null);
|
||||
public static final Property normalTime = BAlarmTimestamps.newProperty((int)65, (BValue)BAbsTime.NULL, null);
|
||||
public static final Property count = BAlarmTimestamps.newProperty((int)65, (int)0, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BAlarmTimestamps;
|
||||
|
||||
public BAbsTime getAlarmTime() {
|
||||
return (BAbsTime)this.get(alarmTime);
|
||||
}
|
||||
|
||||
public void setAlarmTime(BAbsTime bAbsTime) {
|
||||
this.set(alarmTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public BAbsTime getAckTime() {
|
||||
return (BAbsTime)this.get(ackTime);
|
||||
}
|
||||
|
||||
public void setAckTime(BAbsTime bAbsTime) {
|
||||
this.set(ackTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public BAbsTime getNormalTime() {
|
||||
return (BAbsTime)this.get(normalTime);
|
||||
}
|
||||
|
||||
public void setNormalTime(BAbsTime bAbsTime) {
|
||||
this.set(normalTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return this.getInt(count);
|
||||
}
|
||||
|
||||
public void setCount(int n) {
|
||||
this.setInt(count, n, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
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$BAlarmTimestamps;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BAlarmTimestamps = BAlarmTimestamps.class("[Ljavax.baja.alarm.ext.BAlarmTimestamps;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.BAlarmAlgorithm;
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BFaultAlgorithm
|
||||
extends BAlarmAlgorithm {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BFaultAlgorithm;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isParentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BAlarmSourceExt;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BAlarmState checkFault(BStatusValue bStatusValue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final BAlarmState checkAlarmState(BStatusValue bStatusValue) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
}
|
||||
|
||||
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$BFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BFaultAlgorithm = BFaultAlgorithm.class("[Ljavax.baja.alarm.ext.BFaultAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BStruct
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BLimitEnable
|
||||
extends BStruct {
|
||||
public static final Property lowLimitEnable = BLimitEnable.newProperty((int)0, (boolean)false, null);
|
||||
public static final Property highLimitEnable = BLimitEnable.newProperty((int)0, (boolean)false, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BLimitEnable;
|
||||
|
||||
public boolean getLowLimitEnable() {
|
||||
return this.getBoolean(lowLimitEnable);
|
||||
}
|
||||
|
||||
public void setLowLimitEnable(boolean bl) {
|
||||
this.setBoolean(lowLimitEnable, bl, null);
|
||||
}
|
||||
|
||||
public boolean getHighLimitEnable() {
|
||||
return this.getBoolean(highLimitEnable);
|
||||
}
|
||||
|
||||
public void setHighLimitEnable(boolean bl) {
|
||||
this.setBoolean(highLimitEnable, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isHighLimitEnabled() {
|
||||
return this.getHighLimitEnable();
|
||||
}
|
||||
|
||||
public boolean isLowLimitEnabled() {
|
||||
return this.getLowLimitEnable();
|
||||
}
|
||||
|
||||
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$BLimitEnable;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BLimitEnable = BLimitEnable.class("[Ljavax.baja.alarm.ext.BLimitEnable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFrozenEnum
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import javax.baja.sys.BFrozenEnum;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BNotifyType
|
||||
extends BFrozenEnum {
|
||||
public static final int ALARM = 0;
|
||||
public static final int ALERT = 1;
|
||||
public static final int ACK_NOTIFICATION = 2;
|
||||
public static final BNotifyType alarm = new BNotifyType(0);
|
||||
public static final BNotifyType alert = new BNotifyType(1);
|
||||
public static final BNotifyType ackNotification = new BNotifyType(2);
|
||||
public static final Type TYPE;
|
||||
public static final BNotifyType DEFAULT;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BNotifyType;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static final BNotifyType make(int n) {
|
||||
return (BNotifyType)alarm.getRange().get(n, false);
|
||||
}
|
||||
|
||||
public static final BNotifyType make(String string) {
|
||||
return (BNotifyType)alarm.getRange().get(string);
|
||||
}
|
||||
|
||||
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 BNotifyType(int n) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$BNotifyType;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BNotifyType = BNotifyType.class("[Ljavax.baja.alarm.ext.BNotifyType;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = alarm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.control.BControlPoint
|
||||
* javax.baja.log.Log
|
||||
* javax.baja.status.BStatusValue
|
||||
* javax.baja.sys.Action
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BRelTime
|
||||
* javax.baja.sys.Clock
|
||||
* javax.baja.sys.Clock$Ticket
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.BAlarmAlgorithm;
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.control.BControlPoint;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BOffnormalAlgorithm
|
||||
extends BAlarmAlgorithm {
|
||||
public static final Type TYPE;
|
||||
protected static Log log;
|
||||
long endTime;
|
||||
Clock.Ticket ticket;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$BOffnormalAlgorithm;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isParentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BAlarmSourceExt;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public final BAlarmState checkAlarmState(BStatusValue bStatusValue, long l, long l2) {
|
||||
return this.checkAlarms(bStatusValue, l, l2);
|
||||
}
|
||||
|
||||
public final BAlarmState checkAlarmState(BStatusValue bStatusValue, long l) {
|
||||
return this.checkAlarms(bStatusValue, l, l);
|
||||
}
|
||||
|
||||
public BAlarmState checkAlarms(BStatusValue bStatusValue, long l) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BAlarmState checkAlarms(BStatusValue bStatusValue, long l, long l2) {
|
||||
return this.checkAlarms(bStatusValue, l);
|
||||
}
|
||||
|
||||
public void writeAlarmData(BStatusValue bStatusValue, Map map) {
|
||||
}
|
||||
|
||||
protected void startTimer(long l) {
|
||||
this.endTime = Clock.ticks() + l;
|
||||
BControlPoint bControlPoint = this.getParentPoint();
|
||||
if (bControlPoint != null && this.isRunning()) {
|
||||
this.ticket = Clock.schedule((BComponent)bControlPoint, (BRelTime)BRelTime.make((long)l), (Action)BControlPoint.execute, null);
|
||||
}
|
||||
}
|
||||
|
||||
protected void cancelTimer() {
|
||||
this.endTime = -1;
|
||||
if (this.ticket != null) {
|
||||
this.ticket.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isTimerExpired() {
|
||||
long l = Clock.ticks();
|
||||
if (this.endTime == (long)-1) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
return l >= this.endTime;
|
||||
}
|
||||
|
||||
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$BOffnormalAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$BOffnormalAlgorithm = BOffnormalAlgorithm.class("[Ljavax.baja.alarm.ext.BOffnormalAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
log = Log.getLog((String)"control");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package javax.baja.alarm.ext.fault;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.fault.BTwoStateFaultAlgorithm;
|
||||
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.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BEnumFaultAlgorithm
|
||||
extends BTwoStateFaultAlgorithm {
|
||||
public static final Property validValues = BEnumFaultAlgorithm.newProperty((int)0, (BValue)BEnumRange.make((String[])new String[]{"INITIAL_VALUE"}), (BFacets)BFacets.make((String)"fieldEditor", (BIDataValue)BString.make((String)"alarm:EnumAlarmRangeFE")));
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$fault$BEnumFaultAlgorithm;
|
||||
|
||||
public BEnumRange getValidValues() {
|
||||
return (BEnumRange)this.get(validValues);
|
||||
}
|
||||
|
||||
public void setValidValues(BEnumRange bEnumRange) {
|
||||
this.set(validValues, (BValue)bEnumRange, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean isGrandparentLegal(BComponent bComponent) {
|
||||
return bComponent instanceof BEnumPoint;
|
||||
}
|
||||
|
||||
public BFacets getSlotFacets(Slot slot) {
|
||||
if (slot == validValues) {
|
||||
return BFacets.make((BFacets)this.getPointFacets(), (BFacets)super.getSlotFacets(slot));
|
||||
}
|
||||
return super.getSlotFacets(slot);
|
||||
}
|
||||
|
||||
public void started() {
|
||||
if (this.getValidValues().equals((Object)BEnumRange.make((String[])new String[]{"INITIAL_VALUE"}))) {
|
||||
this.setValidValues((BEnumRange)this.getPointFacets().get("range"));
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isNormal(BStatusValue bStatusValue) {
|
||||
BStatusEnum bStatusEnum = (BStatusEnum)bStatusValue;
|
||||
BDynamicEnum bDynamicEnum = bStatusEnum.getValue();
|
||||
int n = bDynamicEnum.getOrdinal();
|
||||
int[] nArray = this.getValidValues().getOrdinals();
|
||||
int n2 = 0;
|
||||
while (n2 < nArray.length) {
|
||||
if (n == nArray[n2]) {
|
||||
return true;
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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$fault$BEnumFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$fault$BEnumFaultAlgorithm = BEnumFaultAlgorithm.class("[Ljavax.baja.alarm.ext.fault.BEnumFaultAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,454 @@
|
||||
/*
|
||||
* 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.fault;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.alarm.ext.BFaultAlgorithm;
|
||||
import javax.baja.alarm.ext.BLimitEnable;
|
||||
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 BOutOfRangeFaultAlgorithm
|
||||
extends BFaultAlgorithm {
|
||||
public static final Property highLimit = BOutOfRangeFaultAlgorithm.newProperty((int)0, (int)0, null);
|
||||
public static final Property lowLimit = BOutOfRangeFaultAlgorithm.newProperty((int)0, (int)0, null);
|
||||
public static final Property deadband = BOutOfRangeFaultAlgorithm.newProperty((int)0, (int)0, (BFacets)BFacets.make((String)"min", (BIDataValue)BFloat.make((float)0.0f)));
|
||||
public static final Property highLimitText = BOutOfRangeFaultAlgorithm.newProperty((int)0, (BValue)BFormat.DEFAULT, (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property lowLimitText = BOutOfRangeFaultAlgorithm.newProperty((int)0, (BValue)BFormat.DEFAULT, (BFacets)BFacets.make((String)"multiLine", (BIDataValue)BBoolean.TRUE));
|
||||
public static final Property limitEnable = BOutOfRangeFaultAlgorithm.newProperty((int)0, (BValue)new BLimitEnable(), null);
|
||||
public static final Property inHighState = BOutOfRangeFaultAlgorithm.newProperty((int)4, (boolean)false, null);
|
||||
public static final Property inLowState = BOutOfRangeFaultAlgorithm.newProperty((int)4, (boolean)false, null);
|
||||
public static final Type TYPE;
|
||||
OutOfRangeState current;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$fault$BOutOfRangeFaultAlgorithm;
|
||||
|
||||
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 boolean getInHighState() {
|
||||
return this.getBoolean(inHighState);
|
||||
}
|
||||
|
||||
public void setInHighState(boolean bl) {
|
||||
this.setBoolean(inHighState, bl, null);
|
||||
}
|
||||
|
||||
public boolean getInLowState() {
|
||||
return this.getBoolean(inLowState);
|
||||
}
|
||||
|
||||
public void setInLowState(boolean bl) {
|
||||
this.setBoolean(inLowState, bl, 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.fault) {
|
||||
if (this.getInHighState()) {
|
||||
this.current = new HighAlarmState();
|
||||
} else if (this.getInLowState()) {
|
||||
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 checkFault(BStatusValue bStatusValue) {
|
||||
BStatusNumeric bStatusNumeric = (BStatusNumeric)bStatusValue;
|
||||
return this.evaluate(bStatusNumeric.getValue());
|
||||
}
|
||||
|
||||
private final BAlarmState evaluate(double d) {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (bAlarmState == BAlarmState.fault) {
|
||||
if (this.getInHighState()) {
|
||||
this.current = new HighAlarmState();
|
||||
} else if (this.getInLowState()) {
|
||||
this.current = new LowAlarmState();
|
||||
}
|
||||
} else {
|
||||
this.current = new NormalState();
|
||||
}
|
||||
return this.current.evaluate(d);
|
||||
}
|
||||
|
||||
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 BOutOfRangeFaultAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$fault$BOutOfRangeFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$fault$BOutOfRangeFaultAlgorithm = BOutOfRangeFaultAlgorithm.class("[Ljavax.baja.alarm.ext.fault.BOutOfRangeFaultAlgorithm;", 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) {
|
||||
if (!(d >= BOutOfRangeFaultAlgorithm.this.getHighLimit() - BOutOfRangeFaultAlgorithm.this.getDeadband())) {
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getLowLimit() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getHighLimit() - BOutOfRangeFaultAlgorithm.this.getDeadband()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public HighAlarmState() {
|
||||
BOutOfRangeFaultAlgorithm.this.setInHighState(true);
|
||||
BOutOfRangeFaultAlgorithm.this.setInLowState(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class LowAlarmState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "LowAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (!(d <= BOutOfRangeFaultAlgorithm.this.getLowLimit() + BOutOfRangeFaultAlgorithm.this.getDeadband())) {
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getHighLimit() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getLowLimit() + BOutOfRangeFaultAlgorithm.this.getDeadband()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public LowAlarmState() {
|
||||
BOutOfRangeFaultAlgorithm.this.setInHighState(false);
|
||||
BOutOfRangeFaultAlgorithm.this.setInLowState(true);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class NormalState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "Normal";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getLowLimit() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if ((!(d >= BOutOfRangeFaultAlgorithm.this.getLowLimit()) || !(d <= BOutOfRangeFaultAlgorithm.this.getHighLimit())) && d > BOutOfRangeFaultAlgorithm.this.getHighLimit() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public NormalState() {
|
||||
BOutOfRangeFaultAlgorithm.this.setInHighState(false);
|
||||
BOutOfRangeFaultAlgorithm.this.setInLowState(false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class OutOfRangeState {
|
||||
public abstract String tag();
|
||||
|
||||
public abstract BAlarmState evaluate(double var1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromLowState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromLowState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (d <= BOutOfRangeFaultAlgorithm.this.getLowLimit() + BOutOfRangeFaultAlgorithm.this.getDeadband() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
} else {
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getHighLimit() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getLowLimit() + BOutOfRangeFaultAlgorithm.this.getDeadband()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateLowAlarmState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "ValidateLowAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getLowLimit() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getHighLimit() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d >= BOutOfRangeFaultAlgorithm.this.getLowLimit()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromHighState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromHighState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getHighLimit() - BOutOfRangeFaultAlgorithm.this.getDeadband() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getLowLimit() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getHighLimit() - BOutOfRangeFaultAlgorithm.this.getDeadband()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateHighAlarmState
|
||||
extends OutOfRangeState {
|
||||
public String tag() {
|
||||
return "ValidateHighAlarmState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(double d) {
|
||||
if (d < BOutOfRangeFaultAlgorithm.this.getLowLimit() && BOutOfRangeFaultAlgorithm.this.isLowLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new LowAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d > BOutOfRangeFaultAlgorithm.this.getHighLimit() && BOutOfRangeFaultAlgorithm.this.isHighLimitEnabled()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new HighAlarmState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
if (d <= BOutOfRangeFaultAlgorithm.this.getHighLimit()) {
|
||||
BOutOfRangeFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.fault;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.baja.alarm.ext.fault.BTwoStateFaultAlgorithm;
|
||||
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 BStatusFaultAlgorithm
|
||||
extends BTwoStateFaultAlgorithm {
|
||||
public static final Property faultValues = BStatusFaultAlgorithm.newProperty((int)0, (BValue)BStatus.ok, null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$fault$BStatusFaultAlgorithm;
|
||||
|
||||
public BStatus getFaultValues() {
|
||||
return (BStatus)this.get(faultValues);
|
||||
}
|
||||
|
||||
public void setFaultValues(BStatus bStatus) {
|
||||
this.set(faultValues, (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("faultValue", 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.getFaultValues().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$fault$BStatusFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$fault$BStatusFaultAlgorithm = BStatusFaultAlgorithm.class("[Ljavax.baja.alarm.ext.fault.BStatusFaultAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* 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.fault;
|
||||
|
||||
import javax.baja.alarm.ext.BAlarmSourceExt;
|
||||
import javax.baja.alarm.ext.BAlarmState;
|
||||
import javax.baja.alarm.ext.BFaultAlgorithm;
|
||||
import javax.baja.status.BStatusValue;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BTwoStateFaultAlgorithm
|
||||
extends BFaultAlgorithm {
|
||||
public static final Type TYPE;
|
||||
TwoState current;
|
||||
static /* synthetic */ Class class$javax$baja$alarm$ext$fault$BTwoStateFaultAlgorithm;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void started() {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
if (bAlarmState == BAlarmState.fault) {
|
||||
this.current = new FaultState();
|
||||
}
|
||||
}
|
||||
|
||||
public BAlarmState checkFault(BStatusValue bStatusValue) {
|
||||
BAlarmState bAlarmState = ((BAlarmSourceExt)this.getParent()).getAlarmState();
|
||||
this.current = bAlarmState == BAlarmState.fault ? new FaultState() : new NormalState();
|
||||
boolean bl = this.isNormal(bStatusValue);
|
||||
return this.current.evaluate(bl);
|
||||
}
|
||||
|
||||
protected abstract boolean isNormal(BStatusValue var1);
|
||||
|
||||
protected boolean isCurrentFault() {
|
||||
return this.current instanceof FaultState;
|
||||
}
|
||||
|
||||
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 BTwoStateFaultAlgorithm() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$javax$baja$alarm$ext$fault$BTwoStateFaultAlgorithm;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$alarm$ext$fault$BTwoStateFaultAlgorithm = BTwoStateFaultAlgorithm.class("[Ljavax.baja.alarm.ext.fault.BTwoStateFaultAlgorithm;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class FaultState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "FaultState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl) {
|
||||
if (bl) {
|
||||
BTwoStateFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private FaultState() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class NormalState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "Normal";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl) {
|
||||
if (!bl) {
|
||||
BTwoStateFaultAlgorithm.this.transition(new FaultState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private NormalState() {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private abstract class TwoState {
|
||||
public abstract String tag();
|
||||
|
||||
public abstract BAlarmState evaluate(boolean var1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateReturnFromFaultState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "ValidateReturnFromFaultState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl) {
|
||||
if (bl) {
|
||||
BTwoStateFaultAlgorithm.this.transition(new NormalState());
|
||||
return BAlarmState.normal;
|
||||
}
|
||||
BTwoStateFaultAlgorithm.this.transition(new FaultState());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ValidateFaultState
|
||||
extends TwoState {
|
||||
public String tag() {
|
||||
return "ValidateFaultState";
|
||||
}
|
||||
|
||||
public BAlarmState evaluate(boolean bl) {
|
||||
if (bl) {
|
||||
BTwoStateFaultAlgorithm.this.transition(new NormalState());
|
||||
return null;
|
||||
}
|
||||
BTwoStateFaultAlgorithm.this.transition(new FaultState());
|
||||
return BAlarmState.fault;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+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