public static ScopeConfiguration FromScopeStorage(ScopeStorage scopeStorage)
        {
            ScopeConfiguration scopeConfiguration = new ScopeConfiguration(scopeStorage.OrganizationalUnitRoot.ObjectGuid, scopeStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <ScopeConfiguration>(scopeConfiguration, new TenantSettingFacade <ScopeStorage>(scopeStorage));
            return(scopeConfiguration);
        }
        public static ScopeStorage ToScopeStorage(ScopeConfiguration scope)
        {
            ScopeStorage scopeStorage = new ScopeStorage();

            scopeStorage[ADObjectSchema.OrganizationalUnitRoot] = new ADObjectId(scope.TenantId);
            scopeStorage.Name = scope.Name;
            scopeStorage.SetId((ADObjectId)DalHelper.ConvertFromStoreObject(scope.ObjectId, typeof(ADObjectId)));
            UnifiedPolicyStorageFactory.CopyPropertiesToStorage <ScopeConfiguration>(new TenantSettingFacade <ScopeStorage>(scopeStorage), scope);
            return(scopeStorage);
        }
Exemple #3
0
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddMvc();
     services.AddIdentityServer()
     .AddDeveloperSigningCredential()
     .AddInMemoryPersistedGrants()
     .AddInMemoryIdentityResources(ScopeConfiguration.GetIdentityResources())
     .AddInMemoryApiResources(ApiConfiguration.Get())
     .AddInMemoryClients(ClientConfiguration.Get())
     .AddTestUsers(UserConfiguration.Get());
 }
        public static void ConfigureScope(NIScope scope, ScopeConfiguration scopeConfig, string channelNames = "0")
        {
            scope.Channels[channelNames].Coupling         = scopeConfig.ScopeCouplingMode;
            scope.Channels[channelNames].InputImpedance   = (double)scopeConfig.InputImpedance;
            scope.Channels[channelNames].Range            = scopeConfig.VerticalRange_V;
            scope.Channels[channelNames].Offset           = scopeConfig.VerticalOffset_V;
            scope.Channels[channelNames].ProbeAttenuation = scopeConfig.ProbeAttenuation;

            scope.Timing.ReferenceClockSource = ScopeInputClockSource.FromString(scopeConfig.ScopeClockSource);

            scope.Channels[channelNames].Enabled = true;
        }
        static void Main()
        {
            NIScope myScope = new NIScope("5154", false, false);

            ScopeConfiguration       scopeConfig = GetDefaultScopeConfiguration();
            MeasurementConfiguration measConfig  = GetDefaultMeasurementConfiguration();

            ConfigureScope(myScope, scopeConfig, "0");
            ConfigureMeasurement(myScope, measConfig, "0");

            MeasurementResults myResults = MeasureChannel(myScope, "0");

            Console.WriteLine(myResults.AverageValue_V);
            Console.ReadKey();
            myScope.Close();
        }
        public void ConfigureScopeTest()
        {
            NIScope testScope = new NIScope("SIM", false, false, "Simulate = 1");

            ScopeConfiguration scopeConfig = ScopeConfiguration.GetDefault();

            ConfigureScope(testScope, scopeConfig, "0");

            //Check that all properties are properly applied to the scope session
            Assert.AreEqual((double)scopeConfig.InputImpedance, testScope.Channels["0"].InputImpedance, "Impedance");
            Assert.AreEqual(scopeConfig.ScopeCouplingMode, testScope.Channels["0"].Coupling, "Coupling");
            Assert.AreEqual(scopeConfig.VerticalOffset_V, testScope.Channels["0"].Offset, "Offset");
            Assert.AreEqual(scopeConfig.VerticalRange_V, testScope.Channels["0"].Range, "Range");
            Assert.AreEqual(scopeConfig.ProbeAttenuation, testScope.Channels["0"].ProbeAttenuation, "Probe Attenuation");
            Assert.AreEqual(scopeConfig.ScopeClockSource, testScope.Timing.ReferenceClockSource.ToString(), "Clock Source");


            testScope.Close();
        }
 public SinkConfiguration(ScopeConfiguration sinkConfiguration)
 {
     Configuration = sinkConfiguration;
 }