Adding support to open different MiniDisplay type.
authorsl
Thu, 21 Aug 2014 21:54:57 +0200
changeset 39083f4935aae4
parent 38 babab407f2bb
child 40 4846aa0bb10c
Adding support to open different MiniDisplay type.
Server/Display.cs
Server/MainForm.cs
     1.1 --- a/Server/Display.cs	Wed Aug 20 18:02:30 2014 +0200
     1.2 +++ b/Server/Display.cs	Thu Aug 21 21:54:57 2014 +0200
     1.3 @@ -18,11 +18,11 @@
     1.4          }
     1.5  
     1.6          //
     1.7 -        public bool Open()
     1.8 +        public bool Open(TMiniDisplayType aType)
     1.9          {
    1.10              if (iDevice == IntPtr.Zero)
    1.11              {
    1.12 -                iDevice = MiniDisplayOpen();
    1.13 +                iDevice = MiniDisplayOpen(aType);
    1.14              }
    1.15              return iDevice != IntPtr.Zero;
    1.16          }
    1.17 @@ -160,16 +160,24 @@
    1.18          //Our display device handle
    1.19          IntPtr iDevice;
    1.20  
    1.21 +        public enum TMiniDisplayType
    1.22 +        {
    1.23 +            EMiniDisplayAutoDetect, /*Not yet implemented*/
    1.24 +            EMiniDisplayFutabaGP1212A01,
    1.25 +            EMiniDisplayFutabaGP1212A02
    1.26 +        };
    1.27 +
    1.28 +
    1.29          public enum TMiniDisplayRequest
    1.30          {
    1.31              EMiniDisplayRequestNone,
    1.32              EMiniDisplayRequestDeviceId,
    1.33              EMiniDisplayRequestFirmwareRevision,
    1.34              EMiniDisplayRequestPowerSupplyStatus
    1.35 -        }
    1.36 +        };
    1.37  
    1.38          [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
    1.39 -        public static extern IntPtr MiniDisplayOpen();
    1.40 +        public static extern IntPtr MiniDisplayOpen(TMiniDisplayType aType);
    1.41  
    1.42          [DllImport("MiniDisplay.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
    1.43          public static extern void MiniDisplayClose(IntPtr aDevice);
     2.1 --- a/Server/MainForm.cs	Wed Aug 20 18:02:30 2014 +0200
     2.2 +++ b/Server/MainForm.cs	Thu Aug 21 21:54:57 2014 +0200
     2.3 @@ -66,7 +66,7 @@
     2.4  
     2.5              if (Properties.Settings.Default.DisplayConnectOnStartup)
     2.6              {
     2.7 -                iDisplay.Open();
     2.8 +                iDisplay.Open(Display.TMiniDisplayType.EMiniDisplayAutoDetect);
     2.9                  UpdateStatus();
    2.10              }
    2.11          }
    2.12 @@ -272,7 +272,7 @@
    2.13  
    2.14          private void buttonOpen_Click(object sender, EventArgs e)
    2.15          {
    2.16 -            if (iDisplay.Open())
    2.17 +            if (iDisplay.Open(Display.TMiniDisplayType.EMiniDisplayAutoDetect))
    2.18              {
    2.19                  UpdateStatus();
    2.20                  iDisplay.RequestPowerSupplyStatus();