private void btnPrevElement_Click(object sender, EventArgs e) { if (SpFuncs.getInt(txtElementNo.Text) > 1) { int indx = this.app.AppDocument.ElementData.IndexOf(SpFuncs.getInt(txtElementNo.Text)); if (indx != -1) { this.app.AppDocument.ElementData[indx] = GetCElementData(); } else { indx = this.app.AppDocument.ElementData.Count - 1; txtElementNo.Text = (this.app.AppDocument.ElementData[indx].elementNo) + ""; return; } if (indx > 0) { txtElementNo.Text = (this.app.AppDocument.ElementData[indx - 1].elementNo) + ""; } if (indx == 0) { txtElementNo.Text = (this.app.AppDocument.ElementData[0].elementNo) + ""; } } }
private void SetIncreament() { //txtNodeNo.Text = SpFuncs.getInt(txtNodeNo.Text) + SpFuncs.getInt(txtNodeIncr.Text) + ""; double val = SpFuncs.getDouble(txtXIncr.Text); double dVal = 0; if (val != 0.0) { dVal = (SpFuncs.getDouble(txtX.Text) + SpFuncs.getDouble(txtXIncr.Text)); txtX.Text = dVal.ToString("0.000"); } val = SpFuncs.getDouble(txtYIncr.Text); if (val != 0.0) { dVal = (SpFuncs.getDouble(txtY.Text) + SpFuncs.getDouble(txtYIncr.Text)); txtY.Text = dVal.ToString("0.000"); } val = SpFuncs.getDouble(txtZIncr.Text); if (val != 0.0) { dVal = (SpFuncs.getDouble(txtZ.Text) + SpFuncs.getDouble(txtZIncr.Text)); txtZ.Text = dVal.ToString("0.000"); } SetStatus(); }
private void WorkWithNodeNo(int nodeNo) { cnd = new CNodeData(); cnd.NodeNo = SpFuncs.getInt(txtNodeNo.Text); int indx = aApp.AppDocument.NodeData.IndexOf(cnd); if (indx != -1) { ShowNodeData(this.aApp.AppDocument.NodeData[indx]); } else { cnd = new CNodeData(); cnd.NodeNo = aApp.AppDocument.NodeData.Count + 1; if (chkIncrOn.Checked) { SetIncreament(); cnd.X = SpFuncs.getDouble(txtX.Text); cnd.Y = SpFuncs.getDouble(txtY.Text); cnd.Z = SpFuncs.getDouble(txtZ.Text); ShowNodeData(cnd); } else { txtX.Text = ""; txtY.Text = ""; txtZ.Text = ""; txtX.Focus(); } //aApp.AppDocument.NodeData.Add(getCNodeData()); } }
private void btnOK_Click(object sender, EventArgs e) { spt = new CSupport(); spt.nodeNo = SpFuncs.getInt(txtNodeNo.Text); spt.dof0 = chkXt.Checked; spt.dof1 = chkYt.Checked; spt.dof2 = chkZt.Checked; spt.dof3 = chkXr.Checked; spt.dof4 = chkYr.Checked; spt.dof5 = chkZr.Checked; int indx = this.iApp.AppDocument.Support.IndexOf(spt.nodeNo); if (indx == -1) { if (spt.nodeNo > 0) { iApp.AppDocument.Support.Add(spt); txtNodeNo.Text = ""; txtNodeNo.Focus(); } } else { this.iApp.AppDocument.Support[indx] = spt; } SetAllSupport(); }
private void btnOk_Click(object sender, EventArgs e) { iApp.AppDocument.SelfWeight.loadcase = (cmbLoadFactorSet.SelectedIndex + 1); iApp.AppDocument.SelfWeight.SELFWEIGHTX = SpFuncs.getDouble(txtSelfWeightX.Text); iApp.AppDocument.SelfWeight.SELFWEIGHTY = SpFuncs.getDouble(txtSelfWeightY.Text); iApp.AppDocument.SelfWeight.SELFWEIGHTZ = SpFuncs.getDouble(txtSelfWeightZ.Text); this.Close(); }
private void txtLoadCase_TextChanged(object sender, EventArgs e) { setList(SpFuncs.getInt(txtLoadCase.Text)); if (lst.Count > 0 && txtNodeNo.Text == "") { txtNodeNo.Text = lst[0].ToString(); } setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); }
public void UpdateElementMultiplier(int selectedIndex) { CElementMultiplier cem = new CElementMultiplier(); cem.Pressure = SpFuncs.getDouble(txtPressure.Text); cem.thermalEffects = SpFuncs.getDouble(txtThermalEffects.Text); cem.XAcceleration = SpFuncs.getDouble(txtXAcceleration.Text); cem.YAcceleration = SpFuncs.getDouble(txtYAcceleration.Text); cem.ZAcceleration = SpFuncs.getDouble(txtZAcceleration.Text); this.app.AppDocument.ElementMultiplier[selectedIndex] = cem; }
private bool isPresent(string loadcase, string nodeNo) { for (int i = 0; i < this.iApp.AppDocument.MemberBeamLoad.Count; i++) { if (this.iApp.AppDocument.MemberBeamLoad[i].loadcase == SpFuncs.getInt(loadcase) && iApp.AppDocument.MemberBeamLoad[i].Node == SpFuncs.getInt(nodeNo)) { return(true); } } return(false); }
private void btnPrevProp_Click(object sender, EventArgs e) { int indx = this.app.AppDocument.MatPropertyInfo.IndexOf(SpFuncs.getInt(txtMatId.Text)); if (indx != -1) { this.app.AppDocument.MatPropertyInfo[indx] = GetCMaterialPropertyInformation(); } if (SpFuncs.getInt(txtMatId.Text) > 1) { txtMatId.Text = (SpFuncs.getInt(txtMatId.Text) - 1) + ""; } }
private void btnDelElement_Click(object sender, EventArgs e) { int index = this.app.AppDocument.ElementData.IndexOf(SpFuncs.getInt(txtElementNo.Text)); if (index != -1) { this.app.AppDocument.ElementData.RemoveAt(index); if (index < this.app.AppDocument.ElementData.Count) { txtElementNo.Text = this.app.AppDocument.ElementData[index].elementNo.ToString(); } } }
private void btnNextProp_Click(object sender, EventArgs e) { int indx = this.app.AppDocument.MatPropertyInfo.IndexOf(SpFuncs.getInt(txtMatId.Text)); if (indx == -1) { this.app.AppDocument.MatPropertyInfo.Add(GetCMaterialPropertyInformation()); } else { this.app.AppDocument.MatPropertyInfo[indx] = GetCMaterialPropertyInformation(); } txtMatId.Text = (SpFuncs.getInt(txtMatId.Text) + 1) + ""; txtMassDensity.Focus(); }
private CElementData GetCElementData() { CElementData ced = new CElementData(); ced.elementNo = SpFuncs.getInt(txtElementNo.Text); ced.node1 = SpFuncs.getInt(txtNode1.Text); ced.node2 = SpFuncs.getInt(txtNode2.Text); ced.node3 = SpFuncs.getInt(txtNode3.Text); ced.node4 = SpFuncs.getInt(txtNode4.Text); ced.matId = SpFuncs.getInt(txtMatIdRef.Text); ced.elementThickness = SpFuncs.getDouble(txtElementThick.Text); ced.distLateralPressure = SpFuncs.getDouble(txtDistLatPressure.Text); ced.meanTempVar = SpFuncs.getDouble(txtMeanTempVar.Text); ced.meanTempGrad = SpFuncs.getDouble(txtMeanTempGrad.Text); return(ced); }
private void addMemberLoad() { mbl = new CMemberBeamLoading(); mbl.Node = SpFuncs.getInt(txtNodeNo.Text); mbl.loadcase = SpFuncs.getInt(txtLoadCase.Text); mbl.fx = SpFuncs.getDouble(txtFx.Text); mbl.fy = SpFuncs.getDouble(txtFy.Text); mbl.fz = SpFuncs.getDouble(txtFz.Text); mbl.mx = SpFuncs.getDouble(txtMx.Text); mbl.my = SpFuncs.getDouble(txtMy.Text); mbl.mz = SpFuncs.getDouble(txtMz.Text); lst.Add(mbl.Node); iApp.AppDocument.MemberBeamLoad.Add(mbl); NodeNo = mbl.Node + 1; //txtNodeNo.Text = () + ""; }
private void SetStatus() { cnd = new CNodeData(); cnd.NodeNo = SpFuncs.getInt(txtNodeNo.Text, -1); int indx = aApp.AppDocument.NodeData.IndexOf(cnd); if (indx == -1) { elCount = aApp.AppDocument.NodeData.Count + 1; } else { elCount = this.aApp.AppDocument.NodeData.IndexOf(cnd) + 1; } lblPosition.Text = "Total Node = " + aApp.AppDocument.NodeData.Count + ", Current Position = " + elCount; }
private CMaterialPropertyInformation GetCMaterialPropertyInformation() { CMaterialPropertyInformation cmpi = new CMaterialPropertyInformation(); cmpi.matIdNo = SpFuncs.getInt(txtMatId.Text); cmpi.massDen = SpFuncs.getDouble(txtMassDensity.Text); cmpi.alphaX = SpFuncs.getDouble(txtAlphaX.Text); cmpi.alphaY = SpFuncs.getDouble(txtAlphaY.Text); cmpi.alphaZ = SpFuncs.getDouble(txtAlphaZ.Text); cmpi.Exx = SpFuncs.getDouble(txtExx.Text); cmpi.Exy = SpFuncs.getDouble(txtExy.Text); cmpi.Exs = SpFuncs.getDouble(txtExs.Text); cmpi.Eyy = SpFuncs.getDouble(txtEyy.Text); cmpi.Eys = SpFuncs.getDouble(txtEys.Text); cmpi.Gxy = SpFuncs.getDouble(txtGxy.Text); return(cmpi); }
private void btnNext_Click(object sender, EventArgs e) { try { cnd = GetNodeData(); } catch (Exception ex) { return; } int indx = aApp.AppDocument.NodeData.IndexOf(cnd); SaveWithNodeNo(NodeNo); if (indx == -1) { if (chkIncrOn.Checked) { int i = SpFuncs.getInt(txtNodeIncr.Text); NodeNo += i; } else { NodeNo += 1; } } else { if (indx < aApp.AppDocument.NodeData.Count - 1) { NodeNo = aApp.AppDocument.NodeData[indx + 1].NodeNo; } else { if (chkIncrOn.Checked) { int i = SpFuncs.getInt(txtNodeIncr.Text); NodeNo += i; } else { NodeNo += 1; } } } SetStatus(); }
private void btnNextElement_Click(object sender, EventArgs e) { CElementData eldata = GetCElementData(); int index = this.app.AppDocument.ElementData.IndexOf(ElementNo); if (SpFuncs.getInt(txtElementNo.Text) > 0) { if (index == -1) { this.app.AppDocument.ElementData.Add(GetCElementData()); } else { this.app.AppDocument.ElementData[index] = GetCElementData(); } } txtElementNo.Text = (SpFuncs.getInt(txtElementNo.Text) + 1) + ""; txtElementNo.Focus(); }
private void btnNextNodalData_Click(object sender, EventArgs e) { if (txtFx.Text == "" && txtFy.Text == "" && txtFz.Text == "" && txtMx.Text == "" && txtMy.Text == "" && txtMz.Text == "") { return; } if (txtNodeNo.Text == "" || txtLoadCase.Text == "") { return; } if (isPresent(txtLoadCase.Text, txtNodeNo.Text)) { ndCount = lst.IndexOf(SpFuncs.getInt(txtNodeNo.Text)); if (ndCount == lst.Count - 1) { txtNodeNo.Text = (lst[lst.Count - 1] + 1) + ""; return; } if (lst.Count > 0) { if (ndCount >= 0 && ndCount < lst.Count - 1) { txtNodeNo.Text = lst[ndCount + 1].ToString(); setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); } else { txtNodeNo.Text = lst[0].ToString(); setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); } } } else { addMemberLoad(); txtNodeNo.Focus(); } showStatus(); }
private void SaveWithNodeNo(int nodeNo) { cnd = new CNodeData(); cnd.NodeNo = SpFuncs.getInt(txtNodeNo.Text); int indx = aApp.AppDocument.NodeData.IndexOf(cnd); try { cnd = GetNodeData(); } catch (Exception ex) { return; } if (indx != -1) { this.aApp.AppDocument.NodeData[indx] = cnd; } else { aApp.AppDocument.NodeData.Add(GetNodeData()); } SetStatus(); }
private void btnPrevNodalData_Click(object sender, EventArgs e) { if (!isPresent(txtLoadCase.Text, txtNodeNo.Text)) { txtNodeNo.Text = lst[lst.Count - 1].ToString(); return; } if (lst.Count > 0) { ndCount = lst.IndexOf(SpFuncs.getInt(txtNodeNo.Text)); if (ndCount > 0 && ndCount < lst.Count) { txtNodeNo.Text = lst[ndCount - 1].ToString(); setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); } else { txtNodeNo.Text = lst[0].ToString(); setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); } } showStatus(); }
private void frmPlateAndShell_Load(object sender, EventArgs e) { cmbLengthUnit.SelectedIndex = CAstraUnits.GetLengthUnitIndex(this.app.AppDocument.MatPropertyInfo.LengthFactor); cmbMassUnit.SelectedIndex = CAstraUnits.GetWeightUnitIndex(this.app.AppDocument.MatPropertyInfo.MassFactor); if (this.app.AppDocument.ElementMultiplier.Count != 4) { for (byte b = 1; b <= 4; b++) { CElementMultiplier em = new CElementMultiplier(); em.loadcase = b; this.app.AppDocument.ElementMultiplier.Add(em); } } int i = 0; MatInfo.Clear(); ElMult.Clear(); ElData.Clear(); for (i = 0; i < this.app.AppDocument.MatPropertyInfo.Count; i++) { MatInfo.Add(this.app.AppDocument.MatPropertyInfo[i]); } for (i = 0; i < this.app.AppDocument.ElementMultiplier.Count; i++) { ElMult.Add(this.app.AppDocument.ElementMultiplier[i]); } for (i = 0; i < this.app.AppDocument.ElementData.Count; i++) { ElData.Add(this.app.AppDocument.ElementData[i]); } cmbLoadCase.SelectedIndex = 0; ShowMatInfo(SpFuncs.getInt(txtMatId.Text)); txtMatId.Focus(); }
private void btnDelProp_Click(object sender, EventArgs e) { //lblStatus.Text = (this.app.AppDocument.MatPropertyInfo.DeleteMatId(SpFuncs.getInt(txtMatId.Text)) + ""); ShowMatInfo(SpFuncs.getInt(txtMatId.Text)); }
private void txtNodeNo_TextChanged(object sender, EventArgs e) { setSupport(SpFuncs.getInt(txtNodeNo.Text)); }
private void btnNextLoadCase_Click(object sender, EventArgs e) { txtLoadCase.Text = (SpFuncs.getInt(txtLoadCase.Text) + 1) + ""; showStatus(); }
private void txtNodeNo_TextChanged(object sender, EventArgs e) { setNodalLoadData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); showStatus(); }
private void btnDeleteNodalData_Click(object sender, EventArgs e) { deleteData(SpFuncs.getInt(txtLoadCase.Text), SpFuncs.getInt(txtNodeNo.Text)); showStatus(); }
private void txtMatId_TextChanged(object sender, EventArgs e) { ShowMatInfo(SpFuncs.getInt(txtMatId.Text)); }
private void txtElementNo_TextChanged(object sender, EventArgs e) { ShowElementData(SpFuncs.getInt(txtElementNo.Text)); }