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
20cc3a5e
Commit
20cc3a5e
authored
Nov 16, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sharingの書き方を変更
parent
a1620e01
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
83 additions
and
91 deletions
+83
-91
GetMessage.swift
Seilassist/Sailassist/Chat/GetMessage.swift
+3
-3
ContentView.swift
Seilassist/Sailassist/ContentView.swift
+1
-1
EcaCoordinatesTable.swift
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
+2
-2
EcaTask.swift
Seilassist/Sailassist/ECA/EcaTask.swift
+9
-9
RegisteredEca.swift
Seilassist/Sailassist/ECA/RegisteredEca.swift
+1
-1
LocationViewModel.swift
Seilassist/Sailassist/LocationViewModel.swift
+1
-1
LoginView.swift
Seilassist/Sailassist/Login/LoginView.swift
+5
-5
InputUserNameView.swift
Seilassist/Sailassist/Login/View/InputUserNameView.swift
+5
-5
MapRepresentable.swift
Seilassist/Sailassist/Map/MapRepresentable.swift
+4
-4
MonitoringRoute.swift
Seilassist/Sailassist/Map/MonitoringRoute.swift
+8
-8
EcaListView.swift
Seilassist/Sailassist/Map/Task/View/EcaListView.swift
+3
-4
EcaSettingView.swift
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
+1
-1
TaskSwitchingMenuView.swift
...sist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
+6
-6
SessionGetMessage.swift
Seilassist/Sailassist/ServerSession/SessionGetMessage.swift
+1
-1
SessionMonitoringRoute.swift
...ist/Sailassist/ServerSession/SessionMonitoringRoute.swift
+1
-1
SessionShipStatus.swift
Seilassist/Sailassist/ServerSession/SessionShipStatus.swift
+1
-1
SessionTaskList.swift
Seilassist/Sailassist/ServerSession/SessionTaskList.swift
+1
-1
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+30
-37
No files found.
Seilassist/Sailassist/Chat/GetMessage.swift
View file @
20cc3a5e
...
@@ -22,10 +22,10 @@ class GetMessage {
...
@@ -22,10 +22,10 @@ class GetMessage {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResGetMessages
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResGetMessages
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
SharingData
.
M
essage
.
mode
=
res
.
mode
SharingData
.
m
essage
.
mode
=
res
.
mode
SharingData
.
M
essage
.
messages
=
[]
SharingData
.
m
essage
.
messages
=
[]
if
let
msg
=
res
.
messages
{
if
let
msg
=
res
.
messages
{
SharingData
.
M
essage
.
messages
=
msg
SharingData
.
m
essage
.
messages
=
msg
}
}
}
}
case
.
failure
(
let
errorCode
):
case
.
failure
(
let
errorCode
):
...
...
Seilassist/Sailassist/ContentView.swift
View file @
20cc3a5e
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
SwiftUI
import
SwiftUI
struct
ContentView
:
View
{
struct
ContentView
:
View
{
@State
var
isLogin
=
fals
e
//ContentView.LoginCheck()
@State
var
isLogin
=
tru
e
//ContentView.LoginCheck()
@EnvironmentObject
private
var
sceneDelegate
:
SceneDelegate
@EnvironmentObject
private
var
sceneDelegate
:
SceneDelegate
@StateObject
var
locationViewModel
=
LocationViewModel
()
@StateObject
var
locationViewModel
=
LocationViewModel
()
var
selectedTabModel
=
SelectedTabModel
()
var
selectedTabModel
=
SelectedTabModel
()
...
...
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
View file @
20cc3a5e
...
@@ -4335,11 +4335,11 @@ class EcaCoordinatesTable : NSObject {
...
@@ -4335,11 +4335,11 @@ class EcaCoordinatesTable : NSObject {
func
setEcaData
()
{
func
setEcaData
()
{
for
data
in
ecaDataTable
{
for
data
in
ecaDataTable
{
if
!
SharingData
.
shared
.
ecaArea
.
keys
.
contains
(
data
.
name
)
{
if
!
SharingData
.
eca
.
ecaArea
.
keys
.
contains
(
data
.
name
)
{
var
reg
=
RegisteredEca
(
ecaName
:
data
.
name
)
!
var
reg
=
RegisteredEca
(
ecaName
:
data
.
name
)
!
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
points
=
data
.
table
reg
.
points
=
data
.
table
SharingData
.
shared
.
ecaArea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
SharingData
.
eca
.
ecaArea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/ECA/EcaTask.swift
View file @
20cc3a5e
...
@@ -9,7 +9,7 @@ import Foundation
...
@@ -9,7 +9,7 @@ import Foundation
class
EcaTask
{
class
EcaTask
{
var
sessionShipStatus
=
SessionShipStatus
()
var
sessionShipStatus
=
SessionShipStatus
()
var
sharingData
=
SharingData
.
shared
var
eca
=
SharingData
.
eca
func
start
()
{
func
start
()
{
print
(
debug
:
"called"
)
print
(
debug
:
"called"
)
...
@@ -23,12 +23,12 @@ class EcaTask {
...
@@ -23,12 +23,12 @@ class EcaTask {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResShipStatus
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResShipStatus
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
SharingData
.
M
y
.
speed
=
res
.
speed
SharingData
.
m
y
.
speed
=
res
.
speed
SharingData
.
M
y
.
course
=
res
.
course
SharingData
.
m
y
.
course
=
res
.
course
SharingData
.
M
y
.
heading
=
res
.
heading
SharingData
.
m
y
.
heading
=
res
.
heading
SharingData
.
M
y
.
server
?
.
latitude
=
res
.
lat
SharingData
.
m
y
.
server
?
.
latitude
=
res
.
lat
SharingData
.
M
y
.
server
?
.
longitude
=
res
.
lon
SharingData
.
m
y
.
server
?
.
longitude
=
res
.
lon
SharingData
.
M
y
.
dataTime
=
res
.
dataTime
//2023-11-02T05:25:49.4362123Z
SharingData
.
m
y
.
dataTime
=
res
.
dataTime
//2023-11-02T05:25:49.4362123Z
}
}
checkEca
()
checkEca
()
case
.
failure
(
let
errorCode
):
case
.
failure
(
let
errorCode
):
...
@@ -38,9 +38,9 @@ class EcaTask {
...
@@ -38,9 +38,9 @@ class EcaTask {
}
}
private
func
checkEca
()
{
private
func
checkEca
()
{
let
runningEca
=
sharingDat
a
.
ecaArea
.
first
(
where
:
{(
key
,
value
)
in
value
.
isRunning
==
true
})
let
runningEca
=
ec
a
.
ecaArea
.
first
(
where
:
{(
key
,
value
)
in
value
.
isRunning
==
true
})
if
let
eca
=
runningEca
?
.
value
{
if
let
eca
=
runningEca
?
.
value
{
if
let
location
=
SharingData
.
M
y
.
location
{
if
let
location
=
SharingData
.
m
y
.
location
{
let
distance
=
LocationCalculation
.
checkPolyLine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
let
distance
=
LocationCalculation
.
checkPolyLine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
if
eca
.
swStart
>=
Float
(
distance
)
{
if
eca
.
swStart
>=
Float
(
distance
)
{
...
...
Seilassist/Sailassist/ECA/RegisteredEca.swift
View file @
20cc3a5e
...
@@ -10,7 +10,7 @@ import CoreLocation
...
@@ -10,7 +10,7 @@ import CoreLocation
struct
RegisteredEca
{
struct
RegisteredEca
{
var
id
:
UInt32
=
0
var
id
:
UInt32
=
0
var
isEnable
:
Bool
=
tru
e
//ECA有効
var
isEnable
:
Bool
=
fals
e
//ECA有効
var
isRunning
:
Bool
=
false
//ECA実行中
var
isRunning
:
Bool
=
false
//ECA実行中
var
name
:
String
=
""
//ECA名称
var
name
:
String
=
""
//ECA名称
var
swNotice
:
Float
=
6
//ECA通知[NM]
var
swNotice
:
Float
=
6
//ECA通知[NM]
...
...
Seilassist/Sailassist/LocationViewModel.swift
View file @
20cc3a5e
...
@@ -42,7 +42,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -42,7 +42,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
if
isLocation
{
if
isLocation
{
lastSeenLocation
=
locations
.
first
lastSeenLocation
=
locations
.
first
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
SharingData
.
M
y
.
gps
=
targetCoordinate
SharingData
.
m
y
.
gps
=
targetCoordinate
}
}
}
}
}
}
...
...
Seilassist/Sailassist/Login/LoginView.swift
View file @
20cc3a5e
...
@@ -145,11 +145,11 @@ struct LoginView: View {
...
@@ -145,11 +145,11 @@ struct LoginView: View {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResLogin
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResLogin
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
SharingData
.
M
y
.
id
=
res
.
id
SharingData
.
m
y
.
id
=
res
.
id
SharingData
.
M
y
.
shipId
=
res
.
shipId
SharingData
.
m
y
.
shipId
=
res
.
shipId
SharingData
.
M
y
.
shipName
=
res
.
shipName
SharingData
.
m
y
.
shipName
=
res
.
shipName
SharingData
.
M
y
.
imo
=
res
.
imo
SharingData
.
m
y
.
imo
=
res
.
imo
SharingData
.
M
y
.
mmsi
=
res
.
mmsi
SharingData
.
m
y
.
mmsi
=
res
.
mmsi
}
}
Preferences
.
lastLoginDate_Int64
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
Preferences
.
lastLoginDate_Int64
=
DateTextLib
.
Date2UnixTime
(
date
:
Date
())
...
...
Seilassist/Sailassist/Login/View/InputUserNameView.swift
View file @
20cc3a5e
...
@@ -101,11 +101,11 @@ struct InputUserNameView: View {
...
@@ -101,11 +101,11 @@ struct InputUserNameView: View {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResLogin
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResLogin
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
SharingData
.
M
y
.
id
=
res
.
id
SharingData
.
m
y
.
id
=
res
.
id
SharingData
.
M
y
.
shipId
=
res
.
shipId
SharingData
.
m
y
.
shipId
=
res
.
shipId
SharingData
.
M
y
.
shipName
=
res
.
shipName
SharingData
.
m
y
.
shipName
=
res
.
shipName
SharingData
.
M
y
.
imo
=
res
.
imo
SharingData
.
m
y
.
imo
=
res
.
imo
SharingData
.
M
y
.
mmsi
=
res
.
mmsi
SharingData
.
m
y
.
mmsi
=
res
.
mmsi
}
}
Preferences
.
ShipId
=
param
.
shipId
Preferences
.
ShipId
=
param
.
shipId
...
...
Seilassist/Sailassist/Map/MapRepresentable.swift
View file @
20cc3a5e
...
@@ -11,7 +11,7 @@ import MapboxMaps
...
@@ -11,7 +11,7 @@ import MapboxMaps
import
UIKit
import
UIKit
struct
MapRepresentable
:
UIViewControllerRepresentable
{
struct
MapRepresentable
:
UIViewControllerRepresentable
{
@ObservedObject
var
sharingData
=
SharingData
.
shared
@ObservedObject
var
ecaData
=
SharingData
.
eca
@State
var
mapVC
=
MapViewController
()
@State
var
mapVC
=
MapViewController
()
func
makeUIViewController
(
context
:
Context
)
->
some
UIViewController
{
func
makeUIViewController
(
context
:
Context
)
->
some
UIViewController
{
...
@@ -19,13 +19,13 @@ struct MapRepresentable: UIViewControllerRepresentable{
...
@@ -19,13 +19,13 @@ struct MapRepresentable: UIViewControllerRepresentable{
}
}
func
updateUIViewController
(
_
uiViewController
:
UIViewControllerType
,
context
:
Context
)
{
func
updateUIViewController
(
_
uiViewController
:
UIViewControllerType
,
context
:
Context
)
{
let
ecaArea
=
sharing
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}
.
first
let
ecaArea
=
eca
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}
.
first
if
let
ecaArea
=
ecaArea
{
if
let
ecaArea
=
ecaArea
{
mapVC
.
updateEcaLine
(
line
:
ecaArea
.
points
)
mapVC
.
updateEcaLine
(
line
:
ecaArea
.
points
)
}
}
if
let
mylocation
=
sharingData
.
location
{
if
let
mylocation
=
SharingData
.
my
.
location
{
mapVC
.
updateOwnShip
(
location
:
mylocation
,
bearing
:
sharingData
.
bear
ing
)
mapVC
.
updateOwnShip
(
location
:
mylocation
,
bearing
:
SharingData
.
my
.
head
ing
)
if
let
ecaArea
=
ecaArea
{
if
let
ecaArea
=
ecaArea
{
mapVC
.
updateEcaSwitchingLine
(
center
:
mylocation
,
notice
:
ecaArea
.
swNotice
,
start
:
ecaArea
.
swStart
,
finish
:
ecaArea
.
swFinish
)
mapVC
.
updateEcaSwitchingLine
(
center
:
mylocation
,
notice
:
ecaArea
.
swNotice
,
start
:
ecaArea
.
swStart
,
finish
:
ecaArea
.
swFinish
)
...
...
Seilassist/Sailassist/Map/MonitoringRoute.swift
View file @
20cc3a5e
...
@@ -23,43 +23,43 @@ class MonitoringRoute {
...
@@ -23,43 +23,43 @@ class MonitoringRoute {
let
serverSession
=
ServerSession
()
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResMonitoringRoute
.
self
)
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
ResMonitoringRoute
.
self
)
if
let
res
=
resjson
{
if
let
res
=
resjson
{
SharingData
.
M
ap
.
wayPoints
=
[]
SharingData
.
m
ap
.
wayPoints
=
[]
if
let
wayPoint
=
res
.
wayPoints
{
if
let
wayPoint
=
res
.
wayPoints
{
wayPoint
.
forEach
{
waypoint
in
wayPoint
.
forEach
{
waypoint
in
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
point
.
latitude
=
CLLocationDegrees
(
waypoint
.
lat
??
0.0
)
point
.
latitude
=
CLLocationDegrees
(
waypoint
.
lat
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
waypoint
.
lon
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
waypoint
.
lon
??
0.0
)
SharingData
.
M
ap
.
wayPoints
.
append
(
point
)
SharingData
.
m
ap
.
wayPoints
.
append
(
point
)
}
}
}
}
SharingData
.
M
ap
.
legLine
=
[]
SharingData
.
m
ap
.
legLine
=
[]
if
let
legLine
=
res
.
legLine
{
if
let
legLine
=
res
.
legLine
{
legLine
.
forEach
{
legline
in
legLine
.
forEach
{
legline
in
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
point
.
latitude
=
CLLocationDegrees
(
legline
.
lat
??
0.0
)
point
.
latitude
=
CLLocationDegrees
(
legline
.
lat
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
legline
.
lon
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
legline
.
lon
??
0.0
)
SharingData
.
M
ap
.
legLine
.
append
(
point
)
SharingData
.
m
ap
.
legLine
.
append
(
point
)
}
}
}
}
SharingData
.
M
ap
.
portLine
=
[]
SharingData
.
m
ap
.
portLine
=
[]
if
let
portLine
=
res
.
portLine
{
if
let
portLine
=
res
.
portLine
{
portLine
.
forEach
{
portline
in
portLine
.
forEach
{
portline
in
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
point
.
latitude
=
CLLocationDegrees
(
portline
.
lat
??
0.0
)
point
.
latitude
=
CLLocationDegrees
(
portline
.
lat
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
portline
.
lon
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
portline
.
lon
??
0.0
)
SharingData
.
M
ap
.
portLine
.
append
(
point
)
SharingData
.
m
ap
.
portLine
.
append
(
point
)
}
}
}
}
SharingData
.
M
ap
.
starboardLine
=
[]
SharingData
.
m
ap
.
starboardLine
=
[]
if
let
starboardLine
=
res
.
starboardLine
{
if
let
starboardLine
=
res
.
starboardLine
{
starboardLine
.
forEach
{
starboardline
in
starboardLine
.
forEach
{
starboardline
in
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
var
point
:
CLLocationCoordinate2D
=
CLLocationCoordinate2D
()
point
.
latitude
=
CLLocationDegrees
(
starboardline
.
lat
??
0.0
)
point
.
latitude
=
CLLocationDegrees
(
starboardline
.
lat
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
starboardline
.
lon
??
0.0
)
point
.
longitude
=
CLLocationDegrees
(
starboardline
.
lon
??
0.0
)
SharingData
.
M
ap
.
starboardLine
.
append
(
point
)
SharingData
.
m
ap
.
starboardLine
.
append
(
point
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/Map/Task/View/EcaListView.swift
View file @
20cc3a5e
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
import
SwiftUI
import
SwiftUI
struct
EcaListView
:
View
{
struct
EcaListView
:
View
{
@ObservedObject
var
sharingData
=
SharingData
.
shared
@ObservedObject
var
ecaData
=
SharingData
.
eca
var
body
:
some
View
{
var
body
:
some
View
{
ForEach
(
sharing
Data
.
ecaArea
.
map
{
$0
.
1
},
id
:
\
.
name
){
eca
in
ForEach
(
eca
Data
.
ecaArea
.
map
{
$0
.
1
},
id
:
\
.
name
){
eca
in
HStack
{
HStack
{
Text
(
eca
.
name
)
Text
(
eca
.
name
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
font
(
FontStyle
.
DefaultText
.
font
)
...
@@ -21,7 +21,7 @@ struct EcaListView: View {
...
@@ -21,7 +21,7 @@ struct EcaListView: View {
Button
(
action
:
{
Button
(
action
:
{
var
newData
=
eca
var
newData
=
eca
newData
.
isEnable
.
toggle
()
newData
.
isEnable
.
toggle
()
sharing
Data
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
eca
Data
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
},
label
:
{
},
label
:
{
Image
(
"icon_plus"
)
Image
(
"icon_plus"
)
.
resizable
()
.
resizable
()
...
@@ -55,6 +55,5 @@ struct EcaListView: View {
...
@@ -55,6 +55,5 @@ struct EcaListView: View {
#Preview {
#Preview {
EcaListView
()
EcaListView
()
.
environmentObject
(
SharingData
.
shared
)
}
}
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
View file @
20cc3a5e
...
@@ -28,7 +28,7 @@ struct EcaSettingView: View {
...
@@ -28,7 +28,7 @@ struct EcaSettingView: View {
Button
(
action
:
{
Button
(
action
:
{
SharingData
.
shared
.
editEcaArea
(
key
:
edittingEca
.
name
,
value
:
edittingEca
)
SharingData
.
eca
.
editEcaArea
(
key
:
edittingEca
.
name
,
value
:
edittingEca
)
isShowSettingEca
=
false
isShowSettingEca
=
false
},
label
:
{
},
label
:
{
Text
(
"Register"
)
Text
(
"Register"
)
...
...
Seilassist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
View file @
20cc3a5e
...
@@ -11,24 +11,24 @@ struct TaskSwitchingMenuView: View {
...
@@ -11,24 +11,24 @@ struct TaskSwitchingMenuView: View {
@Binding
var
viewMode
:
TaskViewMode
@Binding
var
viewMode
:
TaskViewMode
@Binding
var
edittingEcaArea
:
RegisteredEca
?
@Binding
var
edittingEcaArea
:
RegisteredEca
?
@Binding
var
isShowSettingEca
:
Bool
@Binding
var
isShowSettingEca
:
Bool
@ObservedObject
var
sharingData
=
SharingData
.
shared
@ObservedObject
var
ecaData
=
SharingData
.
eca
@State
var
isDeleteAlert
:
Bool
=
false
@State
var
isDeleteAlert
:
Bool
=
false
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
ForEach
(
sharing
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isEnable
},
id
:
\
.
name
){
eca
in
ForEach
(
eca
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isEnable
},
id
:
\
.
name
){
eca
in
VStack
{
VStack
{
HStack
{
HStack
{
Button
{
Button
{
for
runningEca
in
sharing
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}{
for
runningEca
in
eca
Data
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}{
var
newData
=
runningEca
var
newData
=
runningEca
newData
.
isRunning
=
false
newData
.
isRunning
=
false
sharing
Data
.
editEcaArea
(
key
:
runningEca
.
name
,
value
:
newData
)
eca
Data
.
editEcaArea
(
key
:
runningEca
.
name
,
value
:
newData
)
}
}
var
newData
=
eca
var
newData
=
eca
newData
.
isRunning
=
true
newData
.
isRunning
=
true
sharing
Data
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
eca
Data
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
}
label
:
{
}
label
:
{
HStack
{
HStack
{
Circle
()
Circle
()
...
@@ -73,7 +73,7 @@ struct TaskSwitchingMenuView: View {
...
@@ -73,7 +73,7 @@ struct TaskSwitchingMenuView: View {
if
let
ecaArea
=
edittingEcaArea
{
if
let
ecaArea
=
edittingEcaArea
{
var
newData
=
ecaArea
var
newData
=
ecaArea
newData
.
isEnable
=
false
newData
.
isEnable
=
false
sharing
Data
.
editEcaArea
(
key
:
ecaArea
.
name
,
value
:
newData
)
eca
Data
.
editEcaArea
(
key
:
ecaArea
.
name
,
value
:
newData
)
}
}
edittingEcaArea
=
nil
edittingEcaArea
=
nil
}
label
:
{
}
label
:
{
...
...
Seilassist/Sailassist/ServerSession/SessionGetMessage.swift
View file @
20cc3a5e
...
@@ -27,7 +27,7 @@ class SessionGetMessage : ObservableObject {
...
@@ -27,7 +27,7 @@ class SessionGetMessage : ObservableObject {
Calling
=
true
Calling
=
true
// リクエストURLの組み立て
// リクエストURLの組み立て
let
id
=
SharingData
.
M
y
.
shipId
let
id
=
SharingData
.
m
y
.
shipId
if
id
!=
0
{
if
id
!=
0
{
var
url_string
:
String
=
HttpRequestType
.
GetMessage
.
rawValue
var
url_string
:
String
=
HttpRequestType
.
GetMessage
.
rawValue
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
...
...
Seilassist/Sailassist/ServerSession/SessionMonitoringRoute.swift
View file @
20cc3a5e
...
@@ -28,7 +28,7 @@ class SessionMonitoringRoute : ObservableObject {
...
@@ -28,7 +28,7 @@ class SessionMonitoringRoute : ObservableObject {
Calling
=
true
Calling
=
true
// リクエストURLの組み立て
// リクエストURLの組み立て
let
id
=
SharingData
.
M
y
.
shipId
let
id
=
SharingData
.
m
y
.
shipId
if
id
!=
0
{
if
id
!=
0
{
var
url_string
:
String
=
HttpRequestType
.
ShipMonitoringRoute
.
rawValue
var
url_string
:
String
=
HttpRequestType
.
ShipMonitoringRoute
.
rawValue
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
...
...
Seilassist/Sailassist/ServerSession/SessionShipStatus.swift
View file @
20cc3a5e
...
@@ -27,7 +27,7 @@ class SessionShipStatus : ObservableObject {
...
@@ -27,7 +27,7 @@ class SessionShipStatus : ObservableObject {
Calling
=
true
Calling
=
true
// リクエストURLの組み立て
// リクエストURLの組み立て
let
id
=
SharingData
.
M
y
.
shipId
let
id
=
SharingData
.
m
y
.
shipId
if
id
!=
0
{
if
id
!=
0
{
var
url_string
:
String
=
HttpRequestType
.
ShipStatus
.
rawValue
var
url_string
:
String
=
HttpRequestType
.
ShipStatus
.
rawValue
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
...
...
Seilassist/Sailassist/ServerSession/SessionTaskList.swift
View file @
20cc3a5e
...
@@ -27,7 +27,7 @@ class SessionTaskList : ObservableObject {
...
@@ -27,7 +27,7 @@ class SessionTaskList : ObservableObject {
Calling
=
true
Calling
=
true
// リクエストURLの組み立て
// リクエストURLの組み立て
let
id
=
SharingData
.
M
y
.
shipId
let
id
=
SharingData
.
m
y
.
shipId
if
id
!=
0
{
if
id
!=
0
{
var
url_string
:
String
=
HttpRequestType
.
TaskList
.
rawValue
var
url_string
:
String
=
HttpRequestType
.
TaskList
.
rawValue
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
20cc3a5e
...
@@ -7,37 +7,25 @@
...
@@ -7,37 +7,25 @@
import
Foundation
import
Foundation
import
CoreLocation
import
CoreLocation
class
SharingData
:
ObservableObject
{
class
SharingData
{
static
let
shared
=
SharingData
()
static
var
my
=
My
()
@Published
var
location
:
CLLocationCoordinate2D
?
=
CLLocationCoordinate2D
(
latitude
:
0
,
longitude
:
0
)
//nil
class
My
:
ObservableObject
{
@Published
var
speedKnot
:
Double
=
0.0
@Published
var
location
:
CLLocationCoordinate2D
?
=
nil
@Published
var
bearing
:
Double
=
0.0
// 自船進行方向
@Published
var
gps
:
CLLocationCoordinate2D
?
=
nil
@Published
var
compass
:
Double
?
=
nil
// 端末の方位
@Published
var
server
:
CLLocationCoordinate2D
?
=
nil
@Published
var
speed
:
Double
=
0.0
@Published
var
course
:
Double
=
0.0
@Published
var
heading
:
Double
=
0.0
@Published
var
dataTime
:
String
=
""
//2023-11-02T05:25:49.4362123Z
@Published
var
id
:
Int
=
0
@Published
var
shipId
:
Int
=
0
@Published
var
shipName
:
String
=
""
@Published
var
imo
:
Int
=
0
@Published
var
mmsi
:
Int
=
0
func
reset
()
{
func
reset
()
{
location
=
nil
speedKnot
=
0.0
bearing
=
0.0
}
class
My
{
static
var
location
:
CLLocationCoordinate2D
?
=
nil
static
var
gps
:
CLLocationCoordinate2D
?
=
nil
static
var
server
:
CLLocationCoordinate2D
?
=
nil
static
var
speed
:
Double
=
0.0
static
var
course
:
Double
=
0.0
static
var
heading
:
Double
=
0.0
static
var
dataTime
:
String
=
""
//2023-11-02T05:25:49.4362123Z
static
var
id
:
Int
=
0
static
var
shipId
:
Int
=
0
static
var
shipName
:
String
=
""
static
var
imo
:
Int
=
0
static
var
mmsi
:
Int
=
0
static
func
reset
()
{
location
=
nil
location
=
nil
speed
=
0.0
speed
=
0.0
course
=
0.0
course
=
0.0
...
@@ -45,26 +33,31 @@ class SharingData: ObservableObject{
...
@@ -45,26 +33,31 @@ class SharingData: ObservableObject{
}
}
}
}
class
Map
{
static
var
map
=
Map
()
static
var
wayPoints
:
[
CLLocationCoordinate2D
]
=
[]
class
Map
:
ObservableObject
{
static
var
legLine
:
[
CLLocationCoordinate2D
]
=
[]
@Published
var
wayPoints
:
[
CLLocationCoordinate2D
]
=
[]
static
var
portLine
:
[
CLLocationCoordinate2D
]
=
[]
@Published
var
legLine
:
[
CLLocationCoordinate2D
]
=
[]
static
var
starboardLine
:
[
CLLocationCoordinate2D
]
=
[]
@Published
var
portLine
:
[
CLLocationCoordinate2D
]
=
[]
@Published
var
starboardLine
:
[
CLLocationCoordinate2D
]
=
[]
}
}
class
Message
{
static
var
message
=
Message
()
static
var
mode
:
Int
=
0
// 0:通常 , 1:Warning中
class
Message
:
ObservableObject
{
static
var
messages
:
[
message
]
=
[]
@Published
var
mode
:
Int
=
0
// 0:通常 , 1:Warning中
@Published
var
messages
:
[
message
]
=
[]
}
}
/**
/**
* Eca
* Eca
*/
*/
static
var
eca
=
Eca
()
class
Eca
:
ObservableObject
{
@Published
var
ecaArea
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
@Published
var
ecaArea
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
func
editEcaArea
(
key
:
String
,
value
:
RegisteredEca
){
func
editEcaArea
(
key
:
String
,
value
:
RegisteredEca
){
ecaArea
.
updateValue
(
value
,
forKey
:
key
)
ecaArea
.
updateValue
(
value
,
forKey
:
key
)
}
}
}
}
}
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