Ejemplo n.º 1
0
		public ResultDiagram(OutputData outputData, int sizeX, int sizeY)
		{
			_data = outputData.Data;
			_sizeX = sizeX;
			_sizeY = sizeY;
			Drawing();
		}
		public ProjectionIndicatorHelperDiagram(OutputData outputData, double radius, GraphSize diapason, double sc)
		{
			_data = outputData.Data;
			_radius = radius;
			_diapason = diapason;
			_sc = sc;
			Drawing();
		}
Ejemplo n.º 3
0
		public IndicatorDiagram(OutputData outputData, ref List<double> mainCurve)
		{
			_data = outputData.Data;
			Drawing();
			var indProjDiagram = new ProjectionIndicatorDiagram(outputData, _sizeX, _sizeY, _mainCurve1X, _mainCurve1Y, _mainCurve2X, _mainCurve2Y, _p0, _sc, ref mainCurve);
			if (mainCurve == null)
			{
				var indHelpDiagram = new ProjectionIndicatorHelperDiagram(outputData, _radius, Graph.Opt.Diapason, _sc);
				var resDiagram = new ResultDiagram(outputData, _sizeX, _sizeY);
				new ToA1(new List<Graph> { Graph, indProjDiagram.Graph, indHelpDiagram.Graph, resDiagram.Graph }, _p0, (byte)App.CurrentEngineType);
				GC.Collect();
				GC.WaitForFullGCComplete();
			}
		}
		public void DrawEspeciallyOutputData(OutputData inputData)
		{
			var i = 1;
			foreach (var metaData in inputData.Data)
			{
				var textBox = InputData.GetElements<TextBox>(InputDataGrid, i, 1).Count == 0 ? null : InputData.GetElements<TextBox>(InputDataGrid, i, 1)[0];
				if (textBox != null && textBox.Name == metaData.Key)
				{
					textBox.Text = Math.Round(metaData.Value.Val, 3).ToString(CultureInfo.InstalledUICulture);
					i++;
				}
				else
					if (textBox == null)
						i++;
			}
		}
		public ProjectionIndicatorDiagram(OutputData outputData, int sizeX, int sizeY, List<double> x1, List<double> y1, List<double> x2, List<double> y2, double p0, double sc, ref List<double> mainCurve)
		{
			_data = outputData.Data;
			_sizeX = sizeX;
			_sizeY = sizeY;
			_mainCurve1X = x1;
			_mainCurve2X = x2;
			_mainCurve1Y = y1;
			_mainCurve2Y = y2;
			_p0 = p0;
			_sc = sc;
			Drawing();
			if (mainCurve == null)
			{
				PSumCurve();//Shit
			}
			else
				Interpolation(ref mainCurve);
		}
Ejemplo n.º 6
0
		private void DynamicResultTable(ref Table table, OutputData outputData)
		{
			var mainRow = new TableRow();
			var subTable = new Table { CellSpacing = 0, BorderThickness = new Thickness(2), BorderBrush = Brushes.Gray };
			var rowGroup = new TableRowGroup();
			var titleRow = new TableRow();
			var subTitleRow = new TableRow();
			titleRow.Cells.Add(new TableCell(new Paragraph(new Run("Підсумкова таблиця") { FontWeight = FontWeights.Bold, Foreground = Brushes.Gray }) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { ColumnSpan = 11, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("φ°")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("cosφ+λcos2φ")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pr, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pj, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("PΣ, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("tgβ")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("N")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("cos(φ+β)/cosβ")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("K")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("sin(φ+β)/cosβ")) { Margin = new Thickness(10) }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("T")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });

			rowGroup.Rows.Add(titleRow);
			rowGroup.Rows.Add(subTitleRow);
			var iModification = 0;
			for (var i = 0; i < 27; i++)
			{
				var dataRow = new TableRow();
				if (i % 2 == 0)
					dataRow.Background = Brushes.AliceBlue;
				var angle = (i - iModification) * 30;
				var calcTagVal = angle % 360 < 180
					? outputData.ValsTan[outputData.InputData.Data["RatioRadiusCrankToRod"].Val][angle % 180 / 30]
					: -outputData.ValsTan[outputData.InputData.Data["RatioRadiusCrankToRod"].Val][angle % 180 / 30];
				var calcCosPerCos = outputData.ValCosPerCos[outputData.InputData.Data["RatioRadiusCrankToRod"].Val][angle % 360 / 30];
				var calcSinPerCos = outputData.ValSinPerCos[outputData.InputData.Data["RatioRadiusCrankToRod"].Val][angle % 360 / 30];
				if (i != 13 && i != 20)
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - iModification) * 30).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(
						Math.Round(Math.Cos(Graph.DegreeToRadian(angle)) + outputData.InputData.Data["RatioRadiusCrankToRod"].Val * Math.Cos(Graph.DegreeToRadian(angle * 2)), 3)
						.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				}
				else if (i == 13)
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - 1) * 30 + "Max").ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(
						Math.Round(Math.Cos(Graph.DegreeToRadian((i - 1) * 30)) + outputData.InputData.Data["RatioRadiusCrankToRod"].Val * Math.Cos(Graph.DegreeToRadian((i - 1) * 30 * 2)), 3)
						.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					iModification++;
					calcTagVal = 0;
					calcCosPerCos = 1;
					calcSinPerCos = 0;
				}
				else
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - 2) * 30 + "Min").ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(
						Math.Round(Math.Cos(Graph.DegreeToRadian((i - 2) * 30)) + outputData.InputData.Data["RatioRadiusCrankToRod"].Val * Math.Cos(Graph.DegreeToRadian((i - 2) * 30 * 2)), 3)
						.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					iModification++;
					calcTagVal = 0;
					calcCosPerCos = -1;
					calcSinPerCos = 0;
				}
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["MainCurve" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["OrdinatesSpecificSummaryForces" + i].Val - outputData.Data["MainCurve" + i].Val).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["OrdinatesSpecificSummaryForces" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(calcTagVal.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["LateralForce" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(calcCosPerCos.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["ForceK" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(calcSinPerCos.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["ForceT" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				rowGroup.Rows.Add(dataRow);
			}
			subTable.RowGroups.Add(rowGroup);
			mainRow.Cells.Add(new TableCell(subTable) { ColumnSpan = 6, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1) });
			table.RowGroups[table.RowGroups.Count - 1].Rows.Add(mainRow);
		}
Ejemplo n.º 7
0
		private void DynamicOrdinatesSpecificSummaryForces(ref Table table, OutputData outputData)
		{
			var mainRow = new TableRow();
			var subTable = new Table { CellSpacing = 0, BorderThickness = new Thickness(2), BorderBrush = Brushes.Gray };
			var rowGroup = new TableRowGroup();
			var titleRow = new TableRow();
			var subTitleRow = new TableRow();
			titleRow.Cells.Add(new TableCell(new Paragraph(new Run("Визначення ординат питомих підсумкових сил") { FontWeight = FontWeights.Bold, Foreground = Brushes.Gray }) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { ColumnSpan = 4, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("φ°")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pr, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pj, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("PΣ, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });

			rowGroup.Rows.Add(titleRow);
			rowGroup.Rows.Add(subTitleRow);
			var iModification = 0;
			for (var i = 0; i < 27; i++)
			{
				var dataRow = new TableRow();
				if (i % 2 == 0)
					dataRow.Background = Brushes.AliceBlue;
				if (i != 13 && i != 20)
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - iModification) * 30).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				else if (i == 13)
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - 1) * 30 + "Max").ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					iModification++;
				}
				else
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(((i - 2) * 30 + "Min").ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					iModification++;
				}
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["MainCurve" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["OrdinatesSpecificSummaryForces" + i].Val - outputData.Data["MainCurve" + i].Val).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["OrdinatesSpecificSummaryForces" + i].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				rowGroup.Rows.Add(dataRow);
			}
			subTable.RowGroups.Add(rowGroup);
			mainRow.Cells.Add(new TableCell(subTable) { ColumnSpan = 6, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1) });
			table.RowGroups[table.RowGroups.Count - 1].Rows.Add(mainRow);
		}
Ejemplo n.º 8
0
		private void DynamicSpecificOrdinatesInertialForces(ref Table table, OutputData outputData)
		{
			var mainRow = new TableRow();
			var subTable = new Table { CellSpacing = 0, BorderThickness = new Thickness(2), BorderBrush = Brushes.Gray };
			var rowGroup = new TableRowGroup();
			var titleRow = new TableRow();
			var subTitleRow = new TableRow();
			titleRow.Cells.Add(new TableCell(new Paragraph(new Run("Визначення ординат питомих сил інерції") { FontWeight = FontWeights.Bold, Foreground = Brushes.Gray }) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { ColumnSpan = 7, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("φ°")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("mj, кг/м^2")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("ω^2, c^-1")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("r・10^-6, м")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("cosφ + λcos2φ")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pj, H/м^2")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pj, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });

			rowGroup.Rows.Add(titleRow);
			rowGroup.Rows.Add(subTitleRow);
			for (var i = 0; i <= 180; i += 30)
			{
				var dataRow = new TableRow();
				if (i / 30 % 2 == 0)
					dataRow.Background = Brushes.AliceBlue;
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(i.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				var radiusOfCrank = outputData.Data["RadiusOfCrank"].Val * outputData.Data["ConstructiveMassRotatingMotion"].Val *
				 Math.Pow(outputData.Data["AngularVelocityCrankshaft"].Val, 2) * 0.000000001 * -1;
				if (i / 30 == 3)
				{
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(-outputData.Data["ConstructiveMassRotatingMotion"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { Background = Brushes.White, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(Math.Pow(outputData.Data["AngularVelocityCrankshaft"].Val, 2), 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { Background = Brushes.White, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
					dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round((radiusOfCrank), 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { Background = Brushes.White, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				}
				else
					//Magic
					for (var j = 0; j < 3; j++)
						dataRow.Cells.Add(new TableCell(new Paragraph()) { Background = Brushes.White, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				var cosPlusCos = outputData.ValsCosPlusCos[outputData.InputData.Data["RatioRadiusCrankToRod"].Val][i / 30];
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(cosPlusCos.ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(cosPlusCos * radiusOfCrank, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["InertiaEngineParts" + i].Val).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1, 0, 1, 0) });
				rowGroup.Rows.Add(dataRow);
			}
			subTable.RowGroups.Add(rowGroup);
			mainRow.Cells.Add(new TableCell(subTable) { ColumnSpan = 6, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1) });
			table.RowGroups[table.RowGroups.Count - 1].Rows.Add(mainRow);
		}
Ejemplo n.º 9
0
		private void DynamicInputDataRows(ref Table table, OutputData outputData)
		{
			var mainRow = new TableRow();
			var subTable = new Table { CellSpacing = 0, BorderThickness = new Thickness(2), BorderBrush = Brushes.Gray };
			var rowGroup = new TableRowGroup();
			var titleRow = new TableRow();
			var subTitleRow = new TableRow();
			var dataRow = new TableRow();
			titleRow.Cells.Add(new TableCell(new Paragraph(new Run("Вхідні дані для динамічного розрахунку") { FontWeight = FontWeights.Bold, Foreground = Brushes.Gray }) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { ColumnSpan = 6, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("S, мм")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center}) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Po, МПа")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pa, МПа")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pc, МПа")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pz, МПа")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			subTitleRow.Cells.Add(new TableCell(new Paragraph(new Run("Pв, МПа")) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["PistonStroke"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["ChargeDensity"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["PressureInlet"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["PressureCompression"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["MaxPressure"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray, Background = Brushes.AliceBlue });
			dataRow.Cells.Add(new TableCell(new Paragraph(new Run(Math.Round(outputData.Data["PressureExtension"].Val, 3).ToString(CultureInfo.InstalledUICulture))) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { BorderThickness = new Thickness(1), BorderBrush = Brushes.Gray });
			var row = new TableRow();
			row.Cells.Add(new TableCell(new Paragraph(new Run("Хід поршня еквівалентний об'єму камери згоряння, мм") { FontWeight = FontWeights.Bold, Foreground = Brushes.Gray }) { Margin = new Thickness(10), TextAlignment = TextAlignment.Center }) { ColumnSpan = 6, Background = Brushes.AliceBlue });
			rowGroup.Rows.Add(titleRow);
			rowGroup.Rows.Add(subTitleRow);
			rowGroup.Rows.Add(dataRow);
			rowGroup.Rows.Add(row);
			subTable.RowGroups.Add(rowGroup);
			mainRow.Cells.Add(new TableCell(subTable) { ColumnSpan = 6, BorderBrush = Brushes.Gray, BorderThickness = new Thickness(1) });
			table.RowGroups[table.RowGroups.Count - 1].Rows.Add(mainRow);
		}
		private void Window_Loaded(object sender, RoutedEventArgs e)
		{
			_outputData = new OutputData(_inputData);
			InitReporter(_outputData);
		}
Ejemplo n.º 11
0
		private void BuildGraph_OnClick(object sender, RoutedEventArgs e)
		{
			var inputData = new InputData();
			NewInputData(_thermalPage.InputDataGrid, ref inputData);
			NewInputData(_dynamicPage.InputDataGrid, ref inputData);
			var outputData = new OutputData(inputData);

			var thread = new Thread(BuildGraphAsync);
			thread.SetApartmentState(ApartmentState.STA);
			thread.Start(outputData);
		}