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();
        }
    }
}
n> _fillingTimeoutError; public bool FillingTimeoutError { get { return _fillingTimeoutError; } set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } } private bool _midTankEmpty; public bool MidTankEmpty { get { return _midTankEmpty; } set { _midTankEmpty = value; RaisePropertyChangedAuto();} } private bool _midTankRefillPumpActive; public bool MidTankRefillPumpActive { get { return _midTankRefillPumpActive; } set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } } public bool IsMidTankLow { get { return Level <= 0.5; } } private TimeSpan _remainingTimeoutError_; public TimeSpan RemainingTimeoutError { get { return _remainingTimeoutError_; } set { _remainingTimeoutError_ = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasRemainingTimeoutError)); } } public bool HasRemainingTimeoutError { get { return RemainingTimeoutError > TimeSpan.Zero; } } public IdsPack IDSPack { get; set; } public JerricanLevelModel() { //RemainingTimeoutError = new TimeSpan(1,2,0); JerricanPresent = true; //FillingTimeoutError = MidTankEmpty = MidTankRefillPumpActive = false; } } }