Beispiel #1
0
        public FrmDatenlogger()
        {
            InitializeComponent();
            glb_DataBinding = ClsDataBinding.CreateInstance();
            frmMng          = ClsFormularManager.CreateInstance();
            glb_plc         = ClsPLC.CreateInstance();

            sqlHelper = new SQLHelper(m_ConnectionString);
            FuncGeneral.Start();
            this.ShowClose = true;
            this.LoadPlc();
            this.BindConrols();

            glb_plc.IP   = "10.100.72.125";
            glb_plc.Rack = 0;
            glb_plc.Slot = 2;

            glb_plc.Open();
            glb_plc.Read();

            this.CreateListView();
        }
Beispiel #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     glb_plc.Read();
     glb_DataBinding.Dispatch();
     this.UpdateListView();
 }
Beispiel #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.helperLibNoDave.LoadPlcData();
            this.LoadComponentBindings();
            glb_plc.IP   = "10.100.72.125";
            glb_plc.Rack = 0;
            glb_plc.Slot = 2;
            glb_plc.Open();
            glb_plc.Read();


            FrmRelease frmRelease = new FrmRelease();
            FrmError   frmError   = new FrmError();
            FrmPara    frmPara    = new FrmPara();
            FrmService frmService = new FrmService();


            List <Helper.Valve> Schieber = new List <Helper.Valve>();

            Schieber.Add(this.ValveV100);
            Schieber.Add(this.ValveV110);
            Schieber.Add(this.ValveV120);
            Schieber.Add(this.ValveV130);
            Schieber.Add(this.ValveV140);

            Schieber.Add(this.ValveV200);
            Schieber.Add(this.ValveV210);
            Schieber.Add(this.ValveV220);

            Schieber.Add(this.ValveV300);
            Schieber.Add(this.ValveV310);
            Schieber.Add(this.ValveV320);

            Schieber.Add(this.ValveV400);
            Schieber.Add(this.ValveV410);
            Schieber.Add(this.ValveV420);

            Schieber.Add(this.ValveV500);
            Schieber.Add(this.ValveV510);

            Schieber.Add(this.ValveV600);
            Schieber.Add(this.ValveV610);
            Schieber.Add(this.ValveV620);
            Schieber.Add(this.ValveV630);
            Schieber.Add(this.ValveV640);
            Schieber.Add(this.ValveV650);
            Schieber.Add(this.ValveV660);
            Schieber.Add(this.ValveV670);
            Schieber.Add(this.ValveV680);
            Schieber.Add(this.ValveV690);
            Schieber.Add(this.ValveV700);
            Schieber.Add(this.ValveV710);


            frmSchieber = new FrmSchieber[Schieber.Count];

            int counter = 0;

            foreach (Helper.Valve schieber in Schieber)
            {
                schieber.Click              += new System.EventHandler(this.valve);
                frmSchieber[counter]         = new FrmSchieber();
                frmSchieber[counter].TopMost = true;
                string frmName = "FrmSchieber" + schieber.Name;
                frmSchieber[counter].Name = frmName;
                string titelFormular = "Schieber " + schieber.Name.Substring(5, 2) + "." + schieber.Name.Substring(7);
                frmSchieber[counter].Text = titelFormular;
                frmMng.FormularAdd(frmSchieber[counter], frmName);
                frmSchieber[counter].BindDatas(FuncString.GetOnlyNumeric(schieber.Name));
                Point xyValve = FuncGeneral.GetMiddle(schieber);

                Point xyFrm = FuncGeneral.GetMiddle(frmSchieber[counter]);

                Point valvePos = new Point();
                valvePos.X = schieber.Left + xyValve.X;
                valvePos.Y = schieber.Top - xyValve.Y;

                frmSchieber[counter].Left = valvePos.X - xyFrm.X;
                frmSchieber[counter].Top  = valvePos.Y - xyFrm.Y * 2 - xyValve.Y + 35;

                if (frmSchieber[counter].Left < 0)
                {
                    frmSchieber[counter].Left = 0;
                }
                if (frmSchieber[counter].Top < 0)
                {
                    frmSchieber[counter].Top = valvePos.Y + xyValve.Y + 70;
                }
            }

            List <Helper.Scale> Behaelter = new List <Helper.Scale>();

            Behaelter.Add(this.ScaleT1);

            frmBehaelter = new FrmBehaelter[Behaelter.Count];

            counter = 0;
            foreach (Helper.Scale behaelter in Behaelter)
            {
                behaelter.Click              += new System.EventHandler(this.Behaelter);
                frmBehaelter[counter]         = new FrmBehaelter();
                frmBehaelter[counter].TopMost = true;
                string frmName = "FrmBehaelter" + behaelter.Name;
                frmBehaelter[counter].Name = frmName;
                string titelFormular = "Behaelter " + behaelter.Name.Substring(5, 2) + "." + behaelter.Name.Substring(7);
                frmBehaelter[counter].Text = titelFormular;
                frmMng.FormularAdd(frmBehaelter[counter], frmName);
                frmBehaelter[counter].BindDatas(FuncString.GetOnlyNumeric(behaelter.Name));
                Point xyValve = FuncGeneral.GetMiddle(behaelter);

                Point xyFrm = FuncGeneral.GetMiddle(frmBehaelter[counter]);

                Point valvePos = new Point();
                valvePos.X = behaelter.Left + xyValve.X;
                valvePos.Y = behaelter.Top - xyValve.Y;

                frmBehaelter[counter].Left = valvePos.X - xyFrm.X;
                frmBehaelter[counter].Top  = valvePos.Y - xyFrm.Y * 2 - xyValve.Y + 35;

                if (frmBehaelter[counter].Left < 0)
                {
                    frmBehaelter[counter].Left = 0;
                }
                if (frmBehaelter[counter].Top < 0)
                {
                    frmBehaelter[counter].Top = valvePos.Y + xyValve.Y + 70;
                }


                ToolTip toolTip1 = new ToolTip();
                toolTip1.AutoPopDelay = 0;
                toolTip1.ShowAlways   = true;
                toolTip1.UseAnimation = false;
                toolTip1.SetToolTip(this.BTN_Menu, "Menue");
                toolTip1.SetToolTip(this.BTN_Error, "Fehlermeldungen");
            }

            this.Left            = 0;
            this.Top             = 0;
            this.Width           = Screen.PrimaryScreen.Bounds.Width;
            this.Height          = Screen.PrimaryScreen.Bounds.Height;
            this.timer1.Interval = 100;
            this.timer1.Enabled  = true;
        }