Beispiel #1
0
        /// <inheritdoc />
        public bool Write(object command, string value)
        {
            JValue        jasonValue = new JValue(value);
            JetBusCommand _command   = (JetBusCommand)command;

            SetData(_command.Path, jasonValue);
            return(true); // DDD Exception handling
        }
Beispiel #2
0
        public string ReadFromBuffer(object command)
        {
            this.DoHandshake();

            switch (this.behavior)
            {
            case Behavior.t_UnitValue_Success:
                _dataBuffer["6015/01"] = Convert.ToString(0x004C0000);      // Unit, prefix or fixed parameters - for unit 't'.
                break;

            case Behavior.kg_UnitValue_Success:
                _dataBuffer["6015/01"] = Convert.ToString(0x00020000);      // Unit, prefix or fixed parameters - for unit 'kg'.
                break;

            case Behavior.g_UnitValue_Success:
                _dataBuffer["6015/01"] = Convert.ToString(0x004B0000);      // Unit, prefix or fixed parameters - for unit 'g'.
                break;

            case Behavior.lb_UnitValue_Success:
                _dataBuffer["6015/01"] = Convert.ToString(0X00A60000);      // Unit, prefix or fixed parameters - for unit 'lb'.
                break;

            case Behavior.N_UnitValue_Success:
                _dataBuffer["6015/01"] = Convert.ToString(0x00210000);      // Read Unit, prefix or fixed parameters - for unit 'N'.
                break;

            case Behavior.LimitValues_WeightWithinLimits:
                _dataBuffer["6012/01"] = Convert.ToString(0x00);
                break;

            case Behavior.LimitValues_Underload:
                _dataBuffer["6012/01"] = Convert.ToString(0x4);      // For limit values
                break;

            case Behavior.LimitValues_Overload:
                _dataBuffer["6012/01"] = Convert.ToString(0x8);
                break;

            case Behavior.LimitValues_HigherSafeLoadLimit:
                _dataBuffer["6012/01"] = Convert.ToString(0xC);
                break;

            case Behavior.NetGrossTareValues_Success:
                _dataBuffer["601A/01"] = Convert.ToString(11);
                break;

            default:
                _dataBuffer["6015/01"] = Convert.ToString(0x00);      // Unit, prefix or fixed parameters - for default value
                _dataBuffer["601A/01"] = Convert.ToString(0);
                break;
            }

            JetBusCommand jetcommand = (JetBusCommand)command;

            return(jetcommand.ToString(AllData[jetcommand.Path]));
        }
Beispiel #3
0
        public bool WriteInteger(object command, int data)
        {
            JetBusCommand _command = (JetBusCommand)command;

            if (this.behavior == Behavior.WriteZeroSuccess || this.behavior == Behavior.WriteGrossSuccess || this.behavior == Behavior.WriteTareSuccess ||
                this.behavior == Behavior.CalibrationSuccess || this.behavior == Behavior.CalibrationFail || this.behavior == Behavior.MeasureZeroSuccess ||
                this.behavior == Behavior.MeasureZeroFail || this.behavior == Behavior.CalibratePreloadCapacitySuccess)
            {
                JValue valueObj = new JValue(data);
                this.SetData(_command.Path, valueObj);
            }


            if (this.behavior == Behavior.setTestsSuccess || this.behavior == Behavior.setTestsFail)
            {
                JValue valueObj = new JValue(data);
                this.SetData(_command.Path, valueObj);
            }

            return(true);
        }
Beispiel #4
0
        /// <inheritdoc />
        public int ReadIntegerFromBuffer(object command)
        {
            JetBusCommand jetcommand = (JetBusCommand)command;

            return(jetcommand.ToSValue(AllData[jetcommand.Path]));
        }
Beispiel #5
0
        /// <inheritdoc />
        public string ReadFromBuffer(object command)
        {
            JetBusCommand jetcommand = (JetBusCommand)command;

            return(jetcommand.ToString(AllData[jetcommand.Path]));
        }