Skip to content

Commit

Permalink
Removed unnecessary checks related to input events in actions and output
Browse files Browse the repository at this point in the history
events in conditions (commented out the methods: noInputEventInActions
and noOutputEventInConditions)
  • Loading branch information
madiel committed Oct 23, 2024
1 parent 7cf206d commit bbeaa24
Showing 1 changed file with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class RoboSimValidator extends AbstractRoboSimValidator {
if (c !== null) {
val s = c.size
if (s > 1) {
if ( s == 2)
warning(
'''There is more than one element with name '«qnp.getFullyQualifiedName(o)»'.''',
RoboChartPackage.Literals.NAMED_ELEMENT__NAME,
Expand Down Expand Up @@ -396,36 +397,36 @@ class RoboSimValidator extends AbstractRoboSimValidator {
return o.eContainer.getSimContext
}

@Check
def noInputEventInActions(OutputCommunication ocomm) {
val context = getSimContext(ocomm)
//System.out.println(ocomm.event.name);
if (context !== null) {
if (context.inputEventsRS.contains(ocomm.event.name)){
val msg = ' The input event ' + ocomm.event.name + ' cannot be used as an output communication because it is not an output event';
error(
msg,
RoboSimPackage.Literals.OUTPUT_COMMUNICATION__EVENT,
'CommunicationStmtError'
)
}
}
}

@Check
def noOutputEventInConditions(SimRefExp ev) {
val context = getSimContext(ev)
if (context !== null) {
if (context.outputEventsRS.contains(ev.element.name)){
val msg = ' The output event ' + ev.element.name + ' cannot be used in a condition';
error(
msg,
RoboSimPackage.Literals.SIM_REF_EXP__ELEMENT,
'SimRefExpError'
)
}
}
}
// @Check
// def noInputEventInActions(OutputCommunication ocomm) {
// val context = getSimContext(ocomm)
// //System.out.println(ocomm.event.name);
// if (context !== null) {
// if (context.inputEventsRS.contains(ocomm.event.name)){
// val msg = ' The input event ' + ocomm.event.name + ' cannot be used as an output communication because it is not an output event';
// error(
// msg,
// RoboSimPackage.Literals.OUTPUT_COMMUNICATION__EVENT,
// 'CommunicationStmtError'
// )
// }
// }
// }
//
// @Check
// def noOutputEventInConditions(SimRefExp ev) {
// val context = getSimContext(ev)
// if (context !== null) {
// if (context.outputEventsRS.contains(ev.element.name)){
// val msg = ' The output event ' + ev.element.name + ' cannot be used in a condition';
// error(
// msg,
// RoboSimPackage.Literals.SIM_REF_EXP__ELEMENT,
// 'SimRefExpError'
// )
// }
// }
// }



Expand Down

0 comments on commit bbeaa24

Please sign in to comment.