예제 #1
0
        public void _ReadSegmentLinings(
            DGObjects objs,
            string tableNameSQL,
            string conditionSQL,
            string orderSQL)
        {
            ReadRawData(objs, tableNameSQL, orderSQL, conditionSQL);
            DataTable table = objs.rawDataSet.Tables[0];

            ///
            /// 0. [SegmentLinings]
            ///
            foreach (DataRow reader in table.Rows)
            {
                if (IsDbNull(reader, "ID"))
                    continue;

                SegmentLining SL = new SegmentLining(reader);
                SL.id = ReadInt(reader, "ID").Value;
                SL.name = ReadString(reader, "Name");
                SL.fullName = ReadString(reader, "FullName");
                SL.description = ReadString(reader, "Description");
                SL.StartMileage = ReadDouble(reader, "MilageAsDesign");
                SL.SLTypeID = ReadInt(reader, "SLTypeIDAsDesign");
                SL.LineNo = ReadInt(reader, "LineNo").Value;
                SL.RingNo = ReadInt(reader, "RingNo").Value;
                SL.CentroidZ = ReadDouble(reader, "Centroid_Z");

                SL.shape = ReadShape(reader);

                objs[SL.key] = SL;
            }

            /*
             * Don't write code like this because linq is too slow for large data.
             * 
            foreach (SegmentLining SL in objs.Values)
            {
                DataTable sub_table = objs.RawDataSet.Tables[1];
                var rows = from row in sub_table.AsEnumerable()
                           where !IsDbNull(row, "LineNo") &&
                                 !IsDbNull(row, "RingNo") &&
                                 Convert.ToInt32(row["LineNo"]) == SL.LineNo &&
                                 Convert.ToInt32(row["RingNo"]) == SL.RingNo
                           select row;
                ...
            }
            */
            ///
            ///1.[SLConstructionRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLConstructionRecords"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;
                    rec.ConstructionDate = ReadDateTime(reader, "ConstructionDate");
                    rec.MileageAsBuilt = ReadDouble(reader, "MilageAsBuilt");
                    rec.SLTypeIDAsBuilt = ReadInt(reader, "SLTypeIDAsBuilt");
                    rec.KeySegmentPosition = ReadInt(reader, "KeySegementPositionNum");
                    rec.Remarks = ReadString(reader, "Remarks");
                }
            }
            ///
            ///2. [TBMDrivingRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "TBMDrivingRecords"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.TBMDrivingRecord.DataAquisitionNum = ReadInt(reader, "DataAquisitionNum");
                    rec.TBMDrivingRecord.DrivingDate = ReadDateTime(reader, "DrivingDate");
                    rec.TBMDrivingRecord.DrivingSpeed = ReadDouble(reader, "DrivingSpeed");
                    // time detail
                    rec.TBMDrivingRecord.TimeDetail.DrivingStartTime = ReadString(reader, "DrivingStartTime");
                    rec.TBMDrivingRecord.TimeDetail.DrivingEndTime = ReadString(reader, "DrivingEndTime");
                    rec.TBMDrivingRecord.TimeDetail.ExcavTime = ReadInt(reader, "ExcavTime");
                    rec.TBMDrivingRecord.TimeDetail.ExcavStopTime = ReadInt(reader, "ExcavStopTime");
                    rec.TBMDrivingRecord.TimeDetail.ExcavWaitingTime = ReadInt(reader, "ExcavWaitingTime");
                    rec.TBMDrivingRecord.TimeDetail.AssemTime = ReadInt(reader, "AssemTime");
                    rec.TBMDrivingRecord.TimeDetail.AssemStopTime = ReadInt(reader, "AssemStopTime");
                    // grouting detail
                    rec.TBMDrivingRecord.GroutingDetail.GroutingAmountOfPumps = new double?[6];
                    rec.TBMDrivingRecord.GroutingDetail.GroutingPressureOfPumps = new double?[6];
                    for (int index = 0; index < 6; ++index)
                        rec.TBMDrivingRecord.GroutingDetail.GroutingAmountOfPumps[index] = ReadDouble(reader, "GroutingAmountOfPump" + (index + 1).ToString());
                    for (int index = 0; index < 6; ++index)
                        rec.TBMDrivingRecord.GroutingDetail.GroutingPressureOfPumps[index] = ReadDouble(reader, "GroutingPressureOfPump" + (index + 1).ToString());
                    rec.TBMDrivingRecord.GroutingDetail.TotalGroutingAmountOfAllPumps = ReadDouble(reader, "TotalGroutingAmountOfAllPumps");
                    rec.TBMDrivingRecord.GroutingDetail.GroutingOilAmountAtTBMTail = ReadDouble(reader, "GroutingOilAmountAtTBMTail");
                    rec.TBMDrivingRecord.GroutingDetail.GroutingOilAmountAtFrontChamber = ReadDouble(reader, "GroutingOilAmountAtFrontChamber");
                    rec.TBMDrivingRecord.GroutingDetail.GroutingOilAmountAtMiddleChamber = ReadDouble(reader, "GroutingOilAmountAtMiddleChamber");
                    rec.TBMDrivingRecord.GroutingDetail.GroutingOilAmountAtRearChamber = ReadDouble(reader, "GroutingOilAmountAtRearChamber");
                    // driving force detail
                    rec.TBMDrivingRecord.ForceDetail.TotalDrivingForce = ReadDouble(reader, "TotalDrivingForce");
                    rec.TBMDrivingRecord.ForceDetail.RearFrameTractionForce = ReadDouble(reader, "RearFrameTractionForce");
                    // pressure detail
                    rec.TBMDrivingRecord.PressureDetail.AirBubblePressure = ReadDouble(reader, "AirBubblePressure");
                    rec.TBMDrivingRecord.PressureDetail.FrontChamberPressure = ReadDouble(reader, "FrontChamberPressure");
                    // mud detail
                    rec.TBMDrivingRecord.MudDetail.MudLiquidLevel = ReadDouble(reader, "MudLiquidLevel");
                    rec.TBMDrivingRecord.MudDetail.IncomingMudAmount = ReadDouble(reader, "IncomingMudAmount");
                    rec.TBMDrivingRecord.MudDetail.DischargingMudAmount = ReadDouble(reader, "DischargingMudAmount");
                    rec.TBMDrivingRecord.MudDetail.IncomingMudDensity = ReadDouble(reader, "IncomingMudDensity");
                    rec.TBMDrivingRecord.MudDetail.DischargingMudDensity = ReadDouble(reader, "DischargingMudDensity");
                    // cutter header detail
                    rec.TBMDrivingRecord.CutterHeadDetail.RotationSpeedOfCutterHead = ReadDouble(reader, "RotationSpeedOfCutterHead");
                    rec.TBMDrivingRecord.CutterHeadDetail.PenetrationOfCutterHead = ReadDouble(reader, "PenetrationOfCutterHead");
                    // deviation detail
                    rec.TBMDrivingRecord.DeviationDetail.ExcavDeviation = ReadDouble(reader, "ExcavDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.AbsoluteDeviationX = ReadDouble(reader, "AbsoluteDeviationX");
                    rec.TBMDrivingRecord.DeviationDetail.AbsoluteDeviationY = ReadDouble(reader, "AbsoluteDeviationY");
                    rec.TBMDrivingRecord.DeviationDetail.BeginFrontHorizontalDeviation = ReadDouble(reader, "BeginFrontHorizontalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.BeginFrontElevationalDeviation = ReadDouble(reader, "BeginFrontElevationalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.EndFrontHorizontalDeviation = ReadDouble(reader, "EndFrontHorizontalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.EndFrontElevationalDeviation = ReadDouble(reader, "EndFrontElevationalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.BeginRearHorizontalDeviation = ReadDouble(reader, "BeginRearHorizontalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.BeginRearElevationalDeviation = ReadDouble(reader, "BeginRearElevationalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.EndRearHorizontalDeviation = ReadDouble(reader, "EndRearHorizontalDeviation");
                    rec.TBMDrivingRecord.DeviationDetail.EndRearElevationalDeviation = ReadDouble(reader, "EndRearElevationalDeviation");
                    // angle detail
                    rec.TBMDrivingRecord.AngleDetail.FrontRotationAngleOfTBM = ReadDouble(reader, "FrontRotationAngleOfTBM");
                    rec.TBMDrivingRecord.AngleDetail.DipAngle = ReadDouble(reader, "DipAngle");
                    rec.TBMDrivingRecord.AngleDetail.RotationAngle = ReadDouble(reader, "RotationAngle");
                    rec.TBMDrivingRecord.AngleDetail.AzimuthAngle = ReadDouble(reader, "AzimuthAngle");
                    // travel detail
                    rec.TBMDrivingRecord.TravelDetail.BeginTravelDistance = ReadDouble(reader, "BeginTravelDistance");
                    rec.TBMDrivingRecord.TravelDetail.EndTravelDistance = ReadDouble(reader, "EndTravelDistance");
                    rec.TBMDrivingRecord.TravelDetail.DrivingMilage = ReadDouble(reader, "DrivingMilage");
                }
            }
            ///
            ///3.[TBMPostureRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "TBMPostureRecords"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.TBMPostureRecord.CutterHeadHorizontalDeviation = ReadDouble(reader, "CutterHeadHorizontalDeviation");
                    rec.TBMPostureRecord.CutterHeadElevationalDeviation = ReadDouble(reader, "CutterHeadElevationalDeviation");
                    rec.TBMPostureRecord.TBMTailHorizontalDeviation = ReadDouble(reader, "TBMTailHorizontalDeviation");
                    rec.TBMPostureRecord.TBMTailElevationalDeviation = ReadDouble(reader, "TBMTailElevationalDeviation");
                    rec.TBMPostureRecord.TBMSlope = ReadDouble(reader, "TBMSlope");
                    rec.TBMPostureRecord.TBMRotationAngle = ReadString(reader, "TBMRotationAngle");
                }
            }
            ///
            ///4.[SLPostureRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLPostureRecords"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.SLPostureRecord.SLHorizontalDeviation = ReadDouble(reader, "SLHorizontalDeviation");
                    rec.SLPostureRecord.SLElevationalDeviation = ReadDouble(reader, "SLElevationalDeviation");
                    // gap detail
                    rec.SLPostureRecord.GapDetail.SLGapUp = ReadDouble(reader, "SLGapUp");
                    rec.SLPostureRecord.GapDetail.SLGapDown = ReadDouble(reader, "SLGapDown");
                    rec.SLPostureRecord.GapDetail.SLGapLeft = ReadDouble(reader, "SLGapLeft");
                    rec.SLPostureRecord.GapDetail.SLGapRight = ReadDouble(reader, "SLGapRight");
                    rec.SLPostureRecord.GapDetail.SLOtherGaps = new double?[8];
                    for (int index = 0; index < 8; ++index)
                        rec.SLPostureRecord.GapDetail.SLOtherGaps[index] = ReadDouble(reader, "SLGap" + (index + 1).ToString());
                    // diameter detail
                    rec.SLPostureRecord.DiameterDetail.HorizontalDiameter = ReadDouble(reader, "HorizontalDiameter");
                    rec.SLPostureRecord.DiameterDetail.VerticalDiameter = ReadDouble(reader, "VerticalDiameter");
                    rec.SLPostureRecord.DiameterDetail.OtherDiameters = new double?[2];
                    for (int index = 0; index < 2; ++index)
                        rec.SLPostureRecord.DiameterDetail.OtherDiameters[index] = ReadDouble(reader, "Diamter" + (index + 1).ToString());
                    rec.SLPostureRecord.DiameterDetail.DeformationDescription = ReadString(reader, "DeformationDescription");
                }
            }
            ///
            ///5.[SLQualityRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLQualityRecords"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    SLQualityRecordType qualityRec = new SLQualityRecordType();
                    qualityRec.QualityDescription = ReadString(reader, "QualityDescription");
                    qualityRec.InspectionDate = ReadString(reader, "InspectionDate");
                    qualityRec.Repairment = ReadString(reader, "Repairment");
                    rec.SLQualityRecords.Add(qualityRec);
                }
            }
            ///
            ///6.[SLSettlementRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLSettlement"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.SLSettlementRecords.LineNo = rec.LineNo;
                    rec.SLSettlementRecords.RingNo = rec.RingNo;
                    rec.SLSettlementRecords.Name = SL.name;
                    rec.SLSettlementRecords.ID = SL.id;

                    SLSettlementItem item = new SLSettlementItem();
                    item.Name = ReadString(reader, "Name");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Total = ReadDouble(reader, "Total");
                    item.Inc = ReadDouble(reader, "Increasement");
                    item.Rate = ReadDouble(reader, "Rate");
                    item.InitialElev = ReadDouble(reader, "InitialElev");
                    item.Elevation = ReadDouble(reader, "Elevation");
                    rec.SLSettlementRecords.SLSettlementItems.Add(item);
                }
            }

            ///
            ///7.[SLConvergenceRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLConvergence"];
            if (table != null)
            {
                foreach (DataRow reader in table.Rows)
                {
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLConstructionRecordType rec = SL.ConstructionRecord;
                    rec.SLConvergenceRecords.LineNo = rec.LineNo;
                    rec.SLConvergenceRecords.RingNo = rec.RingNo;
                    rec.SLConvergenceRecords.Name = SL.name;
                    rec.SLConvergenceRecords.ID = SL.id;

                    SLConvergenceItem item = new SLConvergenceItem();
                    //item.Name = ReadString(reader, "Name");
                    item.Date = ReadDateTime(reader, "Date");
                    item.HorizontalRad = ReadDouble(reader, "HorizontalRad");
                    item.HorizontalDev = ReadDouble(reader, "HorizontalDeviation");
                    item.VerticalRad = ReadDouble(reader, "VerticalRad");
                    item.VerticalDev = ReadDouble(reader, "VerticalDeviation");
                    rec.SLConvergenceRecords.SLConvergenceItems.Add(item);
                }
            }

            ///
            ///8.[SLSpallRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLSpall"];
            if (table != null)
            {
                DataColumn column = table.Columns.Add("RingNo", typeof(int));
                foreach (DataRow reader in table.Rows)
                {
                    int? ringNo = ReadInt(reader, "StartRingNo");
                    reader.SetField(column, ringNo);
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLInspectionRecordType rec = SL.InspectionRecords;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;

                    SLSpallRecordItem item = new SLSpallRecordItem();
                    //item.Name = ReadString(reader, "Name");
                    item.LineNo = SL.LineNo;
                    item.StartMilage = ReadDouble(reader, "StartMilage");
                    item.EndMilage = ReadDouble(reader, "EndMilage");
                    item.StartRingNo = ReadInt(reader, "StartRingNo");
                    item.EndRingNo = ReadInt(reader, "EndRingNo");
                    item.SLCode = ReadString(reader, "SLCode");
                    item.LocalX = ReadDouble(reader, "LocalX");
                    item.LocalY = ReadDouble(reader, "LocalY");
                    item.Shape = ReadString(reader, "Shape");
                    item.Area = ReadDouble(reader, "Area");
                    item.Length = ReadDouble(reader, "Length");
                    item.Width = ReadDouble(reader, "Width");
                    item.Depth = ReadDouble(reader, "Depth");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Document = ReadString(reader, "Document");
                    item.Discription = ReadString(reader,"Discription");
                    SL.InspectionRecords.SLSpallRecords.Add(item);
                }
            }

            ///
            ///9.[SLCrackRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "SLCrackRecord"];
            if (table != null)
            {
                DataColumn column = table.Columns.Add("RingNo", typeof(int));
                foreach (DataRow reader in table.Rows)
                {
                    int? ringNo = ReadInt(reader, "StartRingNo");
                    reader.SetField(column, ringNo);
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLInspectionRecordType rec = SL.InspectionRecords;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;

                    SLCrackRecordItem item = new SLCrackRecordItem();
                    item.LineNo = SL.LineNo;
                    item.StartMilage = ReadDouble(reader, "StartMilage");
                    item.EndMilage = ReadDouble(reader, "EndMilage");
                    item.StartRingNo = ReadInt(reader, "StartRingNo");
                    item.EndRingNo = ReadInt(reader, "EndRingNo");
                    item.SLCode = ReadString(reader, "SLCode");
                    item.Direction = ReadString(reader, "Direction");
                    item.Length = ReadDouble(reader, "Length");
                    item.Width = ReadDouble(reader, "Width");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Document = ReadString(reader, "Document");
                    item.Discription = ReadString(reader, "Discription");
                    SL.InspectionRecords.SLCrackRecords.Add(item);
                }
            }

            ///
            ///10.[DislocationRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "Dislocation"];
            if (table != null)
            {
                DataColumn column = table.Columns.Add("RingNo", typeof(int));
                foreach (DataRow reader in table.Rows)
                {
                    int? ringNo = ReadInt(reader, "StartRingNo");
                    reader.SetField(column, ringNo);
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLInspectionRecordType rec = SL.InspectionRecords;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;

                    DislocationRecordItem item = new DislocationRecordItem();
                    item.LineNo = SL.LineNo;
                    item.StartMilage = ReadDouble(reader, "StartMilage");
                    item.EndMilage = ReadDouble(reader, "EndMilage");
                    item.StartRingNo = ReadInt(reader, "StartRingNo");
                    item.EndRingNo = ReadInt(reader, "EndRingNo");
                    item.SLCode = ReadString(reader, "SLCode");
                    item.Horizontal = ReadDouble(reader, "Horizontal");
                    item.Vertical = ReadDouble(reader, "Vertical");
                    item.Total = ReadDouble(reader, "Total");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Document = ReadString(reader, "Document");
                    item.Discription = ReadString(reader, "Discription");
                    SL.InspectionRecords.DislocationRecords.Add(item);
                }
            }

            ///
            ///11.[JointOpeningRecords]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "JointOpening"];
            if (table != null)
            {
                DataColumn column = table.Columns.Add("RingNo", typeof(int));
                foreach (DataRow reader in table.Rows)
                {
                    int? ringNo = ReadInt(reader, "StartRingNo");
                    reader.SetField(column, ringNo);
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLInspectionRecordType rec = SL.InspectionRecords;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;

                    JointOpeningRecordItem item = new JointOpeningRecordItem();
                    item.LineNo = SL.LineNo;
                    item.StartMilage = ReadDouble(reader, "StartMilage");
                    item.EndMilage = ReadDouble(reader, "EndMilage");
                    item.StartRingNo = ReadInt(reader, "StartRingNo");
                    item.EndRingNo = ReadInt(reader, "EndRingNo");
                    item.SLCode1 = ReadString(reader, "SLCode1");
                    item.SLCode2 = ReadString(reader, "SLCode2");
                    item.Total = ReadDouble(reader, "Total");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Document = ReadString(reader, "Document");
                    item.Discription = ReadString(reader, "Discription");
                    SL.InspectionRecords.JointOpeningRecords.Add(item);
                }
            }

            ///
            ///11.[LeakageRecord]
            ///
            table = objs.rawDataSet.Tables[_dbContext.TableNamePrefix + "Leakage"];
            if (table != null)
            {
                DataColumn column = table.Columns.Add("RingNo", typeof(int));
                foreach (DataRow reader in table.Rows)
                {
                    int? ringNo = ReadInt(reader, "StartRingNo");
                    reader.SetField(column, ringNo);
                    SegmentLining SL = _GetSL(objs, reader);
                    if (SL == null)
                        continue;

                    SLInspectionRecordType rec = SL.InspectionRecords;
                    rec.LineNo = SL.LineNo;
                    rec.RingNo = SL.RingNo;

                    LeakageRecordItem item = new LeakageRecordItem();
                    item.LineNo = SL.LineNo;
                    item.StartMilage = ReadDouble(reader, "StartMilage");
                    item.EndMilage = ReadDouble(reader, "EndMilage");
                    item.StartRingNo = ReadInt(reader, "StartRingNo");
                    item.EndRingNo = ReadInt(reader, "EndRingNo");
                    item.SLCode = ReadString(reader, "SLCode");
                    item.StartAngle = ReadDouble(reader, "StartAngle");
                    item.EndAngle = ReadDouble(reader, "EndAngle");
                    item.Shape = ReadString(reader, "Shape");
                    item.Area = ReadDouble(reader, "Area");
                    item.Speed = ReadDouble(reader, "Speed");
                    item.Status = ReadString(reader, "Status");
                    item.p = ReadString(reader, "p");
                    item.pH = ReadDouble(reader, "pH");
                    item.Date = ReadDateTime(reader, "Date");
                    item.Document = ReadString(reader, "Document");
                    item.Discription = ReadString(reader, "Discription");
                    item.WaterSample = ReadString(reader, "WaterSample");
                    SL.InspectionRecords.LeakageRecords.Add(item);
                }
            }
        }
예제 #2
0
        void GenerateGraphics(SegmentLining sl, double centerX, double centerZ, SoilInitalStress.IResult rIS)
        {
            IView view = InputViewCB.SelectedItem as IView;

            double zScale = view.eMap.ScaleZ;
            double radius = _IniStress.D / 2.0;
            double len = 5.0;   // drawing length for soil pressure, this is for Qe2.
            double gap = 1.0;   // drawing gap between soil pressure and water pressure.
            double x1, x2, x3, x4, x5, x6;
            double y, y1, y2, y3, y4, y5, y6;
            double max = rIS.Pw2;

            // left
            x1 = centerX - radius * zScale - gap;
            x2 = x1 - (rIS.Qe1 / max) * len;
            x3 = x1 - (rIS.Qe2 / max) * len;
            x4 = x3 - gap;
            x5 = x4 - (rIS.Qw1 / max) * len;
            x6 = x4 - (rIS.Qw2 / max) * len;
            y = centerZ;
            y1 = y - zScale * radius;
            y2 = y + zScale * radius;

            IGraphicCollection graphicResult = Runtime.graphicEngine.newGraphicCollection();
            IGraphicCollection gc = ShieldTunnelMappingUtility.DistributedLoad_Vertical(x1, x2, x3, y1, y2,
                _fillSymbol,_arrowFillSymbol,_lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }

            gc = ShieldTunnelMappingUtility.DistributedLoad_Vertical(x4, x5, x6, y1, y2,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }

            // right
            x1 = centerX + radius * zScale + gap;
            x2 = x1 + (rIS.Qe1 / max) * len;
            x3 = x1 + (rIS.Qe2 / max) * len;
            x4 = x3 + gap;
            x5 = x4 + (rIS.Qw1 / max) * len;
            x6 = x4 + (rIS.Qw2 / max) * len;

            gc = ShieldTunnelMappingUtility.DistributedLoad_Vertical(x1, x2, x3, y1, y2,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            string str = string.Format("Qe1={0:0.0} kPa", rIS.Qe1);
            IMapPoint p = Runtime.geometryEngine.newMapPoint(x2, y2, _spatialRef);
            IGraphic gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);
            str = string.Format("Qe2={0:0.0} kPa", rIS.Qe2);
            p = Runtime.geometryEngine.newMapPoint(x3, y1, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            gc = ShieldTunnelMappingUtility.DistributedLoad_Vertical(x4, x5, x6, y1, y2,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Qw1={0:0.0} kPa", rIS.Qw1);
            p = Runtime.geometryEngine.newMapPoint(x5, y2, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);
            str = string.Format("Qw2={0:0.0} kPa", rIS.Qw2);
            p = Runtime.geometryEngine.newMapPoint(x6, y1, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            // top
            x1 = centerX - radius * zScale;
            x2 = centerX + radius * zScale;
            y1 = centerZ + radius * zScale + gap;
            y2 = y1 + (rIS.Pg / max) * len;
            y3 = y2 + gap;
            y4 = y3 + (rIS.Pe1 / max) * len;
            y5 = y4 + gap;
            y6 = y5 + (rIS.Pw1 / max) * len;

            gc = ShieldTunnelMappingUtility.DistributedLoad_Horizontal(x1, x2, y1, y2, y2,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Pg={0:0.0} kPa", rIS.Pg);
            p = Runtime.geometryEngine.newMapPoint(x2, y2, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            gc = ShieldTunnelMappingUtility.DistributedLoad_Horizontal(x1, x2, y3, y4, y4,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Pe1={0:0.0} kPa", rIS.Pe1);
            p = Runtime.geometryEngine.newMapPoint(x2, y4, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            gc = ShieldTunnelMappingUtility.DistributedLoad_Horizontal(x1, x2, y5, y6, y6,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Pw1={0:0.0} kPa", rIS.Pw1);
            p = Runtime.geometryEngine.newMapPoint(x2, y6, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            // bottom
            y1 = centerZ - radius * zScale - gap;
            y2 = y1 - (rIS.Pe2 / max) * len;
            y3 = y2 - gap;
            y4 = y3 - (rIS.Pw2 / max) * len;

            gc = ShieldTunnelMappingUtility.DistributedLoad_Horizontal(x1, x2, y1, y2, y2,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Pe2={0:0.0} kPa", rIS.Pe2);
            p = Runtime.geometryEngine.newMapPoint(x2, y2, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            gc = ShieldTunnelMappingUtility.DistributedLoad_Horizontal(x1, x2, y3, y4, y4,
                _fillSymbol, _arrowFillSymbol, _lineSymbol, _spatialRef);
            foreach (IGraphic g in gc)
            {
                graphicResult.Add(g);
            }
            str = string.Format("Pw2={0:0.0} kPa", rIS.Pw2);
            p = Runtime.geometryEngine.newMapPoint(x2, y4, _spatialRef);
            gText = Runtime.graphicEngine.newText(str, p, Colors.Blue, "Arial", 14.0);
            graphicResult.Add(gText);

            _slsGraphics[sl.id.ToString() + view.eMap.MapID] = graphicResult;
        }