Beispiel #1
0
        protected override bool ExecMacCommand(byte flag, int MacSN, byte MacType, ref string MacMsg)
        {
            bool ret   = base.ExecMacCommand(flag, MacSN, MacType, ref MacMsg);
            byte IsNew = 0;

            if (flag == 0)
            {
                IsNew = 1;
            }
            if (readData == null)
            {
                readData = new FingerReadData(this.Text + "[" + CurrentTool + "]", IsNew);
            }
            int RecordCount = 0;
            int RecordIndex = 0;

            switch (flag)
            {
            case 0:
            case 1:
                MsgString     = lblMsg.Text;
                progBar.Style = ProgressBarStyle.Blocks;
                progBar.Value = 0;
                ret           = readData.FK623ReadData(db, textFormat, MacSN, ref RecordCount, ref RecordIndex, ShowReadDataProcess);
                MacMsg        = string.Format("{0}/{1}", RecordIndex, RecordCount);
                break;

            case 2:
                RefreshMsg(CurrentTool + "[" + usbFile + "]......");
                MsgString     = lblMsg.Text;
                progBar.Style = ProgressBarStyle.Blocks;
                progBar.Value = 0;
                ret           = readData.FK623ReadDataUSB(usbFile, db, textFormat, ref RecordCount, ref RecordIndex, ShowReadDataProcess);
                if (!ret)
                {
                    MacMsg = DeviceObject.objFK623.ErrMsg;
                }
                if (ret)
                {
                    MacMsg = string.Format("{0}/{1}", RecordIndex, RecordCount);
                }
                lblMsg.Text = MsgString + MacMsg;
                break;
            }
            readData = null;

            return(ret);
        }