Пример #1
0
    public static void Main()
    {
        var usbCon = new USBConnection("COM3");
        //var camCon = new NikonController("Type0014.md3");
        //camCon.SaveToPc = true;
        var cl = new CommandList();

        //camCon.WaitForConnection();

        /*
         * cl.Add(new Command(Command.Cmdtype.TIME, 100));
         * cl.Add(new Command(Command.Cmdtype.PHOTO));
         * for (int i = 0; i < 45; i++)
         * {
         *  cl.Add(new Command(Command.Cmdtype.INFRARED, i + 1));
         *  cl.Add(new Command(Command.Cmdtype.PHOTO));
         * }
         */


        cl.Add(new Command(Command.Cmdtype.TIME, 999));
        cl.Add(new Command(Command.Cmdtype.INFRARED, 41));
        cl.Send(usbCon, null);

        cl.Send(usbCon, null);

        Console.ReadLine();
        Environment.Exit(0);
    }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();

            usbCon          = new USBConnection("COM3");
            camCon          = new NikonController("Type0014.md3");
            camCon.SaveToPc = true;
            cl = new CommandList();
            cl.Add(new Command(Command.Cmdtype.PHOTO));
        }
Пример #3
0
 public void SetupUsbService()
 {
     if (usbService == null)
     {
         detachedReceiver = new LGBroadcastReceiver(this);
         SetFilters();
         usbConnection = new USBConnection(this);
         StartUSBService(usbConnection, null);
         Android.Util.Log.Info("LNG.CMRI.MainActivity.SetupUsbService", "LGUsbService Started");
     }
 }
Пример #4
0
        public MainWindow()
        {
            usbCon = new USBConnection("COM3");
            camCon = new NikonController("Type0014.md3");
            cl     = new CommandList();

            InitializeComponent();

            camCon.Received  += OpenReceivedWindow;
            camCon.Connected += OnCameraConnected;
        }
Пример #5
0
    public void Send(USBConnection usbCon, NikonController camCon)
    {
        usbCon?.Open();
        camCon?.WaitForConnection();
        Console.WriteLine("Inizio a mandare i comandi!");

        var i = 0;

        foreach (var c in list)
        {
            if (ShouldClose)
            {
                ShouldClose = false;
                usbCon?.Close();
                camCon?.WaitForReady();
                return;
            }
            camCon?.WaitForReady();
            if (c.Type == Command.Cmdtype.PHOTO)
            {
                camCon?.Capture();
            }
            else
            {
                c.Send(usbCon);
            }

            Console.WriteLine(c.ToString());

            if (c.Type == Command.Cmdtype.TIME)
            {
                time = c.Value * 10;
            }

            if (c.Type == Command.Cmdtype.VISIBLE || c.Type == Command.Cmdtype.INFRARED ||
                c.Type == Command.Cmdtype.ULTRAVIOLET || c.Type == Command.Cmdtype.PHOTO)
            {
                if (i < list.Count - 1 && list.ElementAt(i + 1).Type != Command.Cmdtype.PHOTO)
                {
                    Thread.Sleep(time);
                }
            }

            Thread.Sleep(DELAY);

            i++;
        }
        camCon?.WaitForReady();
        Console.WriteLine("Finito!");
        usbCon?.Close();
    }
Пример #6
0
 private void OnUSBConnection(USBConnectionEventArgs args)
 {
     USBConnection?.Invoke(this, args);
 }
Пример #7
0
 public void Send(USBConnection usbCon)
 {
     usbCon.Send(ToString());
 }