Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CpjJwWHV
Sailassist
Commits
92a39654
Commit
92a39654
authored
Aug 01, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NGAデータ更新修正
タスク確認見直し
parent
faecedf5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
38 deletions
+107
-38
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+3
-3
LocationViewModel.swift
Seilassist/Sailassist/LocationViewModel.swift
+5
-2
LoginView.swift
Seilassist/Sailassist/Login/LoginView.swift
+0
-7
GetNgaList.swift
Seilassist/Sailassist/NGA/GetNgaList.swift
+94
-26
RegistereNga.swift
Seilassist/Sailassist/NGA/RegistereNga.swift
+1
-0
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+4
-0
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
92a39654
...
...
@@ -1307,7 +1307,7 @@
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
4
;
CURRENT_PROJECT_VERSION
=
4
5
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
@@ -1353,7 +1353,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
4
;
CURRENT_PROJECT_VERSION
=
4
5
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
@@ -1536,7 +1536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
4
;
CURRENT_PROJECT_VERSION
=
4
5
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
...
...
Seilassist/Sailassist/LocationViewModel.swift
View file @
92a39654
...
...
@@ -7,6 +7,9 @@
import
CoreLocation
let
taskCheckTime
=
5.0
let
UpdateTime
=
360.0
class
LocationViewModel
:
NSObject
,
ObservableObject
,
CLLocationManagerDelegate
{
@Published
var
authorizationStatus
:
CLAuthorizationStatus
var
lastSeenLocation
:
CLLocation
?
...
...
@@ -89,7 +92,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
self
.
ecaTask
.
checkEca
()
self
.
ngaTask
.
checkNga
()
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
TimerInterval
)
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
taskCheckTime
)
}
}
}
...
...
@@ -104,7 +107,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
self
.
ecaTask
.
checkEca
()
self
.
ngaTask
.
checkNga
()
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
TimerInterval
)
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
taskCheckTime
)
}
}
...
...
Seilassist/Sailassist/Login/LoginView.swift
View file @
92a39654
...
...
@@ -32,7 +32,6 @@ class LoginViewParam: ObservableObject{
}
let
TimerInterval
=
60.0
let
UpdateTime
=
360.0
struct
LoginView
:
View
{
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
...
...
@@ -216,18 +215,12 @@ struct LoginView: View {
timer
=
Timer
.
scheduledTimer
(
withTimeInterval
:
TimerInterval
,
repeats
:
true
)
{
_
in
print
(
debug
:
"called timer"
)
let
eca
=
EcaTask
()
eca
.
start
()
let
route
=
MonitoringRoute
()
route
.
start
()
let
ecaList
=
GetEcaList
()
ecaList
.
start
()
let
ngaList
=
GetNgaList
()
ngaList
.
start
()
let
pushHistory
=
GetPushHistory
()
pushHistory
.
start
()
}
...
...
Seilassist/Sailassist/NGA/GetNgaList.swift
View file @
92a39654
...
...
@@ -22,32 +22,33 @@ class GetNgaList {
case
.
success
(
let
resultData
):
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
[
ReqNgaList
]
.
self
)
if
let
res
=
resjson
{
var
ngaTmp
:
Dictionary
<
UUID
,
RegisteredNga
>
=
[:]
for
ngaList
in
res
{
if
let
id
=
NSUUID
(
uuidString
:
ngaList
.
id
)
{
if
var
nga
=
RegisteredNga
(
areaName
:
""
)
{
nga
.
areaId
=
id
as
UUID
if
let
name
=
ngaList
.
name
{
nga
.
name
=
name
}
nga
.
isLock
=
ngaList
.
lock
nga
.
isRunning
=
ngaList
.
enabled
if
!
ngaList
.
enabled
{
nga
.
passingCnt
=
0
}
nga
.
color
=
Color
.
green
.
description
for
pos
in
ngaList
.
geometry
{
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
nga
.
points
.
append
(
point
)
}
ngaTmp
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
}
}
}
ngaData
.
ngaArea
=
[:]
ngaData
.
ngaArea
=
ngaTmp
}
// if let res = resjson {
// var ngaTmp: Dictionary<UUID, RegisteredNga> = [:]
// for ngaList in res {
// if let id = NSUUID(uuidString: ngaList.id) {
// if var nga = RegisteredNga(areaName: "") {
// nga.areaId = id as UUID
// if let name = ngaList.name {
// nga.name = name
// }
// nga.isLock = ngaList.lock
// nga.isRunning = ngaList.enabled
// if !ngaList.enabled {
// nga.passingCnt = 0
// }
// nga.color = Color.green.description
// for pos in ngaList.geometry{
// let point = CLLocationCoordinate2D(latitude: pos.lat!, longitude: pos.lon!)
// nga.points.append(point)
// }
// ngaTmp.updateValue(nga, forKey: nga.areaId)
// }
// }
// }
// ngaData.ngaArea = [:]
// ngaData.ngaArea = ngaTmp
// }
// if let res = resjson {
// var ngaAreas = ngaData.ngaArea
// for ngaList in res {
...
...
@@ -88,6 +89,73 @@ class GetNgaList {
// }
// }
// }
if
let
res
=
resjson
{
var
ngaAreas
=
ngaData
.
ngaArea
//更新確認用フラグ
for
area
in
ngaAreas
{
var
areaData
=
area
.
value
areaData
.
isUpdate
=
false
ngaAreas
.
updateValue
(
areaData
,
forKey
:
area
.
value
.
areaId
)
}
for
ngaList
in
res
{
if
let
id
=
NSUUID
(
uuidString
:
ngaList
.
id
)
{
if
var
nga
=
ngaAreas
[
id
as
UUID
]
{
//更新
if
let
name
=
ngaList
.
name
{
nga
.
name
=
name
}
nga
.
isLock
=
ngaList
.
lock
if
ngaList
.
enabled
{
if
!
nga
.
isRunning
{
nga
.
passingCnt
=
0
}
nga
.
isRunning
=
true
}
else
{
nga
.
passingCnt
=
0
nga
.
isRunning
=
false
}
nga
.
points
.
removeAll
()
for
pos
in
ngaList
.
geometry
{
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
nga
.
points
.
append
(
point
)
}
nga
.
isUpdate
=
true
ngaAreas
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
}
else
{
//追加
if
var
nga
=
RegisteredNga
(
areaName
:
""
)
{
nga
.
areaId
=
id
as
UUID
if
let
name
=
ngaList
.
name
{
nga
.
name
=
name
}
nga
.
isLock
=
ngaList
.
lock
nga
.
color
=
Color
.
green
.
description
nga
.
isRunning
=
ngaList
.
enabled
nga
.
passingCnt
=
0
for
pos
in
ngaList
.
geometry
{
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
nga
.
points
.
append
(
point
)
}
nga
.
isUpdate
=
true
ngaAreas
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
}
}
}
}
//更新と削除
for
area
in
ngaAreas
{
if
area
.
value
.
isUpdate
{
ngaData
.
setNgaArea
(
key
:
area
.
value
.
areaId
,
value
:
area
.
value
)
}
else
{
ngaData
.
deleteNgaArea
(
key
:
area
.
value
.
areaId
)
}
}
}
case
.
failure
(
let
errorCode
):
print
(
debug
:
errorCode
)
break
...
...
Seilassist/Sailassist/NGA/RegistereNga.swift
View file @
92a39654
...
...
@@ -29,6 +29,7 @@ struct RegisteredNga {
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
var
color
=
Color
.
green
.
description
//ライン色(ARGB)
var
width
:
Int
=
1
//ライン幅
var
isUpdate
:
Bool
=
false
var
points
:
[
CLLocationCoordinate2D
]
=
[]
init
?(
areaName
:
String
)
{
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
92a39654
...
...
@@ -299,6 +299,10 @@ class SharingData{
ngaArea
.
updateValue
(
value
,
forKey
:
key
)
}
func
deleteNgaArea
(
key
:
UUID
)
{
ngaArea
.
removeValue
(
forKey
:
key
)
}
func
editNgaArea
(
value
:
RegisteredNga
,
type
:
NgaOperation
)
{
let
setNgaArea
=
SetNgaArea
()
var
task
=
ReqNgaList
(
Id
:
value
.
areaId
.
uuidString
)
...
...
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