aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml.cs
blob: de2c728b05fe7ff0b5fde2ca2998ab9f8173dc10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using MahApps.Metro.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Tango.MachineStudio.UI.Console
{
    /// <summary>
    /// Interaction logic for ConsoleWindow.xaml
    /// </summary>
    public partial class ConsoleWindow : MetroWindow
    {
        private ConsoleWindowVM _vm;

        public ConsoleWindow()
        {
            InitializeComponent();

            this.Loaded += (_, __) =>
            {
                _vm = this.DataContext as ConsoleWindowVM;
                _vm.SetLogTextBox(txtLog);
            };
        }

        //Auto scroll to bottom of response log each time it is changed.
        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            txtLog.SelectionStart = txtLog.Text.Length;
            txtLog.ScrollToEnd();
        }
    }
}
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: AlarmHandlingItem.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Tango.PMR.EmbeddedParameters {

  /// <summary>Holder for reflection information generated from AlarmHandlingItem.proto</summary>
  public static partial class AlarmHandlingItemReflection {

    #region Descriptor
    /// <summary>File descriptor for AlarmHandlingItem.proto</summary>
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static AlarmHandlingItemReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "ChdBbGFybUhhbmRsaW5nSXRlbS5wcm90bxIcVGFuZ28uUE1SLkVtYmVkZGVk",
            "UGFyYW1ldGVycxoVQWxhcm1Tb3VyY2VUeXBlLnByb3RvGhZEZWJ1Z0xvZ0Nh",
            "dGVnb3J5LnByb3RvGg9FdmVudFR5cGUucHJvdG8i2wIKEUFsYXJtSGFuZGxp",
            "bmdJdGVtEkIKC0FsYXJtU291cmNlGAEgASgOMi0uVGFuZ28uUE1SLkVtYmVk",
            "ZGVkUGFyYW1ldGVycy5BbGFybVNvdXJjZVR5cGUSEAoIRGV2aWNlSWQYAiAB",
            "KA0SFgoOTW9kdWxlRGV2aWNlSWQYAyABKA0SEgoKQWxhcm1WYWx1ZRgEIAEo",
            "DRIWCg5BbGFybURpcmVjdGlvbhgFIAEoCBI3CghTZXZlcml0eRgGIAEoDjIl",
            "LlRhbmdvLlBNUi5EZWJ1Z2dpbmcuRGVidWdMb2dDYXRlZ29yeRIVCg1EZWJv",
            "dW5jZVZhbHVlGAcgASgNEjMKCUV2ZW50VHlwZRgIIAEoDjIgLlRhbmdvLlBN",
            "Ui5EaWFnbm9zdGljcy5FdmVudFR5cGUSEQoJRXZlbnROYW1lGAkgASgJEhQK",
            "DElzUGVyc2lzdGVudBgKIAEoCEIoCiZjb20udHdpbmUudGFuZ28ucG1yLmVt",
            "YmVkZGVkcGFyYW1ldGVyc2IGcHJvdG8z"));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { global::Tango.PMR.EmbeddedParameters.AlarmSourceTypeReflection.Descriptor, global::Tango.PMR.Debugging.DebugLogCategoryReflection.Descriptor, global::Tango.PMR.Diagnostics.EventTypeReflection.Descriptor, },
          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.EmbeddedParameters.AlarmHandlingItem), global::Tango.PMR.EmbeddedParameters.AlarmHandlingItem.Parser, new[]{ "AlarmSource", "DeviceId", "ModuleDeviceId", "AlarmValue", "AlarmDirection", "Severity", "DebounceValue", "EventType", "EventName", "IsPersistent" }, null, null, null)
          }));
    }
    #endregion

  }
  #region Messages
  public sealed partial class AlarmHandlingItem : pb::IMessage<AlarmHandlingItem> {
    private static readonly pb::MessageParser<AlarmHandlingItem> _parser = new pb::MessageParser<AlarmHandlingItem>(() => new AlarmHandlingItem());
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pb::MessageParser<AlarmHandlingItem> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Tango.PMR.EmbeddedParameters.AlarmHandlingItemReflection.Descriptor.MessageTypes[0]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public AlarmHandlingItem() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public AlarmHandlingItem(AlarmHandlingItem other) : this() {
      alarmSource_ = other.alarmSource_;
      deviceId_ = other.deviceId_;
      moduleDeviceId_ = other.moduleDeviceId_;
      alarmValue_ = other.alarmValue_;
      alarmDirection_ = other.alarmDirection_;
      severity_ = other.severity_;
      debounceValue_ = other.debounceValue_;
      eventType_ = other.eventType_;
      eventName_ = other.eventName_;
      isPersistent_ = other.isPersistent_;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public AlarmHandlingItem Clone() {
      return new AlarmHandlingItem(this);
    }

    /// <summary>Field number for the "AlarmSource" field.</summary>
    public const int AlarmSourceFieldNumber = 1;
    private global::Tango.PMR.EmbeddedParameters.AlarmSourceType alarmSource_ = 0;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public global::Tango.PMR.EmbeddedParameters.AlarmSourceType AlarmSource {
      get { return alarmSource_; }
      set {
        alarmSource_ = value;
      }
    }

    /// <summary>Field number for the "DeviceId" field.</summary>
    public const int DeviceIdFieldNumber = 2;
    private uint deviceId_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint DeviceId {
      get { return deviceId_; }
      set {
        deviceId_ = value;
      }
    }

    /// <summary>Field number for the "ModuleDeviceId" field.</summary>
    public const int ModuleDeviceIdFieldNumber = 3;
    private uint moduleDeviceId_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint ModuleDeviceId {
      get { return moduleDeviceId_; }
      set {
        moduleDeviceId_ = value;
      }
    }

    /// <summary>Field number for the "AlarmValue" field.</summary>
    public const int AlarmValueFieldNumber = 4;
    private uint alarmValue_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint AlarmValue {
      get { return alarmValue_; }
      set {
        alarmValue_ = value;
      }
    }

    /// <summary>Field number for the "AlarmDirection" field.</summary>
    public const int AlarmDirectionFieldNumber = 5;
    private bool alarmDirection_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool AlarmDirection {
      get { return alarmDirection_; }
      set {
        alarmDirection_ = value;
      }
    }

    /// <summary>Field number for the "Severity" field.</summary>
    public const int SeverityFieldNumber = 6;
    private global::Tango.PMR.Debugging.DebugLogCategory severity_ = 0;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public global::Tango.PMR.Debugging.DebugLogCategory Severity {
      get { return severity_; }
      set {
        severity_ = value;
      }
    }

    /// <summary>Field number for the "DebounceValue" field.</summary>
    public const int DebounceValueFieldNumber = 7;
    private uint debounceValue_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public uint DebounceValue {
      get { return debounceValue_; }
      set {
        debounceValue_ = value;
      }
    }

    /// <summary>Field number for the "EventType" field.</summary>
    public const int EventTypeFieldNumber = 8;
    private global::Tango.PMR.Diagnostics.EventType eventType_ = 0;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public global::Tango.PMR.Diagnostics.EventType EventType {
      get { return eventType_; }
      set {
        eventType_ = value;
      }
    }

    /// <summary>Field number for the "EventName" field.</summary>
    public const int EventNameFieldNumber = 9;
    private string eventName_ = "";
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public string EventName {
      get { return eventName_; }
      set {
        eventName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// <summary>Field number for the "IsPersistent" field.</summary>
    public const int IsPersistentFieldNumber = 10;
    private bool isPersistent_;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool IsPersistent {
      get { return isPersistent_; }
      set {
        isPersistent_ = value;
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override bool Equals(object other) {
      return Equals(other as AlarmHandlingItem);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool Equals(AlarmHandlingItem other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (AlarmSource != other.AlarmSource) return false;
      if (DeviceId != other.DeviceId) return false;
      if (ModuleDeviceId != other.ModuleDeviceId) return false;
      if (AlarmValue != other.AlarmValue) return false;
      if (AlarmDirection != other.AlarmDirection) return false;
      if (Severity != other.Severity) return false;
      if (DebounceValue != other.DebounceValue) return false;
      if (EventType != other.EventType) return false;
      if (EventName != other.EventName) return false;
      if (IsPersistent != other.IsPersistent) return false;
      return true;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (AlarmSource != 0) hash ^= AlarmSource.GetHashCode();
      if (DeviceId != 0) hash ^= DeviceId.GetHashCode();
      if (ModuleDeviceId != 0) hash ^= ModuleDeviceId.GetHashCode();
      if (AlarmValue != 0) hash ^= AlarmValue.GetHashCode();
      if (AlarmDirection != false) hash ^= AlarmDirection.GetHashCode();
      if (Severity != 0) hash ^= Severity.GetHashCode();
      if (DebounceValue != 0) hash ^= DebounceValue.GetHashCode();
      if (EventType != 0) hash ^= EventType.GetHashCode();
      if (EventName.Length != 0) hash ^= EventName.GetHashCode();
      if (IsPersistent != false) hash ^= IsPersistent.GetHashCode();
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void WriteTo(pb::CodedOutputStream output) {
      if (AlarmSource != 0) {
        output.WriteRawTag(8);
        output.WriteEnum((int) AlarmSource);
      }
      if (DeviceId != 0) {
        output.WriteRawTag(16);
        output.WriteUInt32(DeviceId);
      }
      if (ModuleDeviceId != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(ModuleDeviceId);
      }
      if (AlarmValue != 0) {
        output.WriteRawTag(32);
        output.WriteUInt32(AlarmValue);
      }
      if (AlarmDirection != false) {
        output.WriteRawTag(40);
        output.WriteBool(AlarmDirection);
      }
      if (Severity != 0) {
        output.WriteRawTag(48);
        output.WriteEnum((int) Severity);
      }
      if (DebounceValue != 0) {
        output.WriteRawTag(56);
        output.WriteUInt32(DebounceValue);
      }
      if (EventType != 0) {
        output.WriteRawTag(64);
        output.WriteEnum((int) EventType);
      }
      if (EventName.Length != 0) {
        output.WriteRawTag(74);
        output.WriteString(EventName);
      }
      if (IsPersistent != false) {
        output.WriteRawTag(80);
        output.WriteBool(IsPersistent);
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (AlarmSource != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) AlarmSource);
      }
      if (DeviceId != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DeviceId);
      }
      if (ModuleDeviceId != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ModuleDeviceId);
      }
      if (AlarmValue != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(AlarmValue);
      }
      if (AlarmDirection != false) {
        size += 1 + 1;
      }
      if (Severity != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Severity);
      }
      if (DebounceValue != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DebounceValue);
      }
      if (EventType != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EventType);
      }
      if (EventName.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(EventName);
      }
      if (IsPersistent != false) {
        size += 1 + 1;
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(AlarmHandlingItem other) {
      if (other == null) {
        return;
      }
      if (other.AlarmSource != 0) {
        AlarmSource = other.AlarmSource;
      }
      if (other.DeviceId != 0) {
        DeviceId = other.DeviceId;
      }
      if (other.ModuleDeviceId != 0) {
        ModuleDeviceId = other.ModuleDeviceId;
      }
      if (other.AlarmValue != 0) {
        AlarmValue = other.AlarmValue;
      }
      if (other.AlarmDirection != false) {
        AlarmDirection = other.AlarmDirection;
      }
      if (other.Severity != 0) {
        Severity = other.Severity;
      }
      if (other.DebounceValue != 0) {
        DebounceValue = other.DebounceValue;
      }
      if (other.EventType != 0) {
        EventType = other.EventType;
      }
      if (other.EventName.Length != 0) {
        EventName = other.EventName;
      }
      if (other.IsPersistent != false) {
        IsPersistent = other.IsPersistent;
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 8: {
            alarmSource_ = (global::Tango.PMR.EmbeddedParameters.AlarmSourceType) input.ReadEnum();
            break;
          }
          case 16: {
            DeviceId = input.ReadUInt32();
            break;
          }
          case 24: {
            ModuleDeviceId = input.ReadUInt32();
            break;
          }
          case 32: {
            AlarmValue = input.ReadUInt32();
            break;
          }
          case 40: {
            AlarmDirection = input.ReadBool();
            break;
          }
          case 48: {
            severity_ = (global::Tango.PMR.Debugging.DebugLogCategory) input.ReadEnum();
            break;
          }
          case 56: {
            DebounceValue = input.ReadUInt32();
            break;
          }
          case 64: {
            eventType_ = (global::Tango.PMR.Diagnostics.EventType) input.ReadEnum();
            break;
          }
          case 74: {
            EventName = input.ReadString();
            break;
          }
          case 80: {
            IsPersistent = input.ReadBool();
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code