Пример #1
0
        private void BtnConnection_Click(object sender, EventArgs e)
        {
            //Added list of mids i want to use in my interpreter, every another will be desconsidered
            driver = new OpenProtocolDriver(new Type[]
            {
                typeof(Mid0002),
                typeof(Mid0005),
                typeof(Mid0004),
                typeof(Mid0003),

                typeof(ParameterSet.Mid0011),
                typeof(ParameterSet.Mid0013),

                typeof(Mid0035),
                typeof(Mid0031),

                typeof(Alarm.Mid0071),
                typeof(Alarm.Mid0074),
                typeof(Alarm.Mid0076),

                typeof(Vin.Mid0052),

                typeof(Mid0061),
                typeof(Mid0065),

                typeof(Time.Mid0081),

                typeof(Mid9999)
            });

            var client = new Ethernet.SimpleTcpClient().Connect(textIp.Text, (int)numericPort.Value);

            if (driver.BeginCommunication(client))
            {
                keepAliveTimer.Start();
                connectionStatus.Text      = "Connected!";
                connectionStatus.BackColor = Color.Green;
            }
            else
            {
                driver = null;
                connectionStatus.Text      = "Disconnected!";
                connectionStatus.BackColor = Color.Red;
            }
        }
        private void btnConnection_Click(object sender, EventArgs e)
        {
            //Added list of mids i want to use in my interpreter, every another will be desconsidered
            this.driver = new OpenProtocolDriver(new List <MID>()
            {
                new MIDs.Communication.MID_0002(),
                new MIDs.Communication.MID_0005(),
                new MIDs.Communication.MID_0004(),
                new MIDs.Communication.MID_0003(),

                new MIDs.ParameterSet.MID_0011(),
                new MIDs.ParameterSet.MID_0013(),

                new MIDs.Job.MID_0035(),
                new MIDs.Job.MID_0031(),

                new MIDs.Alarm.MID_0071(),
                new MIDs.Alarm.MID_0074(),
                new MIDs.Alarm.MID_0076(),

                new MIDs.VIN.MID_0052(),

                new MIDs.Tightening.MID_0061(),
                new MIDs.Tightening.MID_0065(),

                new MIDs.Time.MID_0081(),

                new MID_9999()
            });

            if (this.driver.BeginCommunication(new Ethernet.SimpleTcpClient().Connect(this.textIp.Text, (int)this.numericPort.Value)))
            {
                this.keepAliveTimer.Start();
                this.connectionStatus.Text      = "Connected!";
                this.connectionStatus.BackColor = Color.Green;
            }
            else
            {
                this.driver = null;
                this.connectionStatus.Text      = "Disconnected!";
                this.connectionStatus.BackColor = Color.Red;
            }
        }
        private void btnConnection_Click(object sender, EventArgs e)
        {
            //Added list of mids i want to use in my interpreter, every another will be desconsidered
            driver = new OpenProtocolDriver(new List <Mid>()
            {
                new Mid0002(),
                new Mid0005(),
                new Mid0004(),
                new Mid0003(),

                new ParameterSet.Mid0011(),
                new ParameterSet.Mid0013(),

                new Mid0035(),
                new Mid0031(),

                new Alarm.Mid0071(),
                new Alarm.Mid0074(),
                new Alarm.Mid0076(),

                new Vin.Mid0052(),

                new Mid0061(),
                new Mid0065(),

                new Time.Mid0081(),

                new Mid9999()
            });

            if (driver.BeginCommunication(new Ethernet.SimpleTcpClient().Connect(textIp.Text, (int)numericPort.Value)))
            {
                keepAliveTimer.Start();
                connectionStatus.Text      = "Connected!";
                connectionStatus.BackColor = Color.Green;
            }
            else
            {
                driver = null;
                connectionStatus.Text      = "Disconnected!";
                connectionStatus.BackColor = Color.Red;
            }
        }
 public AbortJobCommand(OpenProtocolDriver driver)
 {
     this.driver = driver;
 }
Пример #5
0
 public DownloadProductCommand(OpenProtocolDriver driver)
 {
     this.driver = driver;
 }
 public SendJobCommand(OpenProtocolDriver driver)
 {
     _driver = driver;
 }