public static void createFloydPath(string dbPath) { //CSubPath path = new CSubPath(CRailwayLineList.gMileage, "DK", 301610, "改DK", 17800, 10); List <string> dcode = new List <string>(); dcode.Add("青连改DK"); dcode.Add("改DK"); //dcode.Add("DK"); //dcode.Add("JQDK"); //dcode.Add("DK"); //dcode.Add("右改DK"); List <double> dmile = new List <double>(); dmile.Add(22693.74128); dmile.Add(25800); //dmile.Add(275950); //dmile.Add(67580); //dmile.Add(299000); //dmile.Add(17600); CSubPath path = new CSubPath(gMileageConnection, dcode, dmile, 10); path.createHeightSample(dbPath); //path.outputPathInfo(); //mPath = new ShortestPathFloyd(mLineList,connectionList); //mRightPath = new ShortestPathFloyd(mRightLineList); }
public CRailwayTunnel(CRailwayScene s, string SerialNo, int projID, int parentID, string ProfessionalName, string profCode, string ProjectName, string SegmentName, string MStartDes, string MEndDes, double Mileage_Start, double Mileage_End, DateTime dt, double AvgProgress, double dir, string labelFile, string photourl, DataTable dt1 = null, DataTable dt2 = null) : base(s, SerialNo, projID, parentID, ProfessionalName, profCode, ProjectName, SegmentName, MStartDes, MEndDes, Mileage_Start, Mileage_End, dt, AvgProgress, dir, labelFile, photourl, false, dt1, dt2) { //DatabaseWrapper.PrintDataTable(mds.Tables[0]); //DatabaseWrapper.PrintDataTable(mds.Tables[1]); foreach (CFXProj fx in FXProgress) { //FIXME 隧道里程标记方法特殊,暂时认为在一个链中 if (fx.fxID == 472 || fx.fxID == 475) // 正洞或斜井的开挖 { if (dir < 90) { mMileage_End = mMileage_Start + fx.TotalAmount; } else { mMileage_End = mMileage_Start - fx.TotalAmount; } mPath = new CSubPath(CRailwayLineList.gMileageConnection, mStartDKCode, mMileage_Start, mEndDKCode, mMileage_End, 10); if (!mPath.hasPath) { mIsValid = false; return; } mIsValid = true; mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_Start, out mMainMileageS, out mdistanceToMainPath); mScene.mMainPath.getPathMileageByDKCode(mEndDKCode, mMileage_End, out mMainMileageE, out mdistanceToMainPath); mPath.getDKCodebyPathMileage(mPath.mLength * 0.5, out mMidDKCode, out mMileage_Mid); mIsOnMainPath = mScene.mMainPath.getPathMileageByDKCode(mMidDKCode, mMileage_Mid, out mMainMileage, out mdistanceToMainPath); mLength = mPath.mLength; //mMileage_Mid = (mMileage_Start + mMileage_End) / 2; //mLength = fx.TotalAmount; //mIsValid = mScene.mMiddleLines.getGPSbyDKCode(mStartDKCode, mMileage_Mid, out mLongitude_Mid, out mLatitude_Mid, out mAltitude_Mid, out mHeading_Mid); //mIsValid &= mScene.mMiddleLines.getGPSbyDKCode(mStartDKCode, mMileage_Start, out mLongitude_Start, out mLatitude_Start, out mAltitude_Start, out mHeading_Start); //mIsValid &= mScene.mMiddleLines.getGPSbyDKCode(mStartDKCode, mMileage_End, out mLongitude_End, out mLatitude_End, out mAltitude_End, out mHeading_End); //mMainMileage = mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_Mid); //mMainMileageS = mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_Start); //mMainMileageE = mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_End); //if (mIsValid) //{ // if (mSpotList != null) // mSpotList.Clear(); // else // mSpotList = new List<CHotSpot>(); // mSpotList.Add(new CHotSpot(mStartDKCode, mMileage_Start, mLongitude_Start, mLatitude_Start, mAltitude_Start, mMainMileageS, "Tunnel", this)); // mSpotList.Add(new CHotSpot(mStartDKCode, mMileage_Mid, mLongitude_Mid, mLatitude_Mid, mAltitude_Mid, mMainMileage, "Tunnel", this)); // mSpotList.Add(new CHotSpot(mStartDKCode, mMileage_End, mLongitude_End, mLatitude_End, mAltitude_End, mMainMileageE, "Tunnel", this)); //} break; } } }
public void AdjustMileage() { if (mPierList.Count > 0) { mMileage_Start = mPierList[0].Mileage_Start; mStartDKCode = mPierList[0].DKCode_Start; mMileage_End = mPierList.Last().Mileage_Start; mEndDKCode = mPierList.Last().DKCode_Start; mPath = new CSubPath(CRailwayLineList.gMileageConnection, mStartDKCode, mMileage_Start, mEndDKCode, mMileage_End, 10); if (!mPath.hasPath) { mIsValid = false; return; } mIsValid = true; mIsOnMainPath = mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_Start, out mMainMileageS, out mdistanceToMainPath); mScene.mMainPath.getPathMileageByDKCode(mEndDKCode, mMileage_End, out mMainMileageE, out mdistanceToMainPath); mPath.getDKCodebyPathMileage(mPath.mLength * 0.5, out mMidDKCode, out mMileage_Mid); mScene.mMainPath.getPathMileageByDKCode(mMidDKCode, mMileage_Mid, out mMainMileage, out mdistanceToMainPath); //mLength = mPath.mLength; //mLongitude_Start = mPierList[0].mLongitude_Mid; //mLatitude_Start = mPierList[0].mLatitude_Mid; //mAltitude_Start = mPierList[0].mAltitude_Mid; //mHeading_Start = mPierList[0].mHeading_Mid; Mileage_Start_Discription = CRailwayLineList.CombiDKCode(mStartDKCode, mMileage_Start); Mileage_End_Discription = CRailwayLineList.CombiDKCode(mEndDKCode, mMileage_End); mLength = Math.Abs(mMileage_End - mMileage_Start); //if (mIsValid) //{ // if (mSpotList != null) // mSpotList.Clear(); // else // mSpotList = new List<CHotSpot>(); // mSpotList.Add(new CHotSpot(mStartDKCode, mMileage_Start, mLongitude_Start, mLatitude_Start, mAltitude_Start, mMainMileageS, "ContBeam", this)); // mSpotList.Add(new CHotSpot(mMidDKCode, mMileage_Mid, mLongitude_Mid, mLatitude_Mid, mAltitude_Mid, mMainMileage, "ContBeam", this)); // mSpotList.Add(new CHotSpot(mEndDKCode, mMileage_End, mLongitude_End, mLatitude_End, mAltitude_End, mMainMileageE, "ContBeam", this)); //} } }
public static void testMainLine() { CSubPath p = new CSubPath(gMileageConnection, "GSJDK", 426000, "JQDK", 17600, 10); Console.WriteLine(p); }
/// <summary> /// 利用dkcode 与 里程初始化,潜在问题,要求在同一个链中,dkcode一致,目前数据库中的里程描述description不正确 /// </summary> /// <param name="s"></param> /// <param name="SerialNo"></param> /// <param name="projID"></param> /// <param name="profName"></param> /// <param name="ProjectName"></param> /// <param name="SegmentName"></param> /// <param name="DKCode"></param> /// <param name="Mileage_Start"></param> /// <param name="Mileage_Mid"></param> /// <param name="Mileage_End"></param> /// <param name="dt"></param> /// <param name="AvgProgress"></param> /// <param name="dir"></param> /// <param name="labelFile"></param> /// <param name="length"></param> public CRailwayProject(CRailwayScene s, string SerialNo, int projID, int parentID, string profName, string profCode, string ProjectName, string SegmentName, string MStartDes, string MEndDes, double Mileage_Start, double Mileage_End, //string Mileage_Start_Des, string Mileage_Mid_Des, string Mileage_End_Des, DateTime dt, double AvgProgress, double dir, string labelFile, string photoUrl, bool isContBeam = false, DataTable dt1 = null, DataTable dt2 = null) { double tmp; mScene = s; ProfessionalName = profName; mProfessionalCode = profCode; mProjectID = projID; mParentID = parentID; mProjectName = ProjectName; mSegmentName = SegmentName; mSerialNo = SerialNo; mIsValid = CRailwayLineList.parseDKCode(MStartDes, out mStartDKCode, out tmp); // should be Mileage_Start mIsValid &= CRailwayLineList.parseDKCode(MEndDes, out mEndDKCode, out tmp); // should be Mileage_End if (!mIsValid) { LogHelper.WriteLog(mProjectName + "里程错误:" + MStartDes + "\t" + MEndDes); } //if (string.IsNullOrEmpty(dkcode2)) // mEndDKCode = mStartDKCode; //else // mEndDKCode = dkcode2; Mileage_Start_Ds = CRailwayLineList.CombiDKCode(mStartDKCode, Mileage_Start); //Mileage_Mid_Ds = Mileage_Mid_Des; Mileage_End_Ds = CRailwayLineList.CombiDKCode(mEndDKCode, Mileage_End);; mMileage_Start = Mileage_Start; mMileage_Mid = 0; mMileage_End = Mileage_End; //mIsValid = mScene.mMiddleLines.getGPSbyDKCode(mStartDKCode, mMileage_Mid, out mLongitude_Mid, out mLatitude_Mid, out mAltitude_Mid, out mHeading_Mid); //mIsValid = mScene.mMiddleLines.getGPSbyDKCode(mStartDKCode, mMileage_Start, out mLongitude_Start, out mLatitude_Start, out mAltitude_Start, out mHeading_Start); //mIsValid &= mScene.mMiddleLines.getGPSbyDKCode(mEndDKCode, mMileage_End, out mLongitude_End, out mLatitude_End, out mAltitude_End, out mHeading_End); mUpdateTime = dt; mDirection = dir; mLabelImage = labelFile; mLength = Math.Abs(mMileage_End - mMileage_Start); //FIXME 目前是导入,不同DKCode的线路如何求解 mPhotoUrl = photoUrl; if (!isContBeam) { //mPath = new CSubPath( mStartDKCode, mMileage_Start, mEndDKCode, mMileage_End, 10); mPath = new CSubPath(CRailwayLineList.gMileageConnection, mStartDKCode, mMileage_Start, mEndDKCode, mMileage_End, 10); if (!mPath.hasPath) { mIsValid = false; //#if DEBUG // Helper.LogHelper.WriteLog(mProjectName +"\t"+ mStartDKCode + mMileage_Start + "\t" + mEndDKCode + mMileage_End); //#endif return; } mIsValid = true; mIsOnMainPath = mScene.mMainPath.getPathMileageByDKCode(mStartDKCode, mMileage_Start, out mMainMileageS, out mdistanceToMainPath); mScene.mMainPath.getPathMileageByDKCode(mEndDKCode, mMileage_End, out mMainMileageE, out mdistanceToMainPath); mPath.getDKCodebyPathMileage(mPath.mLength * 0.5, out mMidDKCode, out mMileage_Mid); mScene.mMainPath.getPathMileageByDKCode(mMidDKCode, mMileage_Mid, out mMainMileage, out mdistanceToMainPath); mLength = Math.Abs(mPath.mLength); } initFXProgress(dt1, dt2); }