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
e43c5064
Commit
e43c5064
authored
Oct 31, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Task関連実装
parent
fa23994a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
65 deletions
+113
-65
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+0
-4
ContentView.swift
Seilassist/Sailassist/ContentView.swift
+7
-0
EcaCoordinatesTable.swift
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
+2
-2
RegisteredEca.swift
Seilassist/Sailassist/ECA/RegisteredEca.swift
+31
-12
EcaListView.swift
Seilassist/Sailassist/Map/Task/View/EcaListView.swift
+27
-35
MapTaskView.swift
Seilassist/Sailassist/Map/Task/View/MapTaskView.swift
+2
-0
TaskSwitchingMenuView.swift
...sist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
+31
-7
Preferences.swift
Seilassist/Sailassist/Preferences/Preferences.swift
+2
-0
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+11
-5
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
e43c5064
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
022789082AE1FE4C00A87787
/* Turf.xcframework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
022788F72AE1FE3C00A87787
/* Turf.xcframework */
;
};
022789082AE1FE4C00A87787
/* Turf.xcframework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
022788F72AE1FE3C00A87787
/* Turf.xcframework */
;
};
022789092AE1FE4C00A87787
/* Turf.xcframework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
022788F72AE1FE3C00A87787
/* Turf.xcframework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
022789092AE1FE4C00A87787
/* Turf.xcframework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
022788F72AE1FE3C00A87787
/* Turf.xcframework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
0227890C2AE22E0B00A87787
/* SharingData.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0227890B2AE22E0B00A87787
/* SharingData.swift */
;
};
0227890C2AE22E0B00A87787
/* SharingData.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0227890B2AE22E0B00A87787
/* SharingData.swift */
;
};
0227890E2AE245C300A87787
/* ECA.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0227890D2AE245C300A87787
/* ECA.swift */
;
};
02CD068F2AE6535F005F8D8F
/* MapSource.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD068E2AE6535F005F8D8F
/* MapSource.swift */
;
};
02CD068F2AE6535F005F8D8F
/* MapSource.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD068E2AE6535F005F8D8F
/* MapSource.swift */
;
};
02CD06912AE6536B005F8D8F
/* LayerEnum.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD06902AE6536B005F8D8F
/* LayerEnum.swift */
;
};
02CD06912AE6536B005F8D8F
/* LayerEnum.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD06902AE6536B005F8D8F
/* LayerEnum.swift */
;
};
02CD06932AE88970005F8D8F
/* ServerSession.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD06922AE88970005F8D8F
/* ServerSession.swift */
;
};
02CD06932AE88970005F8D8F
/* ServerSession.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
02CD06922AE88970005F8D8F
/* ServerSession.swift */
;
};
...
@@ -134,7 +133,6 @@
...
@@ -134,7 +133,6 @@
022788F92AE1FE3D00A87787
/* MapboxCommon.xcframework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.xcframework
;
path
=
MapboxCommon.xcframework
;
sourceTree
=
"<group>"
;
};
022788F92AE1FE3D00A87787
/* MapboxCommon.xcframework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.xcframework
;
path
=
MapboxCommon.xcframework
;
sourceTree
=
"<group>"
;
};
022788FA2AE1FE3D00A87787
/* MapboxMaps.xcframework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.xcframework
;
path
=
MapboxMaps.xcframework
;
sourceTree
=
"<group>"
;
};
022788FA2AE1FE3D00A87787
/* MapboxMaps.xcframework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.xcframework
;
path
=
MapboxMaps.xcframework
;
sourceTree
=
"<group>"
;
};
0227890B2AE22E0B00A87787
/* SharingData.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SharingData.swift
;
sourceTree
=
"<group>"
;
};
0227890B2AE22E0B00A87787
/* SharingData.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
SharingData.swift
;
sourceTree
=
"<group>"
;
};
0227890D2AE245C300A87787
/* ECA.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ECA.swift
;
sourceTree
=
"<group>"
;
};
02CD068E2AE6535F005F8D8F
/* MapSource.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MapSource.swift
;
sourceTree
=
"<group>"
;
};
02CD068E2AE6535F005F8D8F
/* MapSource.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MapSource.swift
;
sourceTree
=
"<group>"
;
};
02CD06902AE6536B005F8D8F
/* LayerEnum.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LayerEnum.swift
;
sourceTree
=
"<group>"
;
};
02CD06902AE6536B005F8D8F
/* LayerEnum.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
LayerEnum.swift
;
sourceTree
=
"<group>"
;
};
02CD06922AE88970005F8D8F
/* ServerSession.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ServerSession.swift
;
sourceTree
=
"<group>"
;
};
02CD06922AE88970005F8D8F
/* ServerSession.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ServerSession.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -393,7 +391,6 @@
...
@@ -393,7 +391,6 @@
022789112AE6028800A87787
/* ViewModel */
=
{
022789112AE6028800A87787
/* ViewModel */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
0227890D2AE245C300A87787
/* ECA.swift */
,
);
);
path
=
ViewModel
;
path
=
ViewModel
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -605,7 +602,6 @@
...
@@ -605,7 +602,6 @@
02CD06912AE6536B005F8D8F
/* LayerEnum.swift in Sources */
,
02CD06912AE6536B005F8D8F
/* LayerEnum.swift in Sources */
,
020B98532AD919180029DE4C
/* LoginTypeSelectView.swift in Sources */
,
020B98532AD919180029DE4C
/* LoginTypeSelectView.swift in Sources */
,
D52D213F2AEBB7D700324D58
/* RegisteredEca.swift in Sources */
,
D52D213F2AEBB7D700324D58
/* RegisteredEca.swift in Sources */
,
0227890E2AE245C300A87787
/* ECA.swift in Sources */
,
02CD06952AE895F5005F8D8F
/* APIError.swift in Sources */
,
02CD06952AE895F5005F8D8F
/* APIError.swift in Sources */
,
02CE4DC82ADF97E8002E79BC
/* View+Extensions.swift in Sources */
,
02CE4DC82ADF97E8002E79BC
/* View+Extensions.swift in Sources */
,
020B98412AD8C3810029DE4C
/* LoginView.swift in Sources */
,
020B98412AD8C3810029DE4C
/* LoginView.swift in Sources */
,
...
...
Seilassist/Sailassist/ContentView.swift
View file @
e43c5064
...
@@ -17,6 +17,13 @@ struct ContentView: View {
...
@@ -17,6 +17,13 @@ struct ContentView: View {
NavigationStack
{
NavigationStack
{
MainTabView
()
MainTabView
()
.
environmentObject
(
selectedTabModel
)
.
environmentObject
(
selectedTabModel
)
.
onAppear
(){
if
isLogin
{
guard
sceneDelegate
.
tabWindow
==
nil
else
{
return
}
sceneDelegate
.
addTabBar
(
selectedTabModel
)
selectedTabModel
.
activeTab
=
.
task
}
}
}
}
.
fullScreenCover
(
isPresented
:
.
constant
(
!
isLogin
),
onDismiss
:
{
.
fullScreenCover
(
isPresented
:
.
constant
(
!
isLogin
),
onDismiss
:
{
guard
sceneDelegate
.
tabWindow
==
nil
else
{
return
}
guard
sceneDelegate
.
tabWindow
==
nil
else
{
return
}
...
...
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
View file @
e43c5064
...
@@ -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
.
Eca
.
a
rea
.
keys
.
contains
(
data
.
name
)
{
if
!
SharingData
.
shared
.
ecaA
rea
.
keys
.
contains
(
data
.
name
)
{
let
reg
=
RegisteredEca
(
ecaName
:
data
.
name
)
!
let
reg
=
RegisteredEca
(
ecaName
:
data
.
name
)
!
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
points
=
data
.
table
reg
.
points
=
data
.
table
SharingData
.
Eca
.
a
rea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
SharingData
.
shared
.
ecaA
rea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/ECA/RegisteredEca.swift
View file @
e43c5064
...
@@ -8,18 +8,37 @@
...
@@ -8,18 +8,37 @@
import
Foundation
import
Foundation
import
CoreLocation
import
CoreLocation
class
RegisteredEca
{
//class RegisteredEca {
var
id
:
UInt32
=
0
// var id: UInt32 = 0
var
isEnable
:
Bool
=
false
//ECA有効
// var isEnable: Bool = false //ECA有効
var
isRunning
:
Bool
=
false
//ECA実行中
// var isRunning: Bool = false //ECA実行中
var
name
:
String
=
""
//ECA名称
// var name: String = "" //ECA名称
var
swNotice
:
UInt32
=
6
//ECA通知[NM]
// var swNotice: UInt32 = 6 //ECA通知[NM]
var
swStart
:
UInt32
=
5
//ECA開始[NM]
// var swStart: UInt32 = 5 //ECA開始[NM]
var
swFinish
:
UInt32
=
4
//ECA終了[NM]
// var swFinish: UInt32 = 4 //ECA終了[NM]
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
// var datetime: String = "" //時刻(UTC ISO8601準拠)
var
color
:
String
=
""
//ライン色(ARGB)
// var color: String = "" //ライン色(ARGB)
var
width
:
UInt32
=
1
//ライン幅
// var width: UInt32 = 1 //ライン幅
var
points
:
[
CLLocationCoordinate2D
]
=
[]
// var points: [CLLocationCoordinate2D] = []
//
// init?( ecaName: String ) {
// self.name = ecaName
// }
//}
class
RegisteredEca
:
ObservableObject
{
@Published
var
id
:
UInt32
=
0
@Published
var
isEnable
:
Bool
=
false
//ECA有効
@Published
var
isRunning
:
Bool
=
false
//ECA実行中
@Published
var
name
:
String
=
""
//ECA名称
@Published
var
swNotice
:
UInt32
=
6
//ECA通知[NM]
@Published
var
swStart
:
UInt32
=
5
//ECA開始[NM]
@Published
var
swFinish
:
UInt32
=
4
//ECA終了[NM]
@Published
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
@Published
var
color
:
String
=
""
//ライン色(ARGB)
@Published
var
width
:
UInt32
=
1
//ライン幅
@Published
var
points
:
[
CLLocationCoordinate2D
]
=
[]
init
?(
ecaName
:
String
)
{
init
?(
ecaName
:
String
)
{
self
.
name
=
ecaName
self
.
name
=
ecaName
...
...
Seilassist/Sailassist/Map/Task/View/EcaListView.swift
View file @
e43c5064
...
@@ -8,50 +8,42 @@
...
@@ -8,50 +8,42 @@
import
SwiftUI
import
SwiftUI
struct
EcaListView
:
View
{
struct
EcaListView
:
View
{
@ObservedObject
var
sharingData
=
SharingData
.
shared
let
ecas
=
[
"America"
,
"Canada"
,
"Japan"
]
var
body
:
some
View
{
var
body
:
some
View
{
ForEach
(
ecas
,
id
:
\
.
self
){
data
in
ForEach
(
sharingData
.
ecaArea
.
map
{
$0
.
1
},
id
:
\
.
name
){
eca
in
AddEcaView
(
name
:
data
,
isRegisterd
:
.
constant
(
true
))
HStack
{
Text
(
eca
.
name
)
Divider
()
.
padding
(
17
)
}
Spacer
()
}
if
!
eca
.
isEnable
{
}
Button
(
action
:
{
eca
.
isEnable
.
toggle
()
struct
AddEcaView
:
View
{
sharingData
.
editEcaArea
(
key
:
eca
.
name
,
value
:
eca
)
let
name
:
String
},
label
:
{
@Binding
var
isRegisterd
:
Bool
Image
(
"icon_plus"
)
var
body
:
some
View
{
.
padding
()
HStack
{
})
Text
(
"
\(
name
)
ECA"
)
.
background
(
.
primaryActiveIcon
)
.
padding
(
17
)
.
cornerRadius
(
50
)
Spacer
()
if
isRegisterd
{
Button
(
action
:
{
isRegisterd
.
toggle
()
},
label
:
{
Image
(
"icon_plus"
)
.
padding
()
})
// .frame(width: 24, height: 24)
.
background
(
.
primaryActiveIcon
)
.
cornerRadius
(
50
)
.
padding
()
}
else
{
Text
(
"Registerd"
)
.
frame
(
height
:
24
)
.
background
(
.
primaryDisable
)
.
cornerRadius
(
12
)
.
padding
()
.
padding
()
}
else
{
Text
(
"Registerd"
)
.
frame
(
height
:
24
)
.
background
(
.
primaryDisable
)
.
cornerRadius
(
12
)
.
padding
()
}
}
}
Divider
()
}
}
}
}
}
}
#Preview {
#Preview {
EcaListView
()
EcaListView
()
.
environmentObject
(
SharingData
.
shared
)
}
}
Seilassist/Sailassist/Map/Task/View/MapTaskView.swift
View file @
e43c5064
...
@@ -76,6 +76,8 @@ struct MapTaskView: View {
...
@@ -76,6 +76,8 @@ struct MapTaskView: View {
.
padding
(
.
leading
,
20
)
.
padding
(
.
leading
,
20
)
.
padding
(
.
trailing
,
10
)
.
padding
(
.
trailing
,
10
)
}
.
onAppear
{
EcaCoordinatesTable
()
.
setEcaData
()
}
}
}
}
}
}
...
...
Seilassist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
View file @
e43c5064
...
@@ -8,16 +8,34 @@
...
@@ -8,16 +8,34 @@
import
SwiftUI
import
SwiftUI
struct
TaskSwitchingMenuView
:
View
{
struct
TaskSwitchingMenuView
:
View
{
@Binding
var
viewMode
:
TaskViewMode
@Binding
var
viewMode
:
TaskViewMode
@ObservedObject
var
sharingData
=
SharingData
.
shared
var
list
:
[
ECA
]
=
[
.
America
]
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
//List
ForEach
(
sharingData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isEnable
},
id
:
\
.
name
){
eca
in
HStack
{
Circle
()
.
frame
(
width
:
10
)
.
foregroundColor
(
eca
.
isRunning
?
.
red
:
.
blue
)
Text
(
eca
.
name
)
Spacer
()
Button
(
action
:
{
for
running
in
sharingData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}{
running
.
isRunning
=
false
sharingData
.
editEcaArea
(
key
:
running
.
name
,
value
:
running
)
}
eca
.
isRunning
=
true
sharingData
.
editEcaArea
(
key
:
eca
.
name
,
value
:
eca
)
},
label
:
{
Text
(
"Button"
)
})
}
}
TaskEcaView
()
//
TaskEcaView()
//AddECAボタン
//AddECAボタン
Button
(
action
:
{
Button
(
action
:
{
viewMode
=
.
EcaList
viewMode
=
.
EcaList
...
@@ -35,20 +53,26 @@ struct TaskSwitchingMenuView: View {
...
@@ -35,20 +53,26 @@ struct TaskSwitchingMenuView: View {
}
}
struct
TaskEcaView
:
View
{
struct
TaskEcaView
:
View
{
@Binding
var
data
:
RegisteredEca
@State
var
isPopover
:
Bool
=
false
var
body
:
some
View
{
var
body
:
some
View
{
HStack
{
HStack
{
Circle
()
Circle
()
.
frame
(
width
:
10
)
.
frame
(
width
:
10
)
Text
(
"America ECA"
)
Text
(
data
.
name
)
Spacer
()
Spacer
()
Button
(
action
:
{
Button
(
action
:
{
// isPopover = true
},
label
:
{
},
label
:
{
/*@START_MENU_TOKEN@*/
Text
(
"Button"
)
/*@END_MENU_TOKEN@*/
/*@START_MENU_TOKEN@*/
Text
(
"Button"
)
/*@END_MENU_TOKEN@*/
})
})
.
popover
(
isPresented
:
$
isPopover
,
content
:
{
Text
(
"aaaa"
)
})
}
}
.
padding
()
.
padding
()
}
}
...
...
Seilassist/Sailassist/Preferences/Preferences.swift
View file @
e43c5064
...
@@ -23,6 +23,8 @@ class Preferences{
...
@@ -23,6 +23,8 @@ class Preferences{
}
}
}
}
@AppStorage("KEY")
static
var
hogehoge
:
String
=
""
// func getPreferences(key)
// func getPreferences(key)
}
}
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
e43c5064
...
@@ -7,24 +7,30 @@
...
@@ -7,24 +7,30 @@
import
Foundation
import
Foundation
import
CoreLocation
import
CoreLocation
class
SharingData
{
class
SharingData
:
ObservableObject
{
static
let
shared
=
SharingData
()
class
My
{
class
My
{
static
var
location
:
CLLocationCoordinate2D
?
=
nil
static
var
location
:
CLLocationCoordinate2D
?
=
nil
static
var
speedKnot
:
Double
=
0.0
static
var
speedKnot
:
Double
=
0.0
static
var
bearing
:
Double
=
0.0
// 自船進行方向
static
var
bearing
:
Double
=
0.0
// 自船進行方向
static
var
compass
:
Double
?
=
nil
// 端末の方位
static
var
compass
:
Double
?
=
nil
// 端末の方位
static
func
reset
()
{
static
func
reset
()
{
location
=
nil
location
=
nil
speedKnot
=
0.0
speedKnot
=
0.0
bearing
=
0.0
bearing
=
0.0
}
}
}
}
/**
/**
* Eca
* Eca
*/
*/
class
Eca
{
@Published
var
ecaArea
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
static
var
area
:
Dictionary
<
String
,
RegisteredEca
>
=
[:]
func
editEcaArea
(
key
:
String
,
value
:
RegisteredEca
){
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