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

Change the HardwareInterface api to use a class structure #13

Closed
lausdahl opened this issue Jun 16, 2016 · 0 comments
Closed

Change the HardwareInterface api to use a class structure #13

lausdahl opened this issue Jun 16, 2016 · 0 comments
Milestone

Comments

@lausdahl
Copy link
Member

class Port

types

PortTypes = int | bool | seq of char | real

operations

protected dgdg : ()==>()
dgdg()== is sub class responsibility;

public getValue:() ==> PortTypes
getValue()==return value;

public setValue:() ==>PortTypes
setValue()==return value;

end Port
class IntPort

instance variables

value : int ;

operations

public getValue:() ==>int
getValue()==return value;

public setValue:() ==>int
setValue()==return value;

end IntPort
class RealPort

instance variables

value : real ;

operations

public getValue:() ==>real
getValue()==return value;

public setValue:() ==>real
setValue()==return value;

end RealPort

and then the system class can be changed to:

new Sensor(hwi.level);
@lausdahl lausdahl added this to the v0.0.6 milestone Jul 9, 2016
@lausdahl lausdahl modified the milestones: v0.0.6, v0.1.0 Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant