Add Telemetry log

This commit is contained in:
Garth Vander Houwen 2022-07-08 06:31:47 -07:00
parent ddfcea4ace
commit 3b90bb7ecc
7 changed files with 219 additions and 27 deletions

View file

@ -127,6 +127,8 @@ struct CannedMessagesConfig: View {
/// Generate input event on Press of this kind.
@State var inputbrokerEventPress = 0
@State var messagesPart1 = ""
var body: some View {
VStack {
@ -157,6 +159,10 @@ struct CannedMessagesConfig: View {
.padding(.bottom, 10)
}
Section(header: Text("Messages")) {
TextEditor(text: $messagesPart1)
}
Section(header: Text("Control Type")) {
@ -310,7 +316,7 @@ struct CannedMessagesConfig: View {
cmc.inputbrokerEventCcw = InputEventChars(rawValue: inputbrokerEventCcw)!.protoEnumValue()
cmc.inputbrokerEventPress = InputEventChars(rawValue: inputbrokerEventPress)!.protoEnumValue()
let adminMessageId = bleManager.saveCannedMessageModuleConfig(config: cmc, fromUser: node!.user!, toUser: node!.user!, wantResponse: true)
let adminMessageId = bleManager.saveCannedMessageModuleConfig(config: cmc, messages: "Where are you garth?, Hello",fromUser: node!.user!, toUser: node!.user!, wantResponse: true)
if adminMessageId > 0 {
// Should show a saved successfully alert once I know that to be true
@ -363,12 +369,23 @@ struct CannedMessagesConfig: View {
}
.onChange(of: enabled) { newEnabled in
if newEnabled != node!.cannedMessageConfig!.enabled { hasChanges = true }
if node!.cannedMessageConfig != nil {
if newEnabled != node!.cannedMessageConfig!.enabled { hasChanges = true }
}
}
.onChange(of: sendBell) { newBell in
if newBell != node!.cannedMessageConfig!.sendBell { hasChanges = true }
}
.onChange(of: rotary1Enabled) { newRot1 in
if newRot1 != node!.cannedMessageConfig!.rotary1Enabled { hasChanges = true }
}
.onChange(of: updown1Enabled) { newUpDown in
if newUpDown != node!.cannedMessageConfig!.updown1Enabled { hasChanges = true }
}
.onChange(of: inputbrokerPinA) { newPinA in
if newPinA != node!.cannedMessageConfig!.inputbrokerPinA { hasChanges = true }