Skip to content

Commit 009462f

Browse files
authored
Part of Workout App to be added to Github (#33)
* Interval Timer App completed * part of Workout App project added
1 parent 4e81449 commit 009462f

File tree

83 files changed

+6705
-815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+6705
-815
lines changed

IntervalTimer/Assets/play-button-simple-svgrepo-com.svg

+7
Loading

IntervalTimer/Package.resolved

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "SQLite.swift",
6+
"repositoryURL": "https://github.com/scadedoc/SQLite.swift",
7+
"state": {
8+
"branch": "master",
9+
"revision": "6e102c81037ce5bb52ed3f8dbd0fd890a1b45a9b",
10+
"version": null
11+
}
12+
}
13+
]
14+
},
15+
"version": 1
16+
}

IntervalTimer/Package.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ let package = Package(
2020
)
2121
],
2222
dependencies: [
23-
23+
.package(url: "https://github.com/scadedoc/SQLite.swift", .branch("master"))
2424
],
2525
targets: [
2626
.target(
2727
name: "IntervalTimer",
28-
dependencies: [],
28+
dependencies: [.product(name: "SQLite", package: "SQLite.swift")],
2929
exclude: ["main.page"],
3030
swiftSettings: [
3131
.unsafeFlags(["-F", SCADE_SDK], .when(platforms: [.macOS, .iOS])),

IntervalTimer/Sources/IntervalTimer/Extensions/Pages/intervalTimer.page.ext.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extension IntervalTimerPageAdapter {
4848
var workTimeLabel: SCDWidgetsLabel {
4949
return self.page?.getWidgetByName("workTimeLabel") as! SCDWidgetsLabel
5050
}
51-
51+
5252
var container2: SCDWidgetsContainer {
5353
return self.page?.getWidgetByName("container2") as! SCDWidgetsContainer
5454
}

IntervalTimer/Sources/IntervalTimer/Extensions/Pages/intervalTimerScreen.page.ext.swift

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extension IntervalTimerScreenPageAdapter {
1313
return self.page?.getWidgetByName("backButton") as! SCDWidgetsButton
1414
}
1515

16+
1617
var timerLabel: SCDWidgetsLabel {
1718
return self.page?.getWidgetByName("timerLabel") as! SCDWidgetsLabel
1819
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import ScadeKit
2+
3+
extension SavingTimerScreenPageAdapter {
4+
var navigationBar: SCDWidgetsNavigationBar {
5+
return self.page?.getWidgetByName("navigationBar") as! SCDWidgetsNavigationBar
6+
}
7+
8+
var backButton: SCDWidgetsButton {
9+
return self.page?.getWidgetByName("backButton") as! SCDWidgetsButton
10+
}
11+
12+
var titleLabel: SCDWidgetsLabel {
13+
return self.page?.getWidgetByName("titleLabel") as! SCDWidgetsLabel
14+
}
15+
16+
var saveButton: SCDWidgetsButton {
17+
return self.page?.getWidgetByName("saveButton") as! SCDWidgetsButton
18+
}
19+
20+
var container1: SCDWidgetsContainer {
21+
return self.page?.getWidgetByName("container1") as! SCDWidgetsContainer
22+
}
23+
24+
var workLabel: SCDWidgetsLabel {
25+
return self.page?.getWidgetByName("workLabel") as! SCDWidgetsLabel
26+
}
27+
28+
var restLabel: SCDWidgetsLabel {
29+
return self.page?.getWidgetByName("restLabel") as! SCDWidgetsLabel
30+
}
31+
32+
var container2: SCDWidgetsContainer {
33+
return self.page?.getWidgetByName("container2") as! SCDWidgetsContainer
34+
}
35+
36+
var label1: SCDWidgetsLabel {
37+
return self.page?.getWidgetByName("label1") as! SCDWidgetsLabel
38+
}
39+
40+
var container3: SCDWidgetsContainer {
41+
return self.page?.getWidgetByName("container3") as! SCDWidgetsContainer
42+
}
43+
44+
var label2: SCDWidgetsLabel {
45+
return self.page?.getWidgetByName("label2") as! SCDWidgetsLabel
46+
}
47+
48+
var setLabel: SCDWidgetsLabel {
49+
return self.page?.getWidgetByName("setLabel") as! SCDWidgetsLabel
50+
}
51+
52+
var container: SCDWidgetsContainer {
53+
return self.page?.getWidgetByName("container") as! SCDWidgetsContainer
54+
}
55+
56+
var label: SCDWidgetsLabel {
57+
return self.page?.getWidgetByName("label") as! SCDWidgetsLabel
58+
}
59+
60+
var rowView1: SCDWidgetsRowView {
61+
return self.page?.getWidgetByName("rowView1") as! SCDWidgetsRowView
62+
}
63+
64+
var cancelButton: SCDWidgetsButton {
65+
return self.page?.getWidgetByName("cancelButton") as! SCDWidgetsButton
66+
}
67+
68+
var rowView2: SCDWidgetsRowView {
69+
return self.page?.getWidgetByName("rowView2") as! SCDWidgetsRowView
70+
}
71+
72+
var textbox: SCDWidgetsTextbox {
73+
return self.page?.getWidgetByName("textbox") as! SCDWidgetsTextbox
74+
}
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import ScadeKit
2+
3+
class TimersCollection: EObject {
4+
var id: Int64?
5+
var workInterval: Int
6+
var restInterval: Int
7+
var rounds: Int
8+
var timerName: String
9+
10+
init(id: Int64? = nil, workInterval: Int, restInterval: Int, rounds: Int, timerName: String) {
11+
self.id = id
12+
self.workInterval = workInterval
13+
self.restInterval = restInterval
14+
self.rounds = rounds
15+
self.timerName = timerName
16+
}
17+
18+
}

IntervalTimer/Sources/IntervalTimer/intervalTimer.page

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<xmi:XMI xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmi:version="2.0" xmi:id="0.6" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:graphics="http://scade.com/sdk/view/graphics" xmlns:layout="http://scade.com/sdk/layout" xmlns:navigation="http://scade.com/lattice/navigation" xmlns:widgets="http://scade.com/sdk/view/widgets">
3+
34
<widgets:Page name="intervalTimer">
45
<minArea width="414" height="736"/>
56
<location/>

IntervalTimer/Sources/IntervalTimer/intervalTimer.page.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class IntervalTimerPageAdapter: SCDLatticePageAdapter {
1111
var totalRestInSecs: Int?
1212
static var workTime: Int = 1
1313
static var restTime: Int = 1
14-
14+
1515
// page adapter initialization
1616
override func load(_ path: String) {
1717
super.load(path)
@@ -49,7 +49,7 @@ class IntervalTimerPageAdapter: SCDLatticePageAdapter {
4949
IntervalTimerPageAdapter.workTime = self.totalWorkInSecs!
5050
}
5151
}
52-
52+
5353
self.workMinusButton.onClick { _ in
5454
if self.workElapsedTime > 1 {
5555
self.workElapsedTime -= 1
@@ -134,7 +134,7 @@ class IntervalTimerPageAdapter: SCDLatticePageAdapter {
134134
self.toolBarItem1.onClick { _ in
135135
Navigation.go(.main, clearHistory: true)
136136
}
137-
137+
138138
}
139139

140140
}
Binary file not shown.

IntervalTimer/Sources/IntervalTimer/intervalTimerScreen.page.swift

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class IntervalTimerScreenPageAdapter: SCDLatticePageAdapter {
119119
self.configureFontStyle(of: self.timerLabel, off: whiteColor)
120120
self.timerLabel.text = "Completed!"
121121
}
122+
122123
}
123124

124125
func timerLabelInitialValue() {

0 commit comments

Comments
 (0)