90 likes | 211 Views
SAFER++. VDM++ and UML Thomas Christensen & Tommy Pedersen. Requirements. The specification contains all requirements Our additional requirement: R1: The avionics software shall compensate for a single defective thruster. UML diagram. The existing model contains 15 classes
E N D
SAFER++ VDM++ and UML Thomas Christensen & Tommy Pedersen
Requirements • The specification contains all requirements • Our additional requirement: • R1: The avionics software shall compensate for a single defective thruster.
UML diagram • The existing model contains 15 classes • For our model we only need 2 + 1 added class • New class ThrusterMonitor abstracts away from actual Thruster objects
UML diagram • The classes we will affect Our Added Class
The ThrusterMonitor Class • Interface to Thruster class • One operation: getDefectiveThrusters() • Returns set of defective thruster positions instead of thruster objects
VDM++ for ThrusterMonitor 8: class ThrusterMonitor 9: 10: instance variables 11: private Thrusters : set of Thruster; 12: private DefectiveThrusters : set of ThrusterControl`ThrusterPosition; 13: 14: operations 15: public getDefectiveThrusters : () ==> set of ThrusterControl`ThrusterPosition 16: getDefectiveThrusters() == 17: return DefectiveThrusters; 18: 19: 20: end ThrusterMonitor
VDM++ for ThrusterControl 1 public OppositeMap : map ThrusterPosition to ThrusterPosition = {<B1> |-> <F1>, <B2> |-> <F2>, <B3> |-> <F3>, <B4> |-> <F4>, <F1> |-> <B1>, <F2> |-> <B2>, <F3> |-> <B3>, <F4> |-> <B4>, <L1R> |-> <R2R>, <L1F> |-> <R2F>, <R2R> |-> <L1R>, <R2F> |-> <L1F>, <L3R> |-> <R4R>, <L3F> |-> <R4F>, <R4R> |-> <L3R>, <R4F> |-> <L3F>, <D1R> |-> <U3R>, <D1F> |-> <U3F>, <D2R> |-> <U4R>, <D2F> |-> <U4F>, <U3R> |-> <D1R>, <U3F> |-> <D1F>, <U4R> |-> <D2R>, <U4F> |-> <D2F> }; • Maps opposite thruster positions • Equivalent map made for diagonally opposite thrusters
VDM++ for ThrusterControl 2 • The ThrusterControl class needs to check the thrusters before selecting them • If one is defective it uses the maps to figure out which thrusters to use • This algorithm is not yet implemented
Existing VDM++ for Workspace • This will not be altered: 31: public 32: ControlCycle : Command`Direction * Command`Direction * Command`Direction * 33: Command`Direction * 34: HandControlUnit`Mode * HandControlUnit`Button * 35: Command`AxisMap ==> 36: set of ThrusterControl`ThrusterPosition 37: ControlCycle(x,pitch,yaw_y,roll_z,modeswitch,aahbutton,aahcmd) == 38: (clock.IncrTime(); 39: hcu.SetAAH(aahbutton); 40: hcu.SetGrip(x, pitch, yaw_y, roll_z); 41: hcu.SetMode(modeswitch); 42: aah.SetRotcmd(aahcmd); 43: intcmd.ConvertGrip(); 44: aah.Update(); 45: intcmd.IntegrateCmds(); 46: thrcontrol.SelectThrusters(); 47: thrcontrol.SignalThrusters(); 48: vda.ThrustersOn())