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();
        }
    }
}
o">= STITCH__INIT; *message = init_value; } size_t stitch__get_packed_size (const Stitch *message) { assert(message->base.descriptor == &stitch__descriptor); return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); } size_t stitch__pack (const Stitch *message, uint8_t *out) { assert(message->base.descriptor == &stitch__descriptor); return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); } size_t stitch__pack_to_buffer (const Stitch *message, ProtobufCBuffer *buffer) { assert(message->base.descriptor == &stitch__descriptor); return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); } Stitch * stitch__unpack (ProtobufCAllocator *allocator, size_t len, const uint8_t *data) { return (Stitch *) protobuf_c_message_unpack (&stitch__descriptor, allocator, len, data); } void stitch__free_unpacked (Stitch *message, ProtobufCAllocator *allocator) { if(!message) return; assert(message->base.descriptor == &stitch__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } static const ProtobufCFieldDescriptor stitch__field_descriptors[9] = { { "Flag", 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_ENUM, offsetof(Stitch, has_flag), offsetof(Stitch, flag), &stitch_flag__descriptor, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "XX", 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_xx), offsetof(Stitch, xx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "YY", 3, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_yy), offsetof(Stitch, yy), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "DX", 4, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_dx), offsetof(Stitch, dx), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "DY", 5, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_dy), offsetof(Stitch, dy), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "Length", 6, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_length), offsetof(Stitch, length), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "Angle", 7, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_angle), offsetof(Stitch, angle), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "DAngle", 8, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, offsetof(Stitch, has_dangle), offsetof(Stitch, dangle), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { "ColorIndex", 9, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_INT32, offsetof(Stitch, has_colorindex), offsetof(Stitch, colorindex), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, }; static const unsigned stitch__field_indices_by_name[] = { 6, /* field[6] = Angle */ 8, /* field[8] = ColorIndex */ 7, /* field[7] = DAngle */ 3, /* field[3] = DX */ 4, /* field[4] = DY */ 0, /* field[0] = Flag */ 5, /* field[5] = Length */ 1, /* field[1] = XX */ 2, /* field[2] = YY */ }; static const ProtobufCIntRange stitch__number_ranges[1 + 1] = { { 1, 0 }, { 0, 9 } }; const ProtobufCMessageDescriptor stitch__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, "Stitch", "Stitch", "Stitch", "", sizeof(Stitch), 9, stitch__field_descriptors, stitch__field_indices_by_name, 1, stitch__number_ranges, (ProtobufCMessageInit) stitch__init, NULL,NULL,NULL /* reserved[123] */ };