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
54
Merge Requests
54
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
gr-ssv
Sailassist
Commits
f37540a2
Commit
f37540a2
authored
Jun 28, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iPad対応
parent
b4e5721a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
31 deletions
+62
-31
MapRepresentable.swift
Seilassist/Sailassist/Map/MapRepresentable.swift
+26
-13
MenuTaskView.swift
Seilassist/Sailassist/Map/Task/View/MenuTaskView.swift
+27
-2
MenuTitleView.swift
Seilassist/Sailassist/Menu/View/MenuTitleView.swift
+1
-1
GetNgaList.swift
Seilassist/Sailassist/NGA/GetNgaList.swift
+0
-3
NgaTask.swift
Seilassist/Sailassist/NGA/NgaTask.swift
+0
-2
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+0
-5
MainTabView.swift
Seilassist/Sailassist/Tab/MainTabView.swift
+8
-5
No files found.
Seilassist/Sailassist/Map/MapRepresentable.swift
View file @
f37540a2
...
...
@@ -169,7 +169,6 @@ class MapViewController : UIViewController {
@objc
func
handleMapDrug
(
sender
:
UIPanGestureRecognizer
)
{
let
spot
=
sender
.
location
(
in
:
mapView
)
let
coordinate
=
mapView
.
mapboxMap
.
coordinate
(
for
:
spot
)
print
(
debug
:
"test: handleMapDrug
\(
coordinate
)
"
)
mapDrug
(
point
:
spot
,
coordinate
:
coordinate
)
if
SharingData
.
nga
.
editType
==
EditNgaType
.
movePoint
{
...
...
@@ -413,6 +412,7 @@ class MapViewController : UIViewController {
var
editTargetSymbolLayer
=
SymbolLayer
(
id
:
editTargetSymbol
.
layerId
)
editTargetSymbolLayer
.
source
=
editTargetSymbol
.
sourceId
editTargetSymbolLayer
.
iconSize
=
.
expression
(
Exp
(
.
get
)
{
PropertyKey
.
Size
.
rawValue
})
editTargetSymbolLayer
.
iconImage
=
.
expression
(
Exp
(
.
get
)
{
PropertyKey
.
IconImage
.
rawValue
})
editTargetSymbolLayer
.
iconColor
=
.
expression
(
Exp
(
.
get
)
{
PropertyKey
.
Color
.
rawValue
})
try
?
mapView
.
mapboxMap
.
style
.
addLayer
(
editTargetSymbolLayer
)
...
...
@@ -701,7 +701,8 @@ class MapViewController : UIViewController {
if
remove
==
false
{
var
feature
=
Feature
(
geometry
:
Point
(
point
))
feature
.
properties
=
[
PropertyKey
.
IconImage
.
rawValue
:
.
string
(
IconImage
.
Target
.
rawValue
),
PropertyKey
.
Color
.
rawValue
:
.
string
(
"#EF6135"
)]
PropertyKey
.
Color
.
rawValue
:
.
string
(
"#EF6135"
),
PropertyKey
.
Size
.
rawValue
:
1.0
]
features
.
append
(
feature
)
}
...
...
@@ -819,9 +820,9 @@ class MapViewController : UIViewController {
PropertyKey
.
Color
.
rawValue
:
.
string
(
"#EF6135"
)]
features
.
append
(
feature
)
id
+=
1
print
(
debug
:
"Test: point
\(
id
)
"
)
}
}
try
self
.
mapView
.
mapboxMap
.
style
.
updateGeoJSONSource
(
withId
:
editAreaSymbol
.
sourceId
,
geoJSON
:
.
featureCollection
(
FeatureCollection
(
features
:
features
)))
}
catch
{
print
(
debug
:
"called"
)
...
...
@@ -901,8 +902,8 @@ class MapViewController : UIViewController {
* NGA 更新処理
*/
func
updateAlertArea
()
{
updateAlertAreaLine
(
area
:
SharingData
.
nga
.
ngaArea
)
updateAlertAreaFill
(
area
:
SharingData
.
nga
.
ngaArea
)
updateAlertAreaLine
(
area
:
SharingData
.
nga
.
ngaArea
,
edit
:
SharingData
.
nga
.
editNga
,
type
:
SharingData
.
nga
.
editType
)
updateAlertAreaFill
(
area
:
SharingData
.
nga
.
ngaArea
,
edit
:
SharingData
.
nga
.
editNga
,
type
:
SharingData
.
nga
.
editType
)
}
/**
...
...
@@ -931,11 +932,19 @@ class MapViewController : UIViewController {
/**
* NGAライン更新処理
*/
private
func
updateAlertAreaLine
(
area
:
Dictionary
<
UUID
,
RegisteredNga
>
)
{
private
func
updateAlertAreaLine
(
area
:
Dictionary
<
UUID
,
RegisteredNga
>
,
edit
:
RegisteredNga
?,
type
:
EditNgaType
)
{
do
{
var
features
:
[
Feature
]
=
[]
for
(
_
,
value
)
in
area
{
if
value
.
isRunning
==
true
{
var
isEdit
=
true
if
let
editId
=
edit
?
.
areaId
{
if
value
.
areaId
==
editId
&&
type
!=
EditNgaType
.
nonEdit
{
isEdit
=
false
}
}
if
value
.
isRunning
==
true
&&
isEdit
==
true
{
if
value
.
points
.
count
>=
3
{
var
areaPoints
=
value
.
points
let
firstPoint
=
value
.
points
[
0
]
...
...
@@ -962,11 +971,19 @@ class MapViewController : UIViewController {
/**
* NGA エリア更新処理
*/
private
func
updateAlertAreaFill
(
area
:
Dictionary
<
UUID
,
RegisteredNga
>
)
{
private
func
updateAlertAreaFill
(
area
:
Dictionary
<
UUID
,
RegisteredNga
>
,
edit
:
RegisteredNga
?,
type
:
EditNgaType
)
{
do
{
var
features
:
[
Feature
]
=
[]
for
(
_
,
value
)
in
area
{
if
value
.
points
.
count
>=
3
{
var
isEdit
=
true
if
let
editId
=
edit
?
.
areaId
{
if
value
.
areaId
==
editId
&&
type
!=
EditNgaType
.
nonEdit
{
isEdit
=
false
}
}
if
value
.
points
.
count
>=
3
&&
isEdit
==
true
{
var
cnvPoints
:
Array
<
Array
<
CLLocationCoordinate2D
>>
=
[]
var
areaPoints
=
value
.
points
...
...
@@ -1106,7 +1123,6 @@ class MapViewController : UIViewController {
*/
private
func
clickSymbolLayer
(
tatchPoint
:
CGPoint
,
coordinate
:
CLLocationCoordinate2D
)
{
if
let
targetFeature
=
self
.
touchedFeatures
{
print
(
debug
:
"Test: clickSymbolLayer
\(
coordinate
)
"
)
guard
let
type
=
targetFeature
.
properties
?[
PropertyKey
.
Dtype
.
rawValue
]
else
{
return
}
switch
type
!
{
...
...
@@ -1128,7 +1144,6 @@ class MapViewController : UIViewController {
updateEditTargetSymbol
(
point
:
coordinate
)
}
case
Turf
.
JSONValue
.
string
(
DataType
.
add
.
rawValue
):
print
(
debug
:
"Test: clickSymbolLayer(add)
\(
coordinate
)
"
)
guard
let
jsonData
=
targetFeature
.
properties
?[
PropertyKey
.
Id
.
rawValue
]
else
{
return
}
guard
let
Id
=
jsonData
?
.
rawValue
else
{
return
}
...
...
@@ -1198,7 +1213,6 @@ class MapViewController : UIViewController {
private
func
longClickSymbolLayer
(
tatchPoint
:
CGPoint
,
coordinate
:
CLLocationCoordinate2D
)
{
if
SharingData
.
nga
.
editType
==
EditNgaType
.
addPoint
{
if
let
targetFeature
=
self
.
touchedFeatures
{
print
(
debug
:
"Test: longClickSymbolLayer
\(
coordinate
)
"
)
guard
let
type
=
targetFeature
.
properties
?[
PropertyKey
.
Dtype
.
rawValue
]
else
{
return
}
if
type
!
==
Turf
.
JSONValue
.
string
(
DataType
.
point
.
rawValue
)
{
...
...
@@ -1228,7 +1242,6 @@ class MapViewController : UIViewController {
self
.
touchedFeatures
=
nil
var
features
:
[
Feature
]
=
[]
let
option
=
RenderedQueryOptions
(
layerIds
:
layers
,
filter
:
nil
)
print
(
debug
:
"Test: (Drug)
\(
coordinate
)
"
)
mapView
.
mapboxMap
.
queryRenderedFeatures
(
with
:
point
,
options
:
option
)
{
[
self
]
result
in
switch
result
{
...
...
Seilassist/Sailassist/Map/Task/View/MenuTaskView.swift
View file @
f37540a2
...
...
@@ -18,7 +18,7 @@ enum TaskViewMode {
var
title
:
String
{
switch
self
{
case
.
MenuList
:
"M
enu
Functions"
"M
ap
Functions"
case
.
FuelSwitching
:
"Fuel Switching"
case
.
EcaList
:
...
...
@@ -66,7 +66,32 @@ struct MenuTaskView: View {
let
appVersionModel
=
AppVersionModel
()
appVersionModel
.
start
()
nga
.
editType
=
EditNgaType
.
registered
if
UIDevice
.
current
.
userInterfaceIdiom
==
.
phone
{
nga
.
editType
=
EditNgaType
.
registered
}
else
if
UIDevice
.
current
.
userInterfaceIdiom
==
.
pad
{
switch
nga
.
editType
{
case
EditNgaType
.
nonEdit
:
print
(
debug
:
"Test: nonEdit"
)
nga
.
editType
=
EditNgaType
.
registered
break
case
EditNgaType
.
registered
:
print
(
debug
:
"Test: registered"
)
taskViewModel
.
viewMode
=
.
NgaNotification
break
case
EditNgaType
.
addPoint
:
print
(
debug
:
"Test: addPoint"
)
taskViewModel
.
viewMode
=
.
NgaSetting
break
case
EditNgaType
.
movePoint
:
print
(
debug
:
"Test: movePoint"
)
taskViewModel
.
viewMode
=
.
NgaSetting
break
case
EditNgaType
.
deletePoint
:
print
(
debug
:
"Test: deletePoint"
)
taskViewModel
.
viewMode
=
.
NgaSetting
break
}
}
}
.
alert
(
""
,
isPresented
:
$
eca
.
isShowEcaAlert
)
{
// if let ecaArea = eca.ecaArea.map({ $0.1 }).filter({ $0.isRunning }).first{
...
...
Seilassist/Sailassist/Menu/View/MenuTitleView.swift
View file @
f37540a2
...
...
@@ -10,7 +10,7 @@ import SwiftUI
struct
MenuTitleView
:
View
{
@Binding
var
path
:
[
MenuPath
]
var
title
=
"M
enu
Functions"
var
title
=
"M
ap
Functions"
var
body
:
some
View
{
VStack
{
HStack
{
...
...
Seilassist/Sailassist/NGA/GetNgaList.swift
View file @
f37540a2
...
...
@@ -20,7 +20,6 @@ class GetNgaList {
private
func
responseGetNgaList
(
result
:
Result
<
Data
,
APIError
>
)
{
print
(
debug
:
"called"
)
print
(
debug
:
"Test: GetNgaList"
)
switch
result
{
case
.
success
(
let
resultData
):
let
serverSession
=
ServerSession
()
...
...
@@ -30,7 +29,6 @@ class GetNgaList {
for
ngaList
in
res
{
if
let
id
=
NSUUID
(
uuidString
:
ngaList
.
id
)
{
if
var
nga
=
ngaAreas
[
id
as
UUID
]
{
print
(
debug
:
"Test: 1
\(
nga
)
"
)
nga
.
name
=
ngaList
.
name
nga
.
isLock
=
ngaList
.
lock
nga
.
points
.
removeAll
()
...
...
@@ -39,7 +37,6 @@ class GetNgaList {
nga
.
points
.
append
(
point
)
}
ngaAreas
.
updateValue
(
nga
,
forKey
:
nga
.
areaId
)
print
(
debug
:
"Test: 2
\(
nga
)
"
)
}
else
{
if
var
nga
=
RegisteredNga
(
areaName
:
"test dammy"
)
{
//TODO: 名称はダミー
nga
.
areaId
=
id
as
UUID
...
...
Seilassist/Sailassist/NGA/NgaTask.swift
View file @
f37540a2
...
...
@@ -41,8 +41,6 @@ class NgaTask {
if
isInside
{
//通過中
area
.
passingCnt
+=
1
let
test
=
area
.
passingCnt
print
(
debug
:
"Test:
\(
test
)
"
)
ngaData
.
editNgaArea
(
value
:
area
,
type
:
NgaOperation
.
Passing
)
if
area
.
passingCnt
==
1
{
let
areaName
=
nga
.
value
.
name
...
...
Seilassist/Sailassist/SailassistApp.swift
View file @
f37540a2
...
...
@@ -178,7 +178,6 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
}
private
func
handleChatMessage
(
message
:
ResChatMessage
)
{
print
(
debug
:
"test:called"
)
let
ownMsg
=
ChatMessage
(
shipId
:
message
.
shipId
,
messageId
:
message
.
messageId
,
type
:
message
.
type
,
time
:
message
.
time
,
location
:
message
.
location
,
from
:
message
.
from
,
message
:
message
.
message
,
stampId
:
message
.
stampId
,
viewer
:
[])
self
.
msg
.
messages
.
append
(
ownMsg
)
...
...
@@ -187,7 +186,6 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
}
private
func
handleAckMessage
(
message
:
ResAckMessage
)
{
print
(
debug
:
"test:called"
)
let
msgIndex
=
self
.
msg
.
messages
.
firstIndex
(
where
:
{
$0
.
messageId
==
message
.
messageId
})
if
let
index
=
msgIndex
{
let
viewer
=
Viewer
(
time
:
message
.
time
,
location
:
message
.
location
,
id
:
message
.
fromId
)
...
...
@@ -199,7 +197,6 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
}
private
func
handleChatMode
(
message
:
ResChatMode
)
{
print
(
debug
:
"test:called"
)
if
message
.
mode
==
1
{
self
.
msg
.
mode
=
true
}
else
{
...
...
@@ -219,7 +216,6 @@ class SignalR: NSObject {
@ObservedObject
var
msg
=
SharingData
.
message
func
chatMessage
(
message
:
String
)
{
print
(
debug
:
"test:called"
)
var
request
=
ReqMessage
(
shipId
:
Preferences
.
shipId
,
messageId
:
UUID
()
.
uuidString
.
lowercased
())
request
.
type
=
0
//0:テキスト, 1:スタンプ
request
.
time
=
DateTextLib
.
Date2ISO8601Text
(
Date
())
...
...
@@ -241,7 +237,6 @@ class SignalR: NSObject {
}
func
ackMessage
(
messageId
:
String
)
{
print
(
debug
:
"test:called"
)
var
request
=
ReqAckMessage
(
shipId
:
Preferences
.
shipId
,
messageId
:
messageId
)
request
.
time
=
DateTextLib
.
Date2ISO8601Text
(
Date
())
request
.
location
=
2
//1:Shore , 2:Ship
...
...
Seilassist/Sailassist/Tab/MainTabView.swift
View file @
f37540a2
...
...
@@ -72,9 +72,12 @@ struct MainTabView: View {
ChatView
()
.
tag
(
Tab
.
chat
)
MapRepresentable
()
.
ignoresSafeArea
()
.
tag
(
Tab
.
task
)
ZStack
{
MapRepresentable
()
MapInformation
()
}
.
ignoresSafeArea
()
.
tag
(
Tab
.
task
)
NotificationView
()
.
tag
(
Tab
.
alert
)
...
...
@@ -85,9 +88,9 @@ struct MainTabView: View {
.
hideNativeTabBar
()
.
popover
(
isPresented
:
.
constant
(
isPopover
&&
SharingData
.
my
.
isFuelSwitchTask
),
attachmentAnchor
:
.
point
(
.
bottom
))
{
MenuTaskView
()
.
presentationCompactAdaptation
(
.
none
)
.
presentationCompactAdaptation
(
.
popover
)
.
zIndex
(
0
)
.
frame
(
minWidth
:
3
00
,
maxHeight
:
500
)
.
frame
(
minWidth
:
5
00
,
maxHeight
:
500
)
.
aspectRatio
(
contentMode
:
.
fit
)
.
presentationCornerRadius
(
15
)
.
presentationBackgroundInteraction
(
.
enabled
(
upThrough
:
.
medium
))
...
...
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