@@ -34,145 +34,57 @@ class DefaultExperimentComposer {
34
34
35
35
//TODO localize content
36
36
addIntroImage ( experiment: experiment)
37
- addIntroNote ( experiment: experiment)
38
- addNewExperimentNote ( experiment: experiment)
39
- addToolbarNote ( experiment: experiment)
40
- //addActionAreaNote(experiment: experiment)
41
- addSensorNote ( experiment: experiment)
42
- addSensorSettingsNote ( experiment: experiment)
43
- addNotesNote ( experiment: experiment)
44
- addSnapshotNote ( experiment: experiment)
45
- addPhotosNote ( experiment: experiment)
46
- addActivitiesNote ( experiment: experiment)
47
-
37
+ addActionAreaImage ( experiment: experiment)
38
+ addWebsiteImage ( experiment: experiment)
39
+ addSidebarImage ( experiment: experiment)
48
40
}
49
41
50
- // swiftlint:disable line_length
51
42
private func addIntroImage( experiment: Experiment ) {
52
43
if let defaultExperimentPicture = UIImage ( named: " default_experiment_picture " ) {
53
44
let coverPicturePath = metaDataManager. relativePicturePath ( for: " default_experiment_picture " )
54
45
metaDataManager. saveImage ( defaultExperimentPicture, atPicturePath: coverPicturePath, experimentID: experiment. ID)
55
46
let pictureNote = PictureNote ( )
56
47
pictureNote. timestamp = timestamp + 100
57
- pictureNote. caption = Caption ( text: " Shape your future! Reason with data and think like a real scientist! Turn your phone into a pocket science laboratory with tools to measure light, motion, sound and more! " )
58
-
59
- //pictureNote.caption = Caption(text: String.firstExperimentPictureNoteCaption)
48
+ pictureNote. caption = Caption ( text: String . firstExperimentNote1)
60
49
pictureNote. filePath = coverPicturePath
61
50
experiment. notes. append ( pictureNote)
62
51
metaDataManager. updateCoverImageForAddedImageIfNeeded ( imagePath: coverPicturePath, experiment: experiment)
63
52
}
64
53
}
65
54
66
- private func addIntroNote( experiment: Experiment ) {
67
- //let textNote = TextNote(text: String.firstExperimentTextNote)
68
- let textNote = TextNote ( text: " Arduino Science Journal is a digital science journal that you can use to document projects through notes, photos, and your phone's built-in sensors, as well as external boards. " )
69
- textNote. timestamp = timestamp + 200
70
- experiment. notes. append ( textNote)
71
- }
72
-
73
- private func addNewExperimentNote( experiment: Experiment ) {
74
- if let picture = UIImage ( named: " default_experiment_new_experiment " ) {
75
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_new_experiment " )
76
- metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
77
- let pictureNote = PictureNote ( )
78
- pictureNote. timestamp = timestamp + 300
79
- pictureNote. caption = Caption ( text: " To create a new experiment, click on the + in the bottom of the Arduino Science Journal app home screen. Then click on the pencil icon in the top to give your experiment a good name! " )
80
-
81
- //pictureNote.caption = Caption(text: String.firstExperimentPictureNoteCaption)
82
- pictureNote. filePath = picturePath
83
- experiment. notes. append ( pictureNote)
84
- }
85
- }
86
-
87
- private func addToolbarNote( experiment: Experiment ) {
55
+ private func addActionAreaImage( experiment: Experiment ) {
88
56
if let picture = UIImage ( named: " default_experiment_toolbar " ) {
89
57
let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_toolbar " )
90
58
metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
91
59
let pictureNote = PictureNote ( )
92
- pictureNote. timestamp = timestamp + 400
93
- pictureNote. caption = Caption ( text: " The observation toolbar in the app can help you record the data around you. Let’s take a closer look! " )
94
- pictureNote. filePath = picturePath
95
- experiment. notes. append ( pictureNote)
96
- }
97
- }
98
-
99
- private func addActionAreaNote( experiment: Experiment ) {
100
- if let picture = UIImage ( named: " default_experiment_action_area " ) {
101
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_action_area " )
102
- metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
103
- let pictureNote = PictureNote ( )
104
- pictureNote. timestamp = timestamp + 400
105
- pictureNote. caption = Caption ( text: " The observation toolbar in the app can help you record the data around you. Let’s take a closer look! " )
106
- pictureNote. filePath = picturePath
107
- experiment. notes. append ( pictureNote)
108
- }
109
- }
110
-
111
- private func addSensorNote( experiment: Experiment ) {
112
- if let picture = UIImage ( named: " default_experiment_sensor_button " ) {
113
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_sensor_button " )
114
- metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
115
- let pictureNote = PictureNote ( )
116
- pictureNote. timestamp = timestamp + 500
117
- pictureNote. caption = Caption ( text: " To start exploring your world by measuring light, sound, movement, and more, tap the Sensor button. " )
118
- pictureNote. filePath = picturePath
119
- experiment. notes. append ( pictureNote)
120
- }
121
- }
122
-
123
- private func addSensorSettingsNote( experiment: Experiment ) {
124
- if let picture = UIImage ( named: " default_experiment_sensor_settings " ) {
125
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_sensor_settings " )
126
- metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
127
- let pictureNote = PictureNote ( )
128
- pictureNote. timestamp = timestamp + 600
129
- pictureNote. caption = Caption ( text: " You can manage your sensors in the Sensor settings screen. Go back to the sensor tab in the toolbar and tap the Gear icon on the sensor card. " )
60
+ pictureNote. timestamp = timestamp + 200
61
+ pictureNote. caption = Caption ( text: String . firstExperimentNote2)
130
62
pictureNote. filePath = picturePath
131
63
experiment. notes. append ( pictureNote)
132
64
}
133
65
}
134
66
135
- private func addNotesNote ( experiment: Experiment ) {
136
- if let picture = UIImage ( named: " default_experiment_note_button " ) {
137
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_note_button " )
67
+ private func addWebsiteImage ( experiment: Experiment ) {
68
+ if let picture = UIImage ( named: " default_experiment_website " ) {
69
+ let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_website " )
138
70
metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
139
71
let pictureNote = PictureNote ( )
140
- pictureNote. timestamp = timestamp + 700
141
- pictureNote. caption = Caption ( text: " You can add notes and hypotheses to your experiments by tapping the Note icon. " )
142
- pictureNote. filePath = picturePath
143
- experiment. notes. append ( pictureNote)
144
- }
145
- }
146
-
147
- private func addSnapshotNote( experiment: Experiment ) {
148
- if let picture = UIImage ( named: " default_experiment_snapshot_button " ) {
149
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_snapshot_button " )
150
- metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
151
- let pictureNote = PictureNote ( )
152
- pictureNote. timestamp = timestamp + 800
153
- pictureNote. caption = Caption ( text: " To make note of a single sensor measurement, tap the Snapshot Sensor button. You can also record sensor data over time, select a sensor and press the Record button to start capturing data. " )
72
+ pictureNote. timestamp = timestamp + 300
73
+ pictureNote. caption = Caption ( text: String . firstExperimentNote3)
154
74
pictureNote. filePath = picturePath
155
75
experiment. notes. append ( pictureNote)
156
76
}
157
77
}
158
78
159
- private func addPhotosNote ( experiment: Experiment ) {
160
- if let picture = UIImage ( named: " default_experiment_camera " ) {
161
- let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_camera " )
79
+ private func addSidebarImage ( experiment: Experiment ) {
80
+ if let picture = UIImage ( named: " default_experiment_getting_started " ) {
81
+ let picturePath = metaDataManager. relativePicturePath ( for: " default_experiment_getting_started " )
162
82
metaDataManager. saveImage ( picture, atPicturePath: picturePath, experimentID: experiment. ID)
163
83
let pictureNote = PictureNote ( )
164
- pictureNote. timestamp = timestamp + 1000
165
- pictureNote. caption = Caption ( text: " Add camera shots, notes and photos to keep track of your observations while recording. " )
84
+ pictureNote. timestamp = timestamp + 400
85
+ pictureNote. caption = Caption ( text: String . firstExperimentNote4 )
166
86
pictureNote. filePath = picturePath
167
87
experiment. notes. append ( pictureNote)
168
88
}
169
89
}
170
-
171
- private func addActivitiesNote( experiment: Experiment ) {
172
- let textNote = TextNote ( text: " Find activities to try at \n science-journal.arduino.cc \n \n Now that you know the basics of using Arduino Science Journal, you can use it to conduct experiments and explore your world! " )
173
- textNote. timestamp = timestamp + 1100
174
- experiment. notes. append ( textNote)
175
- }
176
-
177
- // swiftlint:enable line_length
178
90
}
0 commit comments