Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to connect two ControllerRefs in a SimModule (EValidator issue) #1

Open
pefribeiro opened this issue Jan 28, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@pefribeiro
Copy link
Contributor

pefribeiro commented Jan 28, 2020

Currently the implemented validation rules do not cover the case of connections between controllers, so an error is raised by EValidator.

Example:

module Mod {
	
	cycleDef 1
	
	rref rp=M::RP
	cref c1=SimC1
	cref c2=SimC2	
	
 	connection c1 on c2c 		to c2 on c2c 
}

The validation fails because of connection c1 on c2c to c2 on c2c.

I looked at the code in RoboSimValidator.xtend and I am wondering what is the purpose of checkConnectionDirection. Isn't this validation already covered by the RoboChart rules in RoboChartValidator.xtend @madielfilho? I think we should avoid duplicating any validation that is already part of RoboChart unless it is about elements specific to RoboSim.

I am happy to remove the duplicated code if you can confirm this please @madielfilho. I see that there are other duplicated rules (eg. checkClockExpWellTyped and variableInitWellTyped. Can't these be removed?

@pefribeiro pefribeiro added the bug Something isn't working label Jan 28, 2020
@pefribeiro
Copy link
Contributor Author

pefribeiro commented Jan 28, 2020

I realise there is a comment on line 337:

// The typeFor is an injected method and is required in RoboSim for condition with the Feedback Expression
// If this method is removed, or its superclass method is called, the typeFor won't use RoboSim's injected typeFor.

I guess, this implementation can be improved by defining a method in the parent class, and overriding it, similarly to what @alvarohm has done for the revised TimedGenerator.xtend implementation. Is that possible for the injected RoboSimTypeProvider?

@madielfilho
Copy link
Collaborator

madielfilho commented Jan 28, 2020 via email

@pefribeiro
Copy link
Contributor Author

Thanks @madielfilho for clarifying these aspects.

I think so. The method checkConnectionDirection was initially implemented to check all connections, but, for SimModule and SimControllers, I think such validations are already covered by the RoboChart rules. In RoboSim, for SimMachineDef, we also need to consider the events (and the interfaces) that can be declared directly in the input/output context.

Ok, this is related to issue #3, which is just filled in.

@pefribeiro pefribeiro added this to the New RoboSim Semantics milestone Jan 29, 2020
pefribeiro added a commit that referenced this issue Feb 27, 2020
This contains working changes to enable sample RST files to work
appropriately in light of issues #1, #2 and #3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants