Commit 6a060b4f authored by shigemi miura's avatar shigemi miura

SignalR不具合修正

その他不具合修正
parent 9ef77c06
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
......@@ -892,7 +892,7 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1500;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1540;
TargetAttributes = {
020B980F2AD8C3140029DE4C = {
CreatedOnToolsVersion = 15.0;
......@@ -1307,7 +1307,7 @@
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES;
......@@ -1353,7 +1353,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES;
......@@ -1524,7 +1524,6 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = QC;
......@@ -1537,7 +1536,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Sailassist/Sailassist.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_ASSET_PATHS = "\"Sailassist/Preview Content\"";
DEVELOPMENT_TEAM = D2DC7QNNJ8;
ENABLE_PREVIEWS = YES;
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
......
......@@ -50,13 +50,11 @@ class GetMessage {
for message in SharingData.message.messages {
//SSV Mobileからの受信メッセージ
if message.location == 1 {
msgCnt = msgCnt + 1
if ((message.viewer.first(where: {$0.location == 2})) != nil){
if ((message.viewer.first(where: {$0.id == String(SharingData.my.id)})) != nil){
viewCnt = viewCnt + 1
}
}
}
SharingData.message.viewCnt = msgCnt - viewCnt //未読数
}
......@@ -68,21 +66,25 @@ class GetMessage {
for message in SharingData.message.messages {
//Sail Assist側で既読が無い場合(既読確認)
var unRead = true
if ((message.viewer.first(where: {$0.location == 2})) != nil){
if ((message.viewer.first(where: {$0.id == String(SharingData.my.id)})) != nil) {
unRead = false //既読状態
}
if unRead {
let signalRService = SignalR()
signalRService.ackMessage(messageId: message.messageId)
signalRService.ackMessage(messageId: message.messageId) { error in
if let e = error {
print(debug: "error chat:\(e)")
} else {
let msgIndex = SharingData.message.messages.firstIndex(where: {$0.messageId == message.messageId})
if let index = msgIndex {
let viewer = Viewer(time: DateTextLib.Date2ISO8601Text(Date()), location: 2, id: "")
let viewer = Viewer(time: DateTextLib.Date2ISO8601Text(Date()), location: 2, id: String(SharingData.my.id))
SharingData.message.messages[index].viewer.append(viewer)
}
}
}
}
}
}
}
......@@ -177,7 +177,7 @@ struct ChatInputView: View {
*/
func responseChatMessage(error: Error?) {
if let e = error {
print(debug: "Error:\(e)")
print(debug: "Error chat:\(e)")
msg.messages.removeLast() //最後に追加したメッセージを削除
isChatAlert = true
} else {
......
......@@ -34,7 +34,7 @@ struct ChatMemberView: View {
.listRowBackground(ColorSet.ModalWindowFront.color)
.listRowSeparatorTint(ColorSet.LineModal.color)
}
.scrollDisabled(true)
.scrollDisabled(false)
.scrollContentBackground(.hidden)
.background(ColorSet.ModalWindowBack.color)
......
......@@ -11,8 +11,8 @@ 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
var location: Int = 2 //1:Shore / 2:Ship
var fromId: String = "" //ユーザーID
init(shipId: Int, messageId: String) {
self.shipId = shipId
......
......@@ -13,7 +13,6 @@ import Foundation
*/
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中
......
......@@ -14,7 +14,7 @@ struct ReqMessage : Codable {
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 fromId: String = "" //ユーザーID
var message: String = "" //テキスト
var stampId: Int = 0 //スタンプ番号 0:Fire〜
......
......@@ -12,5 +12,5 @@ struct ResAckMessage: Codable {
var messageId: String //UUID
var time: String //投稿日時
var location: Int //1:Shore、2:Ship
var fromId: String //ユーザーID
var fromId: String? //ユーザーID
}
......@@ -9,8 +9,7 @@ import Foundation
struct ResChatMode: Codable {
var shipId: Int
var time: String //投稿日時
var location: Int //1:Shore、2:Ship
var fromId: String //ユーザーID
var fromId: String? //ユーザーID
var mode: Int //0:通常、1:Warning中
}
......@@ -76,6 +76,12 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let eca = EcaTask()
eca.start()
let ngaList = GetNgaList()
ngaList.start()
if let newLocation = locations.first {
print(debug: "called locationManager")
lastSeenLocation = newLocation
......@@ -86,26 +92,14 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
if Preferences.LocationType == 0 {
ecaTask.checkEca()
ngaTask.checkNga()
if SharingData.message.mode {
let message = GetMessage()
message.start()
}
}
}
if Preferences.LocationType == 1 {
if serverLocationInterval <= DateTextLib.Date2UnixTime(date: Date()) {
let eca = EcaTask()
eca.start()
self.ecaTask.checkEca()
self.ngaTask.checkNga()
if SharingData.message.mode {
let message = GetMessage()
message.start()
}
serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval)
}
}
......
......@@ -10,12 +10,10 @@ import SwiftUI
struct FuelSwitchingView: View {
@ObservedObject var taskViewModel: TaskViewModel
@ObservedObject var ecaData = SharingData.eca
@State var isDeleteAlert: Bool = false
@State var isRunningStopAlert: Bool = false
let deleteEcaArea = DeleteEcaArea()
var body: some View {
VStack{
VStack {
ForEach(ecaData.ecaArea.map{ $0.1 }.filter{ $0.isEnable }.sorted{ $0.areaId < $1.areaId }, id: \.name){ eca in
VStack {
HStack {
......@@ -36,7 +34,7 @@ struct FuelSwitchingView: View {
HStack {
Circle()
.frame(width: 14, height: 14)
.foregroundColor(eca.isRunning ? ColorSet.PrimaryActiveIcon.color : ColorSet.TaskStateIcon.color)
.foregroundColor(eca.isRunning == true ? ColorSet.PrimaryActiveIcon.color : ColorSet.TaskStateIcon.color)
Spacer()
.frame(width: 10)
}
......@@ -51,6 +49,56 @@ struct FuelSwitchingView: View {
Spacer()
EcaMenuView(taskViewModel: taskViewModel, ecaData: ecaData, eca: eca)
.alert("Fuel Switching", isPresented: $isRunningStopAlert) {
Button("Yes") {
if let ecaArea = taskViewModel.edittingEcaArea {
var newData = ecaArea
newData.isRunning = false
newData.status = EcaState.end
ecaData.editEcaArea(key: ecaArea.areaId, value: newData, type: EcaOperation.End)
}
taskViewModel.edittingEcaArea = nil
}
Button("No"){}
} message: {
Text("Have you finished " + taskViewModel.ecaName + " fuel switching?")
}
}
.frame(height: 60)
.padding(.horizontal, 30)
Divider()
.background(.white)
}
}
//AddECAボタン
Button(action: {
taskViewModel.viewMode = .EcaList
}, label: {
Text("Add ECA Task")
.font(FontStyle.DefaultText.font)
.padding()
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
Spacer()
}
}
}
struct EcaMenuView: View {
@ObservedObject var taskViewModel: TaskViewModel
@ObservedObject var ecaData = SharingData.eca
@Environment(\ .colorScheme) var colorScheme
@State var isDeleteAlert: Bool = false
let deleteEcaArea = DeleteEcaArea()
var eca: RegisteredEca
var body: some View {
Menu {
Text(eca.name)
......@@ -72,7 +120,8 @@ struct FuelSwitchingView: View {
} label: {
Image(systemName: "ellipsis")
.frame(width: 22, height: 22)
.foregroundColor(eca.isRunning ? ColorSet.Splash.color : ColorSet.Slidebar.color)
.opacity(eca.isRunning == true ? 0.2 : 1.0)
.foregroundColor(colorScheme == .light ? .black : .white)
}
.disabled(eca.isRunning)
.alert("Delete", isPresented: $isDeleteAlert) {
......@@ -91,47 +140,9 @@ struct FuelSwitchingView: View {
} message: {
Text("Have you finished " + taskViewModel.ecaName + " fuel switching?")
}
.alert("Fuel Switching", isPresented:$isRunningStopAlert) {
Button("Yes") {
if let ecaArea = taskViewModel.edittingEcaArea {
var newData = ecaArea
newData.isRunning = false
newData.status = EcaState.end
ecaData.editEcaArea(key: ecaArea.areaId, value: newData, type: EcaOperation.End)
}
taskViewModel.edittingEcaArea = nil
}
Button("No"){}
} message: {
Text("Have you finished " + taskViewModel.ecaName + " fuel switching?")
}
}
.frame(height: 60)
.padding(.horizontal, 30)
Divider()
.background(.white)
}
}
//AddECAボタン
Button(action: {
taskViewModel.viewMode = .EcaList
}, label: {
Text("Add ECA Task")
.font(FontStyle.DefaultText.font)
.padding()
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
Spacer()
}
}
}
#Preview {
FuelSwitchingView(taskViewModel: TaskViewModel())
}
......@@ -10,14 +10,10 @@ 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
VStack {
HStack {
//NGA開始・終了ボタン
......@@ -25,11 +21,8 @@ struct NgaNotificationView: View {
var newData = nga
newData.isRunning.toggle()
newData.passingCnt = 0
if newData.isRunning {
ngaData.editNgaArea(value: newData, type: NgaOperation.Running)
} else {
ngaData.editNgaArea(value: newData, type: NgaOperation.Cancel)
}
ngaData.editNgaArea(value: newData, type: checkRunning(isRunning: newData.isRunning))
} label: {
HStack {
Circle()
......@@ -50,6 +43,58 @@ struct NgaNotificationView: View {
Spacer()
NgaMenuView(taskViewModel: taskViewModel, ngaData: ngaData, nga: nga)
}
.frame(height: 60)
.padding(.horizontal, 30)
Divider()
.background(.white)
}
}
//Add NGAボタン
let isAddNga = ngaData.ngaArea.count < ngaAreaMax
Button(action: {
if var ngaTmp = RegisteredNga(areaName: "") {
ngaTmp.isLock = false
ngaTmp.isRunning = false
ngaTmp.name = "NGA Area" + String(ngaData.ngaArea.count)
ngaData.editType = EditNgaType.nonEdit
ngaData.editNga = ngaTmp
taskViewModel.viewMode = .NgaSetting
}
}, label: {
Text("Add NGA Task")
.font(FontStyle.DefaultText.font)
.padding()
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(!isAddNga ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
.disabled(!isAddNga)
Spacer()
}
}
func checkRunning(isRunning: Bool) -> NgaOperation {
var type = NgaOperation.Cancel
if isRunning == true {
type = NgaOperation.Running
}
return type
}
}
struct NgaMenuView: View {
@ObservedObject var taskViewModel: TaskViewModel
@ObservedObject var ngaData = SharingData.nga
@Environment(\ .colorScheme) var colorScheme
@State var isDelete: Bool = false
var nga: RegisteredNga
var body: some View {
Menu {
Text(nga.name)
......@@ -79,59 +124,17 @@ struct NgaNotificationView: View {
Button("Yes") {
if let newData = ngaData.editNga {
ngaData.editNgaArea(value: newData, type: NgaOperation.Delete)
ngaData.editNga = nil
}
}
Button("No"){}
} message: {
Text("Delete " + nga.name + " ?")
}
.alert("NGA Switching", isPresented:$isRunningStopNga) {
Button("Yes") {
var newData = nga
newData.isRunning = false
ngaData.editNgaArea(value: newData, type: NgaOperation.Cancel)
}
Button("No"){}
} message: {
Text("Have you finished " + nga.name + "switching?")
if let editNga = ngaData.editNga {
Text("Delete " + editNga.name + " ?")
}
}
.frame(height: 60)
.padding(.horizontal, 30)
Divider()
.background(.white)
}
}
//Add NGAボタン
let isAddNga = ngaData.ngaArea.count < ngaAreaMax
Button(action: {
if var ngaTmp = RegisteredNga(areaName: "") {
ngaTmp.isLock = false
ngaTmp.isRunning = false
ngaTmp.name = "NGA Area" + String(ngaData.ngaArea.count)
ngaData.editType = EditNgaType.nonEdit
ngaData.editNga = ngaTmp
taskViewModel.viewMode = .NgaSetting
}
}, label: {
Text("Add NGA Task")
.font(FontStyle.DefaultText.font)
.padding()
})
.frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color)
.background(!isAddNga ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30)
.disabled(!isAddNga)
Spacer()
}
}
}
#Preview {
NgaNotificationView(taskViewModel: TaskViewModel())
}
......@@ -111,7 +111,7 @@ 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 })
.build()
......@@ -119,30 +119,18 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
if let r_connection = connection {
// 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)
})
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()
}
......@@ -191,22 +179,21 @@ class AppDelegate: NSObject, UIApplicationDelegate ,MSNotificationHubDelegate, M
}
private func handleChatMessage(message: ResChatMessage) {
let ownMsg = ChatMessage(shipId: message.shipId, messageId: message.messageId, type: message.type, time: message.time, location: message.location, from: message.from, message: message.message, stampId: message.stampId, viewer: [])
let ownMsg = ChatMessage(shipId: message.shipId, messageId: message.messageId, type: message.type, time: message.time, location: message.location, from: message.from, fromId: message.fromId, message: message.message, stampId: message.stampId, viewer: [])
self.msg.messages.append(ownMsg)
let message = GetMessage()
message.checkUnreadMessages()
}
private func handleAckMessage(message: ResAckMessage) {
let msgIndex = self.msg.messages.firstIndex(where: {$0.messageId == message.messageId})
if let index = msgIndex {
let viewer = Viewer(time: message.time, location: message.location, id: message.fromId)
if let fromId = message.fromId {
let viewer = Viewer(time: message.time, location: message.location, id: fromId)
self.msg.messages[index].viewer.append(viewer)
} else {
let viewer = Viewer(time: message.time, location: message.location, id: "")
self.msg.messages[index].viewer.append(viewer)
}
let message = GetMessage()
message.checkUnreadMessages()
}
}
private func handleChatMode(message: ResChatMode) {
......@@ -256,7 +243,7 @@ class SignalR: NSObject {
request.time = DateTextLib.Date2ISO8601Text(Date())
request.location = 2 //1:Shore , 2:Ship
request.from = Preferences.UserName //投稿者名
request.fromeId = String(SharingData.my.id) //ユーザーID
request.fromId = String(SharingData.my.id) //ユーザーID
if msg.mode {
request.message = "⚠️\n" + message
} else {
......@@ -265,30 +252,22 @@ class SignalR: NSObject {
request.stampId = 0 //スタンプ番号 0:Fire~
if message != "" {
connection!.invoke(method: "chatMessage", request, invocationDidComplete: completion)
let ownMsg = ChatMessage(shipId: request.shipId, messageId: request.messageId, type: request.type, time: request.time, location: request.location, from: request.from, message: request.message, stampId: request.stampId, viewer: [])
self.msg.messages.append(ownMsg)
connection!.invoke(method: "ChatMessage", request, invocationDidComplete: completion)
}
}
func ackMessage(messageId: String) {
func ackMessage(messageId: String, completion: @escaping (_ error: Error?) -> Void) {
var request = ReqAckMessage(shipId: Preferences.shipId, messageId: messageId)
request.time = DateTextLib.Date2ISO8601Text(Date())
request.location = 2 //1:Shore , 2:Ship
request.fromeId = String(SharingData.my.id) //ユーザーID
request.fromId = String(SharingData.my.id) //ユーザーID
if messageId != "" {
connection!.invoke(method: "ackMessage", request) { error in
if let e = error {
print(debug: "Error:\(e)")
}
}
connection!.invoke(method: "AckMessage", request, invocationDidComplete: completion)
}
}
func chatMode(mode: Bool) {
func chatMode(mode: Bool, completion: @escaping (_ error: Error?) -> Void) {
var request = ReqChatModeMessage(shipId: Preferences.shipId)
request.time = DateTextLib.Date2ISO8601Text(Date())
request.location = 2 //1:Shore , 2:Ship
request.fromeId = String(SharingData.my.id) //ユーザーID
if mode == true{
......@@ -296,11 +275,7 @@ class SignalR: NSObject {
} else {
request.mode = 0
}
connection!.invoke(method: "chatMode", request) { error in
if let e = error {
print(debug: "Error:\(e)")
}
}
connection!.invoke(method: "ChatMode", request, invocationDidComplete: completion)
}
}
......
......@@ -145,7 +145,7 @@ class SharingData{
task.startRange = value.swStart
task.finishRange = value.swFinish
task.status = serverRunning
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Insert:
task.id = UUID().uuidString
......@@ -156,7 +156,7 @@ class SharingData{
task.startRange = value.swStart
task.finishRange = value.swFinish
task.status = serverRegister
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Delete:
let deleteEcaArea = DeleteEcaArea()
......@@ -172,7 +172,7 @@ class SharingData{
if value.isEnable && value.isRunning {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Start:
task.id = value.id
......@@ -185,7 +185,7 @@ class SharingData{
if value.isEnable && value.isRunning {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Finish:
task.id = value.id
......@@ -198,7 +198,7 @@ class SharingData{
if value.isEnable {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.End:
task.id = value.id
......@@ -211,7 +211,7 @@ class SharingData{
if value.isEnable {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Incomplete:
task.id = value.id
......@@ -224,7 +224,7 @@ class SharingData{
if value.isEnable {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Cancel:
task.id = value.id
......@@ -237,7 +237,7 @@ class SharingData{
if value.isEnable {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
case EcaOperation.Change:
task.id = value.id
......@@ -250,7 +250,7 @@ class SharingData{
if value.isEnable && value.isRunning {
task.status = setEcaStatus(eca: value)
}
task.lastUpdateTime = DateTextLib.Date2BCDText(Date())
task.lastUpdateTime = DateTextLib.Date2ISO8601Text(Date())
setEcaArea.start(eca: task)
}
ecaArea.updateValue(value, forKey: key)
......
......@@ -177,9 +177,10 @@ struct CustomTabBar: View {
.background(ColorSet.BottomNav.color)
.alert("", isPresented: $selectedTabModel.isShowChangeEmrMode) {
Button("Yes"){
SharingData.message.changeMode()
var chatMode = SharingData.message.mode
chatMode.toggle()
let signalRService = SignalR()
signalRService.chatMode(mode: SharingData.message.mode)
signalRService.chatMode(mode: chatMode, completion: responseChatMode)
}
Button("No"){
......@@ -206,6 +207,17 @@ struct CustomTabBar: View {
Text("A new version of this app is available.")
}
}
/**
* Warninngモードレスポンス
*/
func responseChatMode(error: Error?) {
if let e = error {
print(debug: "Error chat:\(e)")
} else {
SharingData.message.changeMode()
}
}
}
#Preview {
......
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