/// <summary>
        /// Initializes a new instance of BrowseViewModel class.
        /// </summary>
        public BrowseViewModel(ProgramEditor commandHistory, ProgramEditor commandInput)
        {
            DeclareCommands();

            this.commandInput            = commandInput;
            commandInput.PreviewKeyDown += commandInput_PreviewKeyDown;
            commandInput.TextChanged    += commandInput_TextChanged;

            this.commandHistory = commandHistory;
            commandHistory.PreviewMouseWheel += commandHistory_PreviewMouseWheel;

            MessageList = new MessageList();
            Settings    = DriverSettings.CreateDefaultSettings();

            //this should be removed later on
            manipulator    = new E3JManipulator(DriverSettings.CreateDefaultSettings());
            programService = new ProgramService(manipulator);

            RemotePrograms = new ObservableCollection <RemoteProgram>(new List <RemoteProgram>())
            {
                new RemoteProgram("Pierwszy", 2567, "10-03-15 11:12:56"),
                new RemoteProgram("Wtorek", 1200, "08-06-17 09:34:43"),
                new RemoteProgram("Asd", 45, "17-11-24 04:32:23"),
                new RemoteProgram("qwerty", 52789, "29-09-32 18:14:32")
            };
        }
        /// <summary>
        /// Connections the specified object.
        /// </summary>
        /// <param name="obj">The object.</param>
        private void Connection(object obj)
        {
            if (null != obj)
            {
                var state = (bool)obj;
                if (!state)
                {
                    Manipulator?.Disconnect();
                }
                else
                {
                    if (string.IsNullOrEmpty(SelectedCOMPort))
                    {
                        BadgeText = "!";
                        ConnectionToggleIsChecked = false;
                        return;
                    }

                    ConnectionToggleIsChecked = true;
                    Manipulator = new E3JManipulator(Settings);
                    Manipulator.Port.ConnectionStatusChanged += Port_ConnectionStatusChanged;
                    Manipulator.Connect(SelectedCOMPort);
                    Manipulator.Port.DataReceived += Port_DataReceived;
                    KinectHandler?.StartKinect(Manipulator);
                }
            }
        }
 public void StartKinect(E3JManipulator manipulator)
 {
     Manipulator = manipulator;
     timer       = new DispatcherTimer()
     {
         Interval = new TimeSpan(0, 0, 0, 0, 250)
     };
     timer.Tick += OnResetSamplingTime;
     timer.Start();
 }
Beispiel #4
0
 public Form1()
 {
     InitializeComponent();
     foreach (var port in SerialPort.GetPortNames())
     {
         comboBoxPorts.Items.Add(port);
     }
     manipulator = File.Exists("SerialSettings.json") ?
                   new E3JManipulator(DriverSettings.CreateFromSettingFile()) :
                   new E3JManipulator(DriverSettings.CreateDefaultSettings());
     manipulator.Port.DataReceived            += Port_DataReceived;
     manipulator.Port.ConnectionStatusChanged += Port_ConnectionStatusChanged;
 }
 private async void Connection(object obj)
 {
     if (null != obj)
     {
         var state = (bool)obj;
         if (!state)
         {
             Manipulator?.Disconnect();
         }
         else
         {
             Manipulator = new E3JManipulator(Settings);
             Manipulator.Connect(SelectedCOMPort);
         }
     }
 }
        /// <summary>
        /// Initializes a new instance of BrowseViewModel class.
        /// </summary>
        /// <param name="commandHistory">The command history.</param>
        /// <param name="commandInput">The command input.</param>
        public BrowseViewModel(ProgramEditor commandHistory, ProgramEditor commandInput)
        {
            DeclareCommands();

            this.commandInput            = commandInput;
            commandInput.PreviewKeyDown += commandInput_PreviewKeyDown;
            commandInput.TextChanged    += commandInput_TextChanged;

            this.commandHistory = commandHistory;
            commandHistory.PreviewMouseWheel += commandHistory_PreviewMouseWheel;

            MessageList = new MessageList();
            Settings    = DriverSettings.CreateDefaultSettings();
            //this should be removed later on
            manipulator = new E3JManipulator(DriverSettings.CreateDefaultSettings());
        }
Beispiel #7
0
        private async void Connection(object obj)
        {
            if (null != obj)
            {
                var state = (bool)obj;
                if (!state)
                {
                    Manipulator?.Disconnect();
                }
                else
                {
                    if (string.IsNullOrEmpty(SelectedCOMPort))
                    {
                        BadgeText = "!";
                        ConnectionToggleIsChecked = false;
                        return;
                    }

                    ConnectionToggleIsChecked = true;
                    Manipulator = new E3JManipulator(Settings);
                    Manipulator.Connect(SelectedCOMPort);
                }
            }
        }