private void UpdateConsolidatieGrid() { SpecificTestInformation specific = Model.SpecificTestInformation[0]; GenericTestInformation generic = Model.GenericTestInformation; int duration = 0; float deltaH = 0; float normal_stress = 0; for (int i = 0; i < Model.dataPoints.Length; i++) { if (Model.dataPoints[i].stage_number == 2) { duration = (int)Math.Round((float)Model.dataPoints[i - 1].time_since_start_stage / 3600); normal_stress = (int)Math.Round((float)Model.dataPoints[i].normal_stress); } if (Model.dataPoints[i].axial_displacement > deltaH) { deltaH = Model.dataPoints[i].axial_displacement; } } List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Δh:", deltaH.ToString(), "mm")); items.Add(new GeneralDataEntry("h na consolidatie:", (generic.InitieleHoogte - deltaH).ToString(), "mm")); items.Add(new GeneralDataEntry("Normal stress:", Utilities.RoundTo(normal_stress, 1).ToString(), "kPa")); items.Add(new GeneralDataEntry("Duur:", duration.ToString(), "uur")); ConsolidatieGrid.ItemsSource = items; }
private void Continue_Button_Click(object sender, RoutedEventArgs e) { GenericTestInformation genericTestInformation = GenericInformationComponent.GetInformation(); if (genericTestInformation == null) { return; } SpecificTestInformation[] specific = new SpecificTestInformation[3]; int i = 0; foreach (SpecificTestInformationComponent component in InformationComponents) { if (component == null) { continue; } SpecificTestInformation info = component.GetInformation(); if (info == null) { return; } else { specific[i] = info; i++; } } ResultsWindow wind = new ResultsWindow(FileNames, genericTestInformation, specific); wind.Show(); }
public GenericTestInformation GetInformation() { GenericTestInformation information = new GenericTestInformation(); information.Project = ProjectField.Text; information.Projectnummer = ProjectnummerField.Text; information.Laborant = LaborantField.Text; information.Adviseur = AdviseurField.Text; information.Teamleider = TeamleiderField.Text; try { information.InitieleHoogte = Convert.ToDouble(InitieleHoogteField.Text); } catch { MessageBox.Show("Waarde Initiele hoogte (" + InitieleHoogteField.Text + ") is geen decimale waarde"); return(null); } try { information.Diameter = Convert.ToDouble(DiameterField.Text); } catch { MessageBox.Show("Waarde diameter (" + DiameterField.Text + ") is geen decimale waarde"); return(null); } information.GrondSoort = GrondsoortField.Text; information.SoortMonster = SoortMonsterField.Text; information.Correctie = CorrectieField.Text; try { information.CorrectieWaardeA = Convert.ToDouble(CorrectieAField.Text); } catch { MessageBox.Show("Correctiewaarde a (" + CorrectieAField.Text + ") is geen decimale waarde"); return(null); } try { information.CorrectieWaardeB = Convert.ToDouble(CorrectieBField.Text); } catch { MessageBox.Show("Correctiewaarde b (" + CorrectieBField.Text + ") is geen decimale waarde"); return(null); } return(information); }
private void UpdatePersonnelGrid() { GenericTestInformation generic = Model.GenericTestInformation; List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Laborant:", generic.Laborant, "")); items.Add(new GeneralDataEntry("Adviseur:", generic.Adviseur, "")); items.Add(new GeneralDataEntry("Teamleider:", generic.Teamleider, "")); PersonnelGrid.ItemsSource = items; }
private void UpdateAfschuifGrid() { SpecificTestInformation specific = Model.SpecificTestInformation[0]; GenericTestInformation generic = Model.GenericTestInformation; float max_horizontal_strain = 0; float max_stage_time = 0; float max_horizontal_stress = 0; int max_tau_index = 0; for (int i = 0; i < Model.dataPoints.Length; i++) { if (Model.dataPoints[i].horizontal_strain > max_horizontal_strain) { max_horizontal_strain = Model.dataPoints[i].horizontal_strain; } if (Model.dataPoints[i].stage_number == 2 && Model.dataPoints[i].time_since_start_stage > max_stage_time) { max_stage_time = Model.dataPoints[i].time_since_start_stage; } if (Model.dataPoints[i].horizontal_stress > max_horizontal_stress) { max_horizontal_stress = Model.dataPoints[i].horizontal_stress; max_tau_index = i; } } float afschuifsnelheid = max_horizontal_strain / max_stage_time * 3600; float max_tau = Model.dataPoints[max_tau_index].horizontal_strain; float max_shear = calculateMaxShear(); float best_error = float.MaxValue; float target = max_shear / 2; float horizontal_strain_at_target = 0; for (int i = 0; i < Model.dataPoints.Length; i++) { float current_error = Math.Abs(target - Model.dataPoints[i].horizontal_stress); if (current_error < best_error) { best_error = current_error; horizontal_strain_at_target = Model.dataPoints[i].horizontal_strain; } } float g50 = max_shear / 2 / horizontal_strain_at_target / 10; List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Afschuifsnelheid:", Utilities.RoundTo(afschuifsnelheid, 1).ToString(), "%/h")); items.Add(new GeneralDataEntry("Max. shear stress:", Utilities.RoundTo(max_horizontal_stress, 1).ToString(), "kPa")); items.Add(new GeneralDataEntry("Shear strain bij max.", Utilities.RoundTo(max_tau, 1).ToString(), "%")); items.Add(new GeneralDataEntry("G" + '\u2085' + '\u2080' + ":", Utilities.RoundTo(g50, 3).ToString(), "Mpa")); AfschuifGrid.ItemsSource = items; }
private void UpdateEigenschappenMonsterGrid() { SpecificTestInformation specific = Model.SpecificTestInformation[0]; GenericTestInformation generic = Model.GenericTestInformation; List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Initiële hoogte:", generic.InitieleHoogte.ToString(), "mm")); items.Add(new GeneralDataEntry("Initiëel volumegewicht γ:", specific.InitieelVolumegewicht.ToString(), "kN/m3")); items.Add(new GeneralDataEntry("Droog volumegewicht γ:", specific.DroogVolumegewicht.ToString(), "kN/m3")); items.Add(new GeneralDataEntry("Watergehalte:", specific.WatergehalteVoor.ToString(), "%")); EigenschappenMonsterGrid.ItemsSource = items; }
private void UpdateProjectGrid() { GenericTestInformation generic = Model.GenericTestInformation; SpecificTestInformation specific = Model.SpecificTestInformation[0]; List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Project:", generic.Project, "")); items.Add(new GeneralDataEntry("", specific.Boring, "")); items.Add(new GeneralDataEntry("", generic.Projectnummer, "")); items.Add(new GeneralDataEntry("", "DIRECT SIMPLE SHEAR TEST", "")); ProjectGrid.ItemsSource = items; }
private void UpdateBoringGrid() { GenericTestInformation generic = Model.GenericTestInformation; SpecificTestInformation specific = Model.SpecificTestInformation[0]; List <GeneralDataEntry> items = new List <GeneralDataEntry>(); items.Add(new GeneralDataEntry("Boring:", specific.Boring, "")); items.Add(new GeneralDataEntry("Monsterdiepte:", "MV " + specific.MonsterDiepteMaaiveld + " m", "")); items.Add(new GeneralDataEntry("", "MV NAP " + specific.MonsterDiepteNAP + " m", "")); items.Add(new GeneralDataEntry("", "NAP " + specific.DiepteMaaiveld + " m", "")); items.Add(new GeneralDataEntry("Grondsoort:", generic.GrondSoort, "")); items.Add(new GeneralDataEntry("Monsterklasse:", specific.MonsterKlasse.ToString(), "")); items.Add(new GeneralDataEntry("Datum proef:", specific.DatumProef, "")); BoringGrid.ItemsSource = items; }
public ResultsWindow(String[] fileNames, GenericTestInformation testInformation, SpecificTestInformation[] specificTestInformation) { InitializeComponent(); var engine = new FileHelperEngine <DataPoint>(); var numberOfFiles = fileNames.Length; GenericTestInformation = testInformation; SpecificTestInformation = specificTestInformation; DataPoint[][] resultArrays = new DataPoint[numberOfFiles][]; ShearViewModel[] models = new ShearViewModel[numberOfFiles]; for (int i = 0; i < fileNames.Length; i++) { resultArrays[i] = engine.ReadFile(fileNames[i]); models[i] = new ShearViewModel(resultArrays[i], GenericTestInformation, SpecificTestInformation); } GenericTestInformation = testInformation; SpecificTestInformation = specificTestInformation; for (int i = 0; i < numberOfFiles; i++) { ResultScrollViewer resultScrollViewer = new ResultScrollViewer(i + 1); resultScrollViewer.ShearDataGrid.Model = models[i]; resultScrollViewer.GeneralDataGrid.Model = models[i]; TabItem tabItem = new TabItem { Header = "Resultaten " + (i + 1) }; SeriesCollectionConfiguration shearStrainHorizontalStress = new SeriesCollectionConfiguration { Types = new SeriesCollectionType[] { SeriesCollectionType.ShearStrainHorizontalStress }, DataPoints = resultArrays[i], HasLogarithmicX = false, HasLogarithmicY = false }; SeriesCollectionConfiguration normalStressShearStress = new SeriesCollectionConfiguration { Types = new SeriesCollectionType[] { SeriesCollectionType.NormalStressShearStress }, DataPoints = resultArrays[i], HasLogarithmicX = false, HasLogarithmicY = false }; SeriesCollectionConfiguration timeAxialStrain = new SeriesCollectionConfiguration { Types = new SeriesCollectionType[] { SeriesCollectionType.TimeAxialStrain }, DataPoints = resultArrays[i], HasLogarithmicX = true, HasLogarithmicY = false }; SeriesCollectionConfiguration shearStrainNormalStressAndShearStrainPorePressure = new SeriesCollectionConfiguration { Types = new SeriesCollectionType[] { SeriesCollectionType.ShearStrainNormalStress, SeriesCollectionType.ShearStrainPorePressure }, DataPoints = resultArrays[i], HasLogarithmicX = false, HasLogarithmicY = false }; SeriesCollectionConfiguration horizontalStrainSecantGModulus = new SeriesCollectionConfiguration { Types = new SeriesCollectionType[] { SeriesCollectionType.HorizontalStrainSecantGModulus }, DataPoints = resultArrays[i], HasLogarithmicX = true, HasLogarithmicY = true }; resultScrollViewer.ShearStrainHorizontalStress = SeriesCollectionManager.SeriesCollectionForConfiguration(shearStrainHorizontalStress); resultScrollViewer.NormalStressShearStress = SeriesCollectionManager.SeriesCollectionForConfiguration(normalStressShearStress); resultScrollViewer.TimeAxialStrain = SeriesCollectionManager.SeriesCollectionForConfiguration(timeAxialStrain); resultScrollViewer.ShearStrainNormalStressAndShearStrainPorePressure = SeriesCollectionManager.SeriesCollectionForConfiguration(shearStrainNormalStressAndShearStrainPorePressure); resultScrollViewer.HorizontalStrainSecantGModulus = SeriesCollectionManager.SeriesCollectionForConfiguration(horizontalStrainSecantGModulus); tabItem.Content = resultScrollViewer; TabControl.Items.Add(tabItem); } Formatter = value => Math.Pow(10, value).ToString("N", CultureInfo.CreateSpecificCulture("nl")); Base = 10; DataContext = this; }