public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Shells, Stresses, bottom, Ultimate - Load case: DL Shell Elem Node Sigma x' Sigma y' Tau x'y' Tau x'z' Tau y'z' Sigma vm Sigma 1 Sigma 2 alpha Case [-] [-] [-] [Pa] [Pa] [Pa] [Pa] [Pa] [Pa] [Pa] [Pa] [rad] [-] P.1.1 1 128 -377812.420 -274129.630 -298308.046 0.000 0.000 617480.988 -23191.863 -628750.186 -0.871 DL P.1.1 1 176 -468783.277 -406686.530 -342492.094 0.000 0.000 739193.042 -93838.355 -781631.452 -0.831 DL P.1.1 1 201 -649916.472 -443525.213 -455538.875 0.000 0.000 976421.371 -79639.474 -1013802.211 -0.897 DL P.1.1 1 161 -611957.560 -337629.061 -435079.083 0.000 0.000 921820.051 -18604.929 -930981.692 -0.938 DL P.1.1 1 - -527117.432 -365492.608 -382854.525 0.000 0.000 811488.059 -55014.549 -837595.492 -0.889 DL P.1.1 2 659 -4180120.640 -2127134.540 -1990187.428 0.000 0.000 4998896.771 -914312.074 -5392943.106 -1.023 DL P.1.1 2 656 -3575457.150 -1725826.119 -1813964.210 0.000 0.000 4411706.104 -614530.171 -4686753.098 -1.021 DL P.1.1 2 620 -3370447.772 -1804274.936 -1997640.161 0.000 0.000 4528334.179 -441716.800 -4733005.908 -0.972 DL P.1.1 2 614 -3286627.676 -1839131.834 -1920644.988 0.000 0.000 4382512.670 -510396.328 -4615363.183 -0.966 DL P.1.1 2 - -3603163.310 -1874091.857 -1930609.197 0.000 0.000 4574287.127 -623285.084 -4853970.083 -0.996 DL P.1.1 3 632 -1049147.327 -795773.885 -849383.454 0.000 0.000 1750268.237 -63681.369 -1781239.843 -0.859 DL P.1.1 3 610 -819189.069 -530551.866 -608116.688 0.000 0.000 1275676.856 -49863.456 -1299877.479 -0.902 DL P.1.1 3 643 -674541.927 -558910.915 -586217.521 0.000 0.000 1192196.428 -27664.782 -1205788.060 -0.835 DL P.1.1 3 664 -806735.742 -837671.858 -808924.050 0.000 0.000 1624749.589 -13131.875 -1631275.725 -0.776 DL P.1.1 3 - -837403.516 -680727.131 -713160.428 0.000 0.000 1456153.897 -41615.208 -1476515.440 -0.840 DL" ); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(ShellStress), "Shell Stress should be parsed"); Assert.IsTrue(results[results.Count - 1].GetType() == typeof(ShellStress), "Shell Stress (extract) should be parsed"); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Footfall analysis, Nodal response factors, SE.1 - Overall maximum - for selected objects ID Node x y z [-] [-] [-] [-] [-] P.1.1 1 0.000 0.000 0.000 2 0.000 0.000 0.000 3 0.000 0.000 0.000 4 0.000 0.000 0.000 5 0.000 0.000 0.000 6 0.000 0.000 0.000 7 0.000 0.000 0.000 8 0.000 0.000 0.000 9 0.000 0.000 0.000 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(NodalResponseFactor), "Nodal Acceleration should be parsed"); Assert.IsTrue(results.Count == 9, "Should read all results."); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Line support group, Resultants, Ultimate - Load case: Permanent plats ID l/2 Fx' Fy' Fz' Mx' My' Mz' Case [mm] [N] [N] [N] [Nmm] [Nmm] [Nmm] [-] S.1 500.000 0.000 0.000 -6792.354 0.000 0.000 0.000 Permanent plats S.2 500.000 0.000 0.000 -7015.836 0.000 0.000 0.000 Permanent plats S.3 500.000 0.000 0.000 -7239.318 0.000 0.000 0.000 Permanent plats Line support group, Resultants, Load comb.: 6.10a ID l/2 Fx' Fy' Fz' Mx' My' Mz' Comb. [mm] [N] [N] [N] [Nmm] [Nmm] [Nmm] [-] S.1 500.000 0.000 0.000 -9169.677 0.000 0.000 0.000 6.10a S.2 500.000 0.000 0.000 -9471.378 0.000 0.000 0.000 6.10a S.3 500.000 0.000 0.000 -9773.079 0.000 0.000 0.000 6.10a "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 6); Assert.IsTrue(results.First().GetType() == typeof(LineSupportGroupResultant)); Assert.IsTrue(results.Last().GetType() == typeof(LineSupportGroupResultant)); File.Delete(path); }
/// <summary> /// Test a single result reader, used by testing export stream. /// </summary> /// <param name="reader">A single result reader</param> private void TestExportSingleReader( ResultsReader reader) { var indexEvent = 0; using (reader) { foreach (var ret in reader) { if (indexEvent == 0) { Assert.AreEqual("172.16.35.130", ret["host"]); Assert.AreEqual("16", ret["count"]); } if (indexEvent == 4) { Assert.AreEqual("three.four.com", ret["host"]); Assert.AreEqual("35994", ret["count"]); } indexEvent++; } Assert.AreEqual(5, indexEvent); } }
/// <summary> /// Extends the reader by reading another set of records that are children of the previous results. /// </summary> /// <typeparam name="T1">The type of objects in the first set of results.</typeparam> /// <typeparam name="T2">The type of objects in the second set of results.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results object with child records.</returns> public static ResultsReader <T1> ThenChildren <T1, T2>( this ResultsReader <T1> previous, RecordReader <T2> recordReader, Action <T1, List <T2> > into = null) { return(previous.ThenChildren(recordReader.GroupByAuto <T1, object>(), null, into)); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Quantity estimation, Profiled panel Storey Struct. Identifier Quality Section Thickness Panel type Length Width Area Weight Pcs Total weight type [mm] [-] [mm] [mm] [mm2] [t] [-] [t] - Plate PP.2 C40/50 HD-F 120-20 0.200 A.1 2000.000 1197.000 2394000.000 0.587 1 0.587 - Plate PP.2 C40/50 HD-F 120-20 0.200 A.2 2000.000 797.000 1594000.000 0.391 1 0.391 - Plate PP.6 S 355 HE-B 260 0.260 A.7 2000.000 260.000 520000.000 0.186 7 1.302 - Plate PP.6 S 355 HE-B 260 0.260 A.8 2000.000 156.000 312000.000 0.112 1 0.112 - Plate PP.7 D30 Sawn lumber 150x150 0.150 A.9 2000.000 150.000 300000.000 0.029 13 0.374 - Plate PP.7 D30 Sawn lumber 150x150 0.150 A.10 2000.000 8.000 16000.000 0.002 1 0.002 - Wall PP.9 C40/50 HD-F 120-20 0.200 A.3 3000.000 797.000 2391000.000 0.586 1 0.586 - Wall PP.9 C40/50 HD-F 120-20 0.200 A.4 3000.000 1197.000 3591000.000 0.881 1 0.881 - Plate PP.12 C40/50 HD-F 120-20 0.200 A.5 5000.000 1197.000 5985000.000 1.468 1 1.468 - Plate PP.12 C40/50 HD-F 120-20 0.200 A.6 5000.000 797.000 3985000.000 0.977 1 0.977 TOTAL 28 6.679 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 10, "Should read all results"); Assert.IsTrue(results.All(r => r.GetType() == typeof(QuantityEstimationProfiledPlate))); var _results = results.Cast <QuantityEstimationProfiledPlate>().ToList(); Assert.AreEqual(_results.First().Area, 2394000, 1e-6); File.Delete(path); }
public static List <CandleDataInfo> GetMarginaAverageDataSeries() { List <CandleDataInfo> chartData = new List <CandleDataInfo>(); DataTable dataTable = ResultsReader.ReadMarginalAverage(); var scenarios = dataTable.AsEnumerable() .GroupBy(r => new { scenario = r["escenario"] }) .Select(g => g.OrderBy(r => r["escenario"]).First()).Count(); for (int i = 1; i < scenarios + 1; i++) { DataRow[] rows = dataTable.Select("escenario = " + i); CandleDataInfo dataItem = new CandleDataInfo() { //Date = DateTime.Now.AddDays(1), High = Convert.ToDouble(rows[0][2]), Low = Convert.ToDouble(rows[1][2]), Open = Convert.ToDouble(rows[2][2]), Close = Convert.ToDouble(rows[3][2]) }; chartData.Add(dataItem); } return(chartData); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Shell, Crack width, Load comb.: Kvasi-frekvent ID Elem Face Width 1 Direction 1 Width 2 Direction 2 [-] [-] [-] [mm] [rad] [mm] [rad] P.1.1 1 bottom 0.751 3.168 0.000 4.739 top 0.000 0.000 0.000 0.000 2 bottom 1.763 3.135 0.000 4.706 top 0.000 0.000 0.000 0.000 P.2.1 1 bottom 1.222 3.126 0.000 4.697 top 0.000 0.000 0.000 0.000 2 bottom 0.917 3.142 0.000 4.712 top 0.000 0.000 0.000 0.000 Max. of load combinations, Shell, Crack width ID Elem Face Width 1 Direction 1 Width 2 Direction 2 Comb [-] [-] [-] [mm] [rad] [mm] [rad] [-] P.1.1 1 bottom 0.751 3.168 0.000 4.739 Kvasi-frekvent top 0.000 0.000 0.000 0.000 Kvasi-frekvent 2 bottom 1.763 3.135 0.000 4.706 Kvasi-frekvent top 0.000 0.000 0.000 0.000 Kvasi-frekvent "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 12); Assert.IsTrue(results.First().GetType() == typeof(ShellCrackWidth)); Assert.IsTrue(results.Last().GetType() == typeof(ShellCrackWidth)); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Nodes No. x y z [-] [m] [m] [m] 1 -1.000 -0.000 9.000 2 -0.999 -0.054 4.000 3 -0.997 0.083 7.000 4 -0.996 0.088 2.000 5 -0.994 -0.107 1.000 6 -0.987 -0.158 6.000 7 -0.986 0.008 5.500 8 -0.985 0.175 5.000 9 -0.983 -0.079 7.500 10 -0.982 0.014 7.000 11 -0.982 0.015 4.000 12 -0.982 0.019 2.000 13 -0.982 -0.037 1.000 14 -0.980 0.068 9.000 15 -0.980 -0.068 9.000 16 -0.979 -0.091 2.500 17 -0.978 -0.088 6.000 18 -0.977 0.119 3.500 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(FeaNode), "FeaNode should be parsed"); Assert.IsTrue(results.Count == 18, "Should read all results."); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Bars, Internal forces, Quasi-permanent - Load case: IL ID x N Ty' Tz' Mt My' Mz' [-] [m] [kN] [kN] [kN] [kNm] [kNm] [kNm] B.1.1 0.000 -0.202 0.703 -6.572 -0.109 1.786 0.117 B.1.1 0.141 0.122 0.462 -5.952 -0.113 0.837 0.023 B.1.1 0.141 0.122 0.462 -5.952 -0.113 0.837 0.023 B.1.1 0.282 0.714 0.198 -5.332 -0.092 0.044 -0.000 B.1.1 0.282 0.714 0.198 -5.332 -0.092 0.044 -0.000 B.1.1 0.423 1.254 0.393 -6.129 -0.032 -0.806 -0.018 B.1.1 0.423 1.254 0.393 -6.129 -0.032 -0.806 -0.018 B.1.1 0.563 1.526 0.611 -6.928 0.003 -1.863 -0.101 B.2.1 0.000 -0.786 0.535 -7.064 -0.140 1.876 0.091 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(BarInternalForce), "Bar Internal Force should be parsed"); Assert.IsTrue(results.Count == 9, "Should read all results."); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Bars, Displacements, Ultimate - Load case: IL Bar x ex' ey' ez' fix' fiy' fiz' [-] [m] [mm] [mm] [mm] [rad] [rad] [rad] B.1.1 0.000 1.061 -0.130 -0.416 0.000 0.000 0.001 B.1.1 0.141 1.061 -0.019 -0.433 0.000 0.000 0.001 B.1.1 0.141 1.061 -0.019 -0.433 0.000 0.000 0.001 B.1.1 0.282 1.061 0.092 -0.434 0.000 0.000 0.001 B.1.1 0.282 1.061 0.092 -0.434 0.000 0.000 0.001 B.1.1 0.423 1.061 0.203 -0.433 0.000 0.000 0.001 B.1.1 0.423 1.061 0.203 -0.433 0.000 0.000 0.001 B.1.1 0.563 1.062 0.314 -0.448 0.000 0.000 0.001 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(BarDisplacement), "FeaNode should be parsed"); Assert.IsTrue(results.Count == 8, "Should read all results."); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Shells, Displacements, Ultimate - Load case: DL Shell Elem Node ex' ey' ez' fix' fiy' fiz' Case [-] [-] [-] [mm] [mm] [mm] [rad] [rad] [rad] [-] P.1.1 1859 771 0.000 0.000 -1.180 0.001 -0.001 0.000 DL P.1.1 1859 828 0.000 0.000 -1.081 0.001 -0.001 0.000 DL P.1.1 1859 858 0.000 0.000 -0.861 0.001 -0.001 0.000 DL P.1.1 1859 811 0.000 0.000 -0.919 0.001 -0.001 0.000 DL P.1.1 1859 - 0.000 0.000 -1.010 0.001 -0.001 0.000 DL P.1.1 1860 1406 0.000 0.000 -0.045 0.000 -0.000 0.000 DL P.1.1 1860 1402 0.000 0.000 -0.020 0.000 -0.000 0.000 DL P.1.1 1860 1355 0.000 0.000 -0.069 0.000 -0.001 0.000 DL P.1.1 1860 1345 0.000 0.000 -0.132 0.000 -0.001 0.000 DL P.1.1 1860 - 0.000 0.000 -0.067 0.000 -0.001 0.000 DL P.1.1 1861 1373 0.000 0.000 -0.511 0.001 -0.001 0.000 DL P.1.1 1861 1339 0.000 0.000 -0.701 0.001 -0.001 0.000 DL P.1.1 1861 1387 0.000 0.000 -0.622 0.001 -0.001 0.000 DL P.1.1 1861 1414 0.000 0.000 -0.416 0.001 -0.001 0.000 DL P.1.1 1861 - 0.000 0.000 -0.562 0.001 -0.001 0.000 DL P.1.1 1862 639 0.000 0.000 -2.339 0.001 -0.001 0.000 DL P.1.1 1862 588 0.000 0.000 -2.536 0.001 -0.001 0.000 DL P.1.1 1862 590 0.000 0.000 -2.709 0.001 -0.002 0.000 DL P.1.1 1862 632 0.000 0.000 -2.518 0.001 -0.002 0.000 DL P.1.1 1862 - 0.000 0.000 -2.526 0.001 -0.002 0.000 DL P.1.1 1863 1368 0.000 0.000 -0.252 0.001 -0.001 0.000 DL P.1.1 1863 1377 0.000 0.000 -0.145 0.000 -0.001 0.000 DL P.1.1 1863 1323 0.000 0.000 -0.247 0.001 -0.001 0.000 DL P.1.1 1863 1306 0.000 0.000 -0.377 0.001 -0.001 0.000 DL Shells, Displacements (Extract), Load comb.: LC1 Shell Max. Elem Node ex' ey' ez' fix' fiy' fiz' e fi Comb. [-] [-] [-] [-] [mm] [mm] [mm] [°] [°] [°] [mm] [°] [-] P.1.1 ex' (+) 91 172 -0.001 0.000 0.001 -0.000 0.007 0.000 0.001 0.007 LC1 P.1.1 ey' (+) 9 636 -0.001 0.000 0.031 0.000 -0.007 -0.000 0.031 0.007 LC1 P.1.1 ez' (+) 140 648 -0.001 0.000 0.081 0.001 -0.001 0.000 0.081 0.001 LC1 P.1.1 fix' (+) 140 648 -0.001 0.000 0.081 0.001 -0.001 0.000 0.081 0.001 LC1 P.1.1 fiy' (+) 98 632 -0.001 -0.000 0.001 0.000 0.007 -0.000 0.002 0.007 LC1 P.1.1 fiz' (+) 24 13 -0.001 -0.000 0.073 -0.001 -0.003 0.000 0.073 0.003 LC1 P.1.1 ex' (-) 18 282 -0.001 -0.000 0.077 -0.000 -0.001 -0.000 0.077 0.001 LC1 P.1.1 ey' (-) 136 662 -0.001 -0.000 0.031 0.000 0.007 -0.000 0.031 0.007 LC1 P.1.1 ez' (-) 30 351 -0.001 0.000 0.001 0.000 -0.007 0.000 0.001 0.007 LC1 P.1.1 fix' (-) 81 18 -0.001 0.000 0.081 -0.001 0.001 0.000 0.081 0.001 LC1 P.1.1 fiy' (-) 39 631 -0.001 0.000 0.001 0.000 -0.007 -0.000 0.002 0.007 LC1 P.1.1 fiz' (-) 101 575 -0.001 -0.000 0.071 0.001 0.003 -0.000 0.071 0.003 LC1 P.1.1 e 140 648 -0.001 0.000 0.081 0.001 -0.001 0.000 0.081 0.001 LC1 P.1.1 fi 39 631 -0.001 0.000 0.001 0.000 -0.007 -0.000 0.002 0.007 LC1 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(ShellDisplacement), "Shell displacements should be parsed"); Assert.IsTrue(results[results.Count - 1].GetType() == typeof(ShellDisplacement), "Shell displacements (extract) should be parsed"); File.Delete(path); }
/// <summary> /// Extends the reader by reading another set of records that are children of the previous results. /// </summary> /// <typeparam name="T1">The type of objects in the first set of results.</typeparam> /// <typeparam name="T2">The type of objects in the second set of results.</typeparam> /// <typeparam name="TId">The type of the ID value.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="id">An optional function that extracts an ID from the object. Use when this row is a parent in a parent-child relationship.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results object with child records.</returns> public static ResultsReader <T1> ThenChildren <T1, T2, TId>( this ResultsReader <T1> previous, IChildRecordReader <T2, TId> recordReader, Func <T1, TId> id = null, Action <T1, List <T2> > into = null) { return(previous.AddChild(new Children <T1, T2, TId>(recordReader, new ChildMapper <T1, T2, TId>(id, into)))); }
/// <summary> /// Extends the reader by reading another set of records that are children of a subobject of the previous results. /// </summary> /// <typeparam name="TRoot">The type of the root object that is returned.</typeparam> /// <typeparam name="TParent">The type of the parent object in the parent-child relationship.</typeparam> /// <typeparam name="TChild">The type of the child in the parent-child relationship.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="parents">A function that selects the list of parents from the root object.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results objects with children.</returns> public static ResultsReader <TRoot> ThenChildren <TRoot, TParent, TChild>( this ResultsReader <TRoot> previous, RecordReader <TChild> recordReader, Func <TRoot, IEnumerable <TParent> > parents, Action <TParent, List <TChild> > into = null) { return(previous.ThenChildren(recordReader.GroupByAuto <TParent, object>(), parents, null, into)); }
public SimpleDataGridView(string table, bool HasFewColumns, int tipo) { ItemsSource = ResultsReader.GetResultsFromTable(table); if (tipo != 0) { if (string.IsNullOrEmpty(table)) { return; } IsReadOnly = false; if (HasFewColumns) { ColumnWidth = new GridViewLength(1, GridViewLengthUnitType.Star); } ClipboardCopyMode = GridViewClipboardCopyMode.Cells; SelectionUnit = GridViewSelectionUnit.Mixed; SelectionMode = SelectionMode.Extended; GroupPanelBackground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFE6E6E6")); GroupPanelForeground = new SolidColorBrush(Colors.Black); FilteringMode = Telerik.Windows.Controls.GridView.FilteringMode.Popup; RowLoaded += BaseDataGrid_Formating; for (int i = 1; i < Columns.Count; i++) { GridViewDataColumn column = Columns[i] as GridViewDataColumn; column.ShowFieldFilters = false; column.ShowFilterButton = false; System.Type Tipo = column.DataType; bool Valor; Valor = Tipo.IsValueType; if (Valor) { if (column.Header.ToString().ToLower() == "escenario" || column.Header.ToString().ToLower() == "bloque" || column.Header.ToString().ToLower() == "periodo") { column.DataFormatString = "{0:F0}"; } else { column.DataFormatString = "{0:F2}"; } } } GridViewDataColumn textBoxColumn = new GridViewDataColumn(); textBoxColumn = new GridViewDataColumn { Name = "FechaPeriodo", Header = "Fecha", IsAutoGenerated = true, Width = 80 }; } }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Shells, Derived internal forces, Ultimate - Load case: IL ID Elem Node M1 M2 alpha(M) N1 N2 alpha(N) Case [-] [-] [-] [Nmm/mm] [Nmm/mm] [rad] [N/mm] [N/mm] [rad] [-] P.1.1 595 5773 256.256 92.485 -1.314 6.455 2.446 0.303 IL P.1.1 595 5893 556.806 28.445 -0.187 8.037 0.632 0.180 IL P.1.1 595 6074 745.102 -5.252 -0.161 12.700 1.269 0.225 IL P.1.1 595 6054 -195.868 -1669.048 -1.224 13.862 3.748 -0.028 IL P.1.1 595 - 157.880 -205.649 -0.810 10.144 2.144 0.147 IL P.1.1 596 5431 618.335 77.168 -0.543 4.939 -1.074 0.259 IL P.1.1 596 5767 2409.225 381.773 -0.401 6.812 -0.876 0.164 IL P.1.1 596 5914 582.131 -312.793 -1.077 4.783 -0.964 0.172 IL P.1.1 596 5696 501.837 -325.731 -1.150 5.374 -1.005 0.180 IL P.1.1 596 - 911.020 71.967 -0.693 5.468 -0.971 0.192 IL P.1.1 597 617 -123.324 -428.055 0.222 -1.549 -4.038 0.429 IL P.1.1 597 606 136.395 -746.185 0.394 -0.666 -1.641 -1.365 IL P.1.1 597 999 89.459 -327.459 0.348 -1.031 -1.676 1.332 IL P.1.1 597 1054 103.865 -208.631 0.183 -1.205 -2.397 0.715 IL P.1.1 597 - 48.120 -424.103 0.323 -1.402 -2.149 0.730 IL P.1.1 598 481 155.363 -814.208 0.132 1.629 -3.533 1.407 IL P.1.1 598 544 -297.169 -456.007 0.515 0.974 -5.212 0.913 IL Shells, Derived internal forces (Extract), Ultimate - Load case: IL ID Max. Elem Node M1 M2 alpha(M) N1 N2 alpha(N) Case [-] [-] [-] [-] [Nmm/mm] [Nmm/mm] [rad] [N/mm] [N/mm] [rad] [-] P.1.1 M1 (+) 701 6105 2731.907 57.585 0.427 12.556 -0.179 0.423 IL P.1.1 M2 (+) 603 4227 523.044 458.486 1.245 2.642 -0.398 0.328 IL P.1.1 N1 (+) 595 6054 -195.868 -1669.048 -1.224 13.862 3.748 -0.028 IL P.1.1 N2 (+) 595 6054 -195.868 -1669.048 -1.224 13.862 3.748 -0.028 IL P.1.1 M1 (-) 624 357 -1198.228 -3134.021 0.860 -3.257 -18.207 0.382 IL P.1.1 M2 (-) 624 357 -1198.228 -3134.021 0.860 -3.257 -18.207 0.382 IL P.1.1 N1 (-) 626 150 943.685 -3093.058 0.308 -5.624 -7.436 -1.430 IL P.1.1 N2 (-) 624 357 -1198.228 -3134.021 0.860 -3.257 -18.207 0.382 IL P.2.1 M1 (+) 875 1406 1802.832 -96.426 -1.350 2.037 -0.076 -0.264 IL P.2.1 M2 (+) 775 3146 510.981 488.475 0.663 0.441 0.111 -1.558 IL P.2.1 N1 (+) 793 4 1048.886 -1374.331 0.390 3.085 0.365 -1.301 IL P.2.1 N2 (+) 909 1730 1594.594 -487.776 1.201 1.160 1.018 0.608 IL P.2.1 M1 (-) 820 4380 -511.410 -1655.674 -0.688 0.219 -2.038 1.343 IL P.2.1 M2 (-) 905 689 -217.661 -1755.619 0.172 0.085 -0.459 -1.539 IL P.2.1 N1 (-) 762 5746 -488.269 -1669.396 -1.287 -0.436 -2.292 0.969 IL P.2.1 N2 (-) 762 5746 -488.269 -1669.396 -1.287 -0.436 -2.292 0.969 IL "); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(ShellDerivedForce), "Shell Derived Force force should be parsed"); Assert.IsTrue(results[results.Count - 1].GetType() == typeof(ShellDerivedForce), "Shell Derived Force (extract) should be parsed"); File.Delete(path); }
public static List <DataSeriesViewModel> GetGenerationByCompanyDataSeries(int scenario, string selctedCompany) { ObservableCollection <ChartDataPoint> dataPoints; DataSeriesViewModel dataSeries; List <DataSeriesViewModel> dataSeriesList = new List <DataSeriesViewModel>(); DataTable dataTable = ResultsReader.ReadGenerationByCompany(scenario, selctedCompany); dataPoints = new ObservableCollection <ChartDataPoint>(); foreach (DataRow row in dataTable.Rows) { int period = Convert.ToInt32(row[2]); string periodDate = ""; if (period <= DHOGDataBaseViewModel.PeriodsDate.GetLength(0)) { periodDate = DHOGDataBaseViewModel.PeriodsDate[period - 1]; } else { throw new Exception(MessageUtil.FormatMessage("ERROR.ChartDateNotFound", "Generación SIN", period)); } //dataPoints.Add(new ChartDataPoint(row[2].ToString(), Convert.ToDouble(row[3]))); dataPoints.Add(new ChartDataPoint(periodDate, Convert.ToDouble(row[3]))); } dataSeries = new DataSeriesViewModel("Generación", dataPoints); dataSeriesList.Add(dataSeries); //Generación Objetivo dataTable = ResultsReader.ReadObjectiveGenerationByCompany(scenario, selctedCompany); dataPoints = new ObservableCollection <ChartDataPoint>(); foreach (DataRow row in dataTable.Rows) { int period = Convert.ToInt32(row[2]); string periodDate = ""; if (period <= DHOGDataBaseViewModel.PeriodsDate.GetLength(0)) { periodDate = DHOGDataBaseViewModel.PeriodsDate[period - 1]; } else { throw new Exception(MessageUtil.FormatMessage("ERROR.ChartDateNotFound", "Generación SIN", period)); } //dataPoints.Add(new ChartDataPoint(row[2].ToString(), Convert.ToDouble(row[3]))); dataPoints.Add(new ChartDataPoint(periodDate, Convert.ToDouble(row[3]))); } dataSeries = new DataSeriesViewModel("Generación Objetivo", dataPoints); dataSeriesList.Add(dataSeries); return(dataSeriesList); }
public static List <DataSeriesViewModel> GetSINGenerationDataSeries(int scenario, SINGenerationType generationType) { ObservableCollection <ChartDataPoint> dataPoints; DataSeriesViewModel dataSeries; List <DataSeriesViewModel> dataSeriesList = new List <DataSeriesViewModel>(); DataTable dataTable = ResultsReader.ReadSINGeneration(scenario, generationType); for (int i = 1; i < dataTable.Columns.Count; i++) { DataColumn column = dataTable.Columns[i]; dataPoints = new ObservableCollection <ChartDataPoint>(); foreach (DataRow row in dataTable.Rows) { int period = Convert.ToInt32(row[0]); string periodDate = ""; if (period <= DHOGDataBaseViewModel.PeriodsDate.GetLength(0)) { periodDate = DHOGDataBaseViewModel.PeriodsDate[period - 1]; } else { throw new Exception(MessageUtil.FormatMessage("ERROR.ChartDateNotFound", "Generación SIN", period)); } dataPoints.Add(new ChartDataPoint(periodDate, Convert.ToDouble(row[column]))); } dataSeries = new DataSeriesViewModel(column.ColumnName, dataPoints); dataSeriesList.Add(dataSeries); } dataTable = ResultsReader.ReadMarginalCost(scenario); dataPoints = new ObservableCollection <ChartDataPoint>(); foreach (DataRow row in dataTable.Rows) { int period = Convert.ToInt32(row[0]); string periodDate = ""; if (period <= DHOGDataBaseViewModel.PeriodsDate.GetLength(0)) { periodDate = DHOGDataBaseViewModel.PeriodsDate[period - 1]; } else { throw new Exception(MessageUtil.FormatMessage("ERROR.ChartDateNotFound", "Generación SIN", period)); } dataPoints.Add(new ChartDataPoint(periodDate, Convert.ToDouble(row[1]))); } dataSeries = new DataSeriesViewModel(dataTable.Columns[1].ColumnName, dataPoints); dataSeriesList.Add(dataSeries); return(dataSeriesList); }
/// <summary> /// Extends the reader by reading another set of records that are children of the previous results. /// </summary> /// <typeparam name="T1">The type of objects in the first set of results.</typeparam> /// <typeparam name="T2">The type of objects in the second set of results.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results object with child records.</returns> public static ResultsReader <T1> ThenChildren <T1, T2>( this ResultsReader <T1> previous, RecordReader <T2> recordReader, Action <T1, List <T2> > into = null) { if (previous == null) { throw new ArgumentNullException("previous"); } if (recordReader == null) { throw new ArgumentNullException("recordReader"); } return(previous.ThenChildren(recordReader.GroupByAuto <T1, object>(), null, into)); }
/// <summary> /// Extends the reader by reading another set of records that are children of the previous results. /// </summary> /// <typeparam name="T1">The type of objects in the first set of results.</typeparam> /// <typeparam name="T2">The type of objects in the second set of results.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results object with child records.</returns> public static ResultsReader <T1> ThenChildren <T1, T2>( this ResultsReader <T1> previous, IChildRecordReader <T2> recordReader, Action <T1, List <T2> > into = null) { if (previous == null) { throw new ArgumentNullException("previous"); } if (recordReader == null) { throw new ArgumentNullException("recordReader"); } return(previous.AddChild(new Children <T1, T2, object>(recordReader.GetGuardianReader <object>(), new ChildMapper <T1, T2, object>(null, into)))); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Bar elements Bar Elem Node 1 Node 2 B.1.1 1 6038 5857 B.1.1 2 5857 5642 B.1.1 3 5642 5405 B.1.1 4 5405 5123 B.2.1 5 5123 4686" ); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(FeaBar), "FeaBar should be parsed"); File.Delete(path); }
/// <summary> /// Extends the reader by reading another set of records that are children of the previous results. /// </summary> /// <typeparam name="T1">The type of objects in the first set of results.</typeparam> /// <typeparam name="T2">The type of objects in the second set of results.</typeparam> /// <typeparam name="TId">The type of the ID value.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="id">An optional function that extracts an ID from the object. Use when this row is a parent in a parent-child relationship.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results object with child records.</returns> public static ResultsReader <T1> ThenChildren <T1, T2, TId>( this ResultsReader <T1> previous, IChildRecordReader <T2, TId> recordReader, Func <T1, TId> id = null, Action <T1, List <T2> > into = null) { if (previous == null) { throw new ArgumentNullException("previous"); } if (recordReader == null) { throw new ArgumentNullException("recordReader"); } return(previous.AddChild(new Children <T1, T2, TId>(recordReader, new ChildMapper <T1, T2, TId>(id, into)))); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Shell, Utilization, Load comb.: Lyft Shell Max. RBX RBY RTX RTY BU SC CWB CWT [-] [%] [%] [%] [%] [%] [%] [-] [%] [%] P.1.1 1000 1000 1000 1000 1000 0 OK 0 0 P.2.1 78 78 31 71 66 0 OK 0 0 P.3.1 1000 1000 71 1000 71 0 OK 0 0 Max. of load combinations, Shell, Utilization Shell Max. Combination RBX RBY RTX RTY BU SC CWB CWT [-] [%] [-] [%] [%] [%] [%] [%] [-] [%] [%] P.1.1 1000 Lyft 1000 1000 1000 1000 0 OK 0 0 P.2.1 78 Lyft 78 31 71 66 0 OK 0 0 P.3.1 1000 Lyft 1000 71 1000 71 0 OK 0 0 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.All(r => r.GetType() == typeof(ShellUtilization)), "Shell utilization should be parsed"); Assert.IsTrue(results.Count == 6, "Should read all results."); var shellUtilization = results.Cast <ShellUtilization>().ToArray(); Assert.IsTrue(shellUtilization[0].Id == "P.1.1"); Assert.IsTrue(shellUtilization[1].Id == "P.2.1"); Assert.IsTrue(shellUtilization[2].Id == "P.3.1"); Assert.IsTrue(Math.Abs(shellUtilization[0].Max - 1000.0) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].Max - 78.0) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[2].Max - 1000.0) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].RBX - 78) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].RBY - 31) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].RTX - 71) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].RTY - 66) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].BU - 0) < DOUBLE_TOLERANCE); Assert.IsTrue(shellUtilization[1].SC == true); Assert.IsTrue(Math.Abs(shellUtilization[1].CWB - 0) < DOUBLE_TOLERANCE); Assert.IsTrue(Math.Abs(shellUtilization[1].CWT - 0) < DOUBLE_TOLERANCE); File.Delete(path); }
/// <summary> /// Extends the reader by reading another set of records that are children of a subobject of the previous results. /// </summary> /// <typeparam name="TRoot">The type of the root object that is returned.</typeparam> /// <typeparam name="TParent">The type of the parent object in the parent-child relationship.</typeparam> /// <typeparam name="TChild">The type of the child in the parent-child relationship.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="parents">A function that selects the list of parents from the root object.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results objects with children.</returns> public static ResultsReader <TRoot> ThenChildren <TRoot, TParent, TChild>( this ResultsReader <TRoot> previous, RecordReader <TChild> recordReader, Func <TRoot, IEnumerable <TParent> > parents, Action <TParent, List <TChild> > into = null) { if (previous == null) { throw new ArgumentNullException("previous"); } if (recordReader == null) { throw new ArgumentNullException("recordReader"); } return(previous.ThenChildren(recordReader.GroupByAuto <TParent, object>(), parents, null, into)); }
/// <summary> /// Extends the reader by reading another set of records that are children of a subobject of the previous results. /// </summary> /// <typeparam name="TRoot">The type of the root object that is returned.</typeparam> /// <typeparam name="TParent">The type of the parent object in the parent-child relationship.</typeparam> /// <typeparam name="TChild">The type of the child in the parent-child relationship.</typeparam> /// <typeparam name="TId">The type of the ID value.</typeparam> /// <param name="previous">The previous reader.</param> /// <param name="recordReader">The mapping that defines the layout of the records in each row.</param> /// <param name="parents">A function that selects the list of parents from the root object.</param> /// <param name="id">A function that selects the ID from a parent.</param> /// <param name="into">A function that assigns the children to their parent.</param> /// <returns>A reader that reads a Results objects with children.</returns> public static ResultsReader <TRoot> ThenChildren <TRoot, TParent, TChild, TId>( this ResultsReader <TRoot> previous, IChildRecordReader <TChild, TId> recordReader, Func <TRoot, IEnumerable <TParent> > parents, Func <TParent, TId> id = null, Action <TParent, List <TChild> > into = null) { if (previous == null) { throw new ArgumentNullException("previous"); } if (recordReader == null) { throw new ArgumentNullException("recordReader"); } return(previous.AddChild(new Children <TRoot, TChild, TId>(recordReader, new ChildMapper <TRoot, TParent, TChild, TId>(parents, id, into)))); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Bars, Stresses, Ultimate - Load case: Liveload - for selected objects ID x Sigma x'(max) Sigma x'(min) Sigma vm [-] [m] [N/mm2] [N/mm2] [N/mm2] Analyse_example_beam.1.1 0.000 0.000 0.000 0.000 Analyse_example_beam.1.1 1.230 0.908 -0.908 0.908 Analyse_example_beam.1.1 1.230 0.908 -0.908 0.908 Analyse_example_beam.1.1 2.460 3.632 -3.632 3.632 Analyse_example_beam.1.1 2.460 7.452 -7.452 7.452 Analyse_example_beam.1.1 4.980 3.972 -3.972 3.972 Analyse_example_beam.1.1 4.980 3.972 -3.972 3.972 Analyse_example_beam.1.1 7.500 10.239 -10.239 10.239 Analyse_example_beam.1.1 7.500 10.239 -10.239 10.239 Analyse_example_beam.1.1 11.250 4.183 -4.183 4.183 Analyse_example_beam.1.1 11.250 4.183 -4.183 4.183 Analyse_example_beam.1.1 15.000 0.000 0.000 0.132 Bars, Stresses, Ultimate - Load case: Deadload - for selected objects ID x Sigma x'(max) Sigma x'(min) Sigma vm [-] [m] [N/mm2] [N/mm2] [N/mm2] Analyse_example_beam.1.1 0.000 0.000 0.000 0.000 Analyse_example_beam.1.1 1.230 0.681 -0.681 0.681 Analyse_example_beam.1.1 1.230 0.681 -0.681 0.681 Analyse_example_beam.1.1 2.460 2.724 -2.724 2.724 Analyse_example_beam.1.1 2.460 0.480 -0.480 0.480 Analyse_example_beam.1.1 4.980 0.209 -0.209 0.209 Analyse_example_beam.1.1 4.980 0.209 -0.209 0.209 Analyse_example_beam.1.1 7.500 4.816 -4.816 4.816 Analyse_example_beam.1.1 7.500 4.816 -4.816 4.816 Analyse_example_beam.1.1 11.250 3.920 -3.920 3.920 Analyse_example_beam.1.1 11.250 3.920 -3.920 3.920 Analyse_example_beam.1.1 15.000 0.000 0.000 0.591" ); var results = ResultsReader.Parse(path); Assert.IsTrue(results[0].GetType() == typeof(BarStress), "Bar Stress should be parsed"); Assert.IsTrue(results[results.Count - 1].GetType() == typeof(BarStress), "Bar Stress should be parsed"); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Line connection, Resultants, Ultimate - Load case: Omapaino ID l/2 Fx' Fy' Fz' Mx' My' Mz' [m] [kN] [kN] [kN] [kNm] [kNm] [kNm] PP.1.CE.1 2.500 -0.020 0.001 -29.668 0.000 -3.966 0.002 PP.1.CE.2 1.250 0.094 2.144 -3.131 0.000 -0.041 1.857 PP.1.CE.3 2.500 2.125 -0.093 -29.701 0.000 3.862 1.006 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 3); Assert.IsTrue(results.First().GetType() == typeof(LineConnectionResultant)); Assert.IsTrue(results.Last().GetType() == typeof(LineConnectionResultant)); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Quantity estimation, Concrete Storey Struct. Identifier Quality Section/ Height Width Subtotal Volume Total weight Formwork Reinforcement type Thickness[m] [m] [m] [m,m2] [m3] [t] [m2] [kg/m, kg/m2] - Plate P.1 C40/50 0.200 4.000 0.800 2.039 5.600 0.000 - Plate P.11 C40/50 0.200 10.000 2.000 5.097 22.800 0.000 - Wall W.8 C40/50 0.200 3.00 2.00 6.000 1.200 3.058 13.600 0.000 TOTAL 4.000 10.194 42.000 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 3, "Should read all results"); Assert.IsTrue(results.All(r => r.GetType() == typeof(QuantityEstimationConcrete))); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Line connection forces, Ultimate - Load case: Omapaino No. Elem Node Fx' Fy' Fz' Mx' My' Mz' Fr Mr [-] [-] [-] [kN/m] [kN/m] [kN/m] [kNm/m] [kNm/m] [kNm/m] [kN/m] [kNm/m] PP.1.CE.1 649 385 -0.013 0.031 -41.232 0.000 0.000 0.000 41.232 0.000 PP.1.CE.1 649 1648 -0.015 -0.009 -6.096 0.000 0.000 0.000 6.096 0.000 PP.1.CE.1 649 1382 -0.014 0.009 -19.386 0.000 0.000 0.000 19.386 0.000 PP.1.CE.1 650 1648 -0.015 -0.009 -6.096 0.000 0.000 0.000 6.096 0.000 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 4); Assert.IsTrue(results.First().GetType() == typeof(LineConnectionForce)); Assert.IsTrue(results.Last().GetType() == typeof(LineConnectionForce)); File.Delete(path); }
public void Parse() { string path = Path.GetTempFileName(); using (var stream = new StreamWriter(path)) stream.Write(@"Nodal vibration shapes, 1 ID Node ex ey ez fix fiy fiz [-] [-] [-] [-] [-] [-] [-] [-] B.1.1 5405 -0.045 0.034 -0.021 -0.014 0.002 0.013 B.1.1 5123 -0.047 0.033 -0.023 -0.021 -0.004 0.013 B.1.1 5642 -0.044 0.035 -0.020 -0.012 0.004 0.013 B.1.1 5857 -0.042 0.036 -0.019 -0.014 0.001 0.013 B.1.1 6038 -0.041 0.037 -0.018 -0.020 -0.008 0.014 "); var results = ResultsReader.Parse(path); Assert.IsTrue(results.Count == 5); Assert.IsTrue(results.First().GetType() == typeof(NodalVibration)); Assert.IsTrue(results.Last().GetType() == typeof(NodalVibration)); File.Delete(path); }