示例#1
0
        public bool TestDisconnectJetbus(Behavior behaviour)
        {
            testConnection = new TestJetbusConnection(behaviour, ipaddress, "Administrator", "wtx", delegate { return(true); });

            DSEJet DSEJetObj = new DSEJet(testConnection, 500, Update);

            //this.connectCallbackCalled = false;

            DSEJetObj.Connect(this.OnConnect, 100);

            DSEJetObj.Disconnect(this.OnDisconnect);

            bool con1 = DSEJetObj.IsConnected;

            DSEJetObj.Connect(this.OnConnect, 100);

            DSEJetObj.Disconnect();

            bool con2 = DSEJetObj.IsConnected;

            if (con1 == false && con2 == false)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
 public void TestDisconnecting()
 {
     _connection = new DSEJetConnection(ipaddress);
     _dse        = new DSEJet(_connection, 500, null);
     _dse.Connect(200);
     _dse.Disconnect();
     Assert.AreEqual(false, _dse.IsConnected);
 }
示例#3
0
 public void TestSerial()
 {
     _connection = new DSEJetConnection(ipaddress);
     _dse        = new DSEJet(_connection, 500, null);
     _dse.Connect(200);
     Assert.AreEqual(true, _dse.SerialNumber.Length > 0);
     _dse.Disconnect();
 }
示例#4
0
        public void TestPropertySwitch()
        {
            _connection = new DSEJetConnection(ipaddress);
            _dse        = new DSEJet(_connection, 500, null);
            _dse.Connect(200);
            System.Threading.Thread.Sleep(500);
            double tare = _dse.ManualTareValue;

            _dse.ManualTareValue = 0.040;
            System.Threading.Thread.Sleep(500);
            Assert.AreNotEqual(tare, _dse.ManualTareValue);
            _dse.ManualTareValue = tare;
            _dse.Disconnect();
        }
示例#5
0
 public void readProperties()
 {
     _connection = new DSEJetConnection(ipaddress);
     _dse        = new DSEJet(_connection, 500, null);
     _dse.Connect(200);
     System.Threading.Thread.Sleep(500);
     foreach (var prop in _dse.GetType().GetProperties())
     {
         if (prop.ToString().Equals("Int32 LowPasCutOffFrequency") || prop.ToString().Equals("Int32 LowPassFilterOrder"))
         {
             continue;
         }
         Assert.AreNotEqual(null, prop.GetValue(_dse));
     }
     _dse.Disconnect();
 }