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
78c93d1b
Commit
78c93d1b
authored
Nov 24, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
49894779
' into develop
parents
f7c1e69c
49894779
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
398 additions
and
386 deletions
+398
-386
project.pbxproj
Seilassist/Pods/Pods.xcodeproj/project.pbxproj
+14
-15
project.pbxproj
Seilassist/Sailassist.xcodeproj/project.pbxproj
+16
-20
Canary.xcscheme
...ilassist.xcodeproj/xcshareddata/xcschemes/Canary.xcscheme
+0
-77
QC.xcscheme
...t/Sailassist.xcodeproj/xcshareddata/xcschemes/QC.xcscheme
+0
-77
ContentView.swift
Seilassist/Sailassist/ContentView.swift
+2
-14
AlertDB.swift
Seilassist/Sailassist/DataSource/AlertDB.swift
+3
-4
EcaCoordinatesTable.swift
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
+0
-0
EcaTask.swift
Seilassist/Sailassist/ECA/EcaTask.swift
+14
-9
RegisteredEca.swift
Seilassist/Sailassist/ECA/RegisteredEca.swift
+11
-0
HttpRequestType.swift
Seilassist/Sailassist/Http/HttpRequestType.swift
+3
-0
Info.plist
Seilassist/Sailassist/Info.plist
+0
-1
ReqAckMessage.swift
Seilassist/Sailassist/Json/ReqAckMessage.swift
+21
-0
ReqChatModeMessage.swift
Seilassist/Sailassist/Json/ReqChatModeMessage.swift
+24
-0
ReqMessage.swift
Seilassist/Sailassist/Json/ReqMessage.swift
+25
-0
LocationCalculation.swift
Seilassist/Sailassist/Location/LocationCalculation.swift
+92
-41
LoginView.swift
Seilassist/Sailassist/Login/LoginView.swift
+25
-1
no_sound.mp3
Seilassist/Sailassist/OtherAlertVoice/no_sound.mp3
+0
-0
sound_eca.mp3
Seilassist/Sailassist/OtherAlertVoice/sound_eca.mp3
+0
-0
RequestLocationView.swift
Seilassist/Sailassist/RequestLocationView.swift
+0
-26
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+2
-0
SessionUploadImage.swift
Seilassist/Sailassist/ServerSession/SessionUploadImage.swift
+45
-0
SignalRService.swift
Seilassist/Sailassist/SignalR/SignalRService.swift
+99
-27
AlertManager.swift
Seilassist/Sailassist/VoiceManager/AlertManager.swift
+2
-74
No files found.
Seilassist/Pods/Pods.xcodeproj/project.pbxproj
View file @
78c93d1b
...
...
@@ -16,6 +16,7 @@
dependencies
=
(
);
name
=
"AzureNotificationHubs-iOS"
;
productName
=
"AzureNotificationHubs-iOS"
;
};
/* End PBXAggregateTarget section */
...
...
@@ -121,7 +122,7 @@
99743ABC5876BBF855E5EE7D4D9BBFBC
/* HubConnection.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
HubConnection.swift
;
path
=
Sources/SignalRClient/HubConnection.swift
;
sourceTree
=
"<group>"
;
};
998C647A59261C90EA8DF5F841F81ED8
/* Pods-Sailassist-umbrella.h */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"Pods-Sailassist-umbrella.h"
;
sourceTree
=
"<group>"
;
};
9A23C67D0548DF810D1712CBE602461B
/* LongPollingTransport.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
LongPollingTransport.swift
;
path
=
Sources/SignalRClient/LongPollingTransport.swift
;
sourceTree
=
"<group>"
;
};
9D940727FF8FB9C785EB98E56350EF41
/* Podfile */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
text.script.ruby
;
includeInIndex
=
1
;
indentWidth
=
2
;
lastKnownFileType
=
text
;
name
=
Podfile
;
path
=
../Podfile
;
sourceTree
=
SOURCE_ROOT
;
tabWidth
=
2
;
xcLanguageSpecificationIdentifier
=
xcode.lang.ruby
;
};
9D940727FF8FB9C785EB98E56350EF41
/* Podfile */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
text.script.ruby
;
includeInIndex
=
1
;
indentWidth
=
2
;
name
=
Podfile
;
path
=
../Podfile
;
sourceTree
=
SOURCE_ROOT
;
tabWidth
=
2
;
xcLanguageSpecificationIdentifier
=
xcode.lang.ruby
;
};
9F9AF6D4F29B01D2A9287D1F02E85155
/* JSONHubProtocol.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
JSONHubProtocol.swift
;
path
=
Sources/SignalRClient/JSONHubProtocol.swift
;
sourceTree
=
"<group>"
;
};
A347F728F5AAA8B41DAFE3AD233425B1
/* SwiftSignalRClient-Info.plist */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
text.plist.xml
;
path
=
"SwiftSignalRClient-Info.plist"
;
sourceTree
=
"<group>"
;
};
B1C92344570F3702174B6CD251E58E9E
/* Pods-SailAssistTests-acknowledgements.plist */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
text.plist.xml
;
path
=
"Pods-SailAssistTests-acknowledgements.plist"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -131,7 +132,7 @@
B718183D31FC6004F71844FA616C449A
/* HandshakeProtocol.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
HandshakeProtocol.swift
;
path
=
Sources/SignalRClient/HandshakeProtocol.swift
;
sourceTree
=
"<group>"
;
};
C0A0244A30A292024A7AB96104039BFB
/* HubConnectionExtensions.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
HubConnectionExtensions.swift
;
path
=
Sources/SignalRClient/HubConnectionExtensions.swift
;
sourceTree
=
"<group>"
;
};
C99CC2D377D211487E80F9DC15293987
/* NegotiationResponse.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
NegotiationResponse.swift
;
path
=
Sources/SignalRClient/NegotiationResponse.swift
;
sourceTree
=
"<group>"
;
};
CA2C16F20715BBB5C1E288B9406F6303
/* WindowsAzureMessaging.xcframework */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
name
=
WindowsAzureMessaging.xcframework
;
path
=
"WindowsAzureMessaging-SDK-Apple/WindowsAzureMessaging.xcframework"
;
sourceTree
=
"<group>"
;
};
CA2C16F20715BBB5C1E288B9406F6303
/* WindowsAzureMessaging.xcframework */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
wrapper.xcframework
;
name
=
WindowsAzureMessaging.xcframework
;
path
=
"WindowsAzureMessaging-SDK-Apple/WindowsAzureMessaging.xcframework"
;
sourceTree
=
"<group>"
;
};
CB2414C9D8D9290C1D5F4211D6FC4E26
/* Logger.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
Logger.swift
;
path
=
Sources/SignalRClient/Logger.swift
;
sourceTree
=
"<group>"
;
};
D1D56B5309D1F749EC584E7F5D901428
/* HubConnectionDelegate.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
HubConnectionDelegate.swift
;
path
=
Sources/SignalRClient/HubConnectionDelegate.swift
;
sourceTree
=
"<group>"
;
};
D282F486E6C5E74D2F27BF5ED45ADD47
/* Pods-SailAssistTests-umbrella.h */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"Pods-SailAssistTests-umbrella.h"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -143,7 +144,7 @@
DFFD42573E1097252DD74B9B8686713D
/* ServerInvocationHandler.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ServerInvocationHandler.swift
;
path
=
Sources/SignalRClient/ServerInvocationHandler.swift
;
sourceTree
=
"<group>"
;
};
E04B4C3FF284BC409C8436B3C844044C
/* SwiftSignalRClient-prefix.pch */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"SwiftSignalRClient-prefix.pch"
;
sourceTree
=
"<group>"
;
};
E347DFCE3670A0953EA7E9880C7723D0
/* SignalRError.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SignalRError.swift
;
path
=
Sources/SignalRClient/SignalRError.swift
;
sourceTree
=
"<group>"
;
};
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient
*/
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
name
=
SwiftSignalRClient
;
path
=
SwiftSignalRClient.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient
.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
path
=
SwiftSignalRClient.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
F04040FA4924616899E5F9CD0D5FEF94
/* HttpConnection.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
HttpConnection.swift
;
path
=
Sources/SignalRClient/HttpConnection.swift
;
sourceTree
=
"<group>"
;
};
F371DF14209E4C63D0D1BFF890B0E44D
/* Pods-SailAssistTests */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
name
=
"Pods-SailAssistTests"
;
path
=
Pods_SailAssistTests.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
FAD4FBDFB36028046481AC609256BC25
/* Connection.swift */
=
{
isa
=
PBXFileReference
;
includeInIndex
=
1
;
lastKnownFileType
=
sourcecode.swift
;
name
=
Connection.swift
;
path
=
Sources/SignalRClient/Connection.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -287,7 +288,7 @@
children
=
(
32C8F03288ABF8CB2E1A04518F1394B9
/* Pods-Sailassist */
,
F371DF14209E4C63D0D1BFF890B0E44D
/* Pods-SailAssistTests */
,
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient */
,
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient
.framework
*/
,
);
name
=
Products
;
sourceTree
=
"<group>"
;
...
...
@@ -327,7 +328,6 @@
09BBFD81D450AA2C354BDC78D4AF50E6
/* WebsocketsTransport.swift */
,
C80DDBE8FD00464F8F959003EF78F8BF
/* Support Files */
,
);
name
=
SwiftSignalRClient
;
path
=
SwiftSignalRClient
;
sourceTree
=
"<group>"
;
};
...
...
@@ -346,7 +346,6 @@
1187AA037CB2DE219A69DE3350C6828B
/* Frameworks */
,
6AAA309192D5B46A98CB622F6E79D3D7
/* Support Files */
,
);
name
=
"AzureNotificationHubs-iOS"
;
path
=
"AzureNotificationHubs-iOS"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -434,7 +433,7 @@
);
name
=
SwiftSignalRClient
;
productName
=
SwiftSignalRClient
;
productReference
=
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient */
;
productReference
=
E7AFB048F72A32D1AB967A9164E20741
/* SwiftSignalRClient
.framework
*/
;
productType
=
"com.apple.product-type.framework"
;
};
/* End PBXNativeTarget section */
...
...
@@ -672,7 +671,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
16.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -698,7 +697,7 @@
GCC_PREFIX_HEADER
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch"
;
INFOPLIST_FILE
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist"
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
1.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
6.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -857,7 +856,7 @@
GCC_PREFIX_HEADER
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch"
;
INFOPLIST_FILE
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist"
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
1.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
6.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -929,7 +928,7 @@
GCC_PREFIX_HEADER
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch"
;
INFOPLIST_FILE
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist"
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
1.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
6.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -954,7 +953,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
16.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -1046,7 +1045,7 @@
GCC_PREFIX_HEADER
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-prefix.pch"
;
INFOPLIST_FILE
=
"Target Support Files/SwiftSignalRClient/SwiftSignalRClient-Info.plist"
;
INSTALL_PATH
=
"$(LOCAL_LIBRARY_DIR)/Frameworks"
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
1.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
1
6.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -1110,7 +1109,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
16.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
@@ -1277,7 +1276,7 @@
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
16.4
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"@executable_path/Frameworks"
,
...
...
Seilassist/Sailassist.xcodeproj/project.pbxproj
View file @
78c93d1b
...
...
@@ -83,16 +83,17 @@
D52D213A2AEBAC0500324D58
/* HttpRequestType.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D52D21392AEBAC0500324D58
/* HttpRequestType.swift */
;
};
D52D213F2AEBB7D700324D58
/* RegisteredEca.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D52D213E2AEBB7D700324D58
/* RegisteredEca.swift */
;
};
D52D21412AEDE18F00324D58
/* EcaCoordinatesTable.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
;
};
D545FC712B09C3F900F206D0
/* sound_eca.mp3 in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC702B09C3F900F206D0
/* sound_eca.mp3 */
;
};
D545FC742B09C74300F206D0
/* AlertManager.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC732B09C74300F206D0
/* AlertManager.swift */
;
};
D545FC762B09C81300F206D0
/* PushNotificationTypes.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC752B09C81300F206D0
/* PushNotificationTypes.swift */
;
};
D545FC782B09E18D00F206D0
/* no_sound.mp3 in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D545FC772B09E18D00F206D0
/* no_sound.mp3 */
;
};
D592D5232B0F14FE00B91A1C
/* SessionUploadImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
;
};
D592D5252B0F16CA00B91A1C
/* ReqMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
;
};
D592D5272B0F182C00B91A1C
/* ReqAckMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
;
};
D592D5292B0F198100B91A1C
/* ReqChatModeMessage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D592D5282B0F198100B91A1C
/* ReqChatModeMessage.swift */
;
};
D5AE351A2AEBA66A00059889
/* ReqLogin.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5AE35182AEBA66A00059889
/* ReqLogin.swift */
;
};
D5AE351B2AEBA66A00059889
/* ResLogin.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5AE35192AEBA66A00059889
/* ResLogin.swift */
;
};
D5AE351D2AEBA6FC00059889
/* SessionLogin.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5AE351C2AEBA6FC00059889
/* SessionLogin.swift */
;
};
D5CB6F992B02088C00EC2010
/* ResShipStatus.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5CB6F982B02088C00EC2010
/* ResShipStatus.swift */
;
};
D5CB6F9B2B021C4F00EC2010
/* LocationViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5CB6F9A2B021C4F00EC2010
/* LocationViewModel.swift */
;
};
D5CB6F9D2B02203500EC2010
/* RequestLocationView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5CB6F9C2B02203500EC2010
/* RequestLocationView.swift */
;
};
D5CB6F9F2B0220A700EC2010
/* ErrorView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5CB6F9E2B0220A700EC2010
/* ErrorView.swift */
;
};
D5CB6FA12B023F7F00EC2010
/* EcaTask.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5CB6FA02B023F7F00EC2010
/* EcaTask.swift */
;
};
D5E03A672B04484D00D65FCE
/* SessionTaskList.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
D5E03A662B04484D00D65FCE
/* SessionTaskList.swift */
;
};
...
...
@@ -218,16 +219,17 @@
D52D213E2AEBB7D700324D58
/* RegisteredEca.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
RegisteredEca.swift
;
path
=
Sailassist/ECA/RegisteredEca.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D52D21402AEDE18F00324D58
/* EcaCoordinatesTable.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
EcaCoordinatesTable.swift
;
path
=
Sailassist/ECA/EcaCoordinatesTable.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D53ACA752B0AECF8008DCB18
/* Sailassist.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.entitlements
;
name
=
Sailassist.entitlements
;
path
=
Sailassist/Sailassist.entitlements
;
sourceTree
=
"<group>"
;
};
D545FC702B09C3F900F206D0
/* sound_eca.mp3 */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
audio.mp3
;
name
=
sound_eca.mp3
;
path
=
Sailassist/OtherAlertVoice/sound_eca.mp3
;
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
;
};
D545FC772B09E18D00F206D0
/* no_sound.mp3 */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
audio.mp3
;
name
=
no_sound.mp3
;
path
=
Sailassist/OtherAlertVoice/no_sound.mp3
;
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
;
};
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqAckMessage.swift
;
path
=
Sailassist/Json/ReqAckMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D592D5282B0F198100B91A1C
/* ReqChatModeMessage.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqChatModeMessage.swift
;
path
=
Sailassist/Json/ReqChatModeMessage.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5AE35182AEBA66A00059889
/* ReqLogin.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ReqLogin.swift
;
path
=
Sailassist/Json/ReqLogin.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5AE35192AEBA66A00059889
/* ResLogin.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ResLogin.swift
;
path
=
Sailassist/Json/ResLogin.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5AE351C2AEBA6FC00059889
/* SessionLogin.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SessionLogin.swift
;
path
=
Sailassist/ServerSession/SessionLogin.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5CB6F982B02088C00EC2010
/* ResShipStatus.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ResShipStatus.swift
;
path
=
Sailassist/Json/ResShipStatus.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5CB6F9A2B021C4F00EC2010
/* LocationViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
LocationViewModel.swift
;
path
=
Sailassist/LocationViewModel.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5CB6F9C2B02203500EC2010
/* RequestLocationView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
RequestLocationView.swift
;
path
=
Sailassist/RequestLocationView.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5CB6F9E2B0220A700EC2010
/* ErrorView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
ErrorView.swift
;
path
=
Sailassist/ErrorView.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5CB6FA02B023F7F00EC2010
/* EcaTask.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
EcaTask.swift
;
path
=
Sailassist/ECA/EcaTask.swift
;
sourceTree
=
SOURCE_ROOT
;
};
D5E03A662B04484D00D65FCE
/* SessionTaskList.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
name
=
SessionTaskList.swift
;
path
=
Sailassist/ServerSession/SessionTaskList.swift
;
sourceTree
=
SOURCE_ROOT
;
};
...
...
@@ -293,7 +295,6 @@
isa
=
PBXGroup
;
children
=
(
D545FC722B09C6DA00F206D0
/* VoiceManager */
,
D545FC6F2B09AEF500F206D0
/* OtherAlertVoice */
,
D51AA4052B099F6D00EBBDD4
/* DataSource */
,
D51AA4022B099DA600EBBDD4
/* SignalR */
,
D5EA86482AF2139D0032E810
/* Location */
,
...
...
@@ -318,7 +319,6 @@
020B98172AD8C3190029DE4C
/* Assets.xcassets */
,
020B98192AD8C3190029DE4C
/* Preview Content */
,
D5CB6F9A2B021C4F00EC2010
/* LocationViewModel.swift */
,
D5CB6F9C2B02203500EC2010
/* RequestLocationView.swift */
,
D5CB6F9E2B0220A700EC2010
/* ErrorView.swift */
,
027EF9F12B0D804C0079B825
/* WebView.swift */
,
);
...
...
@@ -503,6 +503,7 @@
D5258CA02B03593500365276
/* SessionMonitoringRoute.swift */
,
D5258CA22B036CC500365276
/* SessionGetMessage.swift */
,
D5E03A662B04484D00D65FCE
/* SessionTaskList.swift */
,
D592D5222B0F14FE00B91A1C
/* SessionUploadImage.swift */
,
);
path
=
ServerSession
;
sourceTree
=
"<group>"
;
...
...
@@ -625,15 +626,6 @@
path
=
ECA
;
sourceTree
=
"<group>"
;
};
D545FC6F2B09AEF500F206D0
/* OtherAlertVoice */
=
{
isa
=
PBXGroup
;
children
=
(
D545FC772B09E18D00F206D0
/* no_sound.mp3 */
,
D545FC702B09C3F900F206D0
/* sound_eca.mp3 */
,
);
path
=
OtherAlertVoice
;
sourceTree
=
"<group>"
;
};
D545FC722B09C6DA00F206D0
/* VoiceManager */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -651,6 +643,9 @@
D5258C9C2B03507A00365276
/* ResMonitoringRoute.swift */
,
D5258C9E2B03527400365276
/* ResGetMessages.swift */
,
D5258CA62B03988500365276
/* ReqTaskList.swift */
,
D592D5242B0F16CA00B91A1C
/* ReqMessage.swift */
,
D592D5262B0F182C00B91A1C
/* ReqAckMessage.swift */
,
D592D5282B0F198100B91A1C
/* ReqChatModeMessage.swift */
,
);
path
=
Json
;
sourceTree
=
"<group>"
;
...
...
@@ -772,9 +767,7 @@
buildActionMask
=
2147483647
;
files
=
(
020B981B2AD8C3190029DE4C
/* Preview Assets.xcassets in Resources */
,
D545FC712B09C3F900F206D0
/* sound_eca.mp3 in Resources */
,
020B98182AD8C3190029DE4C
/* Assets.xcassets in Resources */
,
D545FC782B09E18D00F206D0
/* no_sound.mp3 in Resources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -870,6 +863,7 @@
020B98532AD919180029DE4C
/* LoginTypeSelectView.swift in Sources */
,
D52D213F2AEBB7D700324D58
/* RegisteredEca.swift in Sources */
,
02CD06952AE895F5005F8D8F
/* APIError.swift in Sources */
,
D592D5232B0F14FE00B91A1C
/* SessionUploadImage.swift in Sources */
,
022A98202AF8B8960079C55A
/* LocationCalculation.swift in Sources */
,
D5258CA72B03988600365276
/* ReqTaskList.swift in Sources */
,
D5CB6F9B2B021C4F00EC2010
/* LocationViewModel.swift in Sources */
,
...
...
@@ -883,6 +877,7 @@
020B98552AD924930029DE4C
/* QrCodeScannerView.swift in Sources */
,
02CE4D7F2ADE42A9002E79BC
/* MenuContentView.swift in Sources */
,
D5AE351B2AEBA66A00059889
/* ResLogin.swift in Sources */
,
D592D5252B0F16CA00B91A1C
/* ReqMessage.swift in Sources */
,
02CE4D832ADE672B002E79BC
/* MapTaskView.swift in Sources */
,
02CE4DCC2ADFA03F002E79BC
/* SelectedTabModel.swift in Sources */
,
D5258C9B2B03401E00365276
/* MonitoringRoute.swift in Sources */
,
...
...
@@ -906,7 +901,6 @@
02A1DE312AFB61D8005BCF55
/* MyChatContentView.swift in Sources */
,
025C27FE2B0206D700BADC49
/* PDFDownloadManager.swift in Sources */
,
025C27FC2AFE191A00BADC49
/* MenuManualView.swift in Sources */
,
D5CB6F9D2B02203500EC2010
/* RequestLocationView.swift in Sources */
,
020B98592AD92A4C0029DE4C
/* MainTabView.swift in Sources */
,
020B984F2AD9182D0029DE4C
/* InputUserNameView.swift in Sources */
,
D5AE351A2AEBA66A00059889
/* ReqLogin.swift in Sources */
,
...
...
@@ -922,6 +916,8 @@
02CD068F2AE6535F005F8D8F
/* MapSource.swift in Sources */
,
02C3E5CE2AFCA04700AF7837
/* OtherChatContentView.swift in Sources */
,
020B98442AD8E4910029DE4C
/* FontStyle.swift in Sources */
,
D592D5272B0F182C00B91A1C
/* ReqAckMessage.swift in Sources */
,
D592D5292B0F198100B91A1C
/* ReqChatModeMessage.swift in Sources */
,
D51AA4042B099DCD00EBBDD4
/* SignalRService.swift in Sources */
,
025C27FA2AFE119D00BADC49
/* MenuTitleView.swift in Sources */
,
02CE4D892ADF62E1002E79BC
/* EcaSettingView.swift in Sources */
,
...
...
Seilassist/Sailassist.xcodeproj/xcshareddata/xcschemes/Canary.xcscheme
deleted
100644 → 0
View file @
f7c1e69c
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1500"
version =
"1.7"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
shouldAutocreateTestPlan =
"YES"
>
</TestAction>
<LaunchAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Canary"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
Seilassist/Sailassist.xcodeproj/xcshareddata/xcschemes/QC.xcscheme
deleted
100644 → 0
View file @
f7c1e69c
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"1500"
version =
"1.7"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Canary"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv =
"YES"
shouldAutocreateTestPlan =
"YES"
>
</TestAction>
<LaunchAction
buildConfiguration =
"QC"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"020B980F2AD8C3140029DE4C"
BuildableName =
"Sailassist.app"
BlueprintName =
"Sailassist"
ReferencedContainer =
"container:Sailassist.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Canary"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
Seilassist/Sailassist/ContentView.swift
View file @
78c93d1b
...
...
@@ -10,19 +10,10 @@ import SwiftUI
struct
ContentView
:
View
{
@State
var
isLogin
=
false
//ContentView.LoginCheck()
@EnvironmentObject
private
var
sceneDelegate
:
SceneDelegate
@StateObject
var
locationViewModel
=
LocationView
Model
()
var
selectedTabModel
=
SelectedTabModel
()
let
selectedTabModel
=
SelectedTab
Model
()
let
signalRService
=
SignalRService
()
var
body
:
some
View
{
switch
locationViewModel
.
authorizationStatus
{
case
.
notDetermined
:
RequestLocationView
()
.
environmentObject
(
locationViewModel
)
case
.
restricted
:
ErrorView
(
errorText
:
"位置情報の使用が制限されています。"
)
case
.
denied
:
ErrorView
(
errorText
:
"位置情報を使用できません。"
)
case
.
authorizedAlways
,
.
authorizedWhenInUse
:
MainTabView
()
.
environmentObject
(
selectedTabModel
)
.
onAppear
(){
...
...
@@ -39,9 +30,6 @@ struct ContentView: View {
},
content
:
{
LoginView
(
isLogin
:
$
isLogin
)
})
default
:
Text
(
"Unexpected status"
)
}
}
}
...
...
Seilassist/Sailassist/DataSource/AlertDB.swift
View file @
78c93d1b
...
...
@@ -10,7 +10,6 @@ import Foundation
struct
WarnRecord
{
var
title
:
String
var
body
:
String
let
soundName
:
String
}
enum
SwitchingEca
{
...
...
@@ -28,9 +27,9 @@ class AlertDB {
static
let
OnlyOne
=
AlertDB
()
private
var
alertEca
:
[
SwitchingEca
:
WarnRecord
]
=
[
SwitchingEca
.
Finish
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Finish"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at switching finished point"
,
comment
:
""
)
,
soundName
:
"sound_eca.mp3"
)
,
SwitchingEca
.
Start
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Start"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrivaed at switching start point"
,
comment
:
""
)
,
soundName
:
"sound_eca.mp3"
)
,
SwitchingEca
.
Notice
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Notice"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at advance notice point"
,
comment
:
""
)
,
soundName
:
"sound_eca.mp3"
)
SwitchingEca
.
Finish
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Finish"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at switching finished point"
,
comment
:
""
))
,
SwitchingEca
.
Start
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Start"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrivaed at switching start point"
,
comment
:
""
))
,
SwitchingEca
.
Notice
:
WarnRecord
(
title
:
NSLocalizedString
(
"Eca Notice"
,
comment
:
""
),
body
:
NSLocalizedString
(
"Arrived at advance notice point"
,
comment
:
""
))
]
//Eca通知
...
...
Seilassist/Sailassist/ECA/EcaCoordinatesTable.swift
View file @
78c93d1b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Seilassist/Sailassist/ECA/EcaTask.swift
View file @
78c93d1b
...
...
@@ -6,6 +6,7 @@
//
import
Foundation
import
CoreLocation
class
EcaTask
{
var
sessionShipStatus
=
SessionShipStatus
()
...
...
@@ -21,7 +22,7 @@ class EcaTask {
*/
private
func
notificationEca
(
point
:
SwitchingEca
)
{
let
alertDB
=
AlertDB
.
OnlyOne
var
wernrec
=
WarnRecord
(
title
:
"Eca"
,
body
:
""
,
soundName
:
""
)
var
wernrec
=
WarnRecord
(
title
:
"Eca"
,
body
:
""
)
wernrec
=
alertDB
.
GetAlertEcaPoint
(
point
:
point
)
let
formatstr
=
wernrec
.
title
...
...
@@ -41,15 +42,14 @@ class EcaTask {
SharingData
.
my
.
speed
=
res
.
speed
SharingData
.
my
.
course
=
res
.
course
SharingData
.
my
.
heading
=
res
.
heading
SharingData
.
my
.
server
?
.
latitude
=
res
.
lat
SharingData
.
my
.
server
?
.
longitude
=
res
.
lon
SharingData
.
my
.
server
=
CLLocationCoordinate2D
(
latitude
:
res
.
lat
,
longitude
:
res
.
lon
)
SharingData
.
my
.
dataTime
=
res
.
dataTime
//2023-11-02T05:25:49.4362123Z
if
Preferences
.
LocationType
==
1
{
SharingData
.
my
.
location
=
SharingData
.
my
.
server
checkEca
()
}
}
checkEca
()
case
.
failure
(
let
errorCode
):
print
(
debug
:
errorCode
)
break
...
...
@@ -58,18 +58,23 @@ class EcaTask {
func
checkEca
()
{
let
runningEca
=
eca
.
ecaArea
.
first
(
where
:
{(
key
,
value
)
in
value
.
isRunning
==
true
})
if
let
eca
=
runningEca
?
.
value
{
if
var
eca
=
runningEca
?
.
value
{
if
let
location
=
SharingData
.
my
.
location
{
let
distance
=
LocationCalculation
.
checkPoly
L
ine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
let
distance
=
LocationCalculation
.
checkPoly
l
ine
(
objPos
:
eca
.
points
,
shipPos
:
location
)
if
eca
.
sw
Start
>=
Float
(
distance
)
{
if
eca
.
sw
Notice
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
start
{
notificationEca
(
point
:
SwitchingEca
.
Start
)
eca
.
status
=
EcaState
.
noticePass
}
if
eca
.
swNotice
>=
Float
(
distance
)
{
if
eca
.
swStart
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
noticePass
{
notificationEca
(
point
:
SwitchingEca
.
Notice
)
eca
.
status
=
EcaState
.
startPass
}
if
eca
.
swFinish
>=
Float
(
distance
)
{
if
eca
.
swFinish
>=
Float
(
distance
)
&&
eca
.
status
==
EcaState
.
startPass
{
notificationEca
(
point
:
SwitchingEca
.
Finish
)
eca
.
status
=
EcaState
.
finishPass
}
}
}
...
...
Seilassist/Sailassist/ECA/RegisteredEca.swift
View file @
78c93d1b
...
...
@@ -8,6 +8,16 @@
import
Foundation
import
CoreLocation
enum
EcaState
{
case
start
//ECAタスク実行開始
case
noticePass
//ECA通知円到達
case
startPass
//ECA開始円到達
case
finishPass
//ECAタスク終了円到達
case
end
//ECAタスク完了(燃料切替実施済み)
case
incomplete
//ECAタスク未完了 (燃料切替未実施で終了)
case
cancel
//ECAタスクキャンセル (タスク終了・タスク未完了前にキャンセル)
}
struct
RegisteredEca
{
var
id
:
UInt32
=
0
var
isEnable
:
Bool
=
false
//ECA有効
...
...
@@ -16,6 +26,7 @@ struct RegisteredEca {
var
swNotice
:
Float
=
6
//ECA通知[NM]
var
swStart
:
Float
=
5
//ECA開始[NM]
var
swFinish
:
Float
=
4
//ECA終了[NM]
var
status
:
EcaState
=
EcaState
.
start
//ECA状態
var
datetime
:
String
=
""
//時刻(UTC ISO8601準拠)
var
color
:
String
=
""
//ライン色(ARGB)
var
width
:
UInt32
=
1
//ライン幅
...
...
Seilassist/Sailassist/Http/HttpRequestType.swift
View file @
78c93d1b
...
...
@@ -24,6 +24,7 @@ enum HttpRequestType : String {
case
UploadImage
=
"https://ssv-canary-web.azurewebsites.net/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://ssv-canary-notification.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=rj2WniCJWWP2SG5gk4J7/2P/nIyChx8+JXKWCfTi8KA="
case
HubName
=
"ssv-canary-notification"
case
storage
=
"https://ssvcanarystorage.z1.web.core.windows.net/"
}
#elseif QC
enum
HttpRequestType
:
String
{
...
...
@@ -41,6 +42,7 @@ enum HttpRequestType : String {
case
UploadImage
=
"https://ssv-qc-web.azurewebsites.net/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://tacmiqchub.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=mjGZyOensA5D/T6bMiDDwX6hwhoZNsDcK+GtBBBiUXk="
case
HubName
=
"tacmiqchub"
case
storage
=
"https://tacmiquaritycheckstorage.z31.web.core.windows.net/"
}
#else
//MARK: 運用サーバー用
...
...
@@ -59,5 +61,6 @@ enum HttpRequestType : String {
case
UploadImage
=
"https://ssv.jmarinecloud.com/api/chatdata/uploadimage"
case
ConnectionString
=
"Endpoint=sb://tacmihub.servicebus.windows.net/;SharedAccessKeyName=DefaultListenSharedAccessSignature;SharedAccessKey=/IOJAYGLZmS2JvlsHT5aT+ETlPXqNt1+VGuMNDt4bzw="
case
HubName
=
"tacmihub"
case
storage
=
"https://tacmistorage.z31.web.core.windows.net/"
}
#endif
Seilassist/Sailassist/Info.plist
View file @
78c93d1b
...
...
@@ -6,7 +6,6 @@
<
string
>
pk.eyJ1Ijoiam1hcmluZWNsb3VkIiwiYSI6ImNsbmxjbGYzZjA0dG8yaW82MDgwajQ5OTQifQ.pd8YC9qK1C4YmMUbMx6ywQ
<
/string
>
<
k
e
y
>
UIBackgroundModes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
audio
<
/string
>
<
string
>
location
<
/string
>
<
string
>
remote-notification
<
/string
>
<
/
a
rr
a
y
>
...
...
Seilassist/Sailassist/Json/ReqAckMessage.swift
0 → 100644
View file @
78c93d1b
//
// ReqAckMessage.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/23.
//
import
Foundation
struct
ReqAckMessage
:
Codable
{
var
shipId
:
Int
=
0
var
messageId
:
String
=
""
//確認したMessageId
var
time
:
String
=
""
//投稿日時 2023-11-02T05:25:49.4362123Z
var
location
:
Int
=
0
//1:Shore / 2:Ship
var
fromeId
:
String
=
""
//ユーザーID
init
(
shipId
:
Int
,
messageId
:
String
)
{
self
.
shipId
=
shipId
self
.
messageId
=
messageId
}
}
Seilassist/Sailassist/Json/ReqChatModeMessage.swift
0 → 100644
View file @
78c93d1b
//
// ReqChatModeMessage.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/23.
//
import
Foundation
/**
* モード変更
* 通常モードとWarningモードを切り替えます
*/
struct
ReqChatModeMessage
:
Codable
{
var
shipId
:
Int
=
0
var
time
:
String
=
""
//投稿日時 2023-11-02T05:25:49.4362123Z
var
location
:
Int
=
0
//1:Shore / 2:Ship
var
fromeId
:
String
=
""
//ユーザーID
var
mode
:
Int
=
0
//0:通常 / 1:Warning中
init
(
shipId
:
Int
)
{
self
.
shipId
=
shipId
}
}
Seilassist/Sailassist/Json/ReqMessage.swift
0 → 100644
View file @
78c93d1b
//
// ReqMessage.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/23.
//
import
Foundation
struct
ReqMessage
:
Codable
{
var
shipId
:
Int
=
0
var
messageId
:
String
=
""
//固有ID
var
type
:
Int
=
0
//0:テキスト / 1:スタンプ
var
time
:
String
=
""
//2023-11-02T05:25:49.4362123Z
var
location
:
Int
=
0
//1:Shore / 2:Ship
var
from
:
String
=
""
//投稿者名
var
fromeId
:
String
=
""
//ユーザーID
var
message
:
String
=
""
//テキスト
var
stampId
:
Int
=
0
//スタンプ番号 0:Fire〜
init
(
shipId
:
Int
,
messageId
:
String
)
{
self
.
shipId
=
shipId
self
.
messageId
=
messageId
}
}
Seilassist/Sailassist/Location/LocationCalculation.swift
View file @
78c93d1b
...
...
@@ -697,10 +697,37 @@ class LocationCalculation{
/**
* 線迄の距離
*/
static
func
checkPoly
L
ine
(
static
func
checkPoly
l
ine
(
objPos
:
Array
<
CLLocationCoordinate2D
>
,
shipPos
:
CLLocationCoordinate2D
)
->
Double
{
var
distance
=
1000000.0
let
rtn
=
crossLineDistance
(
objPos
:
objPos
,
shipPos
:
shipPos
)
//直線と直行していない
if
(
!
rtn
.
retCode
)
{
let
rtn1
=
pointsDistance
(
objPos
:
objPos
,
shipPos
:
shipPos
)
if
(
rtn1
.
retCode
)
{
distance
=
0.0
}
else
{
distance
=
rtn1
.
xte
}
}
else
{
distance
=
rtn
.
xte
}
print
(
debug
:
"checkPolyline
\(
distance
)
"
)
return
distance
}
/**
* 線迄の距離
*/
static
func
crossLineDistance
(
objPos
:
Array
<
CLLocationCoordinate2D
>
,
shipPos
:
CLLocationCoordinate2D
)
->
(
retCode
:
Bool
,
xte
:
Double
)
//正常終了:true 異常:false 距離[NM]
{
//Loopしているか確認
var
isLoop
=
false
...
...
@@ -709,17 +736,66 @@ class LocationCalculation{
isLoop
=
true
}
var
loopCntMax
=
objPos
.
count
var
loopCntMax
=
objPos
.
count
-
1
if
isLoop
{
loopCntMax
=
objPos
.
count
-
1
loopCntMax
=
objPos
.
count
-
2
}
//自船が直線に直行している場合の距離を求める
var
isOutside
=
false
var
isCross
=
false
var
distance
=
1000000.0
for
cnt
in
0
...
(
loopCntMax
-
1
)
{
let
rtn
=
eNvXteRL
(
lastPos
:
objPos
[
cnt
],
nextPos
:
objPos
[(
cnt
+
1
)],
shipPos
:
shipPos
)
if
rtn
.
retCode
{
//自船を頂点とした方位が90度以内
if
checkCross
(
lastPos
:
objPos
[
cnt
],
nextPos
:
objPos
[(
cnt
+
1
)],
shipPos
:
shipPos
)
{
if
distance
>
abs
(
rtn
.
xte
)
{
isOutside
=
rtn
.
xte
<
0
distance
=
abs
(
rtn
.
xte
)
isCross
=
true
}
}
print
(
debug
:
"crossLineDistance
\(
rtn
)
/(isOutside)/(distance)"
)
}
}
if
isOutside
{
distance
*=
-
1
}
print
(
debug
:
"crossLineDistance
\(
distance
)
"
)
return
(
isCross
,
distance
)
}
/**
* 点迄の距離
*/
static
func
pointsDistance
(
objPos
:
Array
<
CLLocationCoordinate2D
>
,
shipPos
:
CLLocationCoordinate2D
)
->
(
retCode
:
Bool
,
xte
:
Double
)
//正常終了:true 異常:false 距離[NM]
{
var
distance
=
10000000.0
var
nearbyPoint
=
0
//Loopしているか確認
var
isLoop
=
false
if
objPos
[
0
]
.
latitude
==
objPos
[(
objPos
.
count
-
1
)]
.
latitude
&&
objPos
[
0
]
.
longitude
==
objPos
[(
objPos
.
count
-
1
)]
.
longitude
{
isLoop
=
true
}
var
loopCntMax
=
objPos
.
count
if
isLoop
{
loopCntMax
=
objPos
.
count
-
1
}
//一番近いポイントを見つける
for
cnt
in
0
...
(
loopCntMax
-
1
)
{
let
newDistance
=
distance2
(
lastPos
:
objPos
[
cnt
],
nextPos
:
shipPos
,
type
:
Mrdc
.
E_NV_MRDC_NORMAL
)
if
newDistance
.
retCode
{
print
(
debug
:
"
checkPolyLin
e
\(
newDistance
)
(cnt)"
)
print
(
debug
:
"
pointsDistanc
e
\(
newDistance
)
(cnt)"
)
if
distance
>
newDistance
.
dist
{
distance
=
newDistance
.
dist
nearbyPoint
=
cnt
...
...
@@ -729,7 +805,7 @@ class LocationCalculation{
//近いポイントの前のポイント
var
beforePoint
=
0
if
nearbyPoint
==
(
loopCntMax
-
1
)
{
if
nearbyPoint
==
0
{
if
isLoop
{
beforePoint
=
loopCntMax
-
1
}
else
{
...
...
@@ -753,71 +829,46 @@ class LocationCalculation{
var
outside1
=
false
var
distance1
=
0.0
var
checkCross1
=
false
let
rtn1
=
eNvXteRL
(
lastPos
:
objPos
[
beforePoint
],
nextPos
:
objPos
[
nearbyPoint
],
shipPos
:
shipPos
)
if
rtn1
.
retCode
{
print
(
debug
:
"
checkPolyLin
e
\(
rtn1
)
/(beforePoint)/(nearbyPoint)/(distance)"
)
print
(
debug
:
"
pointsDistanc
e
\(
rtn1
)
/(beforePoint)/(nearbyPoint)/(distance)"
)
if
rtn1
.
xte
<
0
{
outside1
=
true
}
distance1
=
rtn1
.
xte
//自船を頂点とした方位が90度以内
checkCross1
=
checkCross
(
lastPos
:
objPos
[
beforePoint
],
nextPos
:
objPos
[
nearbyPoint
],
shipPos
:
shipPos
)
}
var
outside2
=
false
var
distance2
=
0.0
var
checkCross2
=
false
let
rtn2
=
eNvXteRL
(
lastPos
:
objPos
[
nearbyPoint
],
nextPos
:
objPos
[
nextPoint
],
shipPos
:
shipPos
)
if
rtn2
.
retCode
{
print
(
debug
:
"
checkPolyLin
e
\(
rtn2
)
/(beforePoint)/(nearbyPoint)/(distance)"
)
print
(
debug
:
"
pointsDistanc
e
\(
rtn2
)
/(beforePoint)/(nearbyPoint)/(distance)"
)
if
rtn2
.
xte
<
0
{
outside2
=
true
}
distance2
=
rtn2
.
xte
//自船を頂点とした方位が90度以内
checkCross2
=
checkCross
(
lastPos
:
objPos
[
nearbyPoint
],
nextPos
:
objPos
[
nextPoint
],
shipPos
:
shipPos
)
}
var
lineDistance
=
0.0
var
outside
=
false
if
checkCross1
&&
checkCross2
{
distance1
=
abs
(
distance1
)
distance2
=
abs
(
distance2
)
if
distance1
<
distance2
{
lineDistance
=
distance1
outside
=
outside1
}
else
{
lineDistance
=
distance2
outside
=
outside2
}
}
if
!
checkCross1
&&
!
checkCross2
{
lineDistance
=
distance
outside
=
outside1
}
if
checkCross1
&&
!
checkCross2
{
lineDistance
=
distance1
outside
=
outside1
}
if
!
checkCross1
&&
checkCross2
{
lineDistance
=
distance2
outside
=
outside2
}
if
distance
<
lineDistance
{
lineDistance
=
distance
//船が端の点に近く、ラインと直行していない場合はライン判定から外れていることにする
var
lineOut
=
false
if
nearbyPoint
==
0
{
lineOut
=
true
}
else
if
nearbyPoint
==
(
loopCntMax
-
1
)
{
lineOut
=
true
}
lineDistance
=
abs
(
lineDistance
)
if
outside
{
lineD
istance
*=
-
1
d
istance
*=
-
1
}
print
(
debug
:
"checkPolyLine
\(
lineD
istance
)
"
)
return
lineDistance
print
(
debug
:
"checkPolyLine
\(
d
istance
)
"
)
return
(
lineOut
,
distance
)
}
/**
...
...
Seilassist/Sailassist/Login/LoginView.swift
View file @
78c93d1b
...
...
@@ -19,6 +19,7 @@ enum LoginViewMode: String{
enum
AlertType
:
String
{
case
loginFailure
case
Expired
case
gpsPermission
}
class
LoginViewParam
:
ObservableObject
{
...
...
@@ -37,7 +38,8 @@ struct LoginView: View {
@ObservedObject
var
scannerViewModel
=
ScannerViewModel
()
@State
var
loginViewParam
=
LoginViewParam
()
@State
var
timer
:
Timer
?
var
sessionLogin
=
SessionLogin
()
@StateObject
var
locationViewModel
=
LocationViewModel
()
let
sessionLogin
=
SessionLogin
()
var
body
:
some
View
{
ZStack
{
...
...
@@ -105,6 +107,11 @@ struct LoginView: View {
message
:
Text
(
"Expired."
),
dismissButton
:
.
default
(
Text
(
"OK"
),
action
:
{
viewMode
=
.
SelectType
})
)
case
.
gpsPermission
:
return
Alert
(
title
:
Text
(
"location"
),
message
:
Text
(
"Allow use of location information."
),
dismissButton
:
.
default
(
Text
(
"Next"
),
action
:
{
locationViewModel
.
requestPermission
()})
)
}
}
}
...
...
@@ -115,6 +122,7 @@ struct LoginView: View {
})
.
onAppear
()
{
LoginCheck
()
gpsCheck
()
}
.
preferredColorScheme
(
.
dark
)
}
...
...
@@ -139,6 +147,22 @@ struct LoginView: View {
}
}
func
gpsCheck
()
->
()
{
switch
locationViewModel
.
authorizationStatus
{
case
.
notDetermined
:
isAlert
=
true
alertType
=
.
gpsPermission
case
.
restricted
:
ErrorView
(
errorText
:
"位置情報の使用が制限されています。"
)
case
.
denied
:
ErrorView
(
errorText
:
"位置情報を使用できません。"
)
case
.
authorizedAlways
,
.
authorizedWhenInUse
:
print
(
debug
:
"called"
)
default
:
Text
(
"Unexpected status"
)
}
}
func
responseLogin
(
result
:
Result
<
Data
,
APIError
>
)
{
print
(
debug
:
"calld"
)
switch
result
{
...
...
Seilassist/Sailassist/OtherAlertVoice/no_sound.mp3
deleted
100755 → 0
View file @
f7c1e69c
File deleted
Seilassist/Sailassist/OtherAlertVoice/sound_eca.mp3
deleted
100644 → 0
View file @
f7c1e69c
File deleted
Seilassist/Sailassist/RequestLocationView.swift
deleted
100644 → 0
View file @
f7c1e69c
//
// RequestLocationView.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/13.
//
import
SwiftUI
struct
RequestLocationView
:
View
{
@EnvironmentObject
var
locationViewModel
:
LocationViewModel
var
body
:
some
View
{
Button
(
action
:
{
locationViewModel
.
requestPermission
()
})
{
Text
(
"Allow use of location information."
)
}
}
}
struct
RequestLocationView_Previews
:
PreviewProvider
{
static
var
previews
:
some
View
{
RequestLocationView
()
.
environmentObject
(
LocationViewModel
())
}
}
Seilassist/Sailassist/SailassistApp.swift
View file @
78c93d1b
...
...
@@ -59,6 +59,8 @@ class AppDelegate: NSObject, UIApplicationDelegate{
application
.
registerForRemoteNotifications
()
MSNotificationHub
.
start
(
connectionString
:
HttpRequestType
.
ConnectionString
.
rawValue
,
hubName
:
HttpRequestType
.
HubName
.
rawValue
)
MSNotificationHub
.
addTags
([
String
(
SharingData
.
my
.
shipId
)])
return
true
}
...
...
Seilassist/Sailassist/ServerSession/SessionUploadImage.swift
0 → 100644
View file @
78c93d1b
//
// SessionUploadImage.swift
// Sailassist
//
// Created by 三浦薫巳 on 2023/11/23.
//
import
Foundation
import
SwiftUI
class
SessionUploadImage
:
ObservableObject
{
@Published
var
status
=
false
// シングルトン宣言
static
let
OnlyOne
=
SessionUploadImage
()
private
var
serverSession
=
ServerSession
()
private
var
Calling
:
Bool
=
false
// 通信中
/**
* メッセージ
*/
func
RequestGetUploadImage
(
_
completion
:
@escaping
((
Result
<
Data
,
APIError
>
))
->
Void
)
{
print
(
debug
:
"calld"
)
if
Calling
{
return
}
Calling
=
true
// リクエストURLの組み立て
// リクエストURLの組み立て
// let url_string : String = HttpRequestType.UploadImage.rawValue
// guard let req_url = URL(string : url_string) else {
// Calling = false
// return
// }
// if let postdata = serverSession.toJSON(login) {
// serverSession.postJson(req_url, postdata, completion: completion)
// }
// else {
// Calling = false
// return
// }
}
}
Seilassist/Sailassist/SignalR/SignalRService.swift
View file @
78c93d1b
...
...
@@ -10,45 +10,117 @@ import SwiftSignalRClient
public
class
SignalRService
{
private
var
connection
:
HubConnection
private
var
hubConnectionDelegate
:
HubConnectionDelegate
?
public
init
(
url
:
URL
)
{
// リクエストURLの組み立て
// let url_string : String = HttpRequestType.SignalR.rawValue
// guard let req_url = URL(string : url_string) else {
// return
// }
connection
=
HubConnectionBuilder
(
url
:
url
)
.
withLogging
(
minLogLevel
:
.
error
)
.
build
()
connection
.
on
(
method
:
"MessageReceived"
,
callback
:
{
(
user
:
String
,
message
:
String
)
in
do
{
self
.
handleMessage
(
message
,
from
:
user
)
}
catch
{
print
(
error
)
}
public
init
()
{
// hubConnectionDelegate = ChatHubConnectionDelegate(app: self)
hubConnectionDelegate
=
ChatHubConnectionDelegate
()
connection
=
HubConnectionBuilder
(
url
:
URL
(
string
:
HttpRequestType
.
SignalR
.
rawValue
)
!
)
.
withHubConnectionDelegate
(
delegate
:
hubConnectionDelegate
!
)
.
withAutoReconnect
()
.
withLogging
(
minLogLevel
:
.
error
)
.
build
()
connection
.
on
(
method
:
"chatMessage"
,
callback
:
{
(
shipId
:
Int
,
messageId
:
Int
,
type
:
Int
,
time
:
String
,
location
:
Int
,
from
:
String
,
fromeId
:
Int
,
message
:
String
)
in
self
.
handleChatMessage
(
message
,
from
:
from
)
})
// hubConnection?.invoke(method: "Your Method Name", arguments: [arg1, arg2]) { error in
// if let error = error {
// print("An error occurred: %@", "\(error)")
// }
// }
//
// hubConnection?.on(method: "YourMethod", callback: { (chatCount: Int, notificationsCount: Int) in
// self.notificationCount = notificationsCount
// self.chatCount = chatCount
// })
connection
.
on
(
method
:
"ackMessage"
,
callback
:
{
(
shipId
:
Int
,
time
:
String
,
location
:
Int
,
fromId
:
Int
,
mode
:
Int
)
in
self
.
handleAckMessage
(
time
)
})
connection
.
on
(
method
:
"chatMode"
,
callback
:
{
(
shipId
:
Int
,
time
:
String
,
location
:
Int
,
fromId
:
String
,
mode
:
Int
)
in
self
.
handleChatMessage
(
fromId
)
})
connection
.
start
()
}
private
func
handleMessage
(
_
message
:
String
,
from
user
:
String
)
{
// Do something with the message.
private
func
handleChatMessage
(
_
message
:
String
,
from
user
:
String
)
{
print
(
debug
:
"called"
)
}
private
func
handleAckMessage
(
_
time
:
String
)
{
print
(
debug
:
"called"
)
}
private
func
handleChatMessage
(
_
fromId
:
String
)
{
print
(
debug
:
"called"
)
}
func
applicationWillTerminate
(
_
aNotification
:
Notification
)
{
connection
.
stop
()
}
//呼び出す
func
chatMessage
(
_
message
:
String
)
{
var
request
=
ReqMessage
(
shipId
:
SharingData
.
my
.
shipId
,
messageId
:
"aaaa"
)
request
.
type
=
0
//0:テキスト, 1:スタンプ
// request.time = DateTextLib.Date2ISO8601Text(date: Date())
request
.
location
=
2
//1:Shore , 2:Ship
request
.
from
=
Preferences
.
UserName
//投稿者名
// request.fromeId = SharingData.my.shipName //ユーザーID
request
.
message
=
message
//テキスト
// request.stampId = //スタンプ番号 0:Fire~
if
message
!=
""
{
connection
.
invoke
(
method
:
"ChatMessage"
,
message
)
{
error
in
if
let
e
=
error
{
print
(
debug
:
"Error:
\(
e
)
"
)
}
}
}
}
func
ackMessage
(
_
message
:
String
)
{
var
request
=
ReqAckMessage
(
shipId
:
SharingData
.
my
.
shipId
,
messageId
:
"aaaa"
)
//request.time = DateTextLib.Date2ISO8601Text(date: Date())
request
.
location
=
2
//1:Shore , 2:Ship
// request.fromeId = SharingData.my.shipName //ユーザーID
if
message
!=
""
{
connection
.
invoke
(
method
:
"AckMessage"
,
request
)
{
error
in
if
let
e
=
error
{
print
(
debug
:
"Error:
\(
e
)
"
)
}
}
}
}
func
chatMode
(
_
message
:
String
)
{
var
request
=
ReqChatModeMessage
(
shipId
:
SharingData
.
my
.
shipId
)
// request.time = DateTextLib.Date2ISO8601Text(date: Date())
request
.
location
=
2
//1:Shore , 2:Ship
// request.fromeId = SharingData.my.shipName //ユーザーID
request
.
mode
=
0
//0:通常 / 1:Warning中
if
message
!=
""
{
connection
.
invoke
(
method
:
"ChatMode"
,
message
)
{
error
in
if
let
e
=
error
{
print
(
debug
:
"Error:
\(
e
)
"
)
}
}
}
}
// func chatMode2(_ message: String) {
// connection.send(method: "Broadcast", "Playground user", "Testing send") { error in
// if let error = error {
// print("Send failed: \(error)")
// }
// }
// }
}
class
ChatHubConnectionDelegate
:
HubConnectionDelegate
{
// weak var app: AppDelegate?
//
// init(app: AppDelegate) {
// self.app = app
// }
func
connectionDidOpen
(
hubConnection
:
SwiftSignalRClient
.
HubConnection
)
{
func
connectionDidOpen
(
hubConnection
:
HubConnection
)
{
print
(
"connectionDidOpen"
)
// After connection established call registerUserInServer method
DispatchQueue
.
main
.
async
{
// self.registerUserInServer()
// self.registerUserInServer()
}
}
...
...
Seilassist/Sailassist/VoiceManager/AlertManager.swift
View file @
78c93d1b
...
...
@@ -18,64 +18,6 @@ class AlertManager {
var
lastAlert
:
PushNotificationTypes
.
LocalPushIdentifier
=
.
Reserve
var
lastSpeech
:
String
=
""
private
init
()
{
//とりあえず音源を仮で置いておく
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
"no_sound.mp3"
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
}
catch
{
}
}
// 無音を鳴らす
func
PlayNoSound
(
identifier
:
String
)
{
let
content
=
"no_sound.mp3"
lastSpeech
=
identifier
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
content
)
do
{
if
(
player
.
isPlaying
){
print
(
debug
:
"SOUND Playing:
\(
content
)
"
)
//再生中の音を止めてしてしまうので再生しない
}
else
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
content
)
"
)
}
}
catch
{
lastSpeech
=
""
print
(
debug
:
"SOUND NoSound:
\(
content
)
"
)
return
}
}
// 音声だけ鳴らす
func
Speaking
(
identifier
:
String
,
content
:
String
)
{
lastSpeech
=
identifier
// 音声を再生する
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
content
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
content
)
"
)
}
catch
{
lastSpeech
=
""
print
(
debug
:
"SOUND NoSound:
\(
content
)
"
)
return
}
}
// 音声再生中止
func
CancelSpeak
(
identifier
:
String
)
{
if
let
alertPlayer
=
player
{
if
alertPlayer
.
isPlaying
==
true
{
if
lastSpeech
==
identifier
{
alertPlayer
.
stop
()
}
}
}
lastSpeech
=
""
}
// 警報を鳴らす。引数の型定義はAlertDB.swift
func
VocalizeAlert
(
alertrec
:
WarnRecord
)
{
VocalizeAlert
(
alertrec
:
alertrec
,
identifier
:
.
EcaSwitching
)
...
...
@@ -88,27 +30,13 @@ class AlertManager {
let
content
=
UNMutableNotificationContent
()
content
.
title
=
alertrec
.
title
content
.
body
=
alertrec
.
body
/* 「通知」側の音声は、再生時間上限(10sec)の関係で無音とする
* 無音声ファイル(no_sound.mp3)は予め AppDelegateで ${App}/Library/Sounds にコピー済み
*/
content
.
sound
=
UNNotificationSound
(
named
:
UNNotificationSoundName
(
rawValue
:
"no_sound.mp3"
))
content
.
sound
=
UNNotificationSound
.
default
// 「通知」を発生させる
let
request
=
UNNotificationRequest
(
identifier
:
identifier
.
rawValue
,
content
:
content
,
trigger
:
nil
)
// let request = UNNotificationRequest( identifier: "ShipWarn", content: content, trigger: nil )
UNUserNotificationCenter
.
current
()
.
add
(
request
,
withCompletionHandler
:
nil
)
lastAlert
=
identifier
// 音声を再生する
let
soundpath
=
Bundle
.
main
.
bundleURL
.
appendingPathComponent
(
alertrec
.
soundName
)
do
{
player
=
try
AVAudioPlayer
(
contentsOf
:
soundpath
)
player
.
play
()
print
(
debug
:
"SOUND Go play:
\(
alertrec
.
soundName
)
"
)
}
catch
{
lastAlert
=
.
Reserve
print
(
debug
:
"SOUND NoSound:
\(
alertrec
.
soundName
)
"
)
return
}
}
// 警報の再生を中断する
...
...
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