Commit 9ef77c06 authored by shigemi miura's avatar shigemi miura

ライセンス情報対応

不具合 No.108/106対応
parent aa9c5dbc
...@@ -42,7 +42,6 @@ struct ChatTitleView: View { ...@@ -42,7 +42,6 @@ struct ChatTitleView: View {
.scaledToFit() .scaledToFit()
.frame(width: 12, height: 7) .frame(width: 12, height: 7)
.foregroundColor(ColorSet.Body.color) .foregroundColor(ColorSet.Body.color)
} }
.frame(width: 30, height: 30) .frame(width: 30, height: 30)
} }
......
...@@ -14,4 +14,7 @@ struct ResLogin : Codable { ...@@ -14,4 +14,7 @@ struct ResLogin : Codable {
var imo: Int = 0 var imo: Int = 0
var mmsi: Int = 0 var mmsi: Int = 0
var enableFuelSwitchTask: Bool = false var enableFuelSwitchTask: Bool = false
var enableNga: Bool = false
var enableCommunication: Bool = false
var enableManual: Bool = false
} }
...@@ -15,7 +15,6 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -15,7 +15,6 @@ 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()
...@@ -89,6 +88,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -89,6 +88,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
ngaTask.checkNga() ngaTask.checkNga()
if SharingData.message.mode { if SharingData.message.mode {
let message = GetMessage()
message.start() message.start()
} }
} }
...@@ -102,7 +102,8 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -102,7 +102,8 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
self.ngaTask.checkNga() self.ngaTask.checkNga()
if SharingData.message.mode { if SharingData.message.mode {
self.message.start() let message = GetMessage()
message.start()
} }
serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval) serverLocationInterval = DateTextLib.Date2UnixTime(date: Date()) + Int64(TimerInterval)
......
...@@ -197,6 +197,9 @@ struct LoginView: View { ...@@ -197,6 +197,9 @@ struct LoginView: View {
SharingData.my.imo = res.imo SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi SharingData.my.mmsi = res.mmsi
SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask
SharingData.my.isNga = res.enableNga
SharingData.my.isCommunication = res.enableCommunication
SharingData.my.isManual = res.enableManual
Preferences.shipId = res.shipId Preferences.shipId = res.shipId
......
...@@ -102,6 +102,9 @@ struct InputUserNameView: View { ...@@ -102,6 +102,9 @@ struct InputUserNameView: View {
SharingData.my.imo = res.imo SharingData.my.imo = res.imo
SharingData.my.mmsi = res.mmsi SharingData.my.mmsi = res.mmsi
SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask SharingData.my.isFuelSwitchTask = res.enableFuelSwitchTask
SharingData.my.isNga = res.enableNga
SharingData.my.isCommunication = res.enableCommunication
SharingData.my.isManual = res.enableManual
Preferences.shipId = res.shipId Preferences.shipId = res.shipId
......
...@@ -164,8 +164,9 @@ struct MenuMain: View { ...@@ -164,8 +164,9 @@ struct MenuMain: View {
}) })
.frame(width: 153, height: 42) .frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color) .foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color) .background(!SharingData.my.isFuelSwitchTask ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30) .cornerRadius(30)
.disabled(!SharingData.my.isFuelSwitchTask)
Button(action: { Button(action: {
taskViewModel.viewMode = .NgaNotification taskViewModel.viewMode = .NgaNotification
...@@ -176,8 +177,9 @@ struct MenuMain: View { ...@@ -176,8 +177,9 @@ struct MenuMain: View {
}) })
.frame(width: 153, height: 42) .frame(width: 153, height: 42)
.foregroundColor(ColorSet.ButtonText.color) .foregroundColor(ColorSet.ButtonText.color)
.background(ColorSet.PrimaryActiveIcon.color) .background(!SharingData.my.isNga ? ColorSet.SecondaryDisable.color : ColorSet.PrimaryActiveIcon.color)
.cornerRadius(30) .cornerRadius(30)
.disabled(!SharingData.my.isNga)
} }
.onChange(of: taskViewModel.viewMode){ newViewMode in .onChange(of: taskViewModel.viewMode){ newViewMode in
proxy.scrollTo(0, anchor: .top) proxy.scrollTo(0, anchor: .top)
......
...@@ -135,7 +135,7 @@ struct NgaSetting: View { ...@@ -135,7 +135,7 @@ struct NgaSetting: View {
.padding(.vertical, 20) .padding(.vertical, 20)
.disabled(stateEdit) .disabled(stateEdit)
let stateRegister = nga.editNga!.points.count < 3 || nga.editNga!.name.isEmpty let stateRegister = nga.editNga!.points.count < 3 || taskViewModel.ngaName.isEmpty
Button(action: { Button(action: {
if var ngaData = nga.editNga { if var ngaData = nga.editNga {
ngaData.name = taskViewModel.ngaName ngaData.name = taskViewModel.ngaName
......
...@@ -146,7 +146,7 @@ struct MenuView: View { ...@@ -146,7 +146,7 @@ struct MenuView: View {
path.append(.Manual) path.append(.Manual)
}label: { }label: {
MenuContentView(content: .Manual) MenuContentView(content: .Manual)
} }.disabled(!SharingData.my.isManual)
Button{ Button{
path.append(.Information) path.append(.Information)
......
...@@ -14,7 +14,7 @@ struct MenuContentView: View { ...@@ -14,7 +14,7 @@ struct MenuContentView: View {
HStack { HStack {
Text(content.title) Text(content.title)
.font(FontStyle.EmphasisText.font) .font(FontStyle.EmphasisText.font)
.foregroundColor(ColorSet.Body.color) .foregroundColor(getFontColor())
Spacer() Spacer()
...@@ -31,6 +31,19 @@ struct MenuContentView: View { ...@@ -31,6 +31,19 @@ struct MenuContentView: View {
.background(ColorSet.LineColor04.color) .background(ColorSet.LineColor04.color)
} }
} }
/**
* Manual
*/
func getFontColor() -> Color {
var fontColor = ColorSet.Body.color
if content == .Manual {
if !SharingData.my.isManual {
fontColor = ColorSet.BodyDescriptiion.color
}
}
return fontColor
}
} }
#Preview { #Preview {
......
...@@ -18,6 +18,9 @@ class SharingData{ ...@@ -18,6 +18,9 @@ class SharingData{
@Published var mmsi: Int = 0 @Published var mmsi: Int = 0
@Published var isUpDate: Bool = false @Published var isUpDate: Bool = false
@Published var isFuelSwitchTask: Bool = false @Published var isFuelSwitchTask: Bool = false
@Published var isNga: Bool = false
@Published var isCommunication: Bool = false
@Published var isManual: Bool = false
@Published var ecaStatus: EcaState? @Published var ecaStatus: EcaState?
......
...@@ -38,8 +38,10 @@ struct MainTabView: View { ...@@ -38,8 +38,10 @@ struct MainTabView: View {
@State var isTaskSel: Bool = selectedTabModel.activeTab == .map @State var isTaskSel: Bool = selectedTabModel.activeTab == .map
TabView(selection: $selectedTabModel.activeTab){ TabView(selection: $selectedTabModel.activeTab){
if SharingData.my.isCommunication {
ChatView() ChatView()
.tag(Tab.chat) .tag(Tab.chat)
}
ZStack { ZStack {
MapRepresentable() MapRepresentable()
...@@ -55,7 +57,8 @@ struct MainTabView: View { ...@@ -55,7 +57,8 @@ struct MainTabView: View {
.tag(Tab.menu) .tag(Tab.menu)
} }
.hideNativeTabBar() .hideNativeTabBar()
.sheet(isPresented: .constant(isTaskSel && isTabShow && SharingData.my.isFuelSwitchTask), content: { // .sheet(isPresented: .constant(isTaskSel && isTabShow && SharingData.my.isFuelSwitchTask), content: {
.sheet(isPresented: .constant(isTaskSel && isTabShow), content: {
MenuTaskView() MenuTaskView()
.zIndex(0) .zIndex(0)
.presentationDragIndicator(.hidden) .presentationDragIndicator(.hidden)
...@@ -69,8 +72,10 @@ struct MainTabView: View { ...@@ -69,8 +72,10 @@ struct MainTabView: View {
@State var isPopover: Bool = selectedTabModel.isPoppver @State var isPopover: Bool = selectedTabModel.isPoppver
TabView(selection: $selectedTabModel.activeTab){ TabView(selection: $selectedTabModel.activeTab){
if SharingData.my.isCommunication {
ChatView() ChatView()
.tag(Tab.chat) .tag(Tab.chat)
}
ZStack { ZStack {
MapRepresentable() MapRepresentable()
...@@ -86,7 +91,8 @@ struct MainTabView: View { ...@@ -86,7 +91,8 @@ struct MainTabView: View {
.tag(Tab.menu) .tag(Tab.menu)
} }
.hideNativeTabBar() .hideNativeTabBar()
.popover(isPresented: .constant(isPopover && SharingData.my.isFuelSwitchTask), attachmentAnchor: .point(.bottom)) { // .popover(isPresented: .constant(isPopover && SharingData.my.isFuelSwitchTask), attachmentAnchor: .point(.bottom)) {
.popover(isPresented: .constant(isPopover), attachmentAnchor: .point(.bottom)) {
MenuTaskView() MenuTaskView()
.presentationCompactAdaptation(.popover) .presentationCompactAdaptation(.popover)
.zIndex(0) .zIndex(0)
...@@ -179,7 +185,7 @@ struct CustomTabBar: View { ...@@ -179,7 +185,7 @@ struct CustomTabBar: View {
} }
} message: { } message: {
Text("Do you change an emargency mode?") Text("Do you change an warning mode?")
} }
.alert("Location", isPresented: $selectedTabModel.isLocationAlert) { .alert("Location", isPresented: $selectedTabModel.isLocationAlert) {
Button("Cancel") {} Button("Cancel") {}
......
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