private decimal getvalue7()
        {
            string    domain       = "Construction";
            string    objType_name = "SCHE";
            DGObjects objs         = Globals.project.objsDefIndex[objType_name];

            Type       objType = iS3Property.GetType(domain, objType_name);
            MethodInfo mi      = typeof(iS3Property).GetMethod("GetProperty").MakeGenericMethod(objType);
            Pile       ageo_mileage;

            foreach (DGObject ageo in objs.objContainer)
            {
                List <PropertyDef> _propertyDefs = mi.Invoke(new iS3Property(), new object[] { ageo }) as List <PropertyDef>;

                string st1, st2;
                st1 = _propertyDefs.Find(s => s.key.Equals("PROG_CCJD")).value;
                st2 = _propertyDefs.Find(s => s.key.Equals("PROG_ECJD")).value;
                if ((st1 == null) || (st2 == null))
                {
                    continue;
                }

                ageo_mileage = DrawObjects.getSectionPos(st1);
                decimal v1 = ageo_mileage.pilepoint;
                ageo_mileage = DrawObjects.getSectionPos(st2);
                decimal v2 = ageo_mileage.pilepoint;

                if (Math.Abs(v1 - v2) > 120)
                {
                    return(2);
                }
            }
            return(0);
        }
示例#2
0
        /// <summary>
        /// Old constructor, currently not used (03.05.2020), but retained for future inspection
        /// </summary>
        public OutputChordSymbol(Voice voice, MidiChordDef umcd, int absMsPosition, PageFormat pageFormat)
            : base(voice, umcd.MsDuration, absMsPosition, pageFormat.MinimumCrotchetDuration, pageFormat.MusicFontHeight)
        {
            M.Assert(false); // 03.05.2020: don't use this constructor (to be inspected once work on midi info begins).

            _midiChordDef = umcd;

            _msDurationToNextBarline = umcd.MsDurationToNextBarline;

            SetNoteheadPitchesAndVelocities(umcd.NotatedMidiPitches, umcd.NotatedMidiVelocities);

            if (!String.IsNullOrEmpty(umcd.OrnamentText))
            {
                string ornamentString = null;
                if (Char.IsDigit(umcd.OrnamentText[0]))
                {
                    // if umcd.OrnamentText is null or empty, there will be no ornamentString DrawObject
                    ornamentString = String.Concat('~', umcd.OrnamentText);
                }
                else
                {
                    ornamentString = umcd.OrnamentText;
                }
                OrnamentText ornamentText = new OrnamentText(this, ornamentString, pageFormat.OrnamentFontHeight);
                DrawObjects.Add(ornamentText);
            }

            if (umcd.Lyric != null)
            {
                LyricText lyric = new LyricText(this, umcd.Lyric, FontHeight);
                DrawObjects.Add(lyric);
            }
        }
        private decimal getvalue8()
        {
            string    domain       = "Construction";
            string    objType_name = "SKTH";
            DGObjects objs         = Globals.project.objsDefIndex[objType_name];

            Type       objType = iS3Property.GetType(domain, objType_name);
            MethodInfo mi      = typeof(iS3Property).GetMethod("GetProperty").MakeGenericMethod(objType);

            foreach (DGObject ageo in objs.objContainer)
            {
                List <PropertyDef> _propertyDefs = mi.Invoke(new iS3Property(), new object[] { ageo }) as List <PropertyDef>;
                string             t1            = _propertyDefs.Find(s => s.key.Equals("SKTH_CHAI")).value;

                Pile ageo_mileage;
                if ((t1 == null) || (t1 == ""))
                {
                    continue;
                }
                ageo_mileage = DrawObjects.getSectionPos(t1);
                bool pos_flag = false;
                if (ageo_mileage.piletype == Piletype.point)
                {
                    if ((risk_position >= ageo_mileage.pilepoint - 40) && (risk_position <= ageo_mileage.pilepoint + 40))
                    {
                        pos_flag = true;
                    }
                }
                else
                {
                    if ((risk_position >= ageo_mileage.startpile) && (risk_position <= ageo_mileage.endpile))
                    {
                        pos_flag = true;
                    }
                }

                if (pos_flag == true)
                {
                    string st1;
                    st1 = _propertyDefs.Find(s => s.key.Equals("SKTH_WATG")).value;

                    if (st1 == null)
                    {
                        continue;
                    }
                    if (st1.Contains("淋雨状"))
                    {
                        return(3);
                    }
                    else
                    {
                        if (st1.Contains("大股"))
                        {
                            return(5);
                        }
                    }
                }
            }
            return(0);
        }
示例#4
0
 protected void SetDrawObjects(List <DrawObject> drawObjects)
 {
     DrawObjects.Clear();
     foreach (DrawObject drawObject in drawObjects)
     {
         drawObject.Container = this;
         DrawObjects.Add(drawObject);
     }
 }
        private void PredictLining(object sender, RoutedEventArgs e)
        {
            if (null == tunnelpile)
            {
                return;
            }
            rec_type        = new List <string>();
            similar_section = new List <string>();
            foreach (MILN obj in miln_objList)
            {
                Pile t1 = DrawObjects.getSectionPos(obj.MILN_STAR);
                Pile t2 = DrawObjects.getSectionPos(obj.MILN_END);
                if (obj.MILN_LNTY != design_type)
                {
                    continue;
                }

                //判断是否为已施工段
                if ((tunnelpile.sectionnumber == "S1") || (tunnelpile.sectionnumber == "S2"))
                {
                    if (t2.pilepoint > tunnelpile.pilepoint)
                    {
                        continue;
                    }
                }
                else
                {
                    if (t1.endpile < tunnelpile.pilepoint)
                    {
                        continue;
                    }
                }

                foreach (CHAG obj1 in chag_objList)
                {
                    Pile _tp = DrawObjects.getSectionPos(obj1.CHAG_CHAI);
                    //找已经施工的且相同设计衬砌类型的施工段
                    if ((_tp.startpile >= t1.pilepoint) || (_tp.endpile <= t2.pilepoint))
                    {
                        if (!rec_type.Contains(obj1.CHAG_PRES))
                        {
                            rec_type.Add(obj1.CHAG_PRES);
                        }
                        if (!similar_section.Contains(obj1.CHAG_CHAI))
                        {
                            similar_section.Add(obj1.CHAG_CHAI);
                        }
                    }
                }
                lininglist.Items.Clear();
                lininglist.ItemsSource = rec_type;

                similarlining.Items.Clear();
                similarlining.ItemsSource = similar_section;
            }
        }
示例#6
0
        //主程序加载完成之后执行
        private void MainFrame_projectLoaded(object sender, EventArgs e)
        {
            iS3Legned legeng_ACHE = new iS3Legned()
            {
                legndTitle    = "施工进度图例",
                iS3SymbolList = new List <iS3Symbol>()
                {
                    new iS3Symbol()
                    {
                        colorName = "Yellow", label = "初衬", symbolType = SymbolType.Rectangle
                    },
                    new iS3Symbol()
                    {
                        colorName = "GreenYellow", label = "二衬", symbolType = SymbolType.Rectangle
                    },
                    new iS3Symbol()
                    {
                        colorName = "Khaki", label = "仰拱", symbolType = SymbolType.Rectangle
                    },
                    new iS3Symbol()
                    {
                        label = "掌子面", symbolType = SymbolType.Icon, refPath = "redflag.png"
                    }
                    //new iS3Symbol(){label="图片",symbolType=SymbolType.Icon,refPath="照片.png"}
                }
            };

            IView2D _inputView = (Globals.mainFrame.views.Where(x => x.name == "右幅剖面图").FirstOrDefault()) as IView2D;

            _inputView.holder.setlegend(legeng_ACHE);
            _inputView.holder.setLegendShow(true);
            _inputView = (Globals.mainFrame.views.Where(x => x.name == "左幅剖面图").FirstOrDefault()) as IView2D;
            _inputView.holder.setlegend(legeng_ACHE);
            _inputView.holder.setLegendShow(true);

            try
            {
                DrawObjects drawObjects = new DrawObjects();
                drawObjects.DrawGRPF();

                drawObjects.DrawACHE();
                drawObjects.DrawACHE_EC();
                drawObjects.DrawACHE_YG();
                drawObjects.DrawACHE_ZZM();

                drawObjects.DrawCHAG();
                drawObjects.DrawTPSI();
                drawObjects.RiskIdentification();
                drawObjects.DrawTPZL();
                drawObjects.DrawSPZL();
            }
            catch (Exception ex)
            {
            }
            Globals.mainFrame.viewLoaded -= MainFrame_projectLoaded;
        }
示例#7
0
 private void TreeBaseMesh(object sender, MouseButtonEventArgs e)
 {
     if (sender is TreeViewItem BaseMeshItem && BaseMeshItem.Parent is TreeViewItem DeviceTree)
     {
         if (DeviceTree.DataContext is MonchaDevice device && BaseMeshItem.DataContext is MonchaDeviceMesh mesh)
         {
             DrawObjects?.Invoke(this, CadCanvas.GetMesh(mesh, device, MonchaHub.GetThinkess * AppSt.Default.anchor_size, false));
         }
     }
 }
示例#8
0
        private void UserControl2_Load(object sender, EventArgs e)
        {
            obj = new DrawObjects();

            btm = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            g   = Graphics.FromImage(btm);
            fg  = pictureBox1.CreateGraphics();

            th = new Thread(draw);
            th.IsBackground = true;
            th.Start();
        }
示例#9
0
        private void LiningPredictionWindow_Loaded(object sender, RoutedEventArgs e)
        {
            _prj      = Globals.project;
            mainFrame = Globals.mainFrame;

            _currentDoamin = _prj.getDomain("Construction");
            _getDGObjects  = _currentDoamin.DGObjectsList.Where(x => x.definition.Type == "ACHE").FirstOrDefault();
            //ache_objList = _getDGObjects.objContainer.Cast<ACHE>().ToList();
            ache_objList  = Transfer <ACHE>(_getDGObjects.objContainer);
            _getDGObjects = _currentDoamin.DGObjectsList.Where(x => x.definition.Type == "CHAG").FirstOrDefault();
            //chag_objList = _getDGObjects.objContainer.Cast<CHAG>().ToList();
            chag_objList = Transfer <CHAG>(_getDGObjects.objContainer);

            _currentDoamin = _prj.getDomain("Structure");
            _getDGObjects  = _currentDoamin.DGObjectsList.Where(x => x.definition.Type == "MILI").FirstOrDefault();
            //mili_objList = _getDGObjects.objContainer.Cast<MILN>().ToList();
            //use this func
            mili_objList = Transfer <MILI>(_getDGObjects.objContainer);

            DateTime latesttime = new DateTime(2000, 1, 1, 0, 0, 0);

            //寻找施工进度最新时间
            foreach (ACHE obj in ache_objList)
            {
                if (null != obj.PROG_DATE)
                {
                    DateTime temp = Convert.ToDateTime(obj.PROG_DATE);
                    if (DateTime.Compare(latesttime, temp) < 0)
                    {
                        latesttime = temp;
                    }
                }
            }
            //获取掌子面列表
            List <string> tunnelfacelist = new List <string>();

            foreach (ACHE obj in ache_objList)
            {
                if (obj.PROG_DATE == latesttime)
                {
                    string st        = obj.PROG_SGJD;
                    Pile   judgepile = DrawObjects.getSectionPos(st);
                    if (null != judgepile)
                    {
                        tunnelfacelist.Add(st);
                    }
                }
            }
            tunnelfacebox.ItemsSource = tunnelfacelist;
        }
示例#10
0
        private void MainFrame_viewLoaded(object sender, EventArgs e)
        {
            DrawObjects drawObjects = new DrawObjects();

            try
            {
                drawObjects.DrawMILI();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.ToString());
            }
            Globals.mainFrame.viewLoaded -= MainFrame_viewLoaded;
        }
示例#11
0
        public InputChordSymbol(Voice voice, InputChordDef umcd, int minimumCrotchetDurationMS, float fontSize)
            : base(voice, umcd.MsDuration, umcd.MsPosition, minimumCrotchetDurationMS, fontSize)
        {
            _inputChordDef = umcd;

            _msDurationToNextBarline = umcd.MsDurationToNextBarline;

            SetNoteheadPitches(umcd.NotatedMidiPitches);

            if (umcd.Lyric != null)
            {
                LyricText lyricText = new LyricText(this, umcd.Lyric, FontHeight);
                DrawObjects.Add(lyricText);
            }
        }
示例#12
0
        public void RemovePins()
        {
            List <Object> toRemove = new List <object>();

            foreach (Object dobj in DrawObjects)
            {
                if (dobj.GetType() == typeof(KicadLibPin))
                {
                    toRemove.Add(dobj);
                }
            }

            foreach (Object obj in toRemove)
            {
                DrawObjects.Remove(obj);
            }
        }
示例#13
0
        private void TreeViewDevice_ContextMenuClosing(object sender, ContextMenuEventArgs e)
        {
            if (sender is TreeViewItem viewItem)
            {
                if (viewItem.ContextMenu.DataContext is MenuItem cmindex && sender is TreeViewItem treeView &&
                    treeView.DataContext is MonchaDevice device)
                {
                    switch (cmindex.Tag)
                    {
                    case "dvc_showrect":
                        device.DrawZone();
                        break;

                    case "dvc_showzone":
                        DrawObjects?.Invoke(this, new List <FrameworkElement>()
                        {
                            new CadRectangle(device.DeviceZone.P1, device.DeviceZone.P2, false)
                            {
                                Render = false
                            }
                        });
                        break;

                    case "dvc_polymesh":
                        device.PolyMeshUsed = !device.PolyMeshUsed;
                        MonchaHub.RefreshDevice();
                        break;

                    case "dvc_center":
                        DrawObjects?.Invoke(this, new List <FrameworkElement>()
                        {
                            new CadAnchor(device.DeviceZone.CenterPoint, false)
                            {
                                Render = false
                            }
                        });
                        break;
                    }
                }
            }
        }
示例#14
0
        public OutputChordSymbol(Voice voice, MidiChordDef umcd, int minimumCrotchetDurationMS, float fontSize)
            : base(voice, umcd.MsDuration, umcd.MsPosition, minimumCrotchetDurationMS, fontSize)
        {
            _midiChordDef = umcd;

            _msDurationToNextBarline = umcd.MsDurationToNextBarline;

            SetNoteheadPitches(umcd.NotatedMidiPitches);

            if (umcd.OrnamentNumberSymbol != 0)
            {
                OrnamentText ornamentText = new OrnamentText(this, "~" + umcd.OrnamentNumberSymbol.ToString(), FontHeight);
                DrawObjects.Add(ornamentText);
            }

            if (umcd.Lyric != null)
            {
                LyricText lyric = new LyricText(this, umcd.Lyric, FontHeight);
                DrawObjects.Add(lyric);
            }
        }
示例#15
0
        private void tuennalfacebox_changed(object sender, SelectionChangedEventArgs e)
        {
            string _facepile = tunnelfacebox.SelectedValue.ToString();

            tunnelpile = DrawObjects.getSectionPos(_facepile);
            tunnelpile.sectionnumber = DrawObjects.getrightSectionnumber(tunnelpile.pilepoint);
            //找到该桩号的设计衬砌类型
            foreach (MILI obj in mili_objList)
            {
                Pile t1 = DrawObjects.getSectionPos(obj.MILI_STAR);
                Pile t2 = DrawObjects.getSectionPos(obj.MILI_END);

                if (t1.tunnelpart != tunnelpile.tunnelpart)
                {
                    continue;
                }
                if ((t1.pilepoint <= tunnelpile.pilepoint) && (t2.pilepoint >= tunnelpile.pilepoint))
                {
                    design_type = obj.MILI_LNTY;
                    break;
                }
            }
            disgntype.Text = design_type;
        }
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index1 = sect1.SelectedIndex;

            if (index1 == 0)
            {
                mileage.Text = "K4+020";
            }
            else if (index1 == 1)
            {
                mileage.Text = "K4+715";
            }
            else if (index1 == 2)
            {
                mileage.Text = "K0+180";
            }
            else if (index1 == 3)
            {
                mileage.Text = "YK10+820";
            }
            string t1 = mileage.Text;
            Pile   ageo_mileage;

            ageo_mileage  = DrawObjects.getSectionPos(t1);
            risk_position = ageo_mileage.pilepoint;
            g1.Content    = getvalue1().ToString();
            g2.Content    = getvalue2().ToString();
            g3.Content    = getvalue3().ToString();
            g4.Content    = getvalue4().ToString();
            g5.Content    = getvalue5().ToString();
            g6.Content    = getvalue6().ToString();
            g7.Content    = getvalue7().ToString();
            g8.Content    = getvalue8().ToString();
            g9.Content    = getvalue9().ToString();
            g10.Content   = getvalue10().ToString();
        }
        private decimal getvalue2()
        {
            string    domain       = "Geology";
            string    objType_name = "AGEO";
            Pile      ageo_mileage;
            DGObjects objs = Globals.project.objsDefIndex[objType_name];

            Type       objType = iS3Property.GetType(domain, objType_name);
            MethodInfo mi      = typeof(iS3Property).GetMethod("GetProperty").MakeGenericMethod(objType);



            foreach (DGObject ageo in objs.objContainer)
            {
                List <PropertyDef> _propertyDefs = mi.Invoke(new iS3Property(), new object[] { ageo }) as List <PropertyDef>;
                string             t             = _propertyDefs.Find(s => s.key.Equals("AGEO_DSRG")).value;

                if ((t == null) || (t == ""))
                {
                    continue;
                }
                string t1 = "";
                if (t.Contains("左"))
                {
                    t1 = t.Split('左')[0];
                }
                if (t.Contains("右"))
                {
                    t1 = t.Split('右')[0];
                }
                try
                {
                    ageo_mileage = DrawObjects.getSectionPos(t1);

                    bool pos_flag = false;
                    if (ageo_mileage.piletype == Piletype.point)
                    {
                        if ((risk_position >= ageo_mileage.pilepoint - 40) && (risk_position <= ageo_mileage.pilepoint + 40))
                        {
                            pos_flag = true;
                        }
                    }
                    else
                    {
                        if ((risk_position >= ageo_mileage.startpile) && (risk_position <= ageo_mileage.endpile))
                        {
                            pos_flag = true;
                        }
                    }

                    if (pos_flag == true)
                    {
                        string st1, st2;
                        st1 = _propertyDefs.Find(s => s.key.Equals("AGEO_TYPE")).value;
                        st2 = _propertyDefs.Find(s => s.key.Equals("AGEO_LAWD")).value;
                        if ((st2 == null) || (st1 == null))
                        {
                            continue;
                        }
                        if ((st1 == "溶洞") || (st1 == "岩溶漏斗"))
                        {
                            decimal dis = Convert.ToDecimal(st2);
                            if (dis < 8)
                            {
                                return(3);
                            }
                            else
                            {
                                if (dis < 24)
                                {
                                    return(2);
                                }
                                else
                                {
                                    return(1);
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            return(0);
        }
示例#18
0
        private void ACHE_Control_Loaded(object sender, RoutedEventArgs e)
        {
            _prj           = Globals.project;
            mainFrame      = Globals.mainFrame;
            _currentDoamin = _prj.getDomain("Construction");
            _getDGObjects  = _currentDoamin.DGObjectsList.Where(x => x.definition.Type == "ACHE").FirstOrDefault();
            ache_objList   = Transfer <ACHE>(_getDGObjects.objContainer);
            _getDGObjects  = _currentDoamin.DGObjectsList.Where(x => x.definition.Type == "SCHE").FirstOrDefault();
            sche_objList   = Transfer <SCHE>(_getDGObjects.objContainer);


            Dictionary <string, DateTime> latesttime = new Dictionary <string, DateTime>();
            DateTime temp2 = new DateTime(2000, 1, 1, 0, 0, 0);

            latesttime.Add("S1", temp2);
            latesttime.Add("S2", temp2);
            latesttime.Add("S3", temp2);
            latesttime.Add("S4", temp2);
            latesttime.Add("S2XJ", temp2);
            latesttime.Add("S3XJ", temp2);

            //寻找最新时间
            foreach (ACHE obj in ache_objList)
            {
                if (null != obj.PROG_DATE)
                {
                    string bd = obj.PROG_NAME;
                    if (latesttime[bd] != null)
                    {
                        DateTime temp1 = Convert.ToDateTime(obj.PROG_DATE);
                        if (DateTime.Compare(latesttime[bd], temp1) < 0)
                        {
                            latesttime[bd] = temp1;
                        }
                    }
                }
            }

            //计算各个实际进度比例
            ccdegree = new float[4];
            ecdegree = new float[4];
            ygdegree = new float[4];
            foreach (ACHE obj in ache_objList)
            {
                if ((obj.PROG_DATE != latesttime[obj.PROG_NAME]) || (obj.PROG_LORR != "右幅"))
                {
                    continue;
                }
                ccres = DrawObjects.getSectionPos(obj.PROG_CCJD);
                ecres = DrawObjects.getSectionPos(obj.PROG_ECJD);
                ygres = DrawObjects.getSectionPos(obj.PROG_YGJD);
                switch (obj.PROG_NAME)
                {
                case ("S1"):
                    if (ccres == null)
                    {
                        ccdegree[0] = 0;
                    }
                    else
                    {
                        ccdegree[0] = Convert.ToSingle(ccres.pilepoint - 1440) / (4300 - 1440);
                    }
                    if (ecres == null)
                    {
                        ecdegree[0] = 0;
                    }
                    else
                    {
                        ecdegree[0] = Convert.ToSingle(ecres.pilepoint - 1440) / (4300 - 1440);
                    }
                    if (ygres == null)
                    {
                        ygdegree[0] = 0;
                    }
                    else
                    {
                        ygdegree[0] = Convert.ToSingle(ygres.pilepoint - 1440) / (4300 - 1440);
                    }
                    break;

                case ("S2"):
                    if (ccres == null)
                    {
                        ccdegree[1] = 0;
                    }
                    else
                    {
                        ccdegree[1] = Convert.ToSingle(ccres.pilepoint - 4300) / (7200 - 4300);
                    }
                    if (ecres == null)
                    {
                        ecdegree[1] = 0;
                    }
                    else
                    {
                        ecdegree[1] = Convert.ToSingle(ecres.pilepoint - 4300) / (7200 - 4300);
                    }
                    if (ygres == null)
                    {
                        ygdegree[1] = 0;
                    }
                    else
                    {
                        ygdegree[1] = Convert.ToSingle(ygres.pilepoint - 4300) / (7200 - 4300);
                    }
                    break;

                case ("S3"):
                    if (ccres == null)
                    {
                        ccdegree[2] = 0;
                    }
                    else
                    {
                        ccdegree[2] = Convert.ToSingle(ccres.pilepoint - 10000) / (7200 - 10000);
                    }
                    if (ecres == null)
                    {
                        ecdegree[2] = 0;
                    }
                    else
                    {
                        ecdegree[2] = Convert.ToSingle(ecres.pilepoint - 10000) / (7200 - 10000);
                    }
                    if (ygres == null)
                    {
                        ygdegree[2] = 0;
                    }
                    else
                    {
                        ygdegree[2] = Convert.ToSingle(ygres.pilepoint - 10000) / (7200 - 10000);
                    }
                    break;

                case ("S4"):
                    if (ccres == null)
                    {
                        ccdegree[3] = 0;
                    }
                    else
                    {
                        ccdegree[3] = Convert.ToSingle(ccres.pilepoint - 12995) / (10000 - 12995);
                    }
                    if (ecres == null)
                    {
                        ecdegree[3] = 0;
                    }
                    else
                    {
                        ecdegree[3] = Convert.ToSingle(ecres.pilepoint - 12995) / (10000 - 12995);
                    }
                    if (ygres == null)
                    {
                        ygdegree[3] = 0;
                    }
                    else
                    {
                        ygdegree[3] = Convert.ToSingle(ygres.pilepoint - 12995) / (10000 - 12995);
                    }
                    break;

                default:
                    return;
                }
            }

            plandegree = new float[5, 4];
            //计算计划进度比例
            foreach (SCHE obj in sche_objList)
            {
                if ((obj.PROG_DATE != latesttime[obj.PROG_NAME]) || (obj.PROG_LORR != "右幅"))
                {
                    continue;
                }
                ccres = DrawObjects.getSectionPos(obj.PROG_CCJD);
                ecres = DrawObjects.getSectionPos(obj.PROG_ECJD);
                ygres = DrawObjects.getSectionPos(obj.PROG_YGJD);
                switch (obj.PROG_NAME)
                {
                case ("S1"):
                    if (ccres == null)
                    {
                        plandegree[1, 1] = 0;
                    }
                    else
                    {
                        plandegree[1, 1] = Convert.ToSingle(ccres.pilepoint - 1440) / (4300 - 1440);
                    }
                    if (ecres == null)
                    {
                        plandegree[1, 2] = 0;
                    }
                    else
                    {
                        plandegree[1, 2] = Convert.ToSingle(ecres.pilepoint - 1440) / (4300 - 1440);
                    }
                    if (ygres == null)
                    {
                        plandegree[1, 3] = 0;
                    }
                    else
                    {
                        plandegree[1, 3] = Convert.ToSingle(ygres.pilepoint - 1440) / (4300 - 1440);
                    }
                    break;

                case ("S2"):
                    if (ccres == null)
                    {
                        plandegree[2, 1] = 0;
                    }
                    else
                    {
                        plandegree[2, 1] = Convert.ToSingle(ccres.pilepoint - 4300) / (7200 - 4300);
                    }
                    if (ecres == null)
                    {
                        plandegree[2, 2] = 0;
                    }
                    else
                    {
                        plandegree[2, 2] = Convert.ToSingle(ecres.pilepoint - 4300) / (7200 - 4300);
                    }
                    if (ygres == null)
                    {
                        plandegree[2, 3] = 0;
                    }
                    else
                    {
                        plandegree[2, 3] = Convert.ToSingle(ygres.pilepoint - 4300) / (7200 - 4300);
                    }
                    break;

                case ("S3"):
                    if (ccres == null)
                    {
                        plandegree[3, 1] = 0;
                    }
                    else
                    {
                        plandegree[3, 1] = Convert.ToSingle(ccres.pilepoint - 10000) / (7200 - 10000);
                    }
                    if (ecres == null)
                    {
                        plandegree[3, 2] = 0;
                    }
                    else
                    {
                        plandegree[3, 2] = Convert.ToSingle(ecres.pilepoint - 10000) / (7200 - 10000);
                    }
                    if (ygres == null)
                    {
                        plandegree[3, 3] = 0;
                    }
                    else
                    {
                        plandegree[3, 3] = Convert.ToSingle(ygres.pilepoint - 10000) / (7200 - 10000);
                    }
                    break;

                case ("S4"):
                    if (ccres == null)
                    {
                        plandegree[4, 1] = 0;
                    }
                    else
                    {
                        plandegree[4, 1] = Convert.ToSingle(ccres.pilepoint - 12995) / (10000 - 12995);
                    }
                    if (ecres == null)
                    {
                        plandegree[4, 2] = 0;
                    }
                    else
                    {
                        plandegree[4, 2] = Convert.ToSingle(ecres.pilepoint - 12995) / (10000 - 12995);
                    }
                    if (ygres == null)
                    {
                        plandegree[4, 3] = 0;
                    }
                    else
                    {
                        plandegree[4, 3] = Convert.ToSingle(ygres.pilepoint - 12995) / (10000 - 12995);
                    }
                    break;

                default:
                    return;
                }
            }

            ache_colors = new List <string>()
            {
                "Yellow", "GreenYellow", "Khaki"
            };
            pilebackcolor = "Gray";

            S1_draw();
            S2_draw();
            S3_draw();
            S4_draw();
        }
示例#19
0
        private void PredictLining(object sender, RoutedEventArgs e)
        {
            if (null == tunnelpile)
            {
                return;
            }
            rec_type        = new List <string>();
            similar_section = new List <string>();
            foreach (MILI obj in mili_objList)
            {
                Pile t1 = DrawObjects.getSectionPos(obj.MILI_STAR);
                Pile t2 = DrawObjects.getSectionPos(obj.MILI_END);

                if ((obj.MILI_LNTY != design_type) || (t1.tunnelpart != tunnelpile.tunnelpart))
                {
                    continue;
                }

                //判断是否为已施工段
                if ((tunnelpile.sectionnumber == "S1") || (tunnelpile.sectionnumber == "S2"))
                {
                    if (t1.pilepoint > tunnelpile.pilepoint)
                    {
                        continue;
                    }
                }
                else
                {
                    if (t2.pilepoint < tunnelpile.pilepoint)
                    {
                        continue;
                    }
                }

                foreach (CHAG obj1 in chag_objList)
                {
                    Pile _tp = DrawObjects.getSectionPos(obj1.CHAG_CHAI);
                    //找已经施工的且相同设计衬砌类型的施工段
                    if ((_tp.startpile >= t1.pilepoint) && (_tp.endpile <= t2.pilepoint) && (_tp.tunnelpart == t1.tunnelpart))
                    {
                        if ((tunnelpile.sectionnumber == "S1") || (tunnelpile.sectionnumber == "S2"))
                        {
                            if (_tp.endpile > tunnelpile.pilepoint)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            if (_tp.startpile < tunnelpile.pilepoint)
                            {
                                continue;
                            }
                        }
                        if (!judgeliningtype(obj1.CHAG_PRES))
                        {
                            continue;
                        }
                        if (!rec_type.Contains(obj1.CHAG_PRES))
                        {
                            rec_type.Add(obj1.CHAG_PRES);
                        }
                        if (!similar_section.Contains(obj1.CHAG_CHAI))
                        {
                            similar_section.Add(obj1.CHAG_CHAI);
                        }
                    }
                }
            }

            if (rec_type.Count == 0)
            {
                rec_type.Add("建议采取设计衬砌类型");
            }
            lininglist.ItemsSource = rec_type;

            if (similar_section.Count == 0)
            {
                similar_section.Add("无相似施工段变更记录");
            }
            similarlining.ItemsSource = similar_section;
        }
示例#20
0
 private void DeviceLens_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     DrawObjects?.Invoke(this, CadCanvas.GetMesh(_device.DeviceLens.MonchaDeviceMesh, _device, MonchaHub.GetThinkess * AppSt.Default.anchor_size, true));
 }
示例#21
0
        private void ParseDraw(StreamReader reader)
        {
            do
            {
                String line = reader.ReadLine();

                if (line.StartsWith("#"))
                {
                    continue;
                }

                char[]   charSeparator = new char[] { ' ' };
                String[] items         = line.Split(charSeparator, System.StringSplitOptions.RemoveEmptyEntries);

                switch (items[0])
                {
                case "ENDDRAW":
                    return;

                case "C":
                    KicadLibCircle circle = new KicadLibCircle();
                    circle.Parse(items);
                    DrawObjects.Add(circle);
                    break;

                case "A":
                    KicadLibArc arc = new KicadLibArc();
                    arc.Parse(items);
                    DrawObjects.Add(arc);
                    break;

                case "P":
                    KicadLibPolygon polygon = new KicadLibPolygon();
                    polygon.Parse(items);
                    DrawObjects.Add(polygon);
                    break;

                case "S":
                    KicadLibRectangle rect = new KicadLibRectangle();
                    rect.Parse(items);
                    DrawObjects.Add(rect);
                    break;

                case "T":
                    KicadLibText text = new KicadLibText();
                    text.Parse(items);
                    DrawObjects.Add(text);
                    break;

                case "B":
                    KicadLibBezier bezier = new KicadLibBezier();
                    bezier.Parse(items);
                    DrawObjects.Add(bezier);
                    break;

                case "X":
                    KicadLibPin pin = new KicadLibPin();
                    pin.Parse(items);
                    DrawObjects.Add(pin);
                    break;

                default:
                    throw new Exception("KicadLibComponent parse error. Unknown draw object.");
                }
            } while (true);
        }