private void StartEmuAutomationController()
 {
     Console.WriteLine("-> controller will be loaded from: " + _commandLine.Controller);
     Console.WriteLine("-> controller will be initialised with: " + _commandLine.Initialisation);
     Console.WriteLine("-> controller will identify controls using: " + _commandLine.AutomationIdentification);
     _automationController = Server.Core.Loader.LoadFrom(_commandLine.Controller);
     Console.WriteLine("-> controller loaded: " + _automationController.GetType().FullName);
     _automationController.Trace += (sender, args) => Console.WriteLine("-> " + args.Message);
     _automationController.Start(_commandLine.Initialisation, _commandLine.AutomationIdentification);
     Console.WriteLine("-> controller started");
     Console.WriteLine();
 }
 protected override void Dispose(bool isDisposing)
 {
     if (isDisposing)
     {
         if (_automationController != null)
         {
             _automationController.Dispose();
             _automationController = null;
         }
     }
     base.Dispose(isDisposing);
 }
        public static void DisposeOfEmu(ScenarioContext context)
        {
            Assert.That(context != null);

            lock (context)
            {
                IAutomationController emu = null;
                if (!context.TryGetValue(EmuControllerKey, out emu))
                {
                    return;
                }

                if (emu.DisplayInputController != null)
                {
                    emu.DisplayInputController.ReleaseWindowFromForeground();
                }

                emu.Dispose();
                context.Remove(EmuControllerKey);
            }
        }
        public static IAutomationController GetEmuAutomationController(ScenarioContext context, IConfiguration configuration)
        {
            Assert.That(context != null);
            Assert.That(configuration != null);

            lock (context)
            {
                IAutomationController emu = null;
                if (context.TryGetValue(EmuControllerKey, out emu))
                {
                    return(emu);
                }

                emu        = Server.Core.Loader.LoadFrom(configuration.AutomationControllerName);
                emu.Trace += (sender, args) => StepFlowOutputHelpers.Write(args.Message);
                emu.Start(
                    configuration.ControllerInitialisationString,
                    configuration.AutomationIdentification);

                context[EmuControllerKey] = emu;
                return(emu);
            }
        }
Example #5
0
 public Automation(IAutomationController automation) : base(automation)
 {
 }
Example #6
0
 public Text(IAutomationController automation, string text)
     : base(automation)
 {
     _text = text;
 }
Example #7
0
 public Control(IAutomationController automation, string controlId)
     : base(automation)
 {
     _controlId = controlId;
 }
Example #8
0
 protected FluentBase(IAutomationController automation)
 {
     Automation = automation;
 }
 public ApplicationBarDriver(IAutomationController emulator)
 {
     this.emulator = emulator;
 }
 public AddBuildServerDriver(IAutomationController emulator)
     : base(emulator)
 {
     appBarDriver = new ApplicationBarDriver(emulator);
 }
 protected override void Dispose(bool isDisposing)
 {
     if (isDisposing)
     {
         if (_automationController != null)
         {
             _automationController.Dispose();
             _automationController = null;
         }
     }
     base.Dispose(isDisposing);
 }
Example #12
0
        private static void SetupUSB()
        {
            Trace.TraceInformation("Setting up USB host...");

            USBHostController.DeviceBadConnectionEvent +=
                (device) =>
            {
                Trace.TraceInformation("USB device bad connection");
            };

            USBHostController.DeviceDisconnectedEvent +=
                (device) =>
            {
                Trace.TraceInformation("USB device disconnected");

                switch (device.TYPE)
                {
                case USBH_DeviceType.Serial_FTDI:
                    //webhost.Stop();
                    automationController.Dispose();
                    break;
                }
            };

            USBHostController.DeviceConnectedEvent +=
                (device) =>
            {
                Trace.TraceInformation("USB device connected");

                switch (device.TYPE)
                {
                case USBH_DeviceType.Serial_FTDI:
                    var usbSerial = new USBH_SerialUSB(device, 19200, Parity.None, 8, System.IO.Ports.StopBits.One);

                    // PowerLinc USB Dual-Band #2413U
                    if (device.VENDOR_ID == InsteonAutomationController.VendorID & device.PRODUCT_ID == InsteonAutomationController.ProductID)
                    {
                        Trace.TraceInformation("PowerLinc USB Dual-Band #2413U");

                        automationController = new InsteonAutomationController(settings, usbSerial);
                        automationController.Initalize();

                        //webhost.Start(settings, automationController);
                        //SetupTimers();
                    }
                    break;

                case USBH_DeviceType.Unknown:
                    // Aeon Labs Z-Stick2
                    if (device.VENDOR_ID == ZWaveAutomationController.VendorID & device.PRODUCT_ID == ZWaveAutomationController.ProductID)
                    {
                        Trace.TraceInformation("Aeon Labs Z-Stick2");

                        USBH_Device silabs = new USBH_Device(device.ID, device.INTERFACE_INDEX, USBH_DeviceType.Serial_SiLabs, device.VENDOR_ID, device.PRODUCT_ID, device.PORT_NUMBER);
                        usbSerial = new USBH_SerialUSB(silabs, 19200, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                        usbSerial.Open();

                        automationController = new ZWaveAutomationController(settings, usbSerial);
                        automationController.Initalize();
                    }
                    break;
                }
            };

            USBHostController.GetDevices();
        }
Example #13
0
 public PageDriver(IAutomationController emulator)
 {
     this.emulator = emulator;
 }
 private void StartEmuAutomationController()
 {
     Console.WriteLine("-> controller will be loaded from: " + _commandLine.Controller);
     Console.WriteLine("-> controller will be initialised with: " + _commandLine.Initialisation);
     Console.WriteLine("-> controller will identify controls using: " + _commandLine.AutomationIdentification);
     _automationController = Server.Core.Loader.LoadFrom(_commandLine.Controller);
     Console.WriteLine("-> controller loaded: " + _automationController.GetType().FullName);
     _automationController.Trace += (sender, args) => Console.WriteLine("-> " + args.Message);
     _automationController.Start(_commandLine.Initialisation, _commandLine.AutomationIdentification);
     Console.WriteLine("-> controller started");
     Console.WriteLine();
 }
 public ListJobsDriver(IAutomationController emulator)
     : base(emulator)
 {
     appBarDriver = new ApplicationBarDriver(emulator);
 }
 public Text(IAutomationController automation, string text)
     : base(automation)
 {
     _text = text;
 }
 public Automation(IAutomationController automation) : base(automation)
 {
 }
 protected FluentBase(IAutomationController automation)
 {
     Automation = automation;
 }
 public Control(IAutomationController automation, string controlId)
     : base(automation)
 {
     _controlId = controlId;
 }