Tango/Software/.metadata/.plugins/org.eclipse.core.resources/.history/dc/5077ac2414b80019199adde58e229227, branch software Twine softwares http://git.tvcloud.fr/Tango/atom/Software/.metadata/.plugins/org.eclipse.core.resources/.history/dc/5077ac2414b80019199adde58e229227?h=software 2019-08-15T06:28:24Z update the pitot function toget pressure with the new orifice 2019-08-15T06:28:24Z Avi Levkovich avi@twine-s.com 2019-08-15T06:28:24Z urn:sha1:04db0ce68722b5c8cd87fe6142298c8a1de4f061 and sensor. + stubs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.Core.Commands;
using Tango.MachineStudio.Common.Diagnostics;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.Common.StudioApplication;
using Tango.SharedUI;

namespace Tango.MachineStudio.UI.ViewModels
{
    public class ConnectedMachineViewVM : DialogViewVM
    {
        public enum ConnectedMachineVMResult
        {
            Cancel,
            Disconnect,
            UploadHardwareConfig,
            Reset,
        }

        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 ConnectedMachineViewVM(IStudioApplicationManager application, IDiagnosticsFrameProvider frameProvider)
        {
            ApplicationManager = application;
            DisconnectCommand = new RelayCommand(Disconnect);
            UploadHardwareConfigurationCommand = new RelayCommand(UploadHardwareConfiguration);
            ResetCommand = new RelayCommand(Reset);

            DiagnosticsFrameProvider = frameProvider;
        }

        private void Reset()
        {
            Result = ConnectedMachineVMResult.Reset;
            Accept();
        }

        private void UploadHardwareConfiguration()
        {
            Result = ConnectedMachineVMResult.UploadHardwareConfig;
            Accept();
        }

        private void Disconnect()
        {
            Result = ConnectedMachineVMResult.Disconnect;
            Accept();
        }
    }
}