Skip to content

Commit 859c50b

Browse files
authored
Add new default experiment (#53)
1 parent 81b6cb0 commit 859c50b

File tree

19 files changed

+23
-212
lines changed

19 files changed

+23
-212
lines changed

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_action_area.imageset/Contents.jsonrenamed to ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_getting_started.imageset/Contents.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"images" : [
33
{
4-
"filename" : "default_experiment_action_area.png",
4+
"filename" : "default_experiment_getting_started.png",
55
"idiom" : "universal",
66
"scale" : "1x"
77
},

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_new_experiment.imageset/Contents.json

-21
This file was deleted.

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_note_button.imageset/Contents.json

-21
This file was deleted.

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_record_button.imageset/Contents.json

-21
This file was deleted.

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_sensor_button.imageset/Contents.json

-21
This file was deleted.

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_sensor_settings.imageset/Contents.json

-21
This file was deleted.

ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_camera.imageset/Contents.jsonrenamed to ScienceJournal/Assets.xcassets/Default Experiment/default_experiment_website.imageset/Contents.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"images" : [
33
{
4-
"filename" : "default_experiment_camera.png",
4+
"filename" : "default_experiment_website.png",
55
"idiom" : "universal",
66
"scale" : "1x"
77
},

ScienceJournal/Metadata/DefaultExperimentComposer.swift

+17-105
Original file line numberDiff line numberDiff line change
@@ -34,145 +34,57 @@ class DefaultExperimentComposer {
3434

3535
//TODO localize content
3636
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)
4840
}
4941

50-
// swiftlint:disable line_length
5142
privatefunc addIntroImage(experiment:Experiment){
5243
iflet defaultExperimentPicture =UIImage(named:"default_experiment_picture"){
5344
letcoverPicturePath= metaDataManager.relativePicturePath(for:"default_experiment_picture")
5445
metaDataManager.saveImage(defaultExperimentPicture, atPicturePath: coverPicturePath, experimentID: experiment.ID)
5546
letpictureNote=PictureNote()
5647
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)
6049
pictureNote.filePath = coverPicturePath
6150
experiment.notes.append(pictureNote)
6251
metaDataManager.updateCoverImageForAddedImageIfNeeded(imagePath: coverPicturePath, experiment: experiment)
6352
}
6453
}
6554

66-
privatefunc addIntroNote(experiment:Experiment){
67-
//let textNote = TextNote(text: String.firstExperimentTextNote)
68-
lettextNote=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-
privatefunc addNewExperimentNote(experiment:Experiment){
74-
iflet picture =UIImage(named:"default_experiment_new_experiment"){
75-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_new_experiment")
76-
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
77-
letpictureNote=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-
privatefunc addToolbarNote(experiment:Experiment){
55+
privatefunc addActionAreaImage(experiment:Experiment){
8856
iflet picture =UIImage(named:"default_experiment_toolbar"){
8957
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_toolbar")
9058
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
9159
letpictureNote=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-
privatefunc addActionAreaNote(experiment:Experiment){
100-
iflet picture =UIImage(named:"default_experiment_action_area"){
101-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_action_area")
102-
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
103-
letpictureNote=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-
privatefunc addSensorNote(experiment:Experiment){
112-
iflet picture =UIImage(named:"default_experiment_sensor_button"){
113-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_sensor_button")
114-
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
115-
letpictureNote=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-
privatefunc addSensorSettingsNote(experiment:Experiment){
124-
iflet picture =UIImage(named:"default_experiment_sensor_settings"){
125-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_sensor_settings")
126-
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
127-
letpictureNote=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)
13062
pictureNote.filePath = picturePath
13163
experiment.notes.append(pictureNote)
13264
}
13365
}
13466

135-
privatefuncaddNotesNote(experiment:Experiment){
136-
iflet picture =UIImage(named:"default_experiment_note_button"){
137-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_note_button")
67+
privatefuncaddWebsiteImage(experiment:Experiment){
68+
iflet picture =UIImage(named:"default_experiment_website"){
69+
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_website")
13870
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
13971
letpictureNote=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-
privatefunc addSnapshotNote(experiment:Experiment){
148-
iflet picture =UIImage(named:"default_experiment_snapshot_button"){
149-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_snapshot_button")
150-
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
151-
letpictureNote=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)
15474
pictureNote.filePath = picturePath
15575
experiment.notes.append(pictureNote)
15676
}
15777
}
15878

159-
privatefuncaddPhotosNote(experiment:Experiment){
160-
iflet picture =UIImage(named:"default_experiment_camera"){
161-
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_camera")
79+
privatefuncaddSidebarImage(experiment:Experiment){
80+
iflet picture =UIImage(named:"default_experiment_getting_started"){
81+
letpicturePath= metaDataManager.relativePicturePath(for:"default_experiment_getting_started")
16282
metaDataManager.saveImage(picture, atPicturePath: picturePath, experimentID: experiment.ID)
16383
letpictureNote=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)
16686
pictureNote.filePath = picturePath
16787
experiment.notes.append(pictureNote)
16888
}
16989
}
170-
171-
privatefunc addActivitiesNote(experiment:Experiment){
172-
lettextNote=TextNote(text:"Find activities to try at\nscience-journal.arduino.cc\n\nNow 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
17890
}

ScienceJournal/Strings/ScienceJournalStrings.swift

+4
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ extension String {
290290
staticpublicvarexportOptionsTitle:String{return"export_options_title".localized }
291291
staticpublicvarexportPdfModalTitle:String{return"export_pdf_modal_title".localized }
292292
staticpublicvarexportPhotoChooserTitle:String{return"export_photo_chooser_title".localized }
293+
staticpublicvarfirstExperimentNote1:String{return"first_experiment_note_1".localized }
294+
staticpublicvarfirstExperimentNote2:String{return"first_experiment_note_2".localized }
295+
staticpublicvarfirstExperimentNote3:String{return"first_experiment_note_3".localized }
296+
staticpublicvarfirstExperimentNote4:String{return"first_experiment_note_4".localized }
293297
staticpublicvarfirstExperimentPictureNoteCaption:String{return"first_experiment_picture_note_caption".localized }
294298
staticpublicvarfirstExperimentSecondTextNote:String{return"first_experiment_second_text_note".localized }
295299
staticpublicvarfirstExperimentTextNote:String{return"first_experiment_text_note".localized }

0 commit comments

Comments
 (0)
close