Exemple #1
0
        public void testUnit_t(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            value = _wtxObj.Unit;

            Assert.AreEqual("t", _wtxObj.UnitStringComment());
        }
Exemple #2
0
        public void testGetDataStr(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.NetValue;

            Assert.IsNotNull(_wtxObj.GetDataStr);
        }
Exemple #3
0
        public bool TestConnectJetbus(Behavior behaviour)
        {
            testConnection = new TestJetbusConnection(behaviour, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); }, 5000);

            WtxJet WTXJetObj = new WtxJet(testConnection);

            this.connectCallbackCalled = false;

            WTXJetObj.Connect(this.OnConnect, 100);

            return(WTXJetObj.isConnected);
        }
Exemple #4
0
        public void testActivationTimeAfterFineFlow(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.ActivationTimeAfterFineFlow;

            Assert.IsTrue(_jetTestConnection.getDataBuffer.ContainsKey("FFL"));
        }
Exemple #5
0
        public void testSystematicDifference(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.SystematicDifference;

            Assert.IsTrue(_jetTestConnection.getDataBuffer.ContainsKey("SYD"));
        }
Exemple #6
0
        public void testOptimizationOfCutOffPoints(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.OptimizationOfCutOffPoints;

            Assert.IsTrue(_jetTestConnection.getDataBuffer.ContainsKey("OSN"));
        }
Exemple #7
0
        public void testWeightWithinTheCenterOfZero(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.WeightWithinTheCenterOfZero;

            Assert.IsTrue(_jetTestConnection.getDataBuffer.ContainsKey("6012/01"));
        }
Exemple #8
0
        public void test_NetGrossValueStringComment_0Decimals(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            string strValue = _wtxObj.NetGrossValueStringComment(_wtxObj.GrossValue, 0);

            double dValue = _wtxObj.GrossValue / Math.Pow(10, 0);

            Assert.AreEqual(dValue.ToString(), strValue);
        }
Exemple #9
0
        public void test_StatusStringComment_Default(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            value = 111199990;

            string Strvalue = _wtxObj.StatusStringComment(value);

            Assert.AreEqual("Invalid status", Strvalue);
        }
Exemple #10
0
        public bool testIsDataReceived(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.IsDataReceived = false;

            _wtxObj.getConnection.Read("601A/01");

            return(_wtxObj.IsDataReceived);
        }
Exemple #11
0
        public void testGetDataUshort(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            ushort[] testArray = new ushort[185];

            for (int index = 0; index < testArray.Length; index++)
            {
                testArray[index] = 0;
            }

            Assert.AreEqual(testArray, _wtxObj.GetDataUshort);
        }
Exemple #12
0
        public bool WriteGrossTest(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.gross(WriteDataCompleted);     // Alternative : _jetTestConnection.Write("6002/01", 1936683623);

            if (_jetTestConnection.getDataBuffer.ContainsKey("6002/01") && _jetTestConnection.getDataBuffer.ContainsValue(1936683623))
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
Exemple #13
0
        public void testReadGrossValue(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            testGrossValue = _wtxObj.GrossValue;

            Assert.IsTrue(_jetTestConnection.getDataBuffer.ContainsKey("6144/00"));

            /*
             * if (_jetTestConnection.getDataBuffer.ContainsKey("6144/00"))
             *  return true;
             * else
             *  if (_jetTestConnection.getDataBuffer.ContainsKey(""))
             *  return false;
             * return false;
             */
        }
Exemple #14
0
        public bool CalibrationPreloadCapacityTest(Behavior behavior)
        {
            double preload  = 1;
            double capacity = 2;

            double testdPreload       = 0;
            double testdNominalLoad   = 0;
            int    testIntPreload     = 0;
            int    testIntNominalLoad = 0;

            double multiplierMv2D = 500000; //   2 / 1000000; // 2mV/V correspond 1 million digits (d)

            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.Calculate(preload, capacity);

            testdPreload     = preload * multiplierMv2D;
            testdNominalLoad = testdPreload + (capacity * multiplierMv2D);

            testIntPreload     = Convert.ToInt32(testdPreload);
            testIntNominalLoad = Convert.ToInt32(testdPreload);

            if (
                _jetTestConnection.getDataBuffer.ContainsKey("2110/06") && _jetTestConnection.getDataBuffer.ContainsValue(testIntPreload) &&
                _jetTestConnection.getDataBuffer.ContainsKey("2110/07") && _jetTestConnection.getDataBuffer.ContainsValue(testIntNominalLoad)
                )
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
Exemple #15
0
        public void testLimitValueStatusLVS3(Behavior behavior)
        {
            bool testVar = false;

            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            int limitvalue3 = _wtxObj.LimitValue3Source;

            if (_jetTestConnection.getDataBuffer.ContainsKey("2020/25") == true && limitvalue3 == 0)
            {
                testVar = true;
            }
            else
            {
                testVar = false;
            }

            Assert.IsTrue(testVar);
        }
Exemple #16
0
        public bool MeasureZeroTest(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.MeasureZero();

            if (
                _jetTestConnection.getDataBuffer.ContainsKey("6002/01") && _jetTestConnection.getDataBuffer.ContainsValue(2053923171) &&
                _jetTestConnection.getDataBuffer.ContainsKey("6002/02") && _jetTestConnection.getDataBuffer.ContainsValue(1801543519)
                )
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
Exemple #17
0
        public bool CalibrationTest(Behavior behavior)
        {
            _jetTestConnection = new TestJetbusConnection(behavior, "wss://172.19.103.8:443/jet/canopen", "Administrator", "wtx", delegate { return(true); });

            _wtxObj = new WtxJet(_jetTestConnection);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.Calibrate(15000, "15000");

            if (_jetTestConnection.getDataBuffer.ContainsKey("6152/00") && _jetTestConnection.getDataBuffer.ContainsValue(15000) &&       // LFT_SCALE_CALIBRATION_WEIGHT = "6152/00"
                _jetTestConnection.getDataBuffer.ContainsKey("6002/01") && _jetTestConnection.getDataBuffer.ContainsValue(1852596579) &&  // CALIBRATE_NOMINAL_WEIGHT = 1852596579 // SCALE_COMMAND = "6002/01"
                _jetTestConnection.getDataBuffer.ContainsKey("6002/02") && _jetTestConnection.getDataBuffer.ContainsValue(1801543519)
                )
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }