Example #1
0
        /// <summary>
        /// 设置为完成状态
        /// </summary>
        /// <param name="X"></param>
        /// <param name="Y"></param>
        public virtual void SetFinishStatus(int X, int Y)
        {
            var e = new ChangeBJEventArgs()
            {
                X          = X,
                Y          = Y,
                OldVal     = Values[X, Y],
                NewVal     = Values[X, Y],
                IsComplete = true
            };

            if (e.OldVal != null && e.OldVal is String v)
            {
                e.NewVal     = v + ",F";
                Values[X, Y] = e.NewVal;
            }
            ChangedValueMap?.Invoke(e);
        }
Example #2
0
        /// <summary>
        /// 设置部件对应位置的数据
        /// </summary>
        /// <param name="X">X索引,从0开始</param>
        /// <param name="Y">Y索引,从0开始</param>
        /// <param name="val">对应的数据,如条码,或是否存在</param>
        public virtual void SetValue(int X, int Y, Object val)
        {
            if ("".Equals(val))
            {
                val = null;
            }
            var e = new ChangeBJEventArgs()
            {
                X      = X,
                Y      = Y,
                OldVal = Values[X, Y],
                NewVal = val,
                Code   = _Code
            };

            Values[X, Y] = val;
            System.Diagnostics.Debug.Assert(ChangedValueMap != null);
            ChangedValueMap?.Invoke(e);
        }