Esempio n. 1
0
 private void  位窗口ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!IsDesignMode())
     {
         ViewController.resetAll();
     }
 }
Esempio n. 2
0
        private void ImageReset_Click(object sender, EventArgs e)
        {
            //按钮点击效果
            this.ImageReset.BackgroundImage = global::通用架构.Properties.Resources.PicImageReset_Gray;
            Task ImageReset_Active = new Task(() =>
            {
                Delay(150);
                this.ImageReset.BackgroundImage = global::通用架构.Properties.Resources.PicImageReset_White;
            });

            ImageReset_Active.Start();
            //
            //重置显示画面
            HWndCtrl.resetAll();
            HWndCtrl.repaint();
            //
        }
Esempio n. 3
0
 public void ResetView()
 {
     lock (globalLock){
         try{
             foreach (var item in hObjectList)
             {
                 if (item != null)
                 {
                     item.Dispose();
                 }
             }
             hObjectList.Clear();
             viewController.resetAll();
             viewController.clearList();
             viewController.changeGraphicSettings(GraphicsContext.GC_LINESTYLE, new HTuple());
         }
         catch
         { }
     }
 }
        /// <summary>
        /// Reset window settings including settings for drawing ROIs
        /// </summary>
        public void ResetDisplaySettingsInclROI()
        {
            // clear all settings in graphic window
            hWndControl.resetAll();
            // set the flag to display the full image
            // in correct aspect ration in graphic window
            if (imageViewState == ImageViewStates.fitToWindow)
            {
                hWndControl.adaptSize = true;
            }
            else
            {
                hWndControl.adaptSize = false;
            }

            if ((imageWidth > 0) && (imageHeight > 0))
            {
                hWndControl.resetImagePart(imageWidth, imageHeight);
            }

            this.Invalidate();
        }
Esempio n. 5
0
 /// <summary>Resets the application; invoked by the corresponding button.</summary>
 private void resetButton_Click(object sender, System.EventArgs e)
 {
     viewController.resetAll();
     viewController.repaint();
 }
Esempio n. 6
0
        /// <summary>
        /// 单击打开生产详细数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listView1_MouseClick(object sender, MouseEventArgs e)
        {
            string filename = listView1.FocusedItem.SubItems[0].Text;//获取鼠标当前行

            double[] ChartMin_In  = new double[5];
            double[] ChartMin_Out = new double[5];
            double   Min_In       = new double();
            double   Min_Out      = new double();

            //查看当前电芯数据
            if (filename == "当前电芯数据")
            {
                //触发回调函数更新当前电芯数据
                RefreshChartFlag = true;
                if (RefreshInformationForm_Chart_Event != null)
                {
                    RefreshInformationForm_Chart_Event();
                }
            }
            //查看历史生产电芯数据
            else
            {
                RefreshChartFlag = false;
                string Path_csv = CSV_Directory + "\\" + CB_CSVFileName.Text + "\\" + filename;
                Path_NG_Pic = AppDomain.CurrentDomain.BaseDirectory + "Screen\\" + CB_CSVFileName.Text + "\\" + filename.Substring(0, 8);
                foreach (var series in Chart_Inside.Series)
                {
                    series.Points.Clear();
                }
                foreach (var series in Chart_Outside.Series)
                {
                    series.Points.Clear();
                }
                if (System.IO.File.Exists(Path_csv))
                {
                    listView2.Items.Clear();
                    List <String[]> ls = CsvWrite.ReadCSV(Path_csv);


                    for (int i = 1; i < ls.Count; i++)
                    {
                        if (ls[i][0] != "")
                        {
                            ListViewItem lvi = new ListViewItem();
                            lvi.Text = ls[i][0];
                            lvi.SubItems.Add(ls[i][5]);
                            lvi.SubItems.Add(ls[i][6]);
                            lvi.SubItems.Add(ls[i][7]);
                            lvi.SubItems.Add(ls[i][8]);

                            lvi.SubItems.Add(ls[i][13]);
                            lvi.SubItems.Add(ls[i][14]);
                            lvi.SubItems.Add(ls[i][15]);
                            lvi.SubItems.Add(ls[i][16]);

                            lvi.SubItems.Add(ls[i][17]);
                            //lvi.SubItems.Add(path_csv);
                            listView2.BeginUpdate();
                            listView2.Items.Add(lvi);
                            //listView1.Items[listView1.Items.Count - 1].EnsureVisible();
                            listView2.EndUpdate();

                            double CD_In     = Convert.ToDouble(ls[i][1]);
                            double AD_In     = Convert.ToDouble(ls[i][2]);
                            double UpSD_In   = Convert.ToDouble(ls[i][3]);
                            double DownSD_In = Convert.ToDouble(ls[i][4]);

                            double CD_Out     = Convert.ToDouble(ls[i][9]);
                            double AD_Out     = Convert.ToDouble(ls[i][10]);
                            double UpSD_Out   = Convert.ToDouble(ls[i][11]);
                            double DownSD_Out = Convert.ToDouble(ls[i][12]);


                            Chart_Inside.Series["正极"].Points.AddXY(CD_In, i);
                            Chart_Inside.Series["负极"].Points.AddXY(AD_In, i);
                            Chart_Inside.Series["上隔膜"].Points.AddXY(UpSD_In, i);
                            Chart_Inside.Series["下隔膜"].Points.AddXY(DownSD_In, i);


                            Chart_Outside.Series["正极"].Points.AddXY(CD_Out, i);
                            Chart_Outside.Series["负极"].Points.AddXY(AD_Out, i);
                            Chart_Outside.Series["上隔膜"].Points.AddXY(UpSD_Out, i);
                            Chart_Outside.Series["下隔膜"].Points.AddXY(DownSD_Out, i);

                            if (i == 1)
                            {
                                ChartMin_In  = new double[] { CD_In, AD_In, UpSD_In, DownSD_In };
                                ChartMin_Out = new double[] { CD_Out, AD_Out, UpSD_Out, DownSD_Out };
                                Min_In       = ChartMin_In.Min();
                                Min_Out      = ChartMin_Out.Min();
                            }
                            else
                            {
                                ChartMin_In  = new double[] { CD_In, AD_In, UpSD_In, DownSD_In, Min_In };
                                ChartMin_Out = new double[] { CD_Out, AD_Out, UpSD_Out, DownSD_Out, Min_Out };
                                Min_In       = ChartMin_In.Min();
                                Min_Out      = ChartMin_Out.Min();
                            }

                            Chart_Inside.ChartAreas[0].AxisY.MajorGrid.Interval     = 5;
                            Chart_Inside.ChartAreas[0].AxisY.MajorTickMark.Interval = 5;
                            Chart_Inside.ChartAreas[0].AxisY.MajorGrid.Enabled      = true;
                            Chart_Inside.ChartAreas[0].AxisY.MajorGrid.Enabled      = true;

                            Chart_Inside.ChartAreas[0].AxisX.Minimum                = Convert.ToInt16(Min_In) - 1;
                            Chart_Inside.ChartAreas[0].AxisX.MajorGrid.Interval     = 1;
                            Chart_Inside.ChartAreas[0].AxisX.MajorTickMark.Interval = 1;
                            Chart_Inside.ChartAreas[0].AxisX.MajorGrid.Enabled      = true;
                            Chart_Inside.ChartAreas[0].AxisX.MajorTickMark.Enabled  = true;


                            Chart_Outside.ChartAreas[0].AxisY.MajorGrid.Interval     = 5;
                            Chart_Outside.ChartAreas[0].AxisY.MajorTickMark.Interval = 5;
                            Chart_Outside.ChartAreas[0].AxisY.MajorGrid.Enabled      = true;
                            Chart_Outside.ChartAreas[0].AxisY.MajorTickMark.Enabled  = true;

                            Chart_Outside.ChartAreas[0].AxisX.Minimum                = Convert.ToInt16(Min_Out) - 1;
                            Chart_Outside.ChartAreas[0].AxisX.MajorGrid.Interval     = 1;
                            Chart_Outside.ChartAreas[0].AxisX.MajorTickMark.Interval = 1;
                            Chart_Outside.ChartAreas[0].AxisX.MajorGrid.Enabled      = true;
                            Chart_Outside.ChartAreas[0].AxisX.MajorTickMark.Enabled  = true;
                        }
                        else
                        {
                            i = ls.Count;
                        }
                    }
                }
                else
                {
                }
                //显示对应的NG图片
                if (Directory.Exists(Path_NG_Pic))
                {
                    var files = Directory.GetFiles(Path_NG_Pic, "*.png");
                    if (files.Length != 0)
                    {
                        NG1_ho_Image = new HImage(files[0]);

                        //画面缩放
                        HWndCtrl1.addIconicVar(NG1_ho_Image);
                        HWndCtrl1.resetAll();
                        HWndCtrl1.repaint();
                        Index_Pic.Text      = "1/" + files.Length.ToString();
                        Btn_nextpic.Enabled = true;
                    }
                    else
                    {
                        HOperatorSet.ClearWindow(H_WControl1.HalconID);
                        Index_Pic.Text = "0/0";
                    }
                }
                else
                {
                    HOperatorSet.ClearWindow(H_WControl1.HalconID);
                    Index_Pic.Text = "0/0";
                }
            }
        }