11.10.2013 Views

(4 slides per page) - Updated

(4 slides per page) - Updated

(4 slides per page) - Updated

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Overview<br />

Phase 10<br />

Phase 11<br />

Introduction<br />

Procedure<br />

Example - TLC<br />

Example - SBC<br />

Phase 12<br />

Summary<br />

Overview<br />

Phase 10<br />

Phase 11<br />

Introduction<br />

Procedure<br />

Example - TLC<br />

Example - SBC<br />

Phase 12<br />

Summary<br />

Create class to initialize all components of<br />

TrafficLightsApplication II<br />

package tlc;<br />

public class TrafficLightsApplication {<br />

private TrafficLightBehavior tlb;<br />

private TimeOutTimer tot;<br />

private Clock clk;<br />

}<br />

public LightsInterfaceAbstraction () {<br />

tlb = new TrafficLightBehavior();<br />

tot = new TimeOutTimer(tlb);<br />

clk = new Clock(tot);<br />

}<br />

public void connectTo(LightsInterfaceAbstraction lia) {<br />

tlb.connectTo(tot, lia);<br />

}<br />

Create main class to initialize all components II<br />

package tlc;<br />

public class MainInit {<br />

private BrokenLightDriver bld;<br />

private EmergencyRequestDriver erd;<br />

private InductionLoopDriver ild;<br />

private LightsInterfaceAbstraction lia;<br />

private LightsDriver ld;<br />

private TrafficLightsApplication tla;<br />

public MainInit() {<br />

ld = new LightsDriver(); // Actuators<br />

lia = new LightsInterfaceAbstraction (ld);<br />

tla = new TrafficLightApplication(); // Application<br />

bld = new BrokenLightDriver(tlb); // Sensors<br />

erd = new EmergencyRequestDriver(tlb);<br />

ild = new InductionLoopDriver(tlb);<br />

tla.ConnectTo(lia);<br />

// Connect components and start Application<br />

}<br />

public static void main(String[] args) {<br />

69 / 89<br />

71 / 89<br />

Overview<br />

Phase 10<br />

Phase 11<br />

Introduction<br />

Procedure<br />

Example - TLC<br />

Example - SBC<br />

Phase 12<br />

Summary<br />

Overview<br />

Phase 10<br />

Phase 11<br />

Introduction<br />

Procedure<br />

Example - TLC<br />

Example - SBC<br />

Phase 12<br />

Summary<br />

Create main class to initialize all components I<br />

TrafficLightsController<br />

srr<br />

TrafficLightApplication<br />

InductionLoop LightsInterface<br />

IAL<br />

Abstraction<br />

srr_if’<br />

lights_state_if<br />

lights_on_off_if’<br />

InductionLoop LightsDriver BrokenLight Emergency<br />

Driver<br />

Driver<br />

Request<br />

Driver<br />

irq7<br />

srr_if<br />

induction loop<br />

to detect cars<br />

on secondary<br />

road<br />

lights_on_off_if<br />

ports<br />

Microcontroller<br />

LightsControl<br />

bl_if’<br />

irq8<br />

bl_if<br />

er_if’<br />

irq9<br />

er_if<br />

emergency<br />

request button at<br />

fire brigade<br />

Create main class to initialize all components III<br />

}<br />

}<br />

MainInit m = new MainInit();<br />

Parameters are used to create connections according to the software architecture.<br />

The order of initialisation is important. Start with objects providing interface.<br />

70 / 89<br />

72 / 89

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!