Ejemplo n.º 1
0
 /// <summary>
 /// 电子秤称重委托
 /// </summary>
 /// <param name="sender">事件发送者</param>
 /// <param name="e">事件内容</param>
 void WeightDelegate(object sender, WeightEventArgs e)
 {
     if (WeightHandle != null)
     {
         WeightHandle(sender, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 称重事件回调
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnWight(object sender, WeightEventArgs e)
        {
            if (e._bNeedOutPut)
            {
                //称的触发 移动 到客户端 否则由底层控制不合适
                //_BarCodeCamera[0].IoOutput( 800 );
                //_BarCodeCamera[1].IoOutput(20);
                //_BarCodeCamera[0].IoOutput(20);
            }

            if (Interlocked.Read(ref _bBinding) == 1)
            {
                if (WeightHandle != null)
                {
                    WeightHandle(this, e);
                }
            }

            if (e.RealWeight)
            {
                // 实时数据绑定
                Interlocked.CompareExchange(ref _bBinding, 0, 1);

                //条码通知
                Interlocked.CompareExchange(ref _bBarCodeNotifyFlag, 0, 1);

                if (_BarCodeInfo != null)
                {
                    /*
                     * if (_BarCodeCamera != null)
                     * {
                     *  // 相机Io输出
                     *  _BarCodeCamera.IoOutput(100);
                     * }
                     */
                    // 绑定数据信息
                    if (EmbraceHandle != null)
                    {
                        EmbraceHandle(this, new EmbraceEventArgs(_BarCodeInfo, e.Weight));
                    }

                    // 清理一维码数据
                    _BarCodeInfo = null;
                }
                // 兼容手动获取重量
                else
                {
                    if (WeightHandle != null)
                    {
                        WeightHandle(sender, e);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void OnWeightCompleted(object sender, WeightEventArgs e)
 {
     this.Invoke(new setText(setWtCompelte), new object[] { e.Value.ToString() });
 }
Ejemplo n.º 4
0
 public void OnWeightChanged(object sender, WeightEventArgs e)
 {
     Invoke(new setText(HandleWeightChange), new object[] { e.Value.ToString() });
 }
Ejemplo n.º 5
0
 private void GetWeightInfo(object sender, WeightEventArgs e)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 private void GetWeightInfo(object sender, WeightEventArgs e)
 {
     //throw new NotImplementedException();
     MessageBox.Show("磅秤获取数据");
 }
Ejemplo n.º 7
0
 private void DeviceOnWeightMeasured(object sender, WeightEventArgs weightEventArgs)
 {
     UpdateWeight(this, weightEventArgs);
 }