Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
1
1weather
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
1weather
Commits
68b65e12
Commit
68b65e12
authored
Oct 07, 2021
by
Demid Merzlyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minutely: CoreData fixes.
parent
a989dda1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
CoreDataStorage/CoreDataStorage/1WModel.xcdatamodeld/1.2.xcdatamodel/contents
+3
-4
CoreDataStorage/CoreDataStorage/Objects/Human/CoreMinutelyItem.swift
+4
-1
CoreDataStorage/CoreDataStorage/Objects/Machine/_CoreMinutelyItem.swift
+1
-1
No files found.
CoreDataStorage/CoreDataStorage/1WModel.xcdatamodeld/1.2.xcdatamodel/contents
View file @
68b65e12
...
...
@@ -108,7 +108,7 @@
<relationship
name=
"location"
maxCount=
"1"
deletionRule=
"Nullify"
destinationEntity=
"CoreLocation"
inverseName=
"minutely"
inverseEntity=
"CoreLocation"
/>
</entity>
<entity
name=
"CoreMinutelyItem"
representedClassName=
"CoreMinutelyItem"
syncable=
"YES"
>
<attribute
name=
"precipitation"
attributeType=
"
Double"
defaultValueString=
"0.0"
usesScalarValueType=
"YES
"
/>
<attribute
name=
"precipitation"
attributeType=
"
Binary
"
/>
<attribute
name=
"pressure"
attributeType=
"Binary"
/>
<attribute
name=
"temp"
attributeType=
"Binary"
/>
<attribute
name=
"time"
attributeType=
"Date"
usesScalarValueType=
"NO"
/>
...
...
@@ -146,10 +146,10 @@
<element
name=
"CoreHealth"
positionX=
"277.1640625"
positionY=
"-156.77734375"
width=
"128"
height=
"103"
/>
<element
name=
"CoreHourlyWeather"
positionX=
"279.15234375"
positionY=
"-29.234375"
width=
"128"
height=
"253"
/>
<element
name=
"CoreLocation"
positionX=
"113.6640625"
positionY=
"-337.08984375"
width=
"128"
height=
"329"
/>
<element
name=
"CoreMinutelyForecast"
positionX=
"-90"
positionY=
"-324"
width=
"128"
height=
"74"
/>
<element
name=
"CoreMinutelyItem"
positionX=
"-81"
positionY=
"-315"
width=
"128"
height=
"119"
/>
<element
name=
"CoreNotifications"
positionX=
"-153.28125"
positionY=
"-336.6484375"
width=
"128"
height=
"88"
/>
<element
name=
"CoreNWSAlert"
positionX=
"-315.77734375"
positionY=
"-337.84375"
width=
"128"
height=
"208"
/>
<element
name=
"CorePollutant"
positionX=
"438.171875"
positionY=
"-103.41015625"
width=
"128"
height=
"88"
/>
<element
name=
"CoreMinutelyForecast"
positionX=
"-90"
positionY=
"-324"
width=
"128"
height=
"74"
/>
<element
name=
"CoreMinutelyItem"
positionX=
"-81"
positionY=
"-315"
width=
"128"
height=
"119"
/>
</elements>
</model>
\ No newline at end of file
CoreDataStorage/CoreDataStorage/Objects/Human/CoreMinutelyItem.swift
View file @
68b65e12
...
...
@@ -14,6 +14,9 @@ open class CoreMinutelyItem: _CoreMinutelyItem, CoreDataAppModelConvertable {
guard
let
pressure
:
Pressure
=
try
CoreDataUtils
.
measurement
(
from
:
self
.
pressure
,
in
:
self
,
attributeName
:
"pressure"
)
else
{
throw
CoreDataError
.
LoadAttributeError
(
entity
:
self
,
attributeName
:
"pressure"
,
value
:
self
.
pressure
,
nestedError
:
nil
)
}
guard
let
precipitation
:
Rainfall
=
try
CoreDataUtils
.
measurement
(
from
:
self
.
precipitation
,
in
:
self
,
attributeName
:
"precipitation"
)
else
{
throw
CoreDataError
.
LoadAttributeError
(
entity
:
self
,
attributeName
:
"precipitation"
,
value
:
self
.
precipitation
,
nestedError
:
nil
)
}
return
MinutelyItem
(
time
:
time
,
temp
:
temp
,
precipitation
:
precipitation
,
windSpeed
:
windSpeed
,
pressure
:
pressure
)
}
...
...
@@ -30,7 +33,7 @@ open class CoreMinutelyItem: _CoreMinutelyItem, CoreDataAppModelConvertable {
self
.
init
(
managedObjectContext
:
context
)
self
.
time
=
appModel
.
time
self
.
precipitation
=
appModel
.
precipitation
self
.
precipitation
=
try
CoreDataUtils
.
measurementToData
(
appModel
.
precipitation
,
in
:
self
,
attributeName
:
"precipitation"
)
self
.
temp
=
try
CoreDataUtils
.
measurementToData
(
appModel
.
temp
,
in
:
self
,
attributeName
:
"temp"
)
self
.
windSpeed
=
try
CoreDataUtils
.
measurementToData
(
appModel
.
windSpeed
,
in
:
self
,
attributeName
:
"windSpeed"
)
...
...
CoreDataStorage/CoreDataStorage/Objects/Machine/_CoreMinutelyItem.swift
View file @
68b65e12
...
...
@@ -47,7 +47,7 @@ open class _CoreMinutelyItem: NSManagedObject {
// MARK: - Properties
@NSManaged
open
var
precipitation
:
D
ouble
var
precipitation
:
D
ata
!
@NSManaged
open
var
pressure
:
Data
!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment