示例#1
0
        public PageViewDiagnose()
        {
            InitializeComponent();

            _candatapool = DataPool.CDataPool.GetDataPoolObject();

            this.ForeColor = Color.Black;

            pumpImgLabelList                  = new List <CParaLabel>();
            pumpTitleList                     = new List <ImageLabel>();
            cylinderIOList                    = new List <ImageLabel>();
            cylinderParaList                  = new List <CParaLabel>();
            buttonList                        = new List <ImageButton>();
            pumpNameImage                     = new SimpleImagesContaner();
            pumpNameImage.BackImg             = pumpNameImage.CheckedBackImg
                                              = pumpNameImage.ImgDisable = AdvaMACSystemRes.IO;

            pumpParaImage                     = new SimpleImagesContaner();
            pumpParaImage.BackImg             = pumpParaImage.CheckedBackImg
                                              = pumpParaImage.ImgDisable = AdvaMACSystemRes.IOlabel;

            buttonImage                  = new ImagesContaner();
            buttonImage.DNImg            = AdvaMACSystemRes.Dgn_down;
            buttonImage.UPImg            = AdvaMACSystemRes.Dgn_up;
            buttonImage.UPImgDisaable    = buttonImage.DNImgDisable = AdvaMACSystemRes.Dgn_disable;
            cylinderImage                = new SimpleImagesContaner();
            cylinderImage.BackImg        = AdvaMACSystemRes.IOred;
            cylinderImage.ImgDisable     = AdvaMACSystemRes.IOred;
            cylinderImage.CheckedBackImg = AdvaMACSystemRes.IOblack;

            currentFont = new Font("微软雅黑", 14F, FontStyle.Regular);
            //new pump names
            for (int i = 0; i < 4; i++)
            {
                ImageLabel pumpName = new ImageLabel();
                pumpTitleList.Add(pumpName);
            }

            //new pump paras
            for (int i = 0; i < 12; i++)
            {
                CParaLabel pumpPara = new CParaLabel();
                pumpImgLabelList.Add(pumpPara);
            }

            //new cylinders
            for (int i = 0; i < 32; i++)
            {
                ImageLabel cylinder = new ImageLabel();
                cylinderIOList.Add(cylinder);
            }
            for (int i = 0; i < 32; i++)
            {
                CParaLabel cylinderPara = new CParaLabel();
                cylinderParaList.Add(cylinderPara);
            }

            for (int i = 0; i < 4; i++)
            {
                ImageButton button = new ImageButton();
                buttonList.Add(button);
            }
            exitButton            = new ImageButton();
            panelIO               = new Panel();
            panelPara             = new Panel();
            this.imageLabel_title = new ComCtrls.ImageLabel();
            this.SuspendLayout();
            this.panelIO.SuspendLayout();
            this.panelPara.SuspendLayout();

            this.imageLabel_title.BackColor   = System.Drawing.Color.Silver;
            this.imageLabel_title.Checked     = false;
            this.imageLabel_title.Dock        = System.Windows.Forms.DockStyle.Top;
            this.imageLabel_title.Font        = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Bold);
            this.imageLabel_title.Layout      = ComCtrls.KTLayout.GlyphTop;
            this.imageLabel_title.Location    = new System.Drawing.Point(0, 0);
            this.imageLabel_title.Name        = "imageLabel_title";
            this.imageLabel_title.Size        = new System.Drawing.Size(1024, 57);
            this.imageLabel_title.TabIndex    = 0;
            this.imageLabel_title.Text        = "I/O诊断";
            this.imageLabel_title.TextX       = -1F;
            this.imageLabel_title.TextY       = -1F;
            this.imageLabel_title.TransParent = false;
            this.Controls.Add(this.imageLabel_title);

            panelIO.Size     = new Size(1024, 8 * (IOHeight + IOSpacingY));
            panelIO.Location = new Point(IOMarginLeft, 4 * (IOHeight + IOSpacingY) + IOMarginTop);
            panelIO.Visible  = false;
            this.Controls.Add(panelIO);

            panelPara.Size     = new Size(1024, 8 * (IOHeight + IOSpacingY));
            panelPara.Location = new Point(IOMarginLeft, 4 * (IOHeight + IOSpacingY) + IOMarginTop);
            panelPara.Visible  = false;
            this.Controls.Add(panelPara);

            for (int i = 0; i < 4; i++)
            {
                ImageLabel pumpName = pumpTitleList[i];
                pumpName.Size         = new Size(IOWidth, IOHeight);
                pumpName.Location     = new Point(IOMarginLeft + i * (IOWidth + IOSpacingX), IOMarginTop);
                pumpName.Font         = currentFont;
                pumpName.TransParent  = true;
                pumpName.ForeColor    = textColor;
                pumpName.IMGContainer = pumpNameImage;
                this.Controls.Add(pumpName);
            }

            for (int i = 0; i < 12; i++)
            {
                CParaLabel pumpPara = pumpImgLabelList[i];
                pumpPara.Size         = new Size(IOWidth, IOHeight);
                pumpPara.Location     = new Point(IOMarginLeft + (i / 3) * (IOWidth + IOSpacingX), IOMarginTop + (i % 3 + 1) * (IOHeight + IOSpacingY));
                pumpPara.Font         = currentFont;
                pumpPara.ForeColor    = textColor;
                pumpPara.TransParent  = true;
                pumpPara.TextX        = TextMarginLeft;
                pumpPara.TextY        = TextMarginTop;
                pumpPara.IMGContainer = pumpParaImage;
                this.Controls.Add(pumpPara);
            }
            for (int i = 0; i < 32; i++)
            {
                ImageLabel cylinder = cylinderIOList[i];
                cylinder.Size         = new Size(IOWidth, IOHeight);
                cylinder.Location     = new Point((i / 8) * (IOWidth + IOSpacingX), (i % 8) * (IOHeight + IOSpacingY));
                cylinder.IMGContainer = cylinderImage;
                cylinder.Font         = currentFont;
                cylinder.ForeColor    = textColor;
                cylinder.TransParent  = true;
                cylinder.TextX        = TextMarginLeft;
                cylinder.TextY        = TextMarginTop;
                this.panelIO.Controls.Add(cylinder);
            }
            for (int i = 0; i < 32; i++)
            {
                CParaLabel cylinderPara = cylinderParaList[i];
                cylinderPara.Size         = new Size(IOWidth, IOHeight);
                cylinderPara.Location     = new Point((i / 8) * (IOWidth + IOSpacingX), (i % 8) * (IOHeight + IOSpacingY));
                cylinderPara.IMGContainer = pumpParaImage;
                cylinderPara.Font         = currentFont;
                cylinderPara.ForeColor    = textColor;
                cylinderPara.TransParent  = true;
                cylinderPara.TextX        = TextMarginLeft;
                cylinderPara.TextY        = TextMarginTop;
                this.panelPara.Controls.Add(cylinderPara);
            }
            for (int i = 0; i < 4; i++)
            {
                ImageButton button = buttonList[i];
                button.Size         = new Size(ButtonWidth, ButtonHeight);
                button.Location     = new Point(IOMarginLeft + i * (ButtonWidth + ButtonSpacingX), ButtonMarginTop);
                button.IMGContainer = buttonImage;
                button.Click       += new EventHandler(diagnoseItemButton_Click);
                button.Toggle       = true;
                button.Font         = currentFont;
                button.ForeColor    = textColor;
                button.Tag          = i;//diagnoseItem_Tag
                this.Controls.Add(button);
            }
            buttonList[0].Text = "近端锁定螺母限位";
            buttonList[1].Text = "远端锁定螺母限位";
            buttonList[2].Text = "油缸运行状态";
            buttonList[3].Text = "油缸机械锁状态";

            exitButton.Size            = new Size(ButtonWidth, ButtonHeight);
            exitButton.Location        = new Point(IOMarginLeft + 3 * (ButtonWidth + ButtonSpacingX), ButtonMarginTop + (ButtonHeight + ButtonSpacingY));
            exitButton.IMGContainer    = buttonImage;
            exitButton.Font            = currentFont;
            exitButton.ForeColor       = System.Drawing.Color.Black;
            exitButton.Text            = "返回";
            exitButton.CheckedChanged += new EventHandler(exitButton_CheckedChanged);
            this.Controls.Add(exitButton);
            this.panelPara.ResumeLayout(false);
            this.panelIO.ResumeLayout(false);
            this.ResumeLayout(false);
        }
示例#2
0
        public FormTimeSetting()
        {
            InitializeComponent();
            currentFont                   = new Font("微软雅黑", 14F, FontStyle.Regular);
            dateImage                     = new SimpleImagesContaner();
            dateImage.BackImg             = dateImage.CheckedBackImg
                                          = dateImage.ImgDisable = AdvaMACSystemRes.Dgn_disable;

            inputImage                     = new SimpleImagesContaner();
            inputImage.BackImg             = inputImage.CheckedBackImg
                                           = inputImage.ImgDisable = AdvaMACSystemRes.Input40x40;

            buttonImage               = new ImagesContaner();
            buttonImage.DNImg         = AdvaMACSystemRes.Dgn_down;
            buttonImage.UPImg         = AdvaMACSystemRes.Dgn_up;
            buttonImage.UPImgDisaable = buttonImage.DNImgDisable = AdvaMACSystemRes.Dgn_disable;

            buttonList = new List <ImageButton>();
            ibPressure = new ImageButton();
            buttonList.Add(ibPressure);
            ibPosition = new ImageButton();
            buttonList.Add(ibPosition);
            ibBack = new ImageButton();
            buttonList.Add(ibBack);
            ibEnter = new ImageButton();
            buttonList.Add(ibEnter);

            lbTimeSetting      = new Label();
            inputLabelList     = new List <ImageLabel>();
            ilStartHour        = new ImageLabel();
            ilStartHour.Click += new EventHandler(ilStartHour_Click);
            inputLabelList.Add(ilStartHour);
            ilStartMinute        = new ImageLabel();
            ilStartMinute.Click += new EventHandler(ilStartMinute_Click);
            inputLabelList.Add(ilStartMinute);
            ilHourSpan = new ImageLabel();
            inputLabelList.Add(ilHourSpan);
            ilHourSpan.Click += new EventHandler(ilHourSpan_Click);
            ilMinuteSpan      = new ImageLabel();
            inputLabelList.Add(ilMinuteSpan);
            ilMinuteSpan.Click += new EventHandler(ilMinuteSpan_Click);

            for (int i = 0; i < inputLabelList.Count; i++)
            {
                inputLabelList[i].Size         = new Size(40, 40);
                inputLabelList[i].Location     = new Point(LBTimeMarginLeft + i * (40 + LBTimeSpacingX), LBTimeMarginTop);
                inputLabelList[i].Font         = currentFont;
                inputLabelList[i].IMGContainer = inputImage;
                this.Controls.Add(inputLabelList[i]);
            }

            for (int k = 0; k < buttonList.Count; k++)
            {
                ImageButton button = buttonList[k];
                button.Size         = new Size(ButtonWidth, ButtonHeight);
                button.Location     = new Point(ButtonMarginLeft + (k % 2) * (ButtonWidth + ButtonSpacingX), ButtonMarginTop + (k / 2) * (ButtonHeight + ButtonSpacingY));
                button.Font         = currentFont;
                button.IMGContainer = buttonImage;
                this.Controls.Add(button);
            }
            ibPressure.Text            = "轴力记录";
            ibPressure.Name            = "Pressure";
            ibPressure.Toggle          = true;
            ibPressure.CheckedChanged += new EventHandler(dataTypeChanged);

            ibPosition.Text            = "位移记录";
            ibPosition.Name            = "Position";
            ibPosition.Toggle          = true;
            ibPosition.CheckedChanged += new EventHandler(dataTypeChanged);

            ibBack.Text    = "返回";
            ibBack.Click  += new EventHandler(ibBack_Click);
            ibEnter.Text   = "确认";
            ibEnter.Click += new EventHandler(ibEnter_Click);

            foreach (Control c in this.Controls)
            {
                if (!(c is MonthCalendar))
                {
                    c.Font = currentFont;
                }
            }
            //foreach (Control c in this.Controls)
            //{
            //    if (c is MonthCalendar)
            //        c.Font = new Font("微软雅黑", 10F, FontStyle.Regular);
            //    else
            //        c.Font = currentFont;
            //}
            //monthCalendar1.Location = new Point((this.Width - monthCalendar1.Width) / 2, monthCalendar1.Top);
        }
示例#3
0
        public PageViewHistory()
        {
            InitializeComponent();

            timeSetting = new FormTimeSetting();

            this.ForeColor   = Color.Black;
            sf               = new StringFormat();
            sf.Alignment     = StringAlignment.Center;
            sf.LineAlignment = StringAlignment.Center;

            chartFont                 = new Font("微软雅黑", 9F, FontStyle.Regular);
            currentFont               = new Font("微软雅黑", 14F, FontStyle.Regular);
            buttonImage               = new ImagesContaner();
            buttonImage.DNImg         = AdvaMACSystemRes.Dgn_down;
            buttonImage.UPImg         = AdvaMACSystemRes.Dgn_up;
            buttonImage.UPImgDisaable = buttonImage.DNImgDisable = AdvaMACSystemRes.Dgn_disable;

            ibBack              = new ImageButton();
            ibBack.Size         = new Size(ButtonWidth, ButtonHeight);
            ibBack.Location     = new Point(800, 600);
            ibBack.IMGContainer = buttonImage;
            ibBack.Font         = currentFont;
            ibBack.Text         = "返回";
            ibBack.Click       += new EventHandler(ibBack_Click);
            this.Controls.Add(ibBack);

            cylinderList = new List <ImageButton>();
            for (int i = 0; i < 8; i++)
            {
                ImageButton cylinder = new ImageButton();
                cylinderList.Add(cylinder);
                cylinder.Size         = new Size(CylinderWidth, CylinderHeight);
                cylinder.Location     = new Point(CylinderMarginLeft, CylinderMarginTop + i * (CylinderHeight + CylinderSpacingY));
                cylinder.IMGContainer = buttonImage;
                cylinder.Font         = currentFont;
                cylinder.ForeColor    = textColor;
                cylinder.Tag          = i;
                cylinder.Text         = (i + 1).ToString() + "#油缸";
                cylinder.Toggle       = true;
                cylinder.Click       += new EventHandler(cylinder_Click);
                this.Controls.Add(cylinder);
            }

            dateImage                     = new SimpleImagesContaner();
            dateImage.BackImg             = dateImage.CheckedBackImg
                                          = dateImage.ImgDisable = AdvaMACSystemRes.Dgn_disable;

            inputImage                     = new SimpleImagesContaner();
            inputImage.BackImg             = inputImage.CheckedBackImg
                                           = inputImage.ImgDisable = AdvaMACSystemRes.Input40x40;

            imageLabel_title = new ComCtrls.ImageLabel();
            pBox             = new PictureBox();
            pbDataTable      = new PictureBox();
            lbPumpName       = new Label();
            ilDate           = new ImageLabel();
            ibPrevDay        = new ImageButton();
            ibNextDay        = new ImageButton();
            ilPumpIndex      = new ImageLabel();
            ilCurrentPage    = new ImageLabel();

            lbPage   = new Label();
            prevPage = new ImageButton();
            nextPage = new ImageButton();

            this.SuspendLayout();

            prevPage.Size     = new Size(40, 40);
            prevPage.Location = new Point(BmpLeft, 562);
            prevPage.Font     = currentFont;
            prevPage.UPImg    = prevPage.UPImgDisable = AdvaMACSystemRes.leftup;
            prevPage.DNImg    = prevPage.DNImgDisable = AdvaMACSystemRes.leftdown;
            prevPage.Click   += new EventHandler(prevPage_Click);
            this.Controls.Add(prevPage);

            nextPage.Size     = new Size(40, 40);
            nextPage.Location = new Point(BmpLeft + 350, 562);
            nextPage.Font     = currentFont;
            nextPage.UPImg    = nextPage.UPImgDisable = AdvaMACSystemRes.rightup;
            nextPage.DNImg    = nextPage.DNImgDisable = AdvaMACSystemRes.rightdown;
            nextPage.Click   += new EventHandler(nextPage_Click);
            this.Controls.Add(nextPage);


            ibPrevDay.Size     = new Size(100, 40);
            ibPrevDay.Location = new Point(CylinderMarginLeft, CylinderMarginTop + 9 * (CylinderHeight + CylinderSpacingY));
            ibPrevDay.Font     = currentFont;
            ibPrevDay.Text     = "前一天";
            ibPrevDay.UPImg    = ibPrevDay.UPImgDisable = AdvaMACSystemRes.half_disable;
            ibPrevDay.DNImg    = ibPrevDay.DNImgDisable = AdvaMACSystemRes.half_disable;
            ibPrevDay.Click   += new EventHandler(ibPrevDay_Click);
            this.Controls.Add(ibPrevDay);

            ibNextDay.Size     = new Size(100, 40);
            ibNextDay.Location = new Point(CylinderMarginLeft + 110, CylinderMarginTop + 9 * (CylinderHeight + CylinderSpacingY));
            ibNextDay.Font     = currentFont;
            ibNextDay.Text     = "后一天";
            ibNextDay.UPImg    = ibNextDay.UPImgDisable = AdvaMACSystemRes.half_disable;
            ibNextDay.DNImg    = ibNextDay.DNImgDisable = AdvaMACSystemRes.half_disable;
            ibNextDay.Click   += new EventHandler(ibNextDay_Click);
            this.Controls.Add(ibNextDay);

            this.imageLabel_title.BackColor   = System.Drawing.Color.Silver;
            this.imageLabel_title.Checked     = false;
            this.imageLabel_title.Dock        = System.Windows.Forms.DockStyle.Top;
            this.imageLabel_title.Font        = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Bold);
            this.imageLabel_title.Location    = new System.Drawing.Point(0, 0);
            this.imageLabel_title.Name        = "imageLabel_title";
            this.imageLabel_title.Size        = new System.Drawing.Size(1024, 57);
            this.imageLabel_title.TabIndex    = 0;
            this.imageLabel_title.Text        = "历史记录";
            this.imageLabel_title.TransParent = false;
            this.Controls.Add(this.imageLabel_title);

            pBox.Size     = new Size(BmpWidth, BmpHeight);
            pBox.Location = new Point(BmpLeft, BmpTop);
            pBox.Visible  = true;
            this.Controls.Add(pBox);

            pbDataTable.Size     = new Size(CellWidth * Columns + 1, CellHeight * Lines + 1);
            pbDataTable.Location = new Point(BmpLeft, TableMarginTop);
            pbDataTable.Visible  = true;
            this.Controls.Add(pbDataTable);

            lbPumpName.Size     = new Size(100, 40);
            lbPumpName.Location = new Point(CylinderMarginLeft + 100, CylinderMarginTop - CylinderHeight - CylinderSpacingY + 10);
            lbPumpName.Font     = currentFont;
            lbPumpName.Text     = "号泵站";
            this.Controls.Add(lbPumpName);

            ilDate.Size         = new Size(CylinderWidth, CylinderHeight);
            ilDate.Location     = new Point(CylinderMarginLeft, CylinderMarginTop + 8 * (CylinderHeight + CylinderSpacingY));
            ilDate.Font         = currentFont;
            ilDate.IMGContainer = dateImage;
            ilDate.Click       += new EventHandler(ilDate_Click);
            this.Controls.Add(ilDate);

            ilCurrentPage.Size     = new Size(80, 40);
            ilCurrentPage.Location = new Point(BmpLeft + 70, 562);
            ilCurrentPage.Font     = currentFont;
            ilCurrentPage.BackImg  = AdvaMACSystemRes.Input80x40;
            ilCurrentPage.Click   += new EventHandler(ilCurrentPage_Click);
            this.Controls.Add(ilCurrentPage);

            ilPumpIndex.Size         = new Size(40, 40);
            ilPumpIndex.Font         = currentFont;
            ilPumpIndex.IMGContainer = inputImage;
            ilPumpIndex.Location     = new Point(CylinderMarginLeft + 50, CylinderMarginTop - CylinderHeight - CylinderSpacingY);
            ilPumpIndex.Click       += new EventHandler(ilPumpIndex_Click);
            this.Controls.Add(ilPumpIndex);

            lbPage.Size     = new Size(300, 40);
            lbPage.Location = new Point(BmpLeft + 45, 572);
            lbPage.Font     = currentFont;
            this.Controls.Add(lbPage);

            this.ResumeLayout(false);
        }