use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.
the class WheneverStatementImpl method basicSetInterval.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInterval(TimeInterval newInterval, NotificationChain msgs) {
TimeInterval oldInterval = interval;
interval = newInterval;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHENEVER_STATEMENT__INTERVAL, oldInterval, newInterval);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.
the class WhenHoldsStatementImpl method basicSetEventInterval.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetEventInterval(TimeInterval newEventInterval, NotificationChain msgs) {
TimeInterval oldEventInterval = eventInterval;
eventInterval = newEventInterval;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_HOLDS_STATEMENT__EVENT_INTERVAL, oldEventInterval, newEventInterval);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.
the class WhenHoldsStatementImpl method basicSetConditionInterval.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetConditionInterval(TimeInterval newConditionInterval, NotificationChain msgs) {
TimeInterval oldConditionInterval = conditionInterval;
conditionInterval = newConditionInterval;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_HOLDS_STATEMENT__CONDITION_INTERVAL, oldConditionInterval, newConditionInterval);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.
the class WhenOccursStatmentImpl method basicSetInterval.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInterval(TimeInterval newInterval, NotificationChain msgs) {
TimeInterval oldInterval = interval;
interval = newInterval;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_OCCURS_STATMENT__INTERVAL, oldInterval, newInterval);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.
the class AgreeValidator method checkWhenHoldsStatement.
@Check(CheckType.FAST)
public void checkWhenHoldsStatement(WhenHoldsStatement when) {
Expr condition = when.getCondition();
Expr event = when.getEvent();
TimeInterval condInterval = when.getConditionInterval();
checkExprIsIdentifier(condition);
checkExprIsIdentifier(event);
if (condInterval != null) {
Expr lowExpr = condInterval.getLow();
if (lowExpr instanceof RealLitExpr) {
RealLitExpr realExpr = (RealLitExpr) lowExpr;
if (!realExpr.getVal().equals("0.0")) {
error(lowExpr, "The lower bound of this interval must be zero");
}
}
} else {
error(when, "Statement most of a cause interval");
}
TypeDef type = AgreeTypeSystem.infer(condition);
if (!AgreeTypeSystem.typesEqual(AgreeTypeSystem.Prim.BoolTypeDef, type)) {
error(condition, "The condition of a when statement is of type '" + type + "'" + " but must be of type 'bool'");
}
type = AgreeTypeSystem.infer(event);
if (!AgreeTypeSystem.typesEqual(AgreeTypeSystem.Prim.BoolTypeDef, type)) {
error(event, "The effect of a when statement is of type '" + type + "'" + " but must be of type 'bool'");
}
}
Aggregations