aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Video/Resolution.cs
blob: 994c02edfd8ea831453d7a97734762d9ef75a6aa (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Video.DirectCapture
{
    /// <summary>
    /// Holds a resolution (width and height) for a DeviceCapture object.
    /// </summary>
    public class Resolution : INotifyPropertyChanged
    {
        /// <summary>
        /// Initializes a new instance of Resolution.
        /// </summary>
        public Resolution()
        {

        }

        /// <summary>
        /// Initializes a new instance of Resoultion.
        /// </summary>
        /// <param name="width">desired frame width.</param>
        /// <param name="height">desired frame height.</param>
        public Resolution(int width, int height)
            : this()
        {
            Width = width;
            Height = height;
        }

        private int _width;

        /// <summary>
        /// Gets or sets the current frame width.
        /// </summary>
        public int Width
        {
            get { return _width; }
            set { _width = value; RaisePropertyChanged("Width"); }
        }

        private int _height;

        /// <summary>
        /// Gets or sets the current frame height.
        /// </summary>
        public int Height
        {
            get { return _height; }
            set { _height = value; RaisePropertyChanged("Height"); }
        }


        /// <summary>
        /// Returns a string representation of the current resolution.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Width + "x" + Height;
        }

        private void RaisePropertyChanged(String propName)
        {
            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
pan>== null) { //Get the networks that are currently connected to var connectedNetwork = NetworkListManager.GetNetworks(NetworkConnectivityLevels.Connected).FirstOrDefault(); var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); List<SystemObjectsCollection> system = new List<SystemObjectsCollection>(); if (!Debugger.IsAttached) { system = SystemObjectsCollection.Create(); } //Add custom information.. system.Insert(0, new SystemObjectsCollection() { Name = "Application", Objects = new List<SystemObject>() { new SystemObject() { Name = "Tango PPC", Properties = new List<SystemObjectProperty>() { new SystemObjectProperty() { Name = "Version", Value = _applicationManager.Version.ToString(3) }, new SystemObjectProperty() { Name = "Build Date", Value = _applicationManager.BuildDate.ToString() }, new SystemObjectProperty() { Name = "Previous Version", Value = settings.PreviousApplicationVersion.ToString() }, new SystemObjectProperty() { Name = "Firmware Version", Value = _applicationManager.FirmwareVersion.ToString() }, new SystemObjectProperty() { Name = "Technician Mode", Value = _applicationManager.IsInTechnicianMode.ToStringYesNo() }, new SystemObjectProperty() { Name = "After Update", Value = _applicationManager.IsAfterUpdate.ToStringYesNo() }, new SystemObjectProperty() { Name = "Startup Date", Value = _applicationManager.StartUpDate.ToString() }, }, }, new SystemObject() { Name = "Network", Properties = new List<SystemObjectProperty>() { new SystemObjectProperty() { Name = "Network Name", Value = connectedNetwork.Name }, new SystemObjectProperty() { Name = "Category", Value = connectedNetwork.Category.ToString() }, new SystemObjectProperty() { Name = "Type", Value = connectedNetwork.Connectivity.ToString() }, new SystemObjectProperty() { Name = "Domain", Value = connectedNetwork.DomainType.ToString() }, new SystemObjectProperty() { Name = "Connected Time", Value = connectedNetwork.ConnectedTime.ToString() }, new SystemObjectProperty() { Name = "Internet Connection", Value = connectedNetwork.IsConnectedToInternet.ToStringYesNo() }, }, }, new SystemObject() { Name = "Settings", Properties = new List<SystemObjectProperty>() { new SystemObjectProperty() { Name = "Application State", Value = settings.ApplicationState.ToString() }, new SystemObjectProperty() { Name = "Auto Update Check", Value = settings.AutoCheckForUpdates.ToStringYesNo() }, new SystemObjectProperty() { Name = "Auto Update Interval", Value = settings.AutoUpdateCheckInterval.ToString() }, new SystemObjectProperty() { Name = "Automatic Thread Loading", Value = settings.EnableAutomaticThreadLoading.ToStringYesNo() }, new SystemObjectProperty() { Name = "Firmware Logs Enabled", Value = settings.EnableEmbeddedDebugLogs.ToStringYesNo() }, new SystemObjectProperty() { Name = "Emergency Switch Enabled", Value = settings.EnableEmergencyNotifications.ToStringYesNo() }, new SystemObjectProperty() { Name = "Liquid Quantity Validation Enabled", Value = settings.EnableJobLiquidQuantityValidation.ToStringYesNo() }, new SystemObjectProperty() { Name = "Remote Assistance Enabled", Value = settings.EnableRemoteAssistance.ToStringYesNo() }, new SystemObjectProperty() { Name = "Remote Desktop Enabled", Value = settings.EnableRemoteDesktop.ToStringYesNo() }, new SystemObjectProperty() { Name = "Start in Technician Mode", Value = settings.EnableTechnicianModeByDefault.ToStringYesNo() }, new SystemObjectProperty() { Name = "Watchdog Enabled", Value = settings.EnableWatchDog.ToStringYesNo() }, new SystemObjectProperty() { Name = "Job Units Method", Value = settings.JobUnitsMethod.ToString() }, new SystemObjectProperty() { Name = "PowerUp Screen Enabled", Value = settings.DisplayPowerUpScreen.ToStringYesNo() }, new SystemObjectProperty() { Name = "Firmware COM Port", Value = settings.EmbeddedComPort.ToString() }, new SystemObjectProperty() { Name = "Emergency COM Port", Value = settings.EmergencyComPort.ToString() }, new SystemObjectProperty() { Name = "Job Upload Method", Value = settings.JobUploadStrategy.ToString() }, new SystemObjectProperty() { Name = "Diagnostics Synchronization", Value = settings.SynchronizeDiagnostics.ToStringYesNo() }, new SystemObjectProperty() { Name = "Jobs Synchronization", Value = settings.SynchronizeJobs.ToStringYesNo() }, new SystemObjectProperty() { Name = "TCP Write Mode", Value = settings.TcpTransportAdapterWriteMode.ToString() }, }.OrderBy(x => x.Name).ToList(), }, }, }); response = new GetMachineInformationResponse() { Package = new InformationPackage() { System = system, } }; } await receiver.SendGenericResponse(response, token); } catch (Exception ex) { LogManager.Log(ex, "Error sending system information."); } } public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) { } } }