aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MachineView.xaml.cs
blob: 9d400549bcaa24191c5edca8cb3d32622452ee07 (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
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.Navigation;
using System.Windows.Shapes;

namespace Tango.MachineStudio.Common.Controls
{
    /// <summary>
    /// Interaction logic for MachineView.xaml
    /// </summary>
    public partial class MachineView : UserControl
    {
        public MachineView()
        {
            InitializeComponent();
        }
    }
}
enum ConnectedMachineVMResult { Cancel, Disconnect, UploadHardwareConfig, Reset, TurnOffHeaters } private IStudioApplicationManager _applicationManager; public IStudioApplicationManager ApplicationManager { get { return _applicationManager; } set { _applicationManager = value; RaisePropertyChangedAuto(); } } public ConnectedMachineVMResult Result { get; set; } private IDiagnosticsFrameProvider _diagnosticsFrameProvider; public IDiagnosticsFrameProvider DiagnosticsFrameProvider { get { return _diagnosticsFrameProvider; } set { _diagnosticsFrameProvider = value; RaisePropertyChangedAuto(); } } public RelayCommand DisconnectCommand { get; set; } public RelayCommand UploadHardwareConfigurationCommand { get; set; } public RelayCommand ResetCommand { get; set; } public RelayCommand TurnOffHeatersCommand { get; set; } public ConnectedMachineViewVM(IStudioApplicationManager application, IDiagnosticsFrameProvider frameProvider) { ApplicationManager = application; DisconnectCommand = new RelayCommand(() => AcceptResult(ConnectedMachineVMResult.Disconnect)); UploadHardwareConfigurationCommand = new RelayCommand(() => AcceptResult(ConnectedMachineVMResult.UploadHardwareConfig)); ResetCommand = new RelayCommand(() => AcceptResult(ConnectedMachineVMResult.Reset)); TurnOffHeatersCommand = new RelayCommand(() => AcceptResult(ConnectedMachineVMResult.TurnOffHeaters)); DiagnosticsFrameProvider = frameProvider; } private void AcceptResult(ConnectedMachineVMResult result) { Result = result; Accept(); } } }