Commit e3f92dd3 authored by shigemi miura's avatar shigemi miura

不具合修正 No98,99,101,102,103

parent 0aa6c32e
...@@ -1299,7 +1299,7 @@ ...@@ -1299,7 +1299,7 @@
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements; CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8; DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
...@@ -1345,7 +1345,7 @@ ...@@ -1345,7 +1345,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements; CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8; DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
...@@ -1529,7 +1529,7 @@ ...@@ -1529,7 +1529,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements; CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 29; CURRENT_PROJECT_VERSION = 30;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8; DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
......
...@@ -37,10 +37,10 @@ struct ChatTitleView: View { ...@@ -37,10 +37,10 @@ struct ChatTitleView: View {
Button{ Button{
isShowMember.toggle() isShowMember.toggle()
}label: { }label: {
Image(systemName: isShowMember ? "chevron.down" : "chevron.up") Image(systemName: isShowMember ? "chevron.up" : "chevron.down")
.resizable() .resizable()
.scaledToFit() .scaledToFit()
.frame(width: 22.63, height: 12.73) .frame(width: 12, height: 7)
.foregroundColor(ColorSet.Body.color) .foregroundColor(ColorSet.Body.color)
} }
......
...@@ -33,7 +33,7 @@ class AlertDB { ...@@ -33,7 +33,7 @@ class AlertDB {
SwitchingAlert.Start: WarnRecord(title: NSLocalizedString("Eca Start", comment: ""), body: NSLocalizedString("Arrived at switching start point.", comment: "")), SwitchingAlert.Start: WarnRecord(title: NSLocalizedString("Eca Start", comment: ""), body: NSLocalizedString("Arrived at switching start point.", comment: "")),
SwitchingAlert.Notice: WarnRecord(title: NSLocalizedString("Eca Notice", comment: ""), body: NSLocalizedString("Arrived at advance notice point.", comment: "")), SwitchingAlert.Notice: WarnRecord(title: NSLocalizedString("Eca Notice", comment: ""), body: NSLocalizedString("Arrived at advance notice point.", comment: "")),
SwitchingAlert.NgaPassing: WarnRecord(title: String("Nga Notice "), body: String("Nga Passing.")) SwitchingAlert.NgaPassing: WarnRecord(title: String("NGA Notice "), body: String("NGA Passing."))
] ]
//Eca通知 //Eca通知
......
...@@ -30,6 +30,6 @@ struct PushNotificationTypes { ...@@ -30,6 +30,6 @@ struct PushNotificationTypes {
enum LocalPushIdentifier: String{ enum LocalPushIdentifier: String{
case Reserve = "Reserve" // 予約(初期設定) case Reserve = "Reserve" // 予約(初期設定)
case EcaSwitching = "Eca" // Eca case EcaSwitching = "Eca" // Eca
case NgaAlert = "Nga" // Nga case NgaAlert = "NGA" // Nga
} }
} }
...@@ -15,6 +15,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -15,6 +15,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
private let locationManager: CLLocationManager private let locationManager: CLLocationManager
let ecaTask = EcaTask() let ecaTask = EcaTask()
let ngaTask = NgaTask() let ngaTask = NgaTask()
let message = GetMessage()
override init() { override init() {
let ecaArea = EcaArea() let ecaArea = EcaArea()
...@@ -86,6 +87,10 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -86,6 +87,10 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
if Preferences.LocationType == 0 { if Preferences.LocationType == 0 {
ecaTask.checkEca() ecaTask.checkEca()
ngaTask.checkNga() ngaTask.checkNga()
if SharingData.message.mode {
message.start()
}
} }
} }
...@@ -96,6 +101,10 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -96,6 +101,10 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
self.ecaTask.checkEca() self.ecaTask.checkEca()
self.ngaTask.checkNga() self.ngaTask.checkNga()
if SharingData.message.mode {
self.message.start()
}
serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval) serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval)
} }
} }
......
...@@ -813,7 +813,7 @@ class MapViewController : UIViewController { ...@@ -813,7 +813,7 @@ class MapViewController : UIViewController {
if remove == false { if remove == false {
for point in points { for point in points {
var feature = Feature(geometry: Point(point)) var feature = Feature(geometry: Point(point))
feature.properties = [PropertyKey.Text.rawValue: .string(String(id)), feature.properties = [PropertyKey.Text.rawValue: .string(String(id + 1)),
PropertyKey.IconImage.rawValue: .string(IconImage.AreaPoint.rawValue), PropertyKey.IconImage.rawValue: .string(IconImage.AreaPoint.rawValue),
PropertyKey.Id.rawValue: .string(String(id)), PropertyKey.Id.rawValue: .string(String(id)),
PropertyKey.Dtype.rawValue: .string(DataType.point.rawValue), PropertyKey.Dtype.rawValue: .string(DataType.point.rawValue),
......
...@@ -10,13 +10,14 @@ import SwiftUI ...@@ -10,13 +10,14 @@ import SwiftUI
struct NgaNotificationView: View { struct NgaNotificationView: View {
@ObservedObject var taskViewModel: TaskViewModel @ObservedObject var taskViewModel: TaskViewModel
@ObservedObject var ngaData = SharingData.nga @ObservedObject var ngaData = SharingData.nga
@Environment(\ .colorScheme) var colorScheme
@State var isDelete: Bool = false @State var isDelete: Bool = false
@State var isRunningStopNga: Bool = false @State var isRunningStopNga: Bool = false
var body: some View { var body: some View {
VStack { VStack {
// ForEach(ngaData.ngaArea.map{ $0.1 }.sorted{ $0.name < $1.name }, id: \.areaId) { nga in ForEach(ngaData.ngaArea.map{ $0.1 }.sorted{ $0.name < $1.name }, id: \.areaId) { nga in
ForEach(ngaData.ngaArea.map{ $0.1 }, id: \.areaId) { nga in // ForEach(ngaData.ngaArea.map{ $0.1 }, id: \.areaId) { nga in
VStack { VStack {
HStack { HStack {
//NGA開始・終了ボタン //NGA開始・終了ボタン
...@@ -70,7 +71,8 @@ struct NgaNotificationView: View { ...@@ -70,7 +71,8 @@ struct NgaNotificationView: View {
} label: { } label: {
Image(systemName: "ellipsis") Image(systemName: "ellipsis")
.frame(width: 22, height: 22) .frame(width: 22, height: 22)
.foregroundColor(nga.isRunning ? ColorSet.Splash.color : ColorSet.Slidebar.color) .opacity(nga.isRunning ? 0.2 : 1.0)
.foregroundColor(colorScheme == .light ? .black : .white)
} }
.disabled(nga.isRunning) .disabled(nga.isRunning)
.alert("Delete", isPresented: $isDelete) { .alert("Delete", isPresented: $isDelete) {
......
...@@ -170,6 +170,11 @@ struct NgaPointSetting: View { ...@@ -170,6 +170,11 @@ struct NgaPointSetting: View {
var body: some View { var body: some View {
ZStack { ZStack {
VStack(spacing: 0) { VStack(spacing: 0) {
let no = getPointCoordinates()
Text("No.\(no) Point Coordinates").padding(.horizontal, 0)
Spacer()
HStack { HStack {
Picker("", selection: $selectLat[0]) { Picker("", selection: $selectLat[0]) {
Text("N") Text("N")
...@@ -291,6 +296,15 @@ struct NgaPointSetting: View { ...@@ -291,6 +296,15 @@ struct NgaPointSetting: View {
SharingData.nga.targetLocation = location SharingData.nga.targetLocation = location
} }
} }
func getPointCoordinates() -> Int {
var selectPoint = 0
if let no = SharingData.nga.selectPoint {
selectPoint = no + 1
}
return selectPoint
}
} }
#Preview { #Preview {
......
...@@ -15,7 +15,7 @@ class NgaTask { ...@@ -15,7 +15,7 @@ class NgaTask {
*/ */
private func notificationNga(point: SwitchingAlert, name: String) { private func notificationNga(point: SwitchingAlert, name: String) {
let alertDB = AlertDB.OnlyOne let alertDB = AlertDB.OnlyOne
var wernrec = WarnRecord(title:"Nga", body:"") var wernrec = WarnRecord(title:"NGA", body:"")
wernrec = alertDB.GetAlertNgaPoint(point: point) wernrec = alertDB.GetAlertNgaPoint(point: point)
let formatstr = wernrec.title + name let formatstr = wernrec.title + name
......
...@@ -9,6 +9,7 @@ import SwiftUI ...@@ -9,6 +9,7 @@ import SwiftUI
import UserNotifications import UserNotifications
import WindowsAzureMessaging import WindowsAzureMessaging
import SwiftSignalRClient import SwiftSignalRClient
import Foundation
@main @main
struct SailassistApp: App { struct SailassistApp: App {
...@@ -110,26 +111,38 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M ...@@ -110,26 +111,38 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
connection = HubConnectionBuilder(url: URL(string : HttpRequestType.SignalR.rawValue)!) connection = HubConnectionBuilder(url: URL(string : HttpRequestType.SignalR.rawValue)!)
.withHubConnectionDelegate(delegate: hubConnectionDelegate!) .withHubConnectionDelegate(delegate: hubConnectionDelegate!)
.withAutoReconnect() .withAutoReconnect()
// .withLogging(minLogLevel: .error) // .withLogging(minLogLevel: .error)
.withLogging(minLogLevel: .debug) .withLogging(minLogLevel: .debug)
// .withHubConnectionOptions(configureHubConnectionOptions: {options in options.keepAliveInterval = 20 }) .withHubConnectionOptions(configureHubConnectionOptions: {options in options.keepAliveInterval = 20 })
.build() .build()
if let r_connection = connection { if let r_connection = connection {
r_connection.stop() // r_connection.stop()
//callbackが作成されない?
r_connection.on(method: "ChatMessage", callback: { (message: ResChatMessage) in r_connection.on(method: "chatMessage", callback: { (message: ResChatMessage) in
self.handleChatMessage(message: message) self.handleChatMessage(message: message)
}) })
r_connection.on(method: "AckMessage", callback: { (message: ResAckMessage) in r_connection.on(method: "ackMessage", callback: { (message: ResAckMessage) in
self.handleAckMessage(message: message) self.handleAckMessage(message: message)
}) })
r_connection.on(method: "ChatMode", callback: { (message: ResChatMode) in r_connection.on(method: "chatMode", callback: { (message: ResChatMode) in
self.handleChatMode(message: message) self.handleChatMode(message: message)
}) })
// r_connection.on(method: "chatMode", callback: { (jsonResponse: Data) in
// print(debug: "Test:\(jsonResponse)")
//
// do {
// let decoder = JSONDecoder()
// let resChatMode: ResChatMode = try decoder.decode(ResChatMode.self, from: jsonResponse)
// self.handleChatMode(message: resChatMode)
// } catch(let error) {
// print(error.localizedDescription)
// }
// })
r_connection.start() r_connection.start()
} }
...@@ -206,10 +219,32 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M ...@@ -206,10 +219,32 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
//アプリ終了時 //アプリ終了時
func applicationWillTerminate(_ aNotification: UIApplication) { func applicationWillTerminate(_ aNotification: UIApplication) {
if let connect = connection { if let r_connection = connection {
connect.stop() r_connection.stop()
}
}
func connectionDidStart() {
print(debug: "connectionDidOpen")
}
func connectionDidFailToOpen(error: Error) {
print(debug: "connectionDidFailToOpen:\(error)")
}
func connectionDidClose(error: Error?) {
if let err = error {
print(debug: "connectionDidClose:\(err)")
} }
} }
func connectionWillReconnect(error: Error) {
print(debug: "connectionWillReconnect:\(error)")
}
func connectionDidReconnect() {
print(debug: "connectionDidReconnect")
}
} }
class SignalR: NSObject { class SignalR: NSObject {
...@@ -273,28 +308,23 @@ class ChatHubConnectionDelegate: HubConnectionDelegate { ...@@ -273,28 +308,23 @@ class ChatHubConnectionDelegate: HubConnectionDelegate {
} }
func connectionDidOpen(hubConnection: HubConnection) { func connectionDidOpen(hubConnection: HubConnection) {
print(debug: "connectionDidOpen") app?.connectionDidStart()
// app?.connectionDidStart()
} }
func connectionDidFailToOpen(error: Error) { func connectionDidFailToOpen(error: Error) {
print(debug: "connectionDidFailToOpen") app?.connectionDidFailToOpen(error: error)
// app?.connectionDidFailToOpen(error: error)
} }
func connectionDidClose(error: Error?) { func connectionDidClose(error: Error?) {
print(debug: "connectionDidClose") app?.connectionDidClose(error: error)
// app?.connectionDidClose(error: error)
} }
func connectionWillReconnect(error: Error) { func connectionWillReconnect(error: Error) {
print(debug: "connectionWillReconnect") app?.connectionWillReconnect(error: error)
// app?.connectionWillReconnect(error: error)
} }
func connectionDidReconnect() { func connectionDidReconnect() {
print(debug: "connectionDidReconnect") app?.connectionDidReconnect()
// app?.connectionDidReconnect()
} }
} }
...@@ -323,6 +353,14 @@ extension AppDelegate: UNUserNotificationCenterDelegate { ...@@ -323,6 +353,14 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
print(debug: "called \(subtitle) \(strTitle) \(strBody)") print(debug: "called \(subtitle) \(strTitle) \(strBody)")
if strTitle == "Chat Warning" {
if SharingData.message.mode {
let message = GetMessage()
message.start()
return
}
}
let message = GetMessage() let message = GetMessage()
message.start() message.start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment