private void BottomBedLoadFluxApplyAll() { RiverSimulationProfile.TwoInOne o = _data as RiverSimulationProfile.TwoInOne; for (int kw = 1; kw < p.sedimentParticlesNumber; ++kw) { for (int tw = jStart; tw < jStart + (p.IsConstantFlowType() ? 1 : p.boundaryTimeNumber); ++tw) { for (int jw = iStart; jw < iStart + p.inputGrid.GetJ; ++jw) { o.Array3D()[kw, jw - iStart, tw - jStart] = o.Array3D()[0, jw - iStart, tw - jStart]; } } } }
private bool ConvertType7() { try { RiverSimulationProfile.TwoInOne o = _data as RiverSimulationProfile.TwoInOne; for (int i = 0; i < colCount; ++i) { o.Array3D()[i, 0, 0] = Convert.ToDouble(dataGridView1[i, 0].Value); o.Array3D()[i, 0, 1] = Convert.ToDouble(dataGridView2[i, 0].Value); o.Array3D()[i, 0, 2] = Convert.ToDouble(dataGridView3[i, 0].Value); } } catch { return(false); } return(true); }
private bool ConvertDepthAverageConcentrationData() { try { DataGridView v = dataGridView; RiverSimulationProfile.TwoInOne o = _data as RiverSimulationProfile.TwoInOne; switch (o.type) { case RiverSimulationProfile.TwoInOne.Type.None: case RiverSimulationProfile.TwoInOne.Type.UseValue: for (int tw = jStart; tw < jStart + 1; ++tw) { for (int kw = iStart; kw < iStart + p.sedimentParticlesNumber; ++kw) { o.Value3D()[kw - iStart, 0, 0] = Convert.ToDouble(v[kw, tw].Value); } } break; case RiverSimulationProfile.TwoInOne.Type.UseArray: for (int jw = jStart; jw < jStart + p.inputGrid.GetI; ++jw) { for (int iw = iStart; iw < iStart + p.inputGrid.GetJ; ++iw) { o.Array3D()[tabIndex, iw - iStart, jw - jStart] = Convert.ToDouble(v[iw, jw].Value); } } break; } } catch { return(false); } return(true); }
private bool ConvertBottomBedLoadFluxData() { try { DataGridView v = dataGridView; RiverSimulationProfile.TwoInOne o = _data as RiverSimulationProfile.TwoInOne; switch (o.type) { case RiverSimulationProfile.TwoInOne.Type.None: case RiverSimulationProfile.TwoInOne.Type.UseValue: for (int tw = jStart; tw < jStart + (p.IsConstantFlowType() ? 1 : p.boundaryTimeNumber); ++tw) { for (int kw = iStart; kw < iStart + p.sedimentParticlesNumber; ++kw) { o.Value3D()[kw - iStart, 0, tw - jStart] = Convert.ToDouble(v[kw, tw].Value); } } break; case RiverSimulationProfile.TwoInOne.Type.UseArray: for (int tw = jStart; tw < jStart + (p.IsConstantFlowType() ? 1 : p.boundaryTimeNumber); ++tw) { for (int jw = iStart; jw < iStart + p.inputGrid.GetJ; ++jw) { o.Array3D()[tabIndex, jw - iStart, tw - jStart] = Convert.ToDouble(v[jw + 1, tw + 1].Value); } } break; } } catch { return(false); } return(true); }
private void FillDataGridView() { RiverSimulationProfile.TwoInOne o = _data as RiverSimulationProfile.TwoInOne; if (formType == FormType.FlowQuantity || formType == FormType.WaterLevel) { switch (o.type) { case RiverSimulationProfile.TwoInOne.Type.None: case RiverSimulationProfile.TwoInOne.Type.UseValue: for (int jw = jStart; jw < jStart + rowCount; ++jw) { dataGridView[iStart, jw].Value = o.Value2D()[0, jw - jStart].ToString(); dataGridView[iStart, jw].ReadOnly = false; dataGridView[iStart, jw].Style.BackColor = tabPageItemColor; } dataGridView.CurrentCell = dataGridView[iStart, jStart]; //dataGridView[1, jStart]. = true; break; case RiverSimulationProfile.TwoInOne.Type.UseArray: if (formType == FormType.FlowQuantity) { for (int jw = jStart; jw < jStart + rowCount; ++jw) { dataGridView[iStart, jw].Value = o.Value2D()[0, jw - jStart].ToString(); dataGridView[iStart, jw].ReadOnly = true; dataGridView[iStart, jw].Style.BackColor = tabPageItemColor2; } } for (int jw = jStart; jw < jStart + rowCount; ++jw) { for (int iw = iStart; iw < iStart + colCount; ++iw) { if (formType == FormType.FlowQuantity) { dataGridView[iw + 1, jw].Value = o.Array2D()[iw - iStart, jw - jStart].ToString(); dataGridView[iw + 1, jw].ReadOnly = false; dataGridView[iw + 1, jw].Style.BackColor = tabPageItemColor; } else { dataGridView[iw, jw].Value = o.Array2D()[iw - iStart, jw - jStart].ToString(); dataGridView[iw, jw].ReadOnly = false; dataGridView[iw, jw].Style.BackColor = tabPageItemColor; } } } if (formType == FormType.FlowQuantity) { AutoFinishConvertFlowQualityCell(); } dataGridView.CurrentCell = dataGridView[iStart, jStart]; break; } } else if (formType == FormType.BottomBedLoadFlux) { switch (o.type) { case RiverSimulationProfile.TwoInOne.Type.None: case RiverSimulationProfile.TwoInOne.Type.UseValue: for (int tw = jStart; tw < jStart + (p.IsConstantFlowType() ? 1 : p.boundaryTimeNumber); ++tw) { for (int kw = iStart; kw < iStart + p.sedimentParticlesNumber; ++kw) { dataGridView[kw, tw].Value = o.Value3D()[kw - iStart, 0, tw - jStart].ToString(); dataGridView[kw, tw].ReadOnly = false; dataGridView[kw, tw].Style.BackColor = tabPageItemColor; } } dataGridView.CurrentCell = dataGridView[iStart, jStart]; break; case RiverSimulationProfile.TwoInOne.Type.UseArray: for (int tw = jStart; tw < jStart + (p.IsConstantFlowType() ? 1 : p.boundaryTimeNumber); ++tw) { for (int jw = iStart; jw < iStart + p.inputGrid.GetJ; ++jw) { dataGridView[jw + 1, tw + 1].Value = o.Array3D()[tabIndex, jw - iStart, tw - jStart].ToString(); dataGridView[jw + 1, tw + 1].ReadOnly = false; dataGridView[jw + 1, tw + 1].Style.BackColor = tabPageItemColor; } dataGridView[iStart, tw + 1].Value = o.Value3D()[tabIndex, 0, tw - jStart].ToString(); dataGridView[iStart, tw + 1].ReadOnly = true; dataGridView[iStart, tw + 1].Style.BackColor = tabPageItemColor2; } dataGridView.CurrentCell = dataGridView[iStart, jStart]; break; } } else if (formType == FormType.DepthAverageConcentration) { switch (o.type) { case RiverSimulationProfile.TwoInOne.Type.None: case RiverSimulationProfile.TwoInOne.Type.UseValue: for (int jw = jStart; jw < jStart + 1; ++jw) { for (int iw = iStart; iw < iStart + p.sedimentParticlesNumber; ++iw) { dataGridView[iw, jw].Value = o.Value3D()[iw - iStart, 0, 0].ToString(); dataGridView[iw, jw].ReadOnly = false; dataGridView[iw, jw].Style.BackColor = tabPageItemColor; } } dataGridView.CurrentCell = dataGridView[iStart, jStart]; break; case RiverSimulationProfile.TwoInOne.Type.UseArray: for (int jw = jStart; jw < jStart + p.inputGrid.GetI; ++jw) { for (int iw = iStart; iw < iStart + p.inputGrid.GetJ; ++iw) { dataGridView[iw, jw].Value = o.Array3D()[tabIndex, iw - iStart, jw - jStart].ToString(); dataGridView[iw, jw].ReadOnly = false; dataGridView[iw, jw].Style.BackColor = tabPageItemColor; } } dataGridView.CurrentCell = dataGridView[iStart, jStart]; break; } } dataGridView.PerformLayout(); }