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
faecedf5
Commit
faecedf5
authored
Jul 30, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cloud時の位置情報取得見直し
NGAデータ更新不具合修正
parent
695c323b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
33 deletions
+75
-33
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+3
-3
GetMessage.swift
Seilassist/Sailassist/Chat/GetMessage.swift
+2
-0
LocationViewModel.swift
Seilassist/Sailassist/LocationViewModel.swift
+22
-9
LoginView.swift
Seilassist/Sailassist/Login/LoginView.swift
+1
-0
MenuGpsSelectView.swift
Seilassist/Sailassist/Menu/View/MenuGpsSelectView.swift
+2
-2
GetNgaList.swift
Seilassist/Sailassist/NGA/GetNgaList.swift
+45
-19
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
faecedf5
...
@@ -1307,7 +1307,7 @@
...
@@ -1307,7 +1307,7 @@
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_IDENTITY
=
"Apple Development"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
3
;
CURRENT_PROJECT_VERSION
=
4
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
@@ -1353,7 +1353,7 @@
...
@@ -1353,7 +1353,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
3
;
CURRENT_PROJECT_VERSION
=
4
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
@@ -1536,7 +1536,7 @@
...
@@ -1536,7 +1536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
Sailassist/Sailassist.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
4
3
;
CURRENT_PROJECT_VERSION
=
4
4
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_ASSET_PATHS
=
"\"Sailassist/Preview Content\""
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
DEVELOPMENT_TEAM
=
D2DC7QNNJ8
;
ENABLE_PREVIEWS
=
YES
;
ENABLE_PREVIEWS
=
YES
;
...
...
Seilassist/Sailassist/Chat/GetMessage.swift
View file @
faecedf5
...
@@ -63,6 +63,8 @@ class GetMessage {
...
@@ -63,6 +63,8 @@ class GetMessage {
* 既読通知
* 既読通知
*/
*/
func
readNotification
()
{
func
readNotification
()
{
// let id = SharingData.my.id
// let msg = SharingData.message.messages
for
message
in
SharingData
.
message
.
messages
{
for
message
in
SharingData
.
message
.
messages
{
//Sail Assist側で既読が無い場合(既読確認)
//Sail Assist側で既読が無い場合(既読確認)
var
unRead
=
true
var
unRead
=
true
...
...
Seilassist/Sailassist/LocationViewModel.swift
View file @
faecedf5
...
@@ -11,6 +11,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -11,6 +11,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
@Published
var
authorizationStatus
:
CLAuthorizationStatus
@Published
var
authorizationStatus
:
CLAuthorizationStatus
var
lastSeenLocation
:
CLLocation
?
var
lastSeenLocation
:
CLLocation
?
var
serverLocationInterval
:
Int64
=
0
var
serverLocationInterval
:
Int64
=
0
var
serverDataUpdateInterval
:
Int64
=
0
private
let
locationManager
:
CLLocationManager
private
let
locationManager
:
CLLocationManager
let
ecaTask
=
EcaTask
()
let
ecaTask
=
EcaTask
()
...
@@ -76,26 +77,29 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -76,26 +77,29 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
}
}
func
locationManager
(
_
manager
:
CLLocationManager
,
didUpdateLocations
locations
:
[
CLLocation
])
{
func
locationManager
(
_
manager
:
CLLocationManager
,
didUpdateLocations
locations
:
[
CLLocation
])
{
let
eca
=
EcaTask
()
eca
.
start
()
let
ngaList
=
GetNgaList
()
ngaList
.
start
()
if
let
newLocation
=
locations
.
first
{
if
let
newLocation
=
locations
.
first
{
// print(debug: "called locationManager")
lastSeenLocation
=
newLocation
lastSeenLocation
=
newLocation
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
SharingData
.
location
.
gps
=
targetCoordinate
SharingData
.
location
.
gps
=
targetCoordinate
SharingData
.
location
.
setLocation
()
SharingData
.
location
.
setLocation
()
//Mobile Phone GPS
if
Preferences
.
LocationType
==
0
{
if
Preferences
.
LocationType
==
0
{
ecaTask
.
checkEca
()
if
serverLocationInterval
<=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
{
ngaTask
.
checkNga
()
self
.
ecaTask
.
checkEca
()
self
.
ngaTask
.
checkNga
()
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
TimerInterval
)
}
}
}
}
}
//Cloud GPS
if
Preferences
.
LocationType
==
1
{
if
Preferences
.
LocationType
==
1
{
//位置情報更新
let
eca
=
EcaTask
()
eca
.
start
()
if
serverLocationInterval
<=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
{
if
serverLocationInterval
<=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
{
self
.
ecaTask
.
checkEca
()
self
.
ecaTask
.
checkEca
()
self
.
ngaTask
.
checkNga
()
self
.
ngaTask
.
checkNga
()
...
@@ -103,6 +107,15 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -103,6 +107,15 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
TimerInterval
)
serverLocationInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
TimerInterval
)
}
}
}
}
//データ更新
if
serverDataUpdateInterval
<=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
{
print
(
debug
:
"update data"
)
let
ngaList
=
GetNgaList
()
ngaList
.
start
()
serverDataUpdateInterval
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
+
Int64
(
UpdateTime
)
}
}
}
// func filterLocation(_ location: CLLocation) -> Bool {
// func filterLocation(_ location: CLLocation) -> Bool {
...
...
Seilassist/Sailassist/Login/LoginView.swift
View file @
faecedf5
...
@@ -32,6 +32,7 @@ class LoginViewParam: ObservableObject{
...
@@ -32,6 +32,7 @@ class LoginViewParam: ObservableObject{
}
}
let
TimerInterval
=
60.0
let
TimerInterval
=
60.0
let
UpdateTime
=
360.0
struct
LoginView
:
View
{
struct
LoginView
:
View
{
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
...
...
Seilassist/Sailassist/Menu/View/MenuGpsSelectView.swift
View file @
faecedf5
...
@@ -52,9 +52,9 @@ struct MenuGpsSelectView: View {
...
@@ -52,9 +52,9 @@ struct MenuGpsSelectView: View {
Button
{
Button
{
selected
=
content
selected
=
content
if
content
==
.
Mobile
{
if
content
==
.
Mobile
{
Preferences
.
LocationType
=
0
Preferences
.
LocationType
=
0
//Mobile Phone GPS
}
else
{
}
else
{
Preferences
.
LocationType
=
1
Preferences
.
LocationType
=
1
//Cloud GPS
}
}
SharingData
.
location
.
setLocation
()
SharingData
.
location
.
setLocation
()
}
label
:{
}
label
:{
...
...
Seilassist/Sailassist/NGA/GetNgaList.swift
View file @
faecedf5
...
@@ -23,22 +23,10 @@ class GetNgaList {
...
@@ -23,22 +23,10 @@ class GetNgaList {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
[
ReqNgaList
]
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
[
ReqNgaList
]
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
var
nga
Areas
=
ngaData
.
ngaArea
var
nga
Tmp
:
Dictionary
<
UUID
,
RegisteredNga
>
=
[:]
for
ngaList
in
res
{
for
ngaList
in
res
{
if
let
id
=
NSUUID
(
uuidString
:
ngaList
.
id
)
{
if
let
id
=
NSUUID
(
uuidString
:
ngaList
.
id
)
{
if
var
nga
=
ngaAreas
[
id
as
UUID
]
{
if
var
nga
=
RegisteredNga
(
areaName
:
""
)
{
if
let
name
=
ngaList
.
name
{
nga
.
name
=
name
}
nga
.
isLock
=
ngaList
.
lock
nga
.
points
.
removeAll
()
for
pos
in
ngaList
.
geometry
{
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
nga
.
points
.
append
(
point
)
}
ngaAreas
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
}
else
{
if
var
nga
=
RegisteredNga
(
areaName
:
"test dammy"
)
{
//TODO: 名称はダミー
nga
.
areaId
=
id
as
UUID
nga
.
areaId
=
id
as
UUID
if
let
name
=
ngaList
.
name
{
if
let
name
=
ngaList
.
name
{
nga
.
name
=
name
nga
.
name
=
name
...
@@ -53,15 +41,53 @@ class GetNgaList {
...
@@ -53,15 +41,53 @@ class GetNgaList {
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
let
point
=
CLLocationCoordinate2D
(
latitude
:
pos
.
lat
!
,
longitude
:
pos
.
lon
!
)
nga
.
points
.
append
(
point
)
nga
.
points
.
append
(
point
)
}
}
ngaAreas
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
ngaTmp
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
}
}
}
}
for
ares
in
ngaAreas
{
ngaData
.
setNgaArea
(
key
:
ares
.
value
.
areaId
,
value
:
ares
.
value
)
}
}
}
}
ngaData
.
ngaArea
=
[:]
ngaData
.
ngaArea
=
ngaTmp
}
}
// if let res = resjson {
// var ngaAreas = ngaData.ngaArea
// 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
// nga.points.removeAll()
// for pos in ngaList.geometry{
// let point = CLLocationCoordinate2D(latitude: pos.lat!, longitude: pos.lon!)
// nga.points.append(point)
// }
// ngaAreas.updateValue(nga, forKey: nga.areaId)
// } else {
// if var nga = RegisteredNga(areaName: "test dammy") { //TODO: 名称はダミー
// 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)
// }
// ngaAreas.updateValue(nga, forKey: nga.areaId)
// }
// }
// }
// for ares in ngaAreas {
// ngaData.setNgaArea(key: ares.value.areaId, value: ares.value)
// }
// }
// }
case
.
failure
(
let
errorCode
):
case
.
failure
(
let
errorCode
):
print
(
debug
:
errorCode
)
print
(
debug
:
errorCode
)
break
break
...
...
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