/// <summary> /// Checks if device address is not empty. /// </summary> /// <returns>True if device is selected and address is not empty.</returns> public bool DeviceNotEmpty() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); bool bHasAddress = devices != null && !string.IsNullOrEmpty(devices.ServiceAddress); return(bHasAddress); }
/// <summary> /// Updates view functions. /// </summary> public override void UpdateViewFunctions() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); bool bHasAddress = devices != null && !string.IsNullOrEmpty(devices.ServiceAddress); View.EnableTestRun(bHasAddress); }
/// <summary> /// Updates view. /// </summary> public override void UpdateView() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); if (devices != null) { View.DeviceManagementUrl = devices.ServiceAddress; View.IP = devices.DeviceAddress != null?devices.DeviceAddress.ToString() : string.Empty; if (_client != null && _client.Address != devices.ServiceAddress) { View.Clear(); } } else { View.DeviceManagementUrl = string.Empty; View.IP = string.Empty; View.Clear(); } DeviceEnvironment environment = ContextController.GetDeviceEnvironment(); if (_client != null) { _client.Timeout = environment.Timeouts.Message; } }
/// <summary> /// Collects parameters for launching current test/current test group/all selected tests /// </summary> /// <returns></returns> public TestSuiteParameters GetParameters() { TestSuiteParameters parameters = new TestSuiteParameters(); DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); parameters.Address = devices.ServiceAddress; parameters.CameraIP = devices.DeviceAddress; parameters.NetworkInterfaceController = devices.NIC; if ((devices.Current != null) && (devices.Current.ByDiscovery != null)) { parameters.CameraUUID = devices.Current.ByDiscovery.UUID; } DeviceEnvironment env = ContextController.GetDeviceEnvironment(); parameters.UserName = env.Credentials.UserName; parameters.Password = env.Credentials.Password; parameters.UseUTCTimestamp = env.Credentials.UseUTCTimeStamp; DeviceEnvironment environment = ContextController.GetDeviceEnvironment(); parameters.MessageTimeout = environment.Timeouts.Message; parameters.RebootTimeout = environment.Timeouts.Reboot; parameters.TimeBetweenTests = environment.Timeouts.InterTests; parameters.PTZNodeToken = environment.TestSettings.PTZNodeToken; parameters.EnvironmentSettings = new Tests.Common.TestEngine.EnvironmentSettings() { DnsIpv4 = env.EnvironmentSettings.DnsIpv4, NtpIpv4 = env.EnvironmentSettings.NtpIpv4, DnsIpv6 = env.EnvironmentSettings.DnsIpv6, NtpIpv6 = env.EnvironmentSettings.NtpIpv6, DefaultGateway = env.EnvironmentSettings.GatewayIpv4, DefaultGatewayIpv6 = env.EnvironmentSettings.GatewayIpv6 }; parameters.UseEmbeddedPassword = environment.TestSettings.UseEmbeddedPassword; parameters.Password1 = environment.TestSettings.Password1; parameters.Password2 = environment.TestSettings.Password2; parameters.SecureMethod = environment.TestSettings.SecureMethod; parameters.VideoSourceToken = environment.TestSettings.VideoSourceToken; parameters.OperationDelay = environment.TestSettings.OperationDelay; parameters.RecoveryDelay = environment.TestSettings.RecoveryDelay; parameters.EventTopic = environment.TestSettings.EventTopic; parameters.SubscriptionTimeout = environment.TestSettings.SubscriptionTimeout; parameters.TopicNamespaces = environment.TestSettings.TopicNamespaces; parameters.RelayOutputDelayTimeMonostable = environment.TestSettings.RelayOutputDelayTimeMonostable; Dictionary <string, object> advanced = new Dictionary <string, object>(); foreach (object o in environment.TestSettings.AdvancedSettings) { advanced.Add(o.GetType().GUID.ToString(), o); } parameters.AdvancedPrameters = advanced; return(parameters); }
/// <summary> /// Returns media service address /// </summary> public void GetMediaAddress() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); _deviceClientWorking = true; string address = devices != null ? devices.ServiceAddress : string.Empty; InitializeDeviceClient(address); _deviceClient.GetCapabilities(new Device.CapabilityCategory[] { Device.CapabilityCategory.Media }); }
/// <summary> /// Returns service addresses /// </summary> public void GetAddress(Onvif.CapabilityCategory[] categories) { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); _deviceClientWorking = true; string address = devices != null ? devices.ServiceAddress : string.Empty; InitializeDeviceClient(address); _deviceClient.GetCapabilities(categories); }
/// <summary> /// Start GetDeviceInformation operation /// </summary> public void GetDeviceInformation() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string url = devices.ServiceAddress; _requestPending = true; ReportOperationStarted(); InitializeClient(url); _client.GetDeviceInformation(); }
/// <summary> /// Updates setup tab control /// </summary> public override void UpdateView() { base.UpdateView(); if (CurrentState == Enums.ApplicationState.Idle) { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); bool enable = (devices != null) && !string.IsNullOrEmpty(devices.ServiceAddress); View.EnableGetFromDevice(enable); } }
/// <summary> /// Returns service addresses /// </summary> public void GetAddress(CapabilityCategory[] categories) { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); _deviceClientWorking = true; string address = devices != null ? devices.ServiceAddress : string.Empty; InitializeDeviceClient(address); DebugInfo info = ContextController.GetDebugInfo(); bool capabilitiesStyle = (info.CapabilitiesExchange == CapabilitiesExchangeStyle.GetCapabilities); _deviceClient.GetServiceAddresses(capabilitiesStyle, categories); }
/// <summary> /// Queries PTZ nodes /// </summary> public void GetPTZNodes() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string address = devices != null ? devices.ServiceAddress : string.Empty; DeviceEnvironment env = ContextController.GetDeviceEnvironment(); ManagementServiceProvider deviceClient = new ManagementServiceProvider(address, env.Timeouts.Message); ReportOperationStarted(); Thread thread = new Thread(new ThreadStart(new Action(() => { try { Device.Capabilities capabilities = deviceClient.GetCapabilitiesSync(new Device.CapabilityCategory[] { Device.CapabilityCategory.PTZ }); if (capabilities.PTZ != null) { string ptzAddress = capabilities.PTZ.XAddr; PTZServiceProvider ptzClient = new PTZServiceProvider(ptzAddress, env.Timeouts.Message); PTZ.PTZNode[] nodes = ptzClient.GetNodes(); if ((nodes != null) && (nodes.Length > 0)) { View.SetPTZNodes(nodes); } else { throw new Exception("No PTZ nodes returned by device"); } } else { throw new Exception("Device does not support PTZ service"); } } catch (System.Exception ex) { View.ShowError(ex); } finally { ReportOperationCompleted(); } }))); thread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; thread.Start(); }
/////////////////////////////////////////////////////////////////////////// //! @author Ivan Vagunin //// /// <summary> /// Saves context data. /// </summary> public void SaveContextData() { IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.Machine | IsolatedStorageScope.Application, new System.Security.Policy.Url("www.onvif.org/OnvifTestTool")); IsolatedStorageFileStream isoFile = new IsolatedStorageFileStream(_dataFileName, FileMode.Create, isoStore); // Create a StreamWriter using the isolated storage file StreamWriter writer = new StreamWriter(isoFile); XmlSerializer serializer = new XmlSerializer(typeof(SavedContext)); SavedContext context = new SavedContext(); _conformanceTestController.UpdateContext(); context.SetupInfo = ContextController.GetSetupInfo(); _discoveryController.UpdateContext(); DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); if (devices != null) { context.DiscoveryContext = new SavedDiscoveryContext(); context.DiscoveryContext.ServiceAddress = devices.ServiceAddress; context.DiscoveryContext.DeviceAddress = (devices.DeviceAddress != null) ? devices.DeviceAddress.ToString() : string.Empty; context.DiscoveryContext.SearchScopes = devices.SearchScopes.Replace(System.Environment.NewLine, " "); context.DiscoveryContext.ShowSearchOptions = devices.ShowSearchOptions; if ((devices.NIC != null) && (devices.NIC.IP != null)) { context.DiscoveryContext.InterfaceAddress = devices.NIC.IP.ToString(); } } _managementController.UpdateContext(); context.DeviceEnvironment = ContextController.GetDeviceEnvironment(); _deviceController.UpdateContext(); context.RequestsInfo = ContextController.GetRequestsInfo(); context.MediaInfo = ContextController.GetMediaInfo(); context.PTZInfo = ContextController.GetPTZInfo(); context.DebugInfo = ContextController.GetDebugInfo(); serializer.Serialize(writer, context); writer.Close(); }
/// <summary> /// Initializes service client, if it's possibly. /// </summary> /// <returns>True if client has been initialized successfully.</returns> bool InitializeClient() { string serviceAddress = string.Empty; DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); if (devices.Current != null) { serviceAddress = devices.ServiceAddress; } try { new Uri(serviceAddress); } catch (Exception) { View.ShowError("Device service address is invalid!"); return(false); } try { DeviceEnvironment env = ContextController.GetDeviceEnvironment(); _client = new ManagementServiceProvider(serviceAddress, env.Timeouts.Message); _client.ExceptionThrown += _client_ExceptionThrown; _client.OnDeviceInformationReceived += _client_OnDeviceInformationReceived; _client.OperationCompleted += _client_OperationCompleted; _client.OperationStarted += _client_OperationStarted; _client.ResponseReceived += _client_ResponseReceived; _client.Security = ContextController.GetDebugInfo().Security; return(true); } catch (Exception exc) { View.ShowError(string.Format("Error occurred: {0}", exc.Message)); return(false); } }
/////////////////////////////////////////////////////////////////////////// //! @author Ivan Vagunin //// /// <summary> /// Saves context data. /// </summary> public void SaveContextData() { IsolatedStorageFile isoStore = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream isoFile = new IsolatedStorageFileStream(_dataFileName, FileMode.Create, isoStore); // Create a StreamWriter using the isolated storage file StreamWriter writer = new StreamWriter(isoFile); XmlSerializer serializer = new XmlSerializer(typeof(SavedContext)); SavedContext context = new SavedContext(); _setupController.UpdateContext(); context.SetupInfo = ContextController.GetSetupInfo(); _discoveryController.UpdateContext(); DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); if (devices != null) { context.DiscoveryContext = new SavedDiscoveryContext(); context.DiscoveryContext.ServiceAddress = devices.ServiceAddress; context.DiscoveryContext.DeviceAddress = (devices.DeviceAddress != null) ? devices.DeviceAddress.ToString() : string.Empty; if ((devices.NIC != null) && (devices.NIC.IP != null)) { context.DiscoveryContext.InterfaceAddress = devices.NIC.IP.ToString(); } } _reportController.UpdateContext(); context.ReportInfo = ContextController.GetReportInfo(); _managementController.UpdateContext(); context.DeviceEnvironment = ContextController.GetDeviceEnvironment(); _requestsController.UpdateContext(); context.RequestsInfo = ContextController.GetRequestsInfo(); _deviceController.MediaController.UpdateContext(); context.MediaInfo = ContextController.GetMediaInfo(); _deviceController.PTZController.UpdateContext(); context.PTZInfo = ContextController.GetPTZInfo(); serializer.Serialize(writer, context); writer.Close(); }
public void QueryRecordings() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string address = devices != null ? devices.ServiceAddress : string.Empty; DeviceEnvironment env = ContextController.GetDeviceEnvironment(); ManagementServiceProvider deviceClient = new ManagementServiceProvider(address, env.Timeouts.Message); ReportOperationStarted(); Thread thread = new Thread(new ThreadStart(new Action(() => { try { DeviceServicesInfo info = deviceClient.GetCapabilitiesDefineSecurity(new Onvif.CapabilityCategory[] { Onvif.CapabilityCategory.All }); Onvif.Capabilities capabilities = info.Capabilities; string recordingControlAddress = string.Empty; if (capabilities != null) { if (capabilities.Extension != null) { if (capabilities.Extension.Recording != null) { recordingControlAddress = capabilities.Extension.Recording.XAddr; } } } if (string.IsNullOrEmpty(recordingControlAddress)) { if (info.Services != null) { Onvif.Service service = Tests.Common.CommonUtils.Extensions.FindService( info.Services, OnvifService.RECORIDING); if (service != null) { recordingControlAddress = service.XAddr; } } else { throw new Exception("Unable to get service address"); } } if (string.IsNullOrEmpty(recordingControlAddress)) { throw new Exception("Device does not support Recording service"); } RecordingServiceProvider client = new RecordingServiceProvider(recordingControlAddress, env.Timeouts.Message); client.Security = deviceClient.Security; List <Onvif.GetRecordingsResponseItem> recordings = client.GetRecordings(); List <string> tokens = recordings.Select(R => R.RecordingToken).ToList(); if ((tokens != null) && (tokens.Count > 0)) { View.SettingsView.SetRecordings(tokens); } else { throw new Exception("No Recordings returned by device"); } } catch (System.Exception ex) { View.ShowError(ex); } finally { ReportOperationCompleted(); } }))); thread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; thread.Start(); }
public void QueryVideoSources() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string address = devices != null ? devices.ServiceAddress : string.Empty; DeviceEnvironment env = ContextController.GetDeviceEnvironment(); ManagementServiceProvider deviceClient = new ManagementServiceProvider(address, env.Timeouts.Message); ReportOperationStarted(); Thread thread = new Thread(new ThreadStart(new Action(() => { try { DeviceServicesInfo info = deviceClient.GetCapabilitiesDefineSecurity(new Onvif.CapabilityCategory[] { Onvif.CapabilityCategory.Media }); Onvif.Capabilities capabilities = info.Capabilities; string mediaAddress = string.Empty; if (capabilities != null) { if (capabilities.Media != null) { mediaAddress = capabilities.Media.XAddr; } else { throw new Exception("Device does not support Media service"); } } else { if (info.Services != null) { Onvif.Service mediaService = Tests.Common.CommonUtils.Extensions.FindService( info.Services, OnvifService.MEDIA); if (mediaService != null) { mediaAddress = mediaService.XAddr; } else { throw new Exception("Device does not support Media service"); } } else { throw new Exception("Unable to get service address"); } } MediaServiceProvider client = new MediaServiceProvider(mediaAddress, env.Timeouts.Message); client.Security = deviceClient.Security; Onvif.VideoSource[] sources = client.GetVideoSources(); if ((sources != null) && (sources.Length > 0)) { View.SettingsView.SetVideoSources(sources); } else { throw new Exception("No Video Sources returned by device"); } } catch (System.Exception ex) { View.ShowError(ex); } finally { ReportOperationCompleted(); } }))); thread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; thread.Start(); }
public void QueryEventTopics() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string address = devices != null ? devices.ServiceAddress : string.Empty; DeviceEnvironment env = ContextController.GetDeviceEnvironment(); ManagementServiceProvider deviceClient = new ManagementServiceProvider(address, env.Timeouts.Message); ReportOperationStarted(); Thread thread = new Thread(new ThreadStart(new Action(() => { try { DeviceServicesInfo info = deviceClient.GetCapabilitiesDefineSecurity(new Onvif.CapabilityCategory[] { Onvif.CapabilityCategory.Events }); Onvif.Capabilities capabilities = info.Capabilities; string eventAddress = string.Empty; if (capabilities != null) { if (capabilities.Events != null) { eventAddress = capabilities.Events.XAddr; } else { throw new Exception("Device does not support Events service"); } } else { if (info.Services != null) { Onvif.Service eventsService = Tests.Common.CommonUtils.Extensions.FindService( info.Services, OnvifService.EVENTS); if (eventsService != null) { eventAddress = eventsService.XAddr; } else { throw new Exception("Device does not support Events service"); } } else { throw new Exception("Unable to get service address"); } } EventsServiceProvider client = new EventsServiceProvider(eventAddress, env.Timeouts.Message); client.Security = deviceClient.Security; List <EventsTopicInfo> infos = client.GetTopics(); if ((infos != null) && (infos.Count > 0)) { View.SettingsView.SetEventsTopic(infos); } else { throw new Exception("No Event Topics returned by device"); } } catch (System.Exception ex) { View.ShowError(ex); } finally { ReportOperationCompleted(); } }))); thread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; thread.Start(); }
public void SaveAsXML(string fileName) { // save; SerializableTestingParameters parameters = new SerializableTestingParameters(); { parameters.Advanced = GetAdvancedSettings().ToArray(); parameters.Device = new DeviceParameters(); DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); parameters.Device.DeviceIP = (null != devices.DeviceAddress) ? devices.DeviceAddress.ToString() : ""; parameters.Device.DeviceServiceAddress = devices.ServiceAddress; DeviceInfo devInfo = ContextController.GetSetupInfo().DevInfo; parameters.Device.Model = devInfo != null ? devInfo.Model : string.Empty; { parameters.Output = new Output(); parameters.Output.CreateNestedFolder = true; parameters.Output.Directory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); parameters.Output.FeatureDefinitionLog = "FeatureDefinitionLog.xml"; parameters.Output.Report = "TestReport.pdf"; parameters.Output.TestLog = "TestLog.xml"; } { SetupInfo info = ContextController.GetSetupInfo(); if (info != null) { parameters.SessionInfo = new SessionInfo(); parameters.SessionInfo.MemberInfo = info.MemberInfo; parameters.SessionInfo.OtherInformation = info.OtherInfo; parameters.SessionInfo.TesterInfo = info.TesterInfo; } } { parameters.TestParameters = new TestParameters(); parameters.TestParameters.Address = devices.NIC.IP.ToString(); DeviceEnvironment env = ContextController.GetDeviceEnvironment(); if (env.EnvironmentSettings != null) { parameters.TestParameters.DefaultGatewayIpv4 = env.EnvironmentSettings.GatewayIpv4; parameters.TestParameters.DefaultGatewayIpv6 = env.EnvironmentSettings.GatewayIpv6; parameters.TestParameters.DnsIpv4 = env.EnvironmentSettings.DnsIpv4; parameters.TestParameters.DnsIpv6 = env.EnvironmentSettings.DnsIpv6; parameters.TestParameters.NtpIpv4 = env.EnvironmentSettings.NtpIpv4; parameters.TestParameters.NtpIpv6 = env.EnvironmentSettings.NtpIpv6; } if (env.Credentials != null) { parameters.TestParameters.UserName = env.Credentials.UserName; parameters.TestParameters.Password = env.Credentials.Password; } if (env.Timeouts != null) { parameters.TestParameters.MessageTimeout = env.Timeouts.Message; parameters.TestParameters.RebootTimeout = env.Timeouts.Reboot; parameters.TestParameters.TimeBetweenTests = env.Timeouts.InterTests; } if (env.TestSettings != null) { parameters.TestParameters.EventTopic = env.TestSettings.EventTopic; parameters.TestParameters.TopicNamespaces = env.TestSettings.TopicNamespaces; parameters.TestParameters.OperationDelay = env.TestSettings.OperationDelay; parameters.TestParameters.Password1 = env.TestSettings.Password1; parameters.TestParameters.Password2 = env.TestSettings.Password2; parameters.TestParameters.PTZNodeToken = env.TestSettings.PTZNodeToken; parameters.TestParameters.RelayOutputDelayTime = env.TestSettings.RelayOutputDelayTimeMonostable; parameters.TestParameters.SecureMethod = env.TestSettings.SecureMethod; parameters.TestParameters.SubscriptionTimeout = env.TestSettings.SubscriptionTimeout; parameters.TestParameters.TimeBetweenRequests = env.TestSettings.RecoveryDelay; parameters.TestParameters.UseEmbeddedPassword = env.TestSettings.UseEmbeddedPassword; parameters.TestParameters.VideoSourceToken = env.TestSettings.VideoSourceToken; parameters.TestParameters.SearchTimeout = env.TestSettings.SearchTimeout; parameters.TestParameters.RecordingToken = env.TestSettings.RecordingToken; parameters.TestParameters.MetadataFilter = env.TestSettings.MetadataFilter; } } } XmlSerializer serializer = new XmlSerializer(typeof(SerializableTestingParameters)); FileStream stream = null; try { stream = new FileStream(fileName, FileMode.OpenOrCreate); serializer.Serialize(stream, parameters); } catch (Exception exc) { View.ShowError(exc); return; } finally { if (stream != null) { stream.Close(); } } // open in NotePad, if needed if (View.OpenFileForEditing) { ProcessStartInfo ProcessInfo; Process Process; try { ProcessInfo = new ProcessStartInfo("Notepad.exe", fileName); ProcessInfo.CreateNoWindow = false; ProcessInfo.UseShellExecute = true; Process = Process.Start(ProcessInfo); } catch (System.Exception ex) { View.ShowError(ex); } } }
/// <summary> /// Queries PTZ nodes /// </summary> public void GetPTZNodes() { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); string address = devices != null ? devices.ServiceAddress : string.Empty; DeviceEnvironment env = ContextController.GetDeviceEnvironment(); ManagementServiceProvider deviceClient = new ManagementServiceProvider(address, env.Timeouts.Message); ReportOperationStarted(); Thread thread = new Thread(new ThreadStart(new Action(() => { try { DeviceServicesInfo info = deviceClient.GetCapabilitiesDefineSecurity(new Onvif.CapabilityCategory[] { Onvif.CapabilityCategory.PTZ }); Onvif.Capabilities capabilities = info.Capabilities; string ptzAddress = string.Empty; if (capabilities != null) { if (capabilities.PTZ != null) { ptzAddress = capabilities.PTZ.XAddr; } else { throw new Exception("Device does not support PTZ service"); } } else { if (info.Services != null) { Onvif.Service ptzService = Tests.Common.CommonUtils.Extensions.FindService( info.Services, OnvifService.PTZ); if (ptzService != null) { ptzAddress = ptzService.XAddr; } else { throw new Exception("Device does not support PTZ service"); } } else { throw new Exception("Unable to get service address"); } } PTZServiceProvider ptzClient = new PTZServiceProvider(ptzAddress, env.Timeouts.Message); ptzClient.Security = deviceClient.Security; Onvif.PTZNode[] nodes = ptzClient.GetNodes(); if ((nodes != null) && (nodes.Length > 0)) { View.SetPTZNodes(nodes); } else { throw new Exception("No PTZ nodes returned by device"); } } catch (System.Exception ex) { View.ShowError(ex); } finally { ReportOperationCompleted(); } }))); thread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; thread.Start(); }
public void LoadSettingsFromXML(string fileName) { try { SerializableTestingParameters userParameters = null; if (!File.Exists(fileName)) { View.ShowError(string.Format("File not found: {0}", fileName)); return; } XmlSerializer serializer = new XmlSerializer(typeof(SerializableTestingParameters)); FileStream stream = null; try { stream = new FileStream(fileName, FileMode.Open); userParameters = (SerializableTestingParameters)serializer.Deserialize(stream); } catch (Exception exc) { View.ShowError(exc); View.ShowError(string.Format("Parameters loading failed: {0}", exc.Message)); return; } finally { if (stream != null) { stream.Close(); } } // update context { DeviceEnvironment devEnv = ContextController.GetDeviceEnvironment(); if (userParameters.Advanced != null) { devEnv.TestSettings.AdvancedSettings = ParseAdvancedSettings(userParameters.Advanced); devEnv.TestSettings.RawAdvancedSettings = new List <XmlElement>(userParameters.Advanced); } if (userParameters.Device != null) { DiscoveredDevices devices = ContextController.GetDiscoveredDevices(); devices.ServiceAddress = userParameters.Device.DeviceServiceAddress; } if (userParameters.SessionInfo != null) { } if (userParameters.TestParameters != null) { TestParameters testParameters = userParameters.TestParameters; devEnv.Credentials.UserName = testParameters.UserName; devEnv.Credentials.Password = testParameters.Password; devEnv.EnvironmentSettings.DnsIpv4 = testParameters.DnsIpv4; devEnv.EnvironmentSettings.DnsIpv6 = testParameters.DnsIpv6; devEnv.EnvironmentSettings.GatewayIpv4 = testParameters.DefaultGatewayIpv4; devEnv.EnvironmentSettings.GatewayIpv6 = testParameters.DefaultGatewayIpv6; devEnv.EnvironmentSettings.NtpIpv4 = testParameters.NtpIpv4; devEnv.EnvironmentSettings.NtpIpv6 = testParameters.NtpIpv6; devEnv.TestSettings.EventTopic = testParameters.EventTopic; devEnv.TestSettings.MetadataFilter = testParameters.MetadataFilter; devEnv.TestSettings.OperationDelay = testParameters.OperationDelay; devEnv.TestSettings.Password1 = testParameters.Password1; devEnv.TestSettings.Password2 = testParameters.Password2; devEnv.TestSettings.PTZNodeToken = testParameters.PTZNodeToken; devEnv.TestSettings.RecordingToken = testParameters.RecordingToken; devEnv.TestSettings.RecoveryDelay = testParameters.TimeBetweenRequests; devEnv.TestSettings.RelayOutputDelayTimeMonostable = testParameters.RelayOutputDelayTime; devEnv.TestSettings.SearchTimeout = testParameters.SearchTimeout; devEnv.TestSettings.SecureMethod = testParameters.SecureMethod; devEnv.TestSettings.SubscriptionTimeout = testParameters.SubscriptionTimeout; devEnv.TestSettings.TopicNamespaces = testParameters.TopicNamespaces; devEnv.TestSettings.UseEmbeddedPassword = testParameters.UseEmbeddedPassword; devEnv.TestSettings.VideoSourceToken = testParameters.VideoSourceToken; devEnv.Timeouts.InterTests = testParameters.TimeBetweenTests; devEnv.Timeouts.Message = testParameters.MessageTimeout; devEnv.Timeouts.Reboot = testParameters.RebootTimeout; } UpdateView(); } if (SettingsLoaded != null) { SettingsLoaded(this, new EventArgs()); } } catch (Exception exc) { View.ShowError(exc); } }