Commit e3f92dd3 authored by shigemi miura's avatar shigemi miura

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

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