28 lines
470 B
C++
28 lines
470 B
C++
|
#include "MachineImpl.h"
|
||
|
#include "DieselMotor.h"
|
||
|
#include "ElectrischeMotor.h"
|
||
|
#include "TsensorImpl.h"
|
||
|
|
||
|
MachineImpl::MachineImpl(Motor* m1, Motor* m2): m1(m1), m2(m2){};
|
||
|
|
||
|
void MachineImpl::run(){
|
||
|
t1 = m1->tsensor();
|
||
|
t1->read();
|
||
|
m1->start();
|
||
|
t2 = m2->tsensor();
|
||
|
t2->read();
|
||
|
m2->start();
|
||
|
}
|
||
|
|
||
|
void MachineImpl::halt(){
|
||
|
m1->stop();
|
||
|
m2->stop();
|
||
|
}
|
||
|
|
||
|
Motor* MachineImpl::motor1(){
|
||
|
return m1;
|
||
|
}
|
||
|
|
||
|
Motor* MachineImpl::motor2(){
|
||
|
return m2;
|
||
|
}
|