2
* Copyright (C) 2013 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alessandro Pozzi <signor.hyde@gmail.com>
17
* Nekhelesh Ramananthan <krnekhelesh@gmail.com>
21
import Ubuntu.Components 0.1
22
import "StopwatchSupport.js" as SScript
28
// Properties to store/set the time variables
29
property var startTime: 0
30
property var stopTime: 0
31
property int delay : 0
32
property bool flag: true
33
property int totalTime: 0
34
property int milliseconds: 0
36
// Sets the location and visible (bool) values of the blip (small circle visible when the lap button is pressed)
37
property alias blipLocation: blipFist.location
38
property alias blipVisible: blipFist.visible
40
// Retrieves the status of the stopwatch timer
41
property bool timerStatus: stopwatchUIUpdate.running
44
totalTime = milliseconds = seconds = minutes = hours = 0
45
SScript.deltaTime[0] = SScript.deltaTime[1] = SScript.deltaTime[2] = SScript.deltaTime[3] = 0
46
startTime = stopTime = delay = 0;
51
stopwatchUIUpdate.start()
55
stopwatchUIUpdate.stop()
58
// Timer which runs every 100 microseconds to update the time and also the trailing hand gradient.
65
totalTime = SScript.delta();
66
SScript.deltaTime = SScript.msToTime(totalTime)
67
hours = SScript.deltaTime[0];
68
minutes = SScript.deltaTime[1];
69
seconds = SScript.deltaTime[2];
70
milliseconds = SScript.deltaTime[3];
74
// This component draws the small white circle that is visible everytime the lap button is pressed.
84
delegate: AnalogClockMarker {