blob: a105e82b7af9c6f056a5971a0b2b9226f6779029 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// Copyright (C) 2017 Ford Motor Company
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "engine.h"
Engine::Engine(int cylinders, QObject *parent) :
EngineSimpleSource(cylinders, parent)
{
setRpm(0);
setpurchasedPart(false);
}
Engine::~Engine()
{
}
bool Engine::start()
{
if (started())
return false; // already started
setStarted(true);
return true;
}
void Engine::increaseRpm(int deltaRpm)
{
setRpm(rpm() + deltaRpm);
}
Temperature Engine::temperature()
{
return _temperature;
}
void Engine::setTemperature(const Temperature &value)
{
_temperature = value;
}
void Engine::setpurchasedPart(bool value)
{
_purchasedPart = value;
}
|