public static IDfsDynamicItemInfo CloneDynamicItem(DfsBuilder dfsBuilder, IDfsDynamicItemInfo dynamicItem) { DfsDynamicItemBuilder itemBuilder = dfsBuilder.CreateDynamicItemBuilder(); itemBuilder.Set(dynamicItem.Name, dynamicItem.Quantity, dynamicItem.DataType); itemBuilder.SetValueType(dynamicItem.ValueType); itemBuilder.SetAxis(dynamicItem.SpatialAxis); itemBuilder.SetReferenceCoordinates(dynamicItem.ReferenceCoordinateX, dynamicItem.ReferenceCoordinateY, dynamicItem.ReferenceCoordinateZ); return(itemBuilder.GetDynamicItemInfo()); }
internal Res11Point(Res11 dfs, IDfsDynamicItemInfo I, int ElementNumber, double chainage, string BranchName, string TopoId, double X, double Y, PointType pt) { Chainage = chainage; this.dfs = dfs; this.I = I; this.ElementNumber = ElementNumber; this.BranchName = BranchName; this.TopoID = TopoId; this.X = X; this.Y = Y; this.pointType = pt; }
/// <summary> /// Updates the item info. /// <para> /// The method assumes that the OresundHD.dfs2 test file /// (or preferably a copy of it) is the input file. /// </para> /// </summary> /// <param name="filename">path and name of OresundHD.dfs2 test file</param> public static void DynamicItemInfoModify(string filename) { IDfsFile dfsFile = DfsFileFactory.DfsGenericOpenEdit(filename); IDfsDynamicItemInfo itemInfo = dfsFile.ItemInfo[2]; // Update the values // old name: "Q Flux m^3/s/m". New name: "ShortD " (padded with spaces) // old quantity: (eumItem.eumIFlowFlux, eumUnit.eumUm3PerSecPerM) // old ValueType: Instantaneous itemInfo.Name = "ShortD"; itemInfo.Quantity = eumQuantity.Create(eumItem.eumIDischarge, eumUnit.eumUm3PerSec); itemInfo.ValueType = DataValueType.MeanStepBackward; // Old reference coordinates and orientation is -1.00000002e-35f itemInfo.SetReferenceCoordinates(1, 2, 3); itemInfo.SetOrientation(4, 5, 6); dfsFile.Close(); }