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
5bbab3e4
Commit
5bbab3e4
authored
Nov 27, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
a16032d9
' into develop
parents
a1b2f7b3
a16032d9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
174 additions
and
53 deletions
+174
-53
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+12
-0
EcaArea.swift
Seilassist/Sailassist/ECA/EcaArea.swift
+33
-0
EcaCoordinatesTable.swift
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
+10
-10
RegisteredEca.swift
Seilassist/Sailassist/ECA/RegisteredEca.swift
+4
-3
HttpRequestType.swift
Seilassist/Sailassist/Http/HttpRequestType.swift
+1
-1
ResEcaArea.swift
Seilassist/Sailassist/Json/ResEcaArea.swift
+14
-0
LocationViewModel.swift
Seilassist/Sailassist/LocationViewModel.swift
+4
-4
EcaSettingView.swift
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
+1
-1
TaskSwitchingMenuView.swift
...sist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
+53
-34
SessionEcaArea.swift
Seilassist/Sailassist/ServerSession/SessionEcaArea.swift
+42
-0
No files found.
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
5bbab3e4
...
@@ -86,6 +86,9 @@
...
@@ -86,6 +86,9 @@
D52D21412AEDE18F00324D58
/* EcaCoordinatesTable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
;
};
D52D21412AEDE18F00324D58
/* EcaCoordinatesTable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
;
};
D545FC742B09C74300F206D0
/* AlertManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC732B09C74300F206D0
/* AlertManager.swift */
;
};
D545FC742B09C74300F206D0
/* AlertManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC732B09C74300F206D0
/* AlertManager.swift */
;
};
D545FC762B09C81300F206D0
/* PushNotificationTypes.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC752B09C81300F206D0
/* PushNotificationTypes.swift */
;
};
D545FC762B09C81300F206D0
/* PushNotificationTypes.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC752B09C81300F206D0
/* PushNotificationTypes.swift */
;
};
D58E1F502B142A260092D8FE
/* EcaArea.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D58E1F4F2B142A260092D8FE
/* EcaArea.swift */
;
};
D58E1F522B142A3F0092D8FE
/* ResEcaArea.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D58E1F512B142A3F0092D8FE
/* ResEcaArea.swift */
;
};
D58E1F542B142A510092D8FE
/* SessionEcaArea.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D58E1F532B142A510092D8FE
/* SessionEcaArea.swift */
;
};
D592D5232B0F14FE00B91A1C
/* SessionUploadImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
;
};
D592D5232B0F14FE00B91A1C
/* SessionUploadImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
;
};
D592D5252B0F16CA00B91A1C
/* ReqMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
;
};
D592D5252B0F16CA00B91A1C
/* ReqMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
;
};
D592D5272B0F182C00B91A1C
/* ReqAckMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
;
};
D592D5272B0F182C00B91A1C
/* ReqAckMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
;
};
...
@@ -223,6 +226,9 @@
...
@@ -223,6 +226,9 @@
D53ACA752B0AECF8008DCB18
/* Sailassist.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.entitlements
;
name
=
Sailassist.entitlements
;
path
=
Sailassist/Sailassist.entitlements
;
sourceTree
=
"<group>"
;
};
D53ACA752B0AECF8008DCB18
/* Sailassist.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.entitlements
;
name
=
Sailassist.entitlements
;
path
=
Sailassist/Sailassist.entitlements
;
sourceTree
=
"<group>"
;
};
D545FC732B09C74300F206D0
/* AlertManager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
AlertManager.swift
;
path
=
Sailassist/VoiceManager/AlertManager.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D545FC732B09C74300F206D0
/* AlertManager.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
AlertManager.swift
;
path
=
Sailassist/VoiceManager/AlertManager.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D545FC752B09C81300F206D0
/* PushNotificationTypes.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
PushNotificationTypes.swift
;
path
=
Sailassist/DataSource/PushNotificationTypes.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D545FC752B09C81300F206D0
/* PushNotificationTypes.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
PushNotificationTypes.swift
;
path
=
Sailassist/DataSource/PushNotificationTypes.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D58E1F4F2B142A260092D8FE
/* EcaArea.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
EcaArea.swift
;
path
=
Sailassist/ECA/EcaArea.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D58E1F512B142A3F0092D8FE
/* ResEcaArea.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ResEcaArea.swift
;
path
=
Sailassist/Json/ResEcaArea.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D58E1F532B142A510092D8FE
/* SessionEcaArea.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SessionEcaArea.swift
;
path
=
Sailassist/ServerSession/SessionEcaArea.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SessionUploadImage.swift
;
path
=
Sailassist/ServerSession/SessionUploadImage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SessionUploadImage.swift
;
path
=
Sailassist/ServerSession/SessionUploadImage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqMessage.swift
;
path
=
Sailassist/Json/ReqMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqMessage.swift
;
path
=
Sailassist/Json/ReqMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqAckMessage.swift
;
path
=
Sailassist/Json/ReqAckMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqAckMessage.swift
;
path
=
Sailassist/Json/ReqAckMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
...
@@ -498,6 +504,7 @@
...
@@ -498,6 +504,7 @@
022789122AE602D800A87787
/* ServerSession */
=
{
022789122AE602D800A87787
/* ServerSession */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
D58E1F532B142A510092D8FE
/* SessionEcaArea.swift */
,
D5AE351C2AEBA6FC00059889
/* SessionLogin.swift */
,
D5AE351C2AEBA6FC00059889
/* SessionLogin.swift */
,
02CD06922AE88970005F8D8F
/* ServerSession.swift */
,
02CD06922AE88970005F8D8F
/* ServerSession.swift */
,
02CD06942AE895F5005F8D8F
/* APIError.swift */
,
02CD06942AE895F5005F8D8F
/* APIError.swift */
,
...
@@ -630,6 +637,7 @@
...
@@ -630,6 +637,7 @@
D52D213B2AEBB78E00324D58
/* ECA */
=
{
D52D213B2AEBB78E00324D58
/* ECA */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
D58E1F4F2B142A260092D8FE
/* EcaArea.swift */
,
D52D213E2AEBB7D700324D58
/* RegisteredEca.swift */
,
D52D213E2AEBB7D700324D58
/* RegisteredEca.swift */
,
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
,
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
,
D5CB6FA02B023F7F00EC2010
/* EcaTask.swift */
,
D5CB6FA02B023F7F00EC2010
/* EcaTask.swift */
,
...
@@ -648,6 +656,7 @@
...
@@ -648,6 +656,7 @@
D5AE35172AEBA64800059889
/* Json */
=
{
D5AE35172AEBA64800059889
/* Json */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
D58E1F512B142A3F0092D8FE
/* ResEcaArea.swift */
,
D5AE35182AEBA66A00059889
/* ReqLogin.swift */
,
D5AE35182AEBA66A00059889
/* ReqLogin.swift */
,
D5AE35192AEBA66A00059889
/* ResLogin.swift */
,
D5AE35192AEBA66A00059889
/* ResLogin.swift */
,
D5CB6F982B02088C00EC2010
/* ResShipStatus.swift */
,
D5CB6F982B02088C00EC2010
/* ResShipStatus.swift */
,
...
@@ -879,6 +888,7 @@
...
@@ -879,6 +888,7 @@
D5258CA72B03988600365276
/* ReqTaskList.swift in Sources */
,
D5258CA72B03988600365276
/* ReqTaskList.swift in Sources */
,
D5CB6F9B2B021C4F00EC2010
/* LocationViewModel.swift in Sources */
,
D5CB6F9B2B021C4F00EC2010
/* LocationViewModel.swift in Sources */
,
02CE4DC82ADF97E8002E79BC
/* View+Extensions.swift in Sources */
,
02CE4DC82ADF97E8002E79BC
/* View+Extensions.swift in Sources */
,
D58E1F542B142A510092D8FE
/* SessionEcaArea.swift in Sources */
,
025C28002B034A1900BADC49
/* PDFViewer.swift in Sources */
,
025C28002B034A1900BADC49
/* PDFViewer.swift in Sources */
,
02C3E6092AFDF30000AF7837
/* ChatMemberView.swift in Sources */
,
02C3E6092AFDF30000AF7837
/* ChatMemberView.swift in Sources */
,
020B98412AD8C3810029DE4C
/* LoginView.swift in Sources */
,
020B98412AD8C3810029DE4C
/* LoginView.swift in Sources */
,
...
@@ -911,8 +921,10 @@
...
@@ -911,8 +921,10 @@
020B98692ADD221E0029DE4C
/* Preferences.swift in Sources */
,
020B98692ADD221E0029DE4C
/* Preferences.swift in Sources */
,
02CD06932AE88970005F8D8F
/* ServerSession.swift in Sources */
,
02CD06932AE88970005F8D8F
/* ServerSession.swift in Sources */
,
02A1DE312AFB61D8005BCF55
/* MyChatContentView.swift in Sources */
,
02A1DE312AFB61D8005BCF55
/* MyChatContentView.swift in Sources */
,
D58E1F522B142A3F0092D8FE
/* ResEcaArea.swift in Sources */
,
025C27FE2B0206D700BADC49
/* PDFDownloadManager.swift in Sources */
,
025C27FE2B0206D700BADC49
/* PDFDownloadManager.swift in Sources */
,
025C27FC2AFE191A00BADC49
/* MenuManualView.swift in Sources */
,
025C27FC2AFE191A00BADC49
/* MenuManualView.swift in Sources */
,
D58E1F502B142A260092D8FE
/* EcaArea.swift in Sources */
,
020B98592AD92A4C0029DE4C
/* MainTabView.swift in Sources */
,
020B98592AD92A4C0029DE4C
/* MainTabView.swift in Sources */
,
020B984F2AD9182D0029DE4C
/* InputUserNameView.swift in Sources */
,
020B984F2AD9182D0029DE4C
/* InputUserNameView.swift in Sources */
,
D5AE351A2AEBA66A00059889
/* ReqLogin.swift in Sources */
,
D5AE351A2AEBA66A00059889
/* ReqLogin.swift in Sources */
,
...
...
Seilassist/Sailassist/ECA/EcaArea.swift
0 → 100644
View file @
5bbab3e4
//
// EcaArea.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/26.
//
import
Foundation
import
CoreLocation
class
EcaArea
{
var
sessionEcaArea
=
SessionEcaArea
()
func
start
()
{
print
(
debug
:
"called"
)
sessionEcaArea
.
RequestEcaArea
(
responseEcaArea
)
}
private
func
responseEcaArea
(
result
:
Result
<
Data
,
APIError
>
)
{
print
(
debug
:
"called"
)
switch
result
{
case
.
success
(
let
resultData
):
let
serverSession
=
ServerSession
()
let
resjson
=
serverSession
.
fromJSON
(
resultData
:
resultData
,
resltType
:
[
ResEcaArea
]
.
self
)
if
let
res
=
resjson
{
var
area
=
res
}
case
.
failure
(
let
errorCode
):
print
(
debug
:
errorCode
)
break
}
}
}
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
View file @
5bbab3e4
...
@@ -4313,19 +4313,19 @@ class EcaCoordinatesTable : NSObject {
...
@@ -4313,19 +4313,19 @@ class EcaCoordinatesTable : NSObject {
}
}
var
ecaDataTable
:[
ecaData
]
=
[
var
ecaDataTable
:[
ecaData
]
=
[
// ecaData(id: 1, name: "North American Atlantic Coasts", table: northAmericanAtlanticCoasts),
// ecaData(id: 1
1
, name: "North American Atlantic Coasts", table: northAmericanAtlanticCoasts),
// ecaData(id: 2, name: "North American Hawai", table: northAmericanHawai),
// ecaData(id:
1
2, name: "North American Hawai", table: northAmericanHawai),
// ecaData(id: 3, name: "Unites States Caribbean", table: unitesStatesCaribbean),
// ecaData(id: 3
1
, name: "Unites States Caribbean", table: unitesStatesCaribbean),
// ecaData(id:
4, name: "North Sea 1", table: northSea1),
// ecaData(id:
21, name: "North Sea 1", table: northSea1), //err
// ecaData(id:
5
, name: "North Sea 2", table: northSea2),
// ecaData(id:
22
, name: "North Sea 2", table: northSea2),
// ecaData(id:
6
, name: "Iceland", table: iceland),
// ecaData(id:
1
, name: "Iceland", table: iceland),
// ecaData(id: 7, name: "China Shore", table: chinaShore),
// ecaData(id: 7, name: "China Shore", table: chinaShore),
// ecaData(id: 8, name: "China Hainan", table: chinaHainan),
// ecaData(id: 8, name: "China Hainan", table: chinaHainan),
// ecaData(id: 9, name: "China Yangtzi Shuifu,Yunnan", table: chinaYangtziShuifuYunnan),
// ecaData(id: 9, name: "China Yangtzi Shuifu,Yunnan", table: chinaYangtziShuifuYunnan),
//err
// ecaData(id: 10, name: "China Yangtzi Liuhekou,Jiangsu1", table: chinaYangtziLiuhekouJiangsu1),
// ecaData(id: 10, name: "China Yangtzi Liuhekou,Jiangsu1", table: chinaYangtziLiuhekouJiangsu1),
// ecaData(id: 11, name: "China Yangtzi Liuhekou,Jiangsu2", table: chinaYangtziLiuhekouJiangsu2),
// ecaData(id: 11, name: "China Yangtzi Liuhekou,Jiangsu2", table: chinaYangtziLiuhekouJiangsu2),
// ecaData(id: 12, name: "China Xijiang Nanning,Guangxi", table: chinaXijiangNanningGuangxi),
// ecaData(id: 12, name: "China Xijiang Nanning,Guangxi", table: chinaXijiangNanningGuangxi),
//err
// ecaData(id: 13, name: "China Xijiang Zhaoqing,Guangdong", table: chinaXijiangNanningGuangdong),
// ecaData(id: 13, name: "China Xijiang Zhaoqing,Guangdong", table: chinaXijiangNanningGuangdong),
//err
// ecaData(id: 14, name: "Korea Incheon, PyeongtaekDangjin Port", table: incheonPyeongtaekDanjinPort),
// ecaData(id: 14, name: "Korea Incheon, PyeongtaekDangjin Port", table: incheonPyeongtaekDanjinPort),
// ecaData(id: 15, name: "Korea Yeosu, Gwangyang Port", table: yeosuGwangyangPort),
// ecaData(id: 15, name: "Korea Yeosu, Gwangyang Port", table: yeosuGwangyangPort),
// ecaData(id: 16, name: "Korea Busan Port", table: koreaBusanPort),
// ecaData(id: 16, name: "Korea Busan Port", table: koreaBusanPort),
...
@@ -4338,7 +4338,7 @@ class EcaCoordinatesTable : NSObject {
...
@@ -4338,7 +4338,7 @@ class EcaCoordinatesTable : NSObject {
func
setEcaData
()
{
func
setEcaData
()
{
for
data
in
ecaDataTable
{
for
data
in
ecaDataTable
{
if
!
SharingData
.
eca
.
ecaArea
.
keys
.
contains
(
data
.
name
)
{
if
!
SharingData
.
eca
.
ecaArea
.
keys
.
contains
(
data
.
name
)
{
var
reg
=
RegisteredEca
(
ecaName
:
data
.
name
)
!
var
reg
=
RegisteredEca
(
id
:
data
.
id
,
ecaName
:
data
.
name
)
!
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
color
=
"0xFF0000"
//ライン色(ARGB)
reg
.
points
=
data
.
table
reg
.
points
=
data
.
table
SharingData
.
eca
.
ecaArea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
SharingData
.
eca
.
ecaArea
.
updateValue
(
reg
,
forKey
:
data
.
name
)
...
...
Seilassist/Sailassist/ECA/RegisteredEca.swift
View file @
5bbab3e4
...
@@ -19,7 +19,7 @@ enum EcaState {
...
@@ -19,7 +19,7 @@ enum EcaState {
}
}
struct
RegisteredEca
{
struct
RegisteredEca
{
var
id
:
UInt32
=
0
var
id
:
Int
=
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名称
...
@@ -29,10 +29,11 @@ struct RegisteredEca {
...
@@ -29,10 +29,11 @@ struct RegisteredEca {
var
status
:
EcaState
=
EcaState
.
start
//ECA状態
var
status
:
EcaState
=
EcaState
.
start
//ECA状態
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
var
color
:
String
=
""
//ライン色(ARGB)
var
color
:
String
=
""
//ライン色(ARGB)
var
width
:
UInt32
=
1
//ライン幅
var
width
:
Int
=
1
//ライン幅
var
points
:
[
CLLocationCoordinate2D
]
=
[]
var
points
:
[
CLLocationCoordinate2D
]
=
[]
init
?(
ecaName
:
String
)
{
init
?(
id
:
Int
,
ecaName
:
String
)
{
self
.
id
=
id
self
.
name
=
ecaName
self
.
name
=
ecaName
}
}
}
}
Seilassist/Sailassist/Http/HttpRequestType.swift
View file @
5bbab3e4
...
@@ -16,7 +16,7 @@ enum HttpRequestType : String {
...
@@ -16,7 +16,7 @@ enum HttpRequestType : String {
case
CookiePolicy
=
"https://ssv-canary-web.azurewebsites.net/cookiepolicy"
case
CookiePolicy
=
"https://ssv-canary-web.azurewebsites.net/cookiepolicy"
case
PrivacyPolicy
=
"https://ssv-canary-web.azurewebsites.net/inapp?"
//+バージョン番号
case
PrivacyPolicy
=
"https://ssv-canary-web.azurewebsites.net/inapp?"
//+バージョン番号
case
TaskList
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/tasklist/XXXXX"
case
TaskList
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/tasklist/XXXXX"
case
EcaArea
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/ecaarea"
case
EcaArea
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/ecaarea
/XXXXX
"
case
ShipStatus
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/shipstatus/XXXXX"
case
ShipStatus
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/shipstatus/XXXXX"
case
ShipMonitoringRoute
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/shipmonitoringroute/XXXXX"
case
ShipMonitoringRoute
=
"https://ssv-canary-web.azurewebsites.net/api/sailassist/shipmonitoringroute/XXXXX"
case
GetMessage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
case
GetMessage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/getmessages?shipId=XXXXX"
...
...
Seilassist/Sailassist/Json/ResEcaArea.swift
0 → 100644
View file @
5bbab3e4
//
// ResEcaArea.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/26.
//
import
Foundation
struct
ResEcaArea
:
Codable
{
var
areaId
:
Int
var
areaName
:
String
var
geometry
:
[
points
]?
}
Seilassist/Sailassist/LocationViewModel.swift
View file @
5bbab3e4
...
@@ -12,6 +12,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -12,6 +12,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
@Published
var
lastSeenLocation
:
CLLocation
?
@Published
var
lastSeenLocation
:
CLLocation
?
private
let
locationManager
:
CLLocationManager
private
let
locationManager
:
CLLocationManager
let
ecaTask
=
EcaTask
()
override
init
()
{
override
init
()
{
locationManager
=
CLLocationManager
()
locationManager
=
CLLocationManager
()
...
@@ -38,17 +39,16 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
...
@@ -38,17 +39,16 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
func
locationManager
(
_
manager
:
CLLocationManager
,
didUpdateLocations
locations
:
[
CLLocation
])
{
func
locationManager
(
_
manager
:
CLLocationManager
,
didUpdateLocations
locations
:
[
CLLocation
])
{
if
let
newLocation
=
locations
.
last
{
if
let
newLocation
=
locations
.
last
{
let
isLocation
=
filterLocation
(
newLocation
)
//
let isLocation = filterLocation(newLocation)
if
isLocation
{
//
if isLocation {
lastSeenLocation
=
locations
.
first
lastSeenLocation
=
locations
.
first
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
let
targetCoordinate
:
CLLocationCoordinate2D
=
lastSeenLocation
!.
coordinate
SharingData
.
my
.
gps
=
targetCoordinate
SharingData
.
my
.
gps
=
targetCoordinate
if
Preferences
.
LocationType
==
0
{
if
Preferences
.
LocationType
==
0
{
SharingData
.
my
.
location
=
SharingData
.
my
.
gps
SharingData
.
my
.
location
=
SharingData
.
my
.
gps
let
ecaTask
=
EcaTask
()
ecaTask
.
checkEca
()
ecaTask
.
checkEca
()
}
}
}
//
}
}
}
}
}
...
...
Seilassist/Sailassist/Map/Task/View/EcaSettingView.swift
View file @
5bbab3e4
...
@@ -211,5 +211,5 @@ struct EcaSettingView: View {
...
@@ -211,5 +211,5 @@ struct EcaSettingView: View {
}
}
#Preview {
#Preview {
EcaSettingView
(
isShowSettingEca
:
.
constant
(
true
),
edittingEca
:
RegisteredEca
(
ecaName
:
"eca"
)
!
)
EcaSettingView
(
isShowSettingEca
:
.
constant
(
true
),
edittingEca
:
RegisteredEca
(
id
:
0
,
ecaName
:
"eca"
)
!
)
}
}
Seilassist/Sailassist/Map/Task/View/TaskSwitchingMenuView.swift
View file @
5bbab3e4
...
@@ -7,28 +7,35 @@
...
@@ -7,28 +7,35 @@
import
SwiftUI
import
SwiftUI
enum
EcaAlertType
:
String
{
case
ecaDelete
case
ecaRunningStop
}
struct
TaskSwitchingMenuView
:
View
{
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
ecaData
=
SharingData
.
eca
@ObservedObject
var
ecaData
=
SharingData
.
eca
@State
var
isDeleteAlert
:
Bool
=
false
@State
var
isEcaAlert
:
Bool
=
false
@State
var
ecaAlertType
:
EcaAlertType
=
.
ecaDelete
var
body
:
some
View
{
var
body
:
some
View
{
VStack
{
VStack
{
ForEach
(
ecaData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isEnable
},
id
:
\
.
name
){
eca
in
ForEach
(
ecaData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isEnable
},
id
:
\
.
name
){
eca
in
VStack
{
VStack
{
HStack
{
HStack
{
Button
{
Button
{
for
runningEca
in
ecaData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}{
for
runningEca
in
ecaData
.
ecaArea
.
map
{
$0
.
1
}
.
filter
{
$0
.
isRunning
}{
var
newData
=
runningEca
edittingEcaArea
=
runningEca
newData
.
isRunning
=
false
isEcaAlert
=
true
ecaData
.
editEcaArea
(
key
:
runningEca
.
name
,
value
:
newData
)
ecaAlertType
=
.
ecaRunningStop
}
if
isEcaAlert
==
false
{
var
newData
=
eca
newData
.
isRunning
=
true
ecaData
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
}
}
var
newData
=
eca
newData
.
isRunning
=
true
ecaData
.
editEcaArea
(
key
:
eca
.
name
,
value
:
newData
)
}
label
:
{
}
label
:
{
HStack
{
HStack
{
Circle
()
Circle
()
...
@@ -36,13 +43,15 @@ struct TaskSwitchingMenuView: View {
...
@@ -36,13 +43,15 @@ struct TaskSwitchingMenuView: View {
.
foregroundColor
(
eca
.
isRunning
?
ColorSet
.
PrimaryActiveIcon
.
color
:
ColorSet
.
TaskStateIcon
.
color
)
.
foregroundColor
(
eca
.
isRunning
?
ColorSet
.
PrimaryActiveIcon
.
color
:
ColorSet
.
TaskStateIcon
.
color
)
Spacer
()
Spacer
()
.
frame
(
width
:
10
)
.
frame
(
width
:
10
)
Text
(
eca
.
name
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
}
}
}
}
Text
(
eca
.
name
)
.
font
(
FontStyle
.
DefaultText
.
font
)
.
foregroundColor
(
ColorSet
.
Body
.
color
)
.
onTapGesture
{
ecaData
.
foucusEca
=
eca
.
name
}
Spacer
()
Spacer
()
...
@@ -58,36 +67,46 @@ struct TaskSwitchingMenuView: View {
...
@@ -58,36 +67,46 @@ struct TaskSwitchingMenuView: View {
Button
{
Button
{
edittingEcaArea
=
eca
edittingEcaArea
=
eca
isDeleteAlert
=
true
isEcaAlert
=
true
ecaAlertType
=
.
ecaDelete
}
label
:
{
}
label
:
{
Text
(
"Delete ECA Task"
)
Text
(
"Delete ECA Task"
)
}
}
}
label
:
{
}
label
:
{
Image
(
systemName
:
"ellipsis"
)
Image
(
systemName
:
"ellipsis"
)
.
frame
(
width
:
22
,
height
:
22
)
.
frame
(
width
:
22
,
height
:
22
)
.
foregroundColor
(
ColorSet
.
Slidebar
.
color
)
.
foregroundColor
(
eca
.
isRunning
?
ColorSet
.
Splash
.
color
:
ColorSet
.
Slidebar
.
color
)
}
}
.
disabled
(
eca
.
isRunning
)
.
disabled
(
eca
.
isRunning
)
.
alert
(
"delete"
,
isPresented
:
$
isDeleteAlert
)
{
.
alert
(
isPresented
:
$
isEcaAlert
)
{
Button
(
role
:
.
destructive
)
{
switch
ecaAlertType
{
if
let
ecaArea
=
edittingEcaArea
{
case
.
ecaDelete
:
var
newData
=
ecaArea
return
Alert
(
title
:
Text
(
"delete"
),
newData
.
isEnable
=
false
message
:
Text
(
"eca delete"
),
ecaData
.
editEcaArea
(
key
:
ecaArea
.
name
,
value
:
newData
)
primaryButton
:
.
default
(
Text
(
"cancel"
)),
}
secondaryButton
:
.
cancel
(
Text
(
"delete"
),
action
:
{
edittingEcaArea
=
nil
if
let
ecaArea
=
edittingEcaArea
{
}
label
:
{
var
newData
=
ecaArea
Text
(
"delete"
)
newData
.
isEnable
=
false
}
ecaData
.
editEcaArea
(
key
:
ecaArea
.
name
,
value
:
newData
)
}
Button
(
role
:
.
cancel
)
{
edittingEcaArea
=
nil
}))
}
label
:
{
case
.
ecaRunningStop
:
Text
(
"cancel"
)
return
Alert
(
title
:
Text
(
"stop"
),
message
:
Text
(
"eca running stop"
),
primaryButton
:
.
default
(
Text
(
"cancel"
)),
secondaryButton
:
.
cancel
(
Text
(
"stop"
),
action
:
{
if
let
ecaArea
=
edittingEcaArea
{
var
newData
=
ecaArea
newData
.
isRunning
=
false
newData
.
status
=
EcaState
.
cancel
ecaData
.
editEcaArea
(
key
:
ecaArea
.
name
,
value
:
newData
)
//サーバーにECAキャンセルを通知
}
edittingEcaArea
=
nil
}))
}
}
}
message
:
{
Text
(
"eca delete"
)
}
}
}
}
.
frame
(
height
:
60
)
.
frame
(
height
:
60
)
...
...
Seilassist/Sailassist/ServerSession/SessionEcaArea.swift
0 → 100644
View file @
5bbab3e4
//
// SessionEcaArea.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/26.
//
import
Foundation
import
SwiftUI
class
SessionEcaArea
:
ObservableObject
{
@Published
var
status
=
false
// シングルトン宣言
static
let
OnlyOne
=
SessionEcaArea
()
private
var
serverSession
=
ServerSession
()
private
var
Calling
:
Bool
=
false
// 通信中
/**
* Monitoring Route
*/
func
RequestEcaArea
(
_
completion
:
@escaping
((
Result
<
Data
,
APIError
>
))
->
Void
)
{
print
(
debug
:
"calld"
)
if
Calling
{
return
}
Calling
=
true
// リクエストURLの組み立て
let
id
=
SharingData
.
my
.
shipId
if
id
!=
0
{
var
url_string
:
String
=
HttpRequestType
.
EcaArea
.
rawValue
url_string
=
url_string
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
id
))
guard
let
req_url
=
URL
(
string
:
url_string
)
else
{
Calling
=
false
return
}
serverSession
.
getJson
(
req_url
,
completion
:
completion
)
}
}
}
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