Пример #1
0
 public void getDataManager(ref DataManageBase retDataManageBase)
 {
     retDataManageBase = dataManage;
 }
Пример #2
0
        public LocalPLC24P(SplitContainer splitContainer, UserControlBase userBase
                           , DataManageBase dataManage)
        {
            try
            {
                //控制器类型
                this.Tag = 0;

                InitializeComponent();
                split     = splitContainer;
                userBase_ = userBase;
                UserControl1 us1 = (UserControl1)userBase.parent_;
                myDelegate = new DoSomethingEventHandler(us1.DoSomething);

                di   = new UserControlDI(us1);
                dout = new UserControlDO(/*null, */ us1);
                hi   = new UserControlHighIn(us1);
                hout = new UserControlHighOutput(us1);

                // Create the ToolTip and associate with the Form container.
                ToolTip toolTip1 = new ToolTip();
                // Set up the delays for the ToolTip.
                toolTip1.AutoPopDelay = 5000;
                toolTip1.InitialDelay = 500;
                toolTip1.ReshowDelay  = 200;
                // Force the ToolTip text to be displayed whether or not the form is active.
                toolTip1.ShowAlways = true;

                //pictureBox2.Parent = pictureBox1;
                //pictureBox3.Parent = pictureBox1;

                pictest1.Parent = pictureBox1;
                toolTip1.SetToolTip(pictest1, "DO");
                pictest2.Parent = pictureBox1;
                toolTip1.SetToolTip(pictest2, "DI");

                Serial_Line_1.Parent = pictureBox1;
                Serial_Line_1.Tag    = "COM1";
                // Set up the ToolTip text for the Button and Checkbox.
                toolTip1.SetToolTip(this.Serial_Line_1, Serial_Line_1.Tag.ToString());
                Ethernet_1.Parent = pictureBox1;
                Ethernet_1.Tag    = "NET1";
                toolTip1.SetToolTip(Ethernet_1, Ethernet_1.Tag.ToString());

                Serial_Line_2.Parent = pictureBox1;
                Serial_Line_2.Tag    = "COM2";
                toolTip1.SetToolTip(this.Serial_Line_2, Serial_Line_2.Tag.ToString());

                //key value
                //com1 comobject 从配置文件读
                picArray.Add("COM1", Serial_Line_1);
                picArray.Add("COM2", Serial_Line_2);
                picArray.Add("NET1", Ethernet_1);
                picArray.Add("DO", pictest1);
                picArray.Add("DI", pictest2);

                if (!dataManage.newControlerFlag)
                {
                    refreshData();
                }
                else
                {
                    initDIDO();
                }
            }
            catch
            {
            }
        }