/// <summary>
 /// Adds the metrics to the report request.
 /// </summary>
 /// <param name="dimensions">An IList object containing the dimension names that shall be requested.</param>
 public void AddDimensions(IList <string> dimensions)
 {
     foreach (string s in dimensions)
     {
         Dimensions.Add(new Dimension(s.Trim(' ')));
     }
 }
예제 #2
0
 /// <summary>
 /// Helper constructor for quantity with multiple simple dimensions
 /// </summary>
 /// <param name="value">The value of the quantity</param>
 /// <param name="unitNames">A set of unit names to turn into dimensions</param>
 public Quantity(TNumber value, IEnumerable <string> unitNames)
     : this(value) {
     foreach (string unitName in unitNames)
     {
         Dimensions.Add(new Dimension(unitName));
     }
 }
예제 #3
0
 public IPlotMetricBuilder WithDimension(string dimensionName, string dimensionValue)
 {
     Dimensions.Add(new Dimension {
         Name = dimensionName, Value = dimensionValue
     });
     return(this);
 }
 /// <summary>
 /// Adds the dimensions to the report request.
 /// </summary>
 /// <param name="dimensions">A string containing all dimension names that shall be requested - separated by comma.</param>
 public void AddDimensions(string dimensions)
 {
     foreach (string s in dimensions.Split(','))
     {
         Dimensions.Add(new Dimension(s.Trim(' ')));
     }
 }
예제 #5
0
 private void AddDimensions(string queryParam, int startIndex)
 {
     foreach (string dimension in queryParam.Substring(startIndex).Split(','))
     {
         Dimensions.Add(GetFriendlySizeName(dimension), dimension);
     }
 }
예제 #6
0
        public FeSectionPipe(string inName, int inId, FeMaterial inMaterial,
                             double inArea, double inTorsionalConstant, double inMomentInertia2, double inMomentInertia3, double inProductOfInertia23, double inShearArea2, double inShearArea3, double inSectionModulus2, double inSectionModulus3, double inPlasticModulus2, double inPlasticModulus3, double inRadiusGyration2, double inRadiusGyration3, double inShearCenterEccentricity,
                             double inDimOuterDiameter, double inDimThickness)
        {
            _id       = inId;
            _name     = inName;
            _material = FeMaterial.GetMaterialByName("S355");

            _area = inArea;
            _torsionalConstant       = inTorsionalConstant;
            _momentInertia2          = inMomentInertia2;
            _momentInertia3          = inMomentInertia3;
            _productOfInertia23      = inProductOfInertia23;
            _shearArea2              = inShearArea2;
            _shearArea3              = inShearArea3;
            _sectionModulus2         = inSectionModulus2;
            _sectionModulus3         = inSectionModulus3;
            _plasticModulus2         = inPlasticModulus2;
            _plasticModulus3         = inPlasticModulus3;
            _radiusGyration2         = inRadiusGyration2;
            _radiusGyration3         = inRadiusGyration3;
            _shearCenterEccentricity = inShearCenterEccentricity;

            Dimensions.Add("OuterDiameter", inDimOuterDiameter);
            Dimensions.Add("Thickness", inDimThickness);

            LeastGyrationRadius = Math.Min(_radiusGyration2, _radiusGyration3);
        }
예제 #7
0
 public World(string Name)
 {
     for (int i = 0; i < 2; i++)
     {
         Dimensions.Add(i, new Dimension(this, i));
     }
 }
예제 #8
0
        public CloudWatchMetric AddDimension(HashSet <Dimension> dimensions, HashSet <string[]> dimensionGroups)
        {
            // If scope was not set in constructor, this method should do nothing.
            if (_scope == null)
            {
                return(this);
            }

            if (dimensions == null || dimensions.Count == 0)
            {
                Dimensions.Add(new string[0]);
                return(this);
            }

            foreach (var dimension in dimensions)
            {
                if (!_scope.DimensionValues.ContainsKey(dimension.Name))
                {
                    _scope.DimensionValues[dimension.Name] = dimension.Value;
                }
            }

            foreach (var dg in dimensionGroups)
            {
                Dimensions.Add(dg);
            }

            return(this);
        }
예제 #9
0
        async Task ExecuteCreateEventCommandAsync()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            try
            {
                Models.Constraint socialConstraint = new Models.Constraint {
                    Operator = "owner", Value = Settings.UserId
                };
                DimensionView socialDimension = new DimensionView {
                    Label = "Social", Interval = true, ConstraintList = new List <Models.Constraint> {
                        socialConstraint
                    }
                };
                Dimensions.Add(socialDimension);

                Settings.CurrentSharingSpace = this.SharingSpace.Id;
                var response = await _apiServices.PostSharingSpaceAsync(this.SharingSpace, Settings.AccessToken);

                foreach (var dimension in this.Dimensions)
                {
                    var dimensionId = Utilities.NewGuid();
                    var dataypeId   = Utilities.NewGuid();
                    await _apiServices.PostDimensionAsync(new Dimension { Id = dimensionId, Interval = dimension.Interval, Label = dimension.Label });

                    // metadata related tables
                    await _apiServices.PostDatatypeAsync(new Datatype { Id = dataypeId, Type = "string", Domain = "" });

                    await _apiServices.PostDimDatatypeAsync(new DimDatatype { DatatypeId = dataypeId, DimensionId = dimensionId });

                    foreach (var constraint in dimension.ConstraintList)
                    {
                        constraint.Id = Utilities.NewGuid();
                        await _apiServices.PostConstraintAsync(constraint);

                        await _apiServices.PostEventAsync(new Event { ConstraintId = constraint.Id, DimensionId = dimensionId, SharingSpaceId = this.SharingSpace.Id });
                    }
                }

                await CloudService.SyncOfflineCacheAsync();

                // navigate to event detail (overview)
                MessagingCenter.Send(this, "NavigateToEventOverview", SharingSpace);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: " + ex.Message);
                Debug.WriteLine("Error Full: " + ex);
                await Application.Current.MainPage.DisplayAlert("Event creation failed", ex.Message, "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #10
0
 public void AddDimension(string key, string expression)
 {
     if (Dimensions == null)
     {
         Dimensions = new Dictionary <string, APLDimensionValue>();
     }
     Dimensions.Add(key, expression);
 }
예제 #11
0
 /// <summary>
 /// Adds a dimension to a business process.
 /// </summary>
 /// <param name="d">The Dimesnion d.</param>
 public void AddDimension(Dimension d)
 {
     if (Dimensions == null)
     {
         Dimensions = new List <Dimension>();
     }
     Dimensions.Add(d);
 }
예제 #12
0
        public CloudWatchMetric(IConfiguration configuration)
        {
            Namespace = configuration["Namespace"];
            if (string.IsNullOrWhiteSpace(Namespace))
            {
                throw new Exception("Property 'Namespace' is mandatory in the 'MetricDefinition' section.");
            }

            // The Metrics section is required, so throw an exception if it is missing.
            var metricsSections = configuration.GetSection("Metrics");

            // GetSection never returns null
            if (!metricsSections.Exists())
            {
                throw new Exception("Property 'Metrics' is mandatory in the 'MetricDefinition' section.");
            }

            foreach (var dim in metricsSections.GetChildren())
            {
                var mv = new MetricValue
                {
                    Name = dim["Name"],
                    Unit = dim["Unit"] ?? "None"
                };

                if (dim["Value"] != null && long.TryParse(dim["Value"], out long defaultValue))
                {
                    mv.Value = defaultValue;
                }

                Metrics.Add(mv);
            }

            var dimensionSection = configuration.GetSection("Dimensions");

            if (!dimensionSection.Exists())
            {
                // Add an empty dimensions array if no dimensions are specified.
                Dimensions.Add(new string[0]);
            }
            else
            {
                var dimArray = dimensionSection.GetChildren().ToArray();

                // When the first item's path ends with 1, that means the first element in the array was empty.
                if (dimArray.First().Path.EndsWith("1"))
                {
                    Dimensions.Add(new string[0]);
                }

                foreach (var dim in dimArray)
                {
                    var dimItems = dim.GetChildren();
                    Dimensions.Add(dimItems.Select(i => i.Value).Distinct().OrderBy(i => i).ToArray());
                }
            }
        }
 /// <summary>
 /// Adds the specified dimension.
 /// </summary>
 /// <param name="dimension">The dimension to add.</param>
 public AnalyticsDataOptions AddDimension(AnalyticsDimension dimension)
 {
     if (Dimensions == null)
     {
         Dimensions = new AnalyticsDimensionCollection();
     }
     Dimensions.Add(dimension);
     return(this);
 }
예제 #14
0
        private void dimensionsAddButton_Click(object sender, EventArgs e)
        {
            var dimension = new Dimension("New item");

            Dimensions.Add(dimension);
            SelectedServer.Dimensions.Add(dimension);
            dimensionsListView.SelectObject(dimension);
            dimensionsListView.StartCellEdit(dimensionsListView.SelectedItem, 0);
        }
예제 #15
0
        public void AddDim(DimensionCapture dimension)
        {
            var dimExists = Dimensions.Exists(x => x.Name == dimension.Name);

            if (dimExists)
            {
                return;
            }

            Dimensions.Add(dimension);
        }
        /// <summary>
        /// Creates a new array type signature with the provided dimensions count.
        /// </summary>
        /// <param name="baseType">The element type.</param>
        /// <param name="dimensionCount">The number of dimensions.</param>
        public ArrayTypeSignature(TypeSignature baseType, int dimensionCount)
            : base(baseType)
        {
            if (dimensionCount < 0)
            {
                throw new ArgumentException("Number of dimensions cannot be negative.");
            }

            for (int i = 0; i < dimensionCount; i++)
            {
                Dimensions.Add(new ArrayDimension());
            }
        }
예제 #17
0
파일: World.cs 프로젝트: Arekva/winecrash
        public static Dimension GetOrCreateDimension(string identifier)
        {
            Dimension[] dimensions = null;
            lock (DimensionLocker) dimensions = Dimensions.ToArray();

            Dimension dim = dimensions.FirstOrDefault(d => d.Identifier == identifier);

            if (dim != null)
            {
                return(dim);
            }
            else
            {
                dim = new Dimension(identifier);
                Dimensions.Add(dim);

                Chunks[Dimensions.IndexOf(dim)] = new List <Chunk>(256);

                return(dim);
            }
        }
예제 #18
0
        public void ReadDimensions(string filename, string sheet, int rows)
        {
            using (SLDocument sl = new SLDocument(filename, sheet))
            {
                SLWorksheetStatistics stats = sl.GetWorksheetStatistics();
                int iStartColumnIndex       = CollumnOffset;

                for (int row = RowOffset; (row <= (RowOffset + rows)); ++row)
                {
                    Dimensions.Add(new DimensionLine
                    {
                        Kote       = sl.GetCellValueAsString(row, iStartColumnIndex),
                        DeltaPlus  = sl.GetCellValueAsInt32(row, iStartColumnIndex + 7),
                        DeltaMinus = sl.GetCellValueAsInt32(row, iStartColumnIndex + 9),
                        Nazivno    = sl.GetCellValueAsInt32(row, iStartColumnIndex + 1),
                        Mjereno    = sl.GetCellValueAsInt32(row, iStartColumnIndex + 4),

                        //  Delta = sl.GetCellValueAsInt32(row, iStartColumnIndex + 10)
                    });
                }
            }
        }
예제 #19
0
        internal void FromPivotCacheDefinition(PivotCacheDefinition pcd)
        {
            SetAllNull();

            if (pcd.Id != null)
            {
                Id = pcd.Id.Value;
            }
            if (pcd.Invalid != null)
            {
                Invalid = pcd.Invalid.Value;
            }
            if (pcd.SaveData != null)
            {
                SaveData = pcd.SaveData.Value;
            }
            if (pcd.RefreshOnLoad != null)
            {
                RefreshOnLoad = pcd.RefreshOnLoad.Value;
            }
            if (pcd.OptimizeMemory != null)
            {
                OptimizeMemory = pcd.OptimizeMemory.Value;
            }
            if (pcd.EnableRefresh != null)
            {
                EnableRefresh = pcd.EnableRefresh.Value;
            }
            if (pcd.RefreshedBy != null)
            {
                RefreshedBy = pcd.RefreshedBy.Value;
            }
            if (pcd.RefreshedDate != null)
            {
                RefreshedDate = pcd.RefreshedDate.Value;
            }
            if (pcd.BackgroundQuery != null)
            {
                BackgroundQuery = pcd.BackgroundQuery.Value;
            }
            if (pcd.MissingItemsLimit != null)
            {
                MissingItemsLimit = pcd.MissingItemsLimit.Value;
            }
            if (pcd.CreatedVersion != null)
            {
                CreatedVersion = pcd.CreatedVersion.Value;
            }
            if (pcd.RefreshedVersion != null)
            {
                RefreshedVersion = pcd.RefreshedVersion.Value;
            }
            if (pcd.MinRefreshableVersion != null)
            {
                MinRefreshableVersion = pcd.MinRefreshableVersion.Value;
            }
            if (pcd.RecordCount != null)
            {
                RecordCount = pcd.RecordCount.Value;
            }
            if (pcd.UpgradeOnRefresh != null)
            {
                UpgradeOnRefresh = pcd.UpgradeOnRefresh.Value;
            }
            if (pcd.IsTupleCache != null)
            {
                IsTupleCache = pcd.IsTupleCache.Value;
            }
            if (pcd.SupportSubquery != null)
            {
                SupportSubquery = pcd.SupportSubquery.Value;
            }
            if (pcd.SupportAdvancedDrill != null)
            {
                SupportAdvancedDrill = pcd.SupportAdvancedDrill.Value;
            }

            if (pcd.CacheSource != null)
            {
                CacheSource.FromCacheSource(pcd.CacheSource);
            }

            // doing one by one because it's bloody hindering awkward complicated.

            if (pcd.CacheFields != null)
            {
                SLCacheField cf;
                using (var oxr = OpenXmlReader.Create(pcd.CacheFields))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(CacheField))
                        {
                            cf = new SLCacheField();
                            cf.FromCacheField((CacheField)oxr.LoadCurrentElement());
                            CacheFields.Add(cf);
                        }
                    }
                }
            }

            if (pcd.CacheHierarchies != null)
            {
                SLCacheHierarchy ch;
                using (var oxr = OpenXmlReader.Create(pcd.CacheHierarchies))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(CacheHierarchy))
                        {
                            ch = new SLCacheHierarchy();
                            ch.FromCacheHierarchy((CacheHierarchy)oxr.LoadCurrentElement());
                            CacheHierarchies.Add(ch);
                        }
                    }
                }
            }

            if (pcd.Kpis != null)
            {
                SLKpi k;
                using (var oxr = OpenXmlReader.Create(pcd.Kpis))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(Kpi))
                        {
                            k = new SLKpi();
                            k.FromKpi((Kpi)oxr.LoadCurrentElement());
                            Kpis.Add(k);
                        }
                    }
                }
            }

            if (pcd.TupleCache != null)
            {
                TupleCache.FromTupleCache(pcd.TupleCache);
                HasTupleCache = true;
            }

            if (pcd.CalculatedItems != null)
            {
                SLCalculatedItem ci;
                using (var oxr = OpenXmlReader.Create(pcd.CalculatedItems))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(CalculatedItem))
                        {
                            ci = new SLCalculatedItem();
                            ci.FromCalculatedItem((CalculatedItem)oxr.LoadCurrentElement());
                            CalculatedItems.Add(ci);
                        }
                    }
                }
            }

            if (pcd.CalculatedMembers != null)
            {
                SLCalculatedMember cm;
                using (var oxr = OpenXmlReader.Create(pcd.CalculatedMembers))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(CalculatedMember))
                        {
                            cm = new SLCalculatedMember();
                            cm.FromCalculatedMember((CalculatedMember)oxr.LoadCurrentElement());
                            CalculatedMembers.Add(cm);
                        }
                    }
                }
            }

            if (pcd.Dimensions != null)
            {
                SLDimension d;
                using (var oxr = OpenXmlReader.Create(pcd.Dimensions))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(Dimension))
                        {
                            d = new SLDimension();
                            d.FromDimension((Dimension)oxr.LoadCurrentElement());
                            Dimensions.Add(d);
                        }
                    }
                }
            }

            if (pcd.MeasureGroups != null)
            {
                SLMeasureGroup mg;
                using (var oxr = OpenXmlReader.Create(pcd.MeasureGroups))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(MeasureGroup))
                        {
                            mg = new SLMeasureGroup();
                            mg.FromMeasureGroup((MeasureGroup)oxr.LoadCurrentElement());
                            MeasureGroups.Add(mg);
                        }
                    }
                }
            }

            if (pcd.Maps != null)
            {
                SLMeasureDimensionMap mdm;
                using (var oxr = OpenXmlReader.Create(pcd.Maps))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(MeasureDimensionMap))
                        {
                            mdm = new SLMeasureDimensionMap();
                            mdm.FromMeasureDimensionMap((MeasureDimensionMap)oxr.LoadCurrentElement());
                            Maps.Add(mdm);
                        }
                    }
                }
            }
        }
예제 #20
0
 /// <summary>
 /// Adds a dimension to object model.
 /// </summary>
 /// <param name="dimension"></param>
 public void AddToObjectModel(HlaDimension dimension)
 {
     Dimensions.Add(dimension);
 }
예제 #21
0
        // Regions - Manually declare regions such as:
        // public HlaRegion Oda1Region;
        // Region Extents - Manually declare region extents such as:
        // public private HlaExtent exOd1;
        #endregion //Declarations

        #region Constructor
        public CCommunicationSpace() : base("Communication")
        {
            // Create Dimensions
            RadioChannel = new Racon.ObjectModel.CDimension("RadioChannel", this);
            Dimensions.Add(RadioChannel);
        }
예제 #22
0
 public void AddDimension(Dimension dimension)
 {
     dimension.Cube   = this;
     dimension.Server = Server;
     Dimensions.Add(dimension);
 }
예제 #23
0
 public void AddDimensions(DimensionCube dimensionCube)
 {
     Dimensions.Add(dimensionCube);
 }
예제 #24
0
 public ArrayAttribute(string arrayXSizeFieldName, uint arrayYSize)
 {
     Dimensions.Add(arrayXSizeFieldName);
     Dimensions.Add(arrayYSize);
 }
예제 #25
0
 public ArrayAttribute(uint arrayXSize, uint arrayYSize)
 {
     Dimensions.Add(arrayXSize);
     Dimensions.Add(arrayYSize);
 }
예제 #26
0
 public ArrayAttribute(uint arraySize)
 {
     Dimensions.Add(arraySize);
 }
예제 #27
0
 public ArrayAttribute(string arraySizeFieldName)
 {
     Dimensions.Add(arraySizeFieldName);
 }
예제 #28
0
 /// <summary>
 /// Helper constructor for quantity with single complex dimension
 /// </summary>
 /// <param name="value">The value of the quantity</param>
 /// <param name="dimension">Pre-existing dimension to use with this quantity</param>
 public Quantity(TNumber value, Dimension dimension)
     : this(value) {
     Dimensions.Add(dimension);
 }
예제 #29
0
 public void AddDimensionValues(DimensionValues dimValues)
 {
     Dimensions.Add(dimValues);
 }
예제 #30
0
 /// <summary>
 /// Helper constructor for quantity with a single dimension
 /// </summary>
 /// <param name="value">The value of the quantity</param>
 /// <param name="unitName">The common name of the unit of the dimension</param>
 public Quantity(TNumber value, string unitName)
     : this(value) {
     Dimensions.Add(new Dimension(unitName));
 }