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)); }
public MainWindow() { usbCon = new USBConnection("COM3"); camCon = new NikonController("Type0014.md3"); cl = new CommandList(); InitializeComponent(); camCon.Received += OpenReceivedWindow; camCon.Connected += OnCameraConnected; }
public CameraWindow(Window caller, NikonController con) { InitializeComponent(); this.caller = caller; this.con = con; liveViewTimer.Tick += new EventHandler(liveViewTimer_Tick); liveViewTimer.Interval = 1000 / 30; con.SetLiveView(true); liveViewTimer.Start(); }
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(); }