Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pointYCollection"></param>
        /// <param name="isRunRoto">是否运行求解器</param>
        public DisGKResult(TabPage page, Dictionary<int, PointPairList> pointYCollection, bool isRunRoto = true)
        {
            InitializeComponent();

            this.page = page;
            this.currenGKPath = Common.prjName + Path.DirectorySeparatorChar + this.page.Text + Path.DirectorySeparatorChar;
            this.myPane = this.zedGraphControl1.GraphPane;

            //设置图标标题和x、y轴标题
            this.myPane.Title.Text = "计算监控";
            this.myPane.XAxis.Title.Text = "迭代步数";

            //更改标题的字体
            //FontSpec myFont = new FontSpec("宋体", 20, Color.Red, false, false, false);

            //this.myPane.Title.FontSpec = myFont;
            //this.myPane.XAxis.Title.FontSpec = myFont;
            //this.myPane.YAxis.Title.FontSpec = myFont;

            //设置网格线可见
            myPane.XAxis.MajorGrid.IsVisible = true;
            myPane.YAxis.MajorGrid.IsVisible = true;

            //设置网格线颜色
            myPane.XAxis.MajorGrid.Color = Color.Chocolate;
            myPane.YAxis.MajorGrid.Color = Color.Chocolate;

            //设置网格线形式
            myPane.XAxis.MajorGrid.DashOff = 1;
            myPane.YAxis.MajorGrid.DashOff = 1;
            myPane.XAxis.MajorGrid.DashOn = 4;
            myPane.YAxis.MajorGrid.DashOn = 4;

            //初始化图形
            if (pointYCollection == null||pointYCollection.Count==0)
            {
                this.myCurve = this.myPane.AddCurve("数据", new PointPairList(), Color.Red, SymbolType.None);
            }
            else
            {
                this.pointYCollection = pointYCollection;
                this.myCurve = this.myPane.AddCurve("数据", pointYCollection[0], Color.Red, SymbolType.None);
            }

            //监控显示(默认值)
            this.cmbDisType.SelectedIndex = 0;
            this.cmbType = 0;

            this.labGK.Text = this.page.Text;

            DisGKResult.CheckForIllegalCrossThreadCalls = false;
            this.mainForm = (MainForm)this.ParentForm;

            //当前工况
            this.currentGK = (sGK)MainForm.GKNode.Nodes[this.page.Text].Tag;

            //this.baseLine = Convert.ToInt64(this.currentGK.maxIterateNum);

            if (pointYCollection == null && isRunRoto)
            {
                Thread thread = new Thread(loadData);
                thread.IsBackground = true;
                thread.Start();
            }
            else if(pointYCollection.Count!=0)
            {
                try
                {
                    SyswareDataObject sdo = new SyswareDataObject();
                    if (SyswareDataObjectUtil.loadFresultData(sdo, Common.GKPath))
                    {
                        loadDataGridView(sdo.children[0].children);
                    }
                    else
                    {
                        MessageBox.Show("文件加载失败");
                    }

                }
                catch (Exception e)
                {
                    MessageBox.Show("文件格式错误.详细:"+e.Message);
                }

            }
        }
Ejemplo n.º 2
0
Archivo: GKDlg.cs Proyecto: algz/AFA
        private void GKDlg_Load(object sender, EventArgs e)
        {
            this.mainForm=(MainForm)this.Owner;

            this.SetData( ref this.m_Node);
            if (!this.m_bEdit)
            {
                this.tbName.Text = "";
                this.chkBLCONT.Enabled = false;
                this.chkBLCONT.Checked = false;
            }
            else
            {
                string GKPath = Common.prjName + Path.DirectorySeparatorChar + this.tbName.Text + Path.DirectorySeparatorChar;
                this.chkBLCONT.Enabled = File.Exists(GKPath + "FRESULT.DAT");
            }

            chkModelXY_CheckedChanged(null, null);
        }