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
06371738
Commit
06371738
authored
Dec 01, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eca通過時のAlertを追加
parent
dc03aff2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
EcaTask.swift
Seilassist/Sailassist/ECA/EcaTask.swift
+6
-0
MapTaskView.swift
Seilassist/Sailassist/Map/Task/View/MapTaskView.swift
+43
-3
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+1
-0
No files found.
Seilassist/Sailassist/ECA/EcaTask.swift
View file @
06371738
...
@@ -65,21 +65,27 @@ class EcaTask {
...
@@ -65,21 +65,27 @@ class EcaTask {
if
eca
.
swNotice
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
start
{
if
eca
.
swNotice
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
start
{
notificationEca
(
point
:
SwitchingEca
.
Start
)
notificationEca
(
point
:
SwitchingEca
.
Start
)
eca
.
status
=
EcaState
.
noticePass
eca
.
status
=
EcaState
.
noticePass
SharingData
.
eca
.
isShowEcaAlert
=
true
}
}
if
eca
.
swStart
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
noticePass
{
if
eca
.
swStart
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
noticePass
{
notificationEca
(
point
:
SwitchingEca
.
Notice
)
notificationEca
(
point
:
SwitchingEca
.
Notice
)
eca
.
status
=
EcaState
.
startPass
eca
.
status
=
EcaState
.
startPass
SharingData
.
eca
.
isShowEcaAlert
=
true
}
}
if
eca
.
swFinish
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
startPass
{
if
eca
.
swFinish
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
startPass
{
notificationEca
(
point
:
SwitchingEca
.
Finish
)
notificationEca
(
point
:
SwitchingEca
.
Finish
)
eca
.
status
=
EcaState
.
finishPass
eca
.
status
=
EcaState
.
finishPass
SharingData
.
eca
.
isShowEcaAlert
=
true
}
}
if
0.0
<=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
finishPass
{
if
0.0
<=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
finishPass
{
eca
.
status
=
EcaState
.
incomplete
eca
.
status
=
EcaState
.
incomplete
SharingData
.
eca
.
isShowEcaAlert
=
true
}
}
SharingData
.
eca
.
editEcaArea
(
key
:
eca
.
name
,
value
:
eca
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/Map/Task/View/MapTaskView.swift
View file @
06371738
...
@@ -26,6 +26,8 @@ struct MapTaskView: View {
...
@@ -26,6 +26,8 @@ struct MapTaskView: View {
@State
var
viewMode
:
TaskViewMode
=
.
SwitchingMenu
@State
var
viewMode
:
TaskViewMode
=
.
SwitchingMenu
@State
var
edittingEcaArea
:
RegisteredEca
?
=
nil
@State
var
edittingEcaArea
:
RegisteredEca
?
=
nil
@State
var
isShowSettingView
:
Bool
=
false
@State
var
isShowSettingView
:
Bool
=
false
@ObservedObject
var
eca
=
SharingData
.
eca
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
Capsule
()
Capsule
()
...
@@ -38,8 +40,16 @@ struct MapTaskView: View {
...
@@ -38,8 +40,16 @@ struct MapTaskView: View {
Button
(
action
:
{
Button
(
action
:
{
viewMode
=
.
SwitchingMenu
viewMode
=
.
SwitchingMenu
isShowSettingView
=
false
if
var
eca
=
SharingData
.
eca
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}
.
first
{
eca
.
status
=
.
noticePass
// SharingData.eca.editEcaArea(key: eca.name, value: eca)
SharingData
.
eca
.
isShowEcaAlert
=
true
}
},
label
:
{
},
label
:
{
if
viewMode
!=
.
SwitchingMenu
{
if
viewMode
!=
.
SwitchingMenu
||
isShowSettingView
{
Image
(
"ink_02"
)
Image
(
"ink_02"
)
}
}
})
})
...
@@ -59,7 +69,7 @@ struct MapTaskView: View {
...
@@ -59,7 +69,7 @@ struct MapTaskView: View {
Button
(
action
:
{
Button
(
action
:
{
},
label
:
{
},
label
:
{
Image
(
"closeIcon"
)
})
})
.
frame
(
width
:
48
,
height
:
48
)
.
frame
(
width
:
48
,
height
:
48
)
...
@@ -89,9 +99,39 @@ struct MapTaskView: View {
...
@@ -89,9 +99,39 @@ struct MapTaskView: View {
Spacer
()
Spacer
()
.
frame
(
height
:
55
)
.
frame
(
height
:
55
)
}
.
onAppear
{
}
.
onAppear
{
EcaCoordinatesTable
()
.
setEcaData
()
EcaCoordinatesTable
()
.
setEcaData
()
}
}
.
alert
(
""
,
isPresented
:
$
eca
.
isShowEcaAlert
)
{
if
var
ecaArea
=
eca
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}
.
first
,
ecaArea
.
status
==
.
finishPass
{
Button
(
"Yes"
){
ecaArea
.
status
=
.
end
}
Button
(
"No"
){
ecaArea
.
status
=
.
incomplete
}
}
else
{
Button
(
"OK"
){
}
}
}
message
:
{
if
let
ecaArea
=
eca
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}
.
first
{
switch
ecaArea
.
status
{
case
.
noticePass
:
Text
(
"Arrived at advance notice point."
)
case
.
startPass
:
Text
(
"Arrived at switching start point."
)
case
.
finishPass
:
Text
(
"Have you finished
\(
ecaArea
.
name
)
fuel switching?"
)
case
.
incomplete
:
Text
(
"Have you finished
\(
ecaArea
.
name
)
fuel switching?
\n
If you finish, you disable it."
)
default
:
Text
(
""
)
}
}
}
}
}
}
}
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
06371738
...
@@ -104,6 +104,7 @@ class SharingData{
...
@@ -104,6 +104,7 @@ class SharingData{
class
Eca
:
ObservableObject
{
class
Eca
:
ObservableObject
{
@Published
var
ecaArea
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
@Published
var
ecaArea
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
@Published
var
foucusEca
:
String
?
=
nil
@Published
var
foucusEca
:
String
?
=
nil
@Published
var
isShowEcaAlert
:
Bool
=
false
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