Esempio n. 1
0
        public CRailwayProject(CRailwayScene s)
        {
            mScene           = s;
            ProfessionalName = "铁路工程";
            mProjectID       = 1;
            mProjectName     = "新建济青高速铁路工程";
            mSegmentName     = "山东高速集团";
            mSerialNo        = "XXXX";
            mStartDKCode     = "DK";
            mEndDKCode       = "DK";

            mMileage_Start = 0;
            mMileage_Mid   = 158000;
            mMileage_End   = 316000;

            Mileage_Start_Ds = CRailwayLineList.CombiDKCode(mStartDKCode, mMileage_Start);
            //Mileage_Mid_Ds = Mileage_Mid_Des;
            Mileage_End_Ds = CRailwayLineList.CombiDKCode(mEndDKCode, mMileage_End);
            mLength        = Math.Abs(mMileage_End - mMileage_Start);
            mUpdateTime    = DateTime.Now;
            // FIXME 应该进行统计
            mfx = new List <CFXProj>();
            //mfx.Add(new CFXProj(0,"桥梁",1000));
            //mfx.Add(new CFXProj(1, "路基", 10000));
            //mfx.Add(new CFXProj(2, "隧道", 10000));
        }
Esempio n. 2
0
        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));
                //}
            }
        }
Esempio n. 3
0
        /// <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);
        }