예제 #1
0
        /// <summary>
        /// RFID Active
        /// </summary>
        /// <returns></returns>
        private bool SwitchRfid()
        {
            bool isRight = true;

            try
            {
                _pdamodel = PDAInfo.GetDevModel();
                if (_pdamodel == PDAInfo.DevModel.XC2903)
                {
                    bool isext = RfidControl.IsExtRfid();
                    if (isext)
                    {
                        RfidControl.SwitchRfid(RfidControl.RFIDModuleFlag.Extern);
                    }
                    else
                    {
                        RfidControl.SwitchRfid(RfidControl.RFIDModuleFlag.Internal);
                    }
                }
                else
                {
                    RfidControl.Active();
                }
            }
            catch
            {
                isRight = false;
            }

            return(isRight);
        }
예제 #2
0
 public FrBattery()
 {
     InitializeComponent();
     _pdatype = PDAInfo.GetDevModel();
     GetInfoAsync();
     timerGetPower.Enabled = true;
 }
예제 #3
0
 public void SelBarCode()
 {
     PDAInfo.DevModel _pdamodel = PDAInfo.GetDevModel();
     if (_pdamodel == PDAInfo.DevModel.XC2903)
     {
         CameraBarcodeSwitch.SelBarCode();
     }
     ;
 }
예제 #4
0
        public static bool IsXC2903()
        {
            bool IsXC2903 = false;

            _pdamodel = PDAInfo.GetDevModel();
            if (_pdamodel == PDAInfo.DevModel.XC2903)
            {
                IsXC2903 = true;
            }
            return(IsXC2903);
        }
예제 #5
0
        /// <summary>
        /// Is XC2903
        /// </summary>
        /// <returns></returns>
        public static bool IsXC2903()
        {
            bool IsXC2903 = false;

            _pdamodel = PDAInfo.GetDevModel();
            if (_pdamodel == PDAInfo.DevModel.XC2903)
            {
                CameraBarcodeSwitch.SelBarCode();
                IsXC2903 = true;
            }
            return(IsXC2903);
        }
예제 #6
0
        private void Startup(object sender, EventArgs e)
        {
            condoc = new XmlHelper();
            condoc.LoadXmlDocument("sys.config");
            string strauto = condoc.GetSingleAttributeValue("startup", "mode");

            _pdamodel = PDAInfo.GetDevModel();
            //if (strauto == "auto")
            //{
            //    //this.timerLoad.Enabled = true;
            LoaderAsync();
            //}
            //else if (strauto == "manual")
            //{
            //    FrDemolist demolist = new FrDemolist();
            //    progressBarWait.Value = progressBarWait.Maximum;
            //    demolist.Load += new EventHandler(showform_Load);
            //    demolist.ShowDialog();
            //    this.Close();
            //}
            //else
            //{
            //    demoname = condoc.GetSingleAttributeValue("startup", "default");
            //    FrTagMain form = new FrTagMain();
            //    switch (demoname)
            //    {
            //        case "F6C":
            //            RfidConfig._rfidModel = RFIDModule.F6C;
            //            break;
            //        case "F6B":
            //            RfidConfig._rfidModel = RFIDModule.F6B;
            //            break;
            //        case "F6G":
            //            RfidConfig._rfidModel = RFIDModule.F6G;
            //            break;
            //        default:
            //            MessageBox.Show("No matched demo!", "RFID DEMO", MessageBoxButtons.OKCancel, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
            //            break;
            //    }
            //    if (form != null)
            //    {
            //        progressBarWait.Value = progressBarWait.Maximum;
            //        form.Load += new EventHandler(showform_Load);
            //        form.ShowDialog();
            //    }
            //    this.Close();
            //}
        }
예제 #7
0
        /// <summary>
        /// Get Power Info
        /// </summary>
        /// <param name="pdatype"></param>
        /// <returns></returns>
        public static PowerInfo GetPowerInfo(PDAInfo.DevModel pdatype)
        {
            PowerInfo obj = null;

            try
            {
                int    mRetLen;
                string temp_str;
                ushort temp;
                byte[] mBatVoltageBuf = new byte[2];
                SystemPower.SYSTEM_POWER_STATUS_EX2 sSysPowerStatus = new SystemPower.SYSTEM_POWER_STATUS_EX2();
                int wlen = Marshal.SizeOf(sSysPowerStatus);
                mRetLen = SystemPower.GetSystemPowerStatusEx2(ref sSysPowerStatus, wlen, true);
                if (mRetLen < 1)
                {
                    return(null);                        // Get System Power Status Error
                }
                obj = new PowerInfo();
                if (sSysPowerStatus.ACLineStatus == SystemPower.AC_LINE_ONLINE)
                {
                    obj.PowerType = "AC power supply";
                }
                else
                {
                    obj.PowerType = "Battery power supply";
                }


                {
                    temp = (ushort)(((sSysPowerStatus.BatteryVoltage)) / 100); //2903
                    mBatVoltageBuf[0] = (byte)temp;                            //ProcessVoltageValue(temp);
                }

                mBatVoltageBuf[1] = (byte)(mBatVoltageBuf[0] % 10);
                mBatVoltageBuf[0] = (byte)(mBatVoltageBuf[0] / 10);
                temp_str          = string.Format("{0}.{1}V", mBatVoltageBuf[0], mBatVoltageBuf[1]);
                obj.Voltage       = temp_str;

                //lifePercent;
                temp = sSysPowerStatus.BatteryLifePercent;
                if ((temp >= 100) && (temp != SystemPower.BATTERY_PERCENTAGE_UNKNOWN))
                {
                    temp = 100;
                }
                if ((temp == SystemPower.BATTERY_PERCENTAGE_UNKNOWN) ||
                    (sSysPowerStatus.ACLineStatus == SystemPower.AC_LINE_ONLINE))
                {
                    obj.LifePercent = "Unknow";
                }
                else
                {
                    {
                        mBatVoltageBuf[0] = (byte)temp;
                    }

                    temp_str        = string.Format("{0} %", mBatVoltageBuf[0]);
                    obj.LifePercent = temp_str;
                }

                temp = sSysPowerStatus.BatteryFlag;
                switch ((uint)temp)
                {
                case SystemPower.BATTERY_FLAG_HIGH:
                    obj.BaterryStatus = "Discharge";
                    break;

                case SystemPower.BATTERY_FLAG_LOW:
                    obj.BaterryStatus = "Power lower";
                    break;

                case SystemPower.BATTERY_FLAG_CRITICAL:
                    obj.BaterryStatus = "Power extremely low";
                    break;

                case SystemPower.BATTERY_FLAG_CHARGING:
                    obj.BaterryStatus = "Charging";
                    break;

                case SystemPower.BATTERY_FLAG_NO_BATTERY:
                    obj.BaterryStatus = "No baterry";
                    break;

                case SystemPower.BATTERY_FLAG_UNKNOWN:
                default:
                    obj.BaterryStatus = "Unknown status";
                    break;
                }

                //backup battery
                obj.BakcupBatteryFlag = sSysPowerStatus.BackupBatteryFlag;
                if (obj.BakcupBatteryFlag != SystemPower.BATTERY_FLAG_NO_BATTERY ||
                    obj.BakcupBatteryFlag != sSysPowerStatus.BackupBatteryFlag)
                {
                    int    bval   = sSysPowerStatus.BackupBatteryVoltage;
                    byte[] tmpBuf = new byte[2];
                    tmpBuf[0] = (byte)(bval / 100);
                    tmpBuf[1] = (byte)(tmpBuf[0] / 10);
                    tmpBuf[0] = (byte)(tmpBuf[0] % 10);

                    obj.BakcupBatteryVoltage = Convert.ToSingle(string.Format("{0}.{1}", tmpBuf[1], tmpBuf[0]));

                    int bPer = sSysPowerStatus.BackupBatteryLifePercent;
                    if ((bPer > 100) && (bPer != SystemPower.BATTERY_PERCENTAGE_UNKNOWN))
                    {
                        bPer = 100;
                    }
                    if (bPer == SystemPower.BATTERY_PERCENTAGE_UNKNOWN)
                    {
                        obj.BakcupBatteryLifePercent = 0;
                    }
                    else
                    {
                        obj.BakcupBatteryLifePercent = (byte)bPer;
                    }
                }
            }
            catch { }

            return(obj);
        }