Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
334a7e11
Commit
334a7e11
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: db, add BodyOfWater entity
parent
0edb98f6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/pages/marker_handler/marker_data.dart
+3
-0
3 additions, 0 deletions
app/lib/pages/marker_handler/marker_data.dart
server/sql_db/icedb
+0
-0
0 additions, 0 deletions
server/sql_db/icedb
server/sql_db/schema.sql
+10
-1
10 additions, 1 deletion
server/sql_db/schema.sql
with
13 additions
and
1 deletion
app/lib/pages/marker_handler/marker_data.dart
+
3
−
0
View file @
334a7e11
...
...
@@ -4,6 +4,7 @@ class Measurement {
Sensor
sensor
;
List
<
Data
>
dataList
;
List
<
Corner
>
cornerList
;
String
bodyOfWater
;
Measurement
({
required
this
.
measurementID
,
...
...
@@ -11,6 +12,7 @@ class Measurement {
required
this
.
sensor
,
required
this
.
dataList
,
required
this
.
cornerList
,
required
this
.
bodyOfWater
,
});
factory
Measurement
.
Measurement
(
Map
<
String
,
dynamic
>
json
)
{
...
...
@@ -24,6 +26,7 @@ class Measurement {
cornerList:
(
json
[
'Corner'
]
as
List
<
dynamic
>)
.
map
((
data
)
=
>
Corner
.
fromJson
(
data
))
.
toList
(),
bodyOfWater:
json
[
'WaterBodyName'
],
);
}
}
...
...
This diff is collapsed.
Click to expand it.
server/sql_db/icedb
+
0
−
0
View file @
334a7e11
No preview for this file type
This diff is collapsed.
Click to expand it.
server/sql_db/schema.sql
+
10
−
1
View file @
334a7e11
...
...
@@ -2,7 +2,9 @@ CREATE TABLE Measurement (
MeasurementID
INT
PRIMARY
KEY
,
SensorID
INT
,
TimeMeasured
DATETIME
,
FOREIGN
KEY
(
SensorID
)
REFERENCES
Sensor
(
SensorID
)
WaterBodyName
TEXT
,
FOREIGN
KEY
(
SensorID
)
REFERENCES
Sensor
(
SensorID
),
FOREIGN
KEY
(
WaterBodyName
)
REFERENCES
BodyOfWater
(
Name
)
);
CREATE
TABLE
Sensor
(
...
...
@@ -32,6 +34,10 @@ CREATE TABLE Corner (
FOREIGN
KEY
(
MeasurementID
)
REFERENCES
Measurement
(
MeasurementID
)
);
CREATE
TABLE
BodyOfWater
(
Name
TEXT
PRIMARY
KEY
);
INSERT
INTO
Sensor
(
SensorID
,
SensorType
,
Active
)
VALUES
(
1
,
'LiDar'
,
1
),
(
2
,
'Magnetic'
,
1
),
...
...
@@ -84,3 +90,6 @@ INSERT INTO Corner (CornerID, MeasurementID, CornerLatitude, CornerLongitude) VA
(
2
,
3
,
60
.
7361
,
10
.
8471
),
(
3
,
3
,
60
.
7362
,
10
.
8472
),
(
4
,
3
,
60
.
7363
,
10
.
8473
);
INSERT
INTO
BodyOfWater
(
Name
)
VALUES
(
'Mjosa'
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment