void designed_curve_input() { findflag = 0; while (fp1SR.EndOfStream == false) { CHalignFilData fildata = CHalignFilData.Parse(fp1SR.ReadLine()); if (fildata == null) { continue; } modnam = fildata.sMod; strnam = fildata.sString; elno = (short)fildata.iSlno; eltype = fildata.iEltype; stchn = fildata.dStartchn; endchn = fildata.dEndchn; IPX = fildata.dHipx; IPY = fildata.dHipy; T1 = fildata.dT1; T2 = fildata.dT2; R = fildata.dRadius; L = fildata.dEllength; xst = fildata.dStartx; yst = fildata.dStarty; xed = fildata.dEndx; yed = fildata.dEndy; B1 = fildata.dB1; B2 = fildata.dB2; DEL = fildata.dDeviation; turn = fildata.iTurn; if (stchn == last_stchn && endchn == last_endchn) { findflag = 0; break; } if ((modnam == model) && (strnam == stglbl)) { findflag = 1; break; } } if (findflag != 0) { initiate_param(); start_param(); if (eltype == 1) { SL = L; L = 0; LC = 0; M = 0; } else if (eltype == 2) /*L = L;*/ SL {
public static CHIPInfo[] ReadHaligns(string strHalignFilePath) { List <CHIPInfo> listhips = new List <CHIPInfo>(); if (File.Exists(strHalignFilePath)) { StreamReader readerSrc = new StreamReader(strHalignFilePath); string strLastModelName = ""; string strLastStringLabel = ""; CHIPInfo hipinfo = null; while (readerSrc.EndOfStream == false) { string strline = readerSrc.ReadLine(); CHalignFilData fildata = CHalignFilData.Parse(strline); if (fildata != null) { if (strLastModelName != fildata.sMod || strLastStringLabel != fildata.sString) { hipinfo = new CHIPInfo(); hipinfo.ModelName = fildata.sMod; hipinfo.StringLabel = fildata.sString; listhips.Add(hipinfo); strLastModelName = fildata.sMod; strLastStringLabel = fildata.sString; } hipinfo.DataList.Add(fildata); } //string[] arrStr = strline.Split(new char[] { '\t' }); //if (arrStr.Length == 20) //{ // if (strLastModelName != arrStr[0] || strLastStringLabel != arrStr[1]) // { // hipinfo = new CHIPInfo(); // hipinfo.ModelName = arrStr[0]; // hipinfo.StringLabel = arrStr[1]; // listhips.Add(hipinfo); // strLastModelName = arrStr[0]; // strLastStringLabel = arrStr[1]; // } // hipinfo.DataList.Add(CHalignFilData.Parse(strline)); //} } readerSrc.Close(); } return(listhips.ToArray()); }
/// <summary> /// This function copied from CHalignDxCode::save_halign() /// </summary> /// <param name="strWorkingDirPath"></param> public static void SaveHalign(string strWorkingDirPath) { StreamReader readerSrc = new StreamReader(Path.Combine(strWorkingDirPath, "halign.tmp")); List <CHalignFilData> listTempHalign = new List <CHalignFilData>(); while (readerSrc.EndOfStream == false) { string strlineSrc = readerSrc.ReadLine(); CHalignFilData filDataTemp = CHalignFilData.Parse(strlineSrc); if (filDataTemp != null) { listTempHalign.Add(filDataTemp); } } readerSrc.Close(); //If any data present in temp file if (listTempHalign.Count > 0) { string strHalignFilFilePath = Path.Combine(strWorkingDirPath, "HALIGN.FIL"); CHIPInfo[] infoarr = CHalignHipUtil.ReadHaligns(strHalignFilFilePath); StreamWriter writerDesti = new StreamWriter(strHalignFilFilePath, false); foreach (CHIPInfo info in infoarr) { foreach (CHalignFilData filData in info.DataList) { if (filData.sMod != listTempHalign[0].sMod || filData.sString != listTempHalign[0].sString) { writerDesti.WriteLine(filData.ToString()); } } } //Now write the data from temp file foreach (CHalignFilData filData in listTempHalign) { writerDesti.WriteLine(filData.ToString()); } writerDesti.Close(); } }
private void write_halign() { del = b2 - b1; if (del < 0) { del = 0.0 - del; } if (del > 360) { del = del - 360; } //string strTemp = ""; string strModelName = (modnam.Length > 8)? modnam.Substring(0, 8) : modnam; string strLabelStr = (stglbl.Length > 4) ? stglbl.Substring(0, 4) : stglbl; CHalignFilData FilDataObj = new CHalignFilData(); FilDataObj.sMod = strModelName; FilDataObj.sString = strLabelStr; FilDataObj.iSlno = elno; FilDataObj.iEltype = eltype; FilDataObj.dStartchn = chn1; FilDataObj.dEndchn = chn2; FilDataObj.dHipx = hipx; FilDataObj.dHipy = hipy; FilDataObj.dT1 = t1; FilDataObj.dT2 = t2; FilDataObj.dRadius = rad; FilDataObj.dEllength = l; FilDataObj.dStartx = xs; FilDataObj.dStarty = ys; FilDataObj.dEndx = xe; FilDataObj.dEndy = ye; FilDataObj.dB1 = b1; FilDataObj.dB2 = b2; FilDataObj.dDeviation = del; FilDataObj.iTurn = turn; fp2.WriteLine(FilDataObj.ToString()); //fprintf(fp2, "%8s %4s %4d %4d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %4d\n", modnam, stglbl, elno, eltype, chn1, chn2, hipx, hipy, t1, t2, rad, l, xs, ys, xe, ye, b1, b2, del, turn); }
public void Funcmain(string argv1) { path = argv1; //err_code = 9; /* no error */ V = 130.0; read_input(); pathfile = Path.Combine(path, "DETAILS2.TMP"); fp2 = new BinaryWriter(new FileStream(pathfile, FileMode.Create), Encoding.Default); if (rotn != 0.0) { textstring = "DRG not by 'Draw String', use 'Minor option(s) 1103 / 1104'..."; error_msg(); return; } pathfile = Path.Combine(path, "HALIGN.TMP"); if (File.Exists(pathfile) == false) { pathfile = Path.Combine(path, "HALIGN.FIL"); } if (File.Exists(pathfile) == false) { textstring = "File %s not found..." + pathfile; error_msg(); return; } fp1SR = new StreamReader(pathfile); //index = false; elcount = 0; int telemno = 0; HIPchainage = 0.0; string mdlnam, strnam; // Sandipan 25082008 Kolkata while (fp1SR.EndOfStream == false) { Ls1 = 0.0; Ls2 = 0.0; CHalignFilData fildata = CHalignFilData.Parse(fp1SR.ReadLine()); mdlnam = fildata.sMod; strnam = fildata.sString; telemno = fildata.iSlno; eltype = fildata.iEltype; stchn = fildata.dStartchn; endchn = fildata.dEndchn; IPX = fildata.dHipx; IPY = fildata.dHipy; T1 = fildata.dT1; T2 = fildata.dT2; R = fildata.dRadius; L = fildata.dEllength; xst = fildata.dStartx; yst = fildata.dStarty; xed = fildata.dEndx; yed = fildata.dEndy; B1 = fildata.dB1; B2 = fildata.dB2; DEL = fildata.dDeviation; turn1 = fildata.iTurn; if ((telemno > 0) && (mdlnam == modstr) && (strnam == stgstr)) { finchn = endchn; } } fp1SR.Close(); fp1SR = new StreamReader(pathfile); while (fp1SR.EndOfStream == false) { init_param(); des_curve_input(); if (flag == 0) { continue; } if ((stchn == last_stchn) && (endchn == last_endchn)) { break; } //if(start_index == 0) //{ // XST = xst; // YST = yst; // start_index = 1; //} draw_hips(); //index = true; if (endchn == finchn) { break; } } // end while(fp1SR.EndOfStream) end_HIP(); fp1.Close(); fp1SR.Close(); fp2.Close(); }
void des_curve_input() { string mdlnam; string strnam; int telemno = 0, teltype = 0; double tstchn = 0.0, tendchn = 0.0, tIPX = 0.0, tIPY = 0.0; double tT1 = 0.0, tT2 = 0.0, tR = 0.0, tL = 0.0; double txst = 0.0, tyst = 0.0, txed = 0.0, tyed = 0.0; double tB1 = 0.0, tB2 = 0.0, tDEL = 0.0; int tturn1 = 0; Ls1 = 0.0; Ls2 = 0.0; while (true) { string strLine = fp1SR.ReadLine(); if (strLine == null) { break; } CHalignFilData fildata = CHalignFilData.Parse(strLine); mdlnam = fildata.sMod; strnam = fildata.sString; telemno = fildata.iSlno; teltype = fildata.iEltype; tstchn = fildata.dStartchn; tendchn = fildata.dEndchn; tIPX = fildata.dHipx; tIPY = fildata.dHipy; tT1 = fildata.dT1; tT2 = fildata.dT2; tR = fildata.dRadius; tL = fildata.dEllength; txst = fildata.dStartx; tyst = fildata.dStarty; txed = fildata.dEndx; tyed = fildata.dEndy; tB1 = fildata.dB1; tB2 = fildata.dB2; tDEL = fildata.dDeviation; tturn1 = fildata.iTurn; if (lasteltype == teltype && last_endchn == tendchn) { break; } if ((telemno > 0) && (mdlnam == modstr) && (strnam == stgstr)) { flag = 1; // final 13/09/01 DD elemno = (short)telemno; eltype = (short)teltype; stchn = tstchn; endchn = tendchn; //if(telemno==1) if (eltype == 1) { xst = txst; yst = tyst; Xc = txst; Yc = tyst; startchn = tstchn; HIPchainage = tstchn; B1 = tB1; B2 = tB2; } if (eltype == 2) { Ls1 = tL; Brg1 = tB1; } else if (eltype == 3) { Lc = tL; elcount++; IPX = tIPX; IPY = tIPY; T1 = tT1; T2 = tT2; R = tR; L = tL; xed = txed; yed = tyed; B1 = tB1; B2 = tB2; DEL = tDEL; turn1 = (short)tturn1; HIPchainage += Math.Sqrt((Xc - IPX) * (Xc - IPX) + (Yc - IPY) * (Yc - IPY)); Xc = IPX; Yc = IPY; } if (eltype == 4) { Ls2 = tL; Brg2 = tB2; } if (start_index == 0) { XST = xst; YST = yst; start_index = 1; } if (tIPX == 0.0 && tIPY == 0.0) { xed = txed; yed = tyed; break; } else { if (eltype == 1 && (lasteltype == 3 || lasteltype == 4)) { xed = txed; yed = tyed; break; } } } else { flag = 0; } lasteltype = teltype; last_stchn = stchn; last_endchn = endchn; last_eltype = eltype; } }
void ProcessData() { BinaryWriter fp2 = null; StreamWriter fp3 = null; string nam; string lbl; int ind = 0, len, ival; int slno, eltype, turn; double x, y, z; double stchn, RC, sc = 0, inc, seglen, segend; //, seginc; double RCI, num, val; double T1, T2, R, D, lastRC = -999.999; /* Select a Polyline from screen */ /* User Input data in dialog box */ modnam = this.tbModelName_.Text; stglbl = this.tbStringlabel_.Text; stchn = this.tbStartChainage_.Value; inc = this.tbChainageInterval_.Value; string csTemp = Path.Combine(this.app.AppDataPath, "MODEL.FIL"); fp2 = new BinaryWriter(new FileStream(csTemp, FileMode.Append), Encoding.Default); if (this.checkMasterString_.Checked == true) { csTemp = Path.Combine(this.app.AppDataPath, "HALIGN.FIL"); fp3 = new StreamWriter(csTemp, true); } CLabtype lab = null; CPTStype pts = null; CModType mod = null; CStgType stg = null; ClSTtype lst = null; lab = new CLabtype(); lab.attr = CLabtype.Type.Model; mod = new CModType(); mod.name = modnam; lab.Tag = mod; lab.ToStream(fp2); lab = new CLabtype(); lab.attr = CLabtype.Type.String; stg = new CStgType(); stg.label = stglbl; lab.Tag = stg; lab.ToStream(fp2); RC = stchn; //seginc=0.0; sx = sy = sz = -999.999; T1 = T2 = R = D = 0; turn = 0; B1 = B2 = 0.0; slno = 1; eltype = 1; turn = 1; ind = 0; //ind1=0; for (int vx = 0; vx < this.ptCords.Length; vx++) { /*JBLN*/ ex = this.ptCords[vx].X; ey = this.ptCords[vx].Y; ez = this.ptCords[vx].Z; // fscanf(fp1, "%lf %lf %lf", &ex, &ey, &ez); /* close in vc++ */ if (ind == 0) { lab = new CLabtype(); lab.attr = CLabtype.Type.Point; pts = new CPTStype(); pts.mc = RC; pts.mx = ex; pts.my = ey; pts.mz = ez; lab.Tag = pts; lab.ToStream(fp2); sc = RC; sx = ex; sy = ey; sz = ez; B1 = B2; ind = 1; continue; } if (ex == sx && ey == sy) { continue; } tt = string.Format("{0:f0}", inc);//sprintf(tt,"%.0f", inc); len = tt.Length; RCI = RC; num = Math.Pow(10, len); RCI = RCI / num; ival = (int)RCI; RCI = ival * num; while (RCI < RC) { RCI += inc; } RC = RCI; if (RC == sc) { RC += inc; /* NEW */ } determine_bearing(); seglen = Math.Sqrt((ex - sx) * (ex - sx) + (ey - sy) * (ey - sy)); /* NEW */ segend = sc + seglen; /* NEW */ if (this.checkMasterString_.Checked == true) { if (B1 == 0) { B1 = B2; } D = B1 - B2; if (D < 0) { D += 360; } if (D > 360) { D -= 360; } CHalignFilData fildata = new CHalignFilData(); fildata.sMod = modnam; fildata.sString = stglbl; fildata.iSlno = slno; fildata.iEltype = (short)eltype; fildata.dStartchn = sc; fildata.dEndchn = segend; fildata.dHipx = ex; fildata.dHipy = ey; fildata.dT1 = T1; fildata.dT2 = T2; fildata.dRadius = R; fildata.dEllength = seglen; fildata.dStartx = sx; fildata.dStarty = sy; fildata.dEndx = ex; fildata.dEndy = ey; fildata.dB1 = B2; fildata.dB2 = B2; fildata.dDeviation = D; fildata.iTurn = (short)turn; fp3.WriteLine(fildata.ToString()); //fprintf(fp3, "%s %s %d %d %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.5f %.3f %.3f %.3f %d\n", modnam, stglbl, slno, eltype, sc, segend, ex, ey, T1, T2, R, seglen, sx, sy, ex, ey, B2, B2, D, turn); slno++; /* NEW */ } val = Math.Abs(RC - segend);/* fabs will be abs in VC++*/ if (val < 0.001) { segend = RC; } while (true) { if (segend < RC) { if (segend + inc != RC) { val = Math.Abs(segend - lastRC); if (val > 0.001) { lab = new CLabtype(); lab.attr = CLabtype.Type.Point; pts = new CPTStype(); pts.mc = segend; pts.mx = ex; pts.my = ey; pts.mz = ez; lab.Tag = pts; lab.ToStream(fp2); lastRC = segend; } } RC = segend; ind = 0; break; } else { if ((RC - sc) > 0.001) { x = sx + (RC - sc) * Math.Sin(B2 / r9); /* E */ y = sy + (RC - sc) * Math.Cos(B2 / r9); /* N */ z = sz + (RC - sc) * (ez - sz) / (segend - sc); if (RC != lastRC) { lab = new CLabtype(); lab.attr = CLabtype.Type.Point; pts = new CPTStype(); pts.mc = RC; pts.mx = x; pts.my = y; pts.mz = z; lab.Tag = pts; lab.ToStream(fp2); lastRC = RC; } } RC += inc; } } sc = RC; sx = ex; sy = ey; sz = ez; B1 = B2; ind = 1; }// end for previously while fp2.Close(); if (this.checkMasterString_.Checked == true) { fp3.Close(); } csTemp = Path.Combine(this.app.AppDataPath, "MODEL.LST"); fp2 = new BinaryWriter(new FileStream(csTemp, FileMode.Append), Encoding.Default); lst = new ClSTtype(); lst.strMod1 = modnam; lst.strStg = stglbl; lst.ToStream(fp2); fp2.Close(); csTemp = Path.Combine(this.app.AppDataPath, "MODEL.FIL"); fp2 = new BinaryWriter(new FileStream(csTemp, FileMode.Append), Encoding.Default); lab = new CLabtype(); lab.attr = CLabtype.Type.Model; mod = new CModType(); nam = modnam + "%%"; mod.name = nam; lab.Tag = mod; lab.ToStream(fp2); lab = new CLabtype(); lab.attr = CLabtype.Type.String; stg = new CStgType(); lbl = stglbl; stg.label = lbl; lab.Tag = stg; lab.ToStream(fp2); for (int vx = 0; vx < this.ptCords.Length; vx++) { ex = this.ptCords[vx].X; ey = this.ptCords[vx].Y; ez = this.ptCords[vx].Z; lab = new CLabtype(); lab.attr = CLabtype.Type.Point; pts = new CPTStype(); pts.mc = RC; pts.mx = ex; pts.my = ey; pts.mz = ez; lab.Tag = pts; lab.ToStream(fp2); } fp2.Close(); csTemp = Path.Combine(this.app.AppDataPath, "MODEL.LST"); fp2 = new BinaryWriter(new FileStream(csTemp, FileMode.Append), Encoding.Default); lst = new ClSTtype(); lst.strMod1 = nam; lst.strStg = lbl; lst.ToStream(fp2); fp2.Close(); }
public static List <CHHipData> GenerateHIPData(CHIPInfo hipinfo) { List <CHHipData> listHhip = null; int ln = 0; int iLine = 0; int iHipArrIndex = 0; double nSign = 0; CHalignFilData filData = null; CHHipData[] hipArr = new CHHipData[hipinfo.DataList.Count]; for (int i = 0; i < hipinfo.DataList.Count; i++) { hipArr[i] = new CHHipData(); } ln++; filData = hipinfo.DataList[iLine]; iLine++; nSign = (filData.iTurn == 1) ? -1 : 1; hipArr[iHipArrIndex].xvalue = filData.dStartx; hipArr[iHipArrIndex].yvalue = filData.dStarty; hipArr[iHipArrIndex].delta = filData.dDeviation * nSign; hipArr[iHipArrIndex].radius = 0.0; hipArr[iHipArrIndex].leadtrans = 0.0; hipArr[iHipArrIndex].trailtrans = 0.0; double dLastHIPx = filData.dHipx; double dLastHIPy = filData.dHipy; while (ln < (hipinfo.DataList.Count - 1)) { ln++; filData = hipinfo.DataList[iLine]; iLine++; if (ln == 2) { if (filData.iEltype != 1) { iHipArrIndex++; nSign = (filData.iTurn == 1) ? -1 : 1; hipArr[iHipArrIndex].xvalue = filData.dHipx; hipArr[iHipArrIndex].yvalue = filData.dHipy; hipArr[iHipArrIndex].delta = filData.dDeviation * nSign; hipArr[iHipArrIndex].radius = 0.0; hipArr[iHipArrIndex].leadtrans = 0.0; hipArr[iHipArrIndex].trailtrans = 0.0; } } if ((Math.Abs(dLastHIPx - filData.dHipx) < 0.00001) && (Math.Abs(dLastHIPy - filData.dHipy) < 0.00001)) { // same HIP set if (filData.iEltype == 2) // lead transition { hipArr[iHipArrIndex].leadtrans = filData.dEllength; } else if (filData.iEltype == 3) // circular transition { hipArr[iHipArrIndex].radius = filData.dRadius * nSign; } else if (filData.iEltype == 4) // trail transition { hipArr[iHipArrIndex].trailtrans = filData.dEllength; } else { //Error return(listHhip); } } else { // next HIP set iHipArrIndex++; nSign = (filData.iTurn == 1) ? -1 : 1; hipArr[iHipArrIndex].xvalue = filData.dHipx; hipArr[iHipArrIndex].yvalue = filData.dHipy; hipArr[iHipArrIndex].delta = filData.dDeviation * nSign; hipArr[iHipArrIndex].radius = 0.0; hipArr[iHipArrIndex].leadtrans = 0.0; hipArr[iHipArrIndex].trailtrans = 0.0; dLastHIPx = filData.dHipx; dLastHIPy = filData.dHipy; } } iHipArrIndex++; filData = hipinfo.DataList[iLine]; iLine++; ln++; nSign = (filData.iTurn == 1) ? -1 : 1; hipArr[iHipArrIndex].xvalue = filData.dEndx; hipArr[iHipArrIndex].yvalue = filData.dEndy; hipArr[iHipArrIndex].delta = filData.dDeviation * nSign; hipArr[iHipArrIndex].radius = 0.0; hipArr[iHipArrIndex].leadtrans = 0.0; hipArr[iHipArrIndex].trailtrans = 0.0; listHhip = new List <CHHipData>(); for (int ii = 0; ii < (iHipArrIndex + 1); ii++) { listHhip.Add(hipArr[ii]); } return(listHhip); }
/// <summary> /// Unreachable code segment /// </summary> private void save_halign() { double last_chn1 = 0.0; double last_chn2 = 0.0; string last_mod = "NULL"; string last_stg = "NULL"; string strhalignPath = Path.Combine(this.m_strWorkingDirPath, "halign.tmp"); if (File.Exists(strhalignPath) == false) { throw new Exception("Failed to open file : " + strhalignPath); } StreamReader readerfp2 = new StreamReader(strhalignPath); StreamWriter writerfp3 = new StreamWriter(Path.Combine(this.m_strWorkingDirPath, "HALIGN.FIL"), true); while (readerfp2.EndOfStream == false) { //int iIndex = 0; string strValTSV = readerfp2.ReadLine(); CHalignFilData FilDataObj = CHalignFilData.Parse(strValTSV); //string[] Values = strValTSV.Split(new char[] { '\t' }); modnam = FilDataObj.sMod; stglbl = FilDataObj.sString; if (last_mod.CompareTo(modnam) == 0 && last_stg.CompareTo(stglbl) == 0) { break; } elno = (short)FilDataObj.iSlno; eltype = FilDataObj.iEltype; chn1 = FilDataObj.dStartchn; chn2 = FilDataObj.dEndchn; hipx = FilDataObj.dHipx; hipy = FilDataObj.dHipy; t1 = FilDataObj.dT1; t2 = FilDataObj.dT2; rad = FilDataObj.dRadius; l = FilDataObj.dEllength; xs = FilDataObj.dStartx; ys = FilDataObj.dStarty; xe = FilDataObj.dEndx; ye = FilDataObj.dEndy; b1 = FilDataObj.dB1; b2 = FilDataObj.dB2; del = FilDataObj.dDeviation; turn = FilDataObj.iTurn; del = b2 - b1; if (del < 0) { del = del + 360; } if (del > 360) { del = del - 360; } FilDataObj.sMod = modnam; FilDataObj.sString = stglbl; FilDataObj.iSlno = elno; FilDataObj.iEltype = eltype; FilDataObj.dStartchn = chn1; FilDataObj.dEndchn = chn2; FilDataObj.dHipx = hipx; FilDataObj.dHipy = hipy; FilDataObj.dT1 = t1; FilDataObj.dT2 = t2; FilDataObj.dRadius = rad; FilDataObj.dEllength = l; FilDataObj.dStartx = xs; FilDataObj.dStarty = ys; FilDataObj.dEndx = xe; FilDataObj.dEndy = ye; FilDataObj.dB1 = b1; FilDataObj.dB2 = b2; FilDataObj.dDeviation = del; FilDataObj.iTurn = turn; writerfp3.WriteLine(FilDataObj.ToString()); last_chn1 = chn1; last_chn2 = chn2; last_mod = modnam; last_stg = stglbl; } readerfp2.Close(); writerfp3.Close(); }
void FillFromExistingData(CHIPInfo info) { if (info.IsHipData == false) { ViewerUtils.DeleteFileIfExists(System.IO.Path.Combine(this.m_app.AppDataPath, "halign.tmp")); int nidxED = 0; this.txtModelName_.Text = info.ModelName; this.txtStringlabel_.Text = info.StringLabel; for (int iCnt = 0; iCnt < info.DataList.Count; iCnt++) { CHalignFilData fildata = info.DataList[iCnt]; if (carED[nidxED] == null) { carED[nidxED] = new CElementData(); } carED[nidxED].dBearings = fildata.dB1; carED[nidxED].dChainInterval = 10; carED[nidxED].dLength = fildata.dEllength; if (fildata.iTurn == 1) { fildata.dRadius = -1 * fildata.dRadius; } carED[nidxED].dRadius = fildata.dRadius; carED[nidxED].dStartChain = fildata.dStartchn; carED[nidxED].dXvalue = fildata.dStartx; carED[nidxED].dYvalue = fildata.dStarty; carED[nidxED].nElementNo = nidxED + 1; carED[nidxED].nType = fildata.iEltype; CHalignElementUtil code = new CHalignElementUtil(); code.Funcmain(this.m_app.AppDataPath, 2, 1, info.ModelName, info.StringLabel , (short)(nidxED + 1), fildata.iEltype, fildata.dStartchn , 10.0, fildata.dStartx, fildata.dStarty, fildata.dB1 , fildata.dEllength, fildata.dRadius); carED[nidxED].npLineID = DrawingUtil.DrawData(this.m_app, System.IO.Path.Combine(this.m_app.AppDataPath, "HAL2.TMP"), "ELE", true); nidxED++; this.SelectedElementType = fildata.iEltype; this.txtChainageInterval_.Value = 10.0; this.txtLength_.Value = fildata.dEllength; this.txtModelName_.Text = fildata.sMod; this.txtRadius_.Value = fildata.dRadius; this.txtStartInterval_.Value = fildata.dEndchn; this.txtStringlabel_.Text = fildata.sString; this.txtWCBearings_.Value = fildata.dB2; this.txtXVal_.Value = fildata.dEndx; this.txtYVal_.Value = fildata.dEndy; this.StartEleNo = nidxED + 1; ElementNo = nidxED + 1; nTotED = ElementNo - 1; TotalEleDrawn = nidxED; lastED.dStartChain = this.txtStartInterval_.Value; lastED.dChainInterval = this.txtChainageInterval_.Value; lastED.dXvalue = this.txtXVal_.Value; lastED.dYvalue = this.txtYVal_.Value; lastED.nType = this.SelectedElementType; lastED.dBearings = this.txtWCBearings_.Value; lastED.dLength = this.txtLength_.Value; lastED.dRadius = this.txtRadius_.Value; lastED.nElementNo = this.StartEleNo; } this.m_app.ActiveDocument.RefreshDocument(); this.m_app.ZoomExtents(); //ViewerUtils.DeleteFileIfExists(this.m_app.AppDataPath + @"\~halign.fil"); } }