Ejemplo n.º 1
0
        public bool hasPlaten;                      //是否有平板


        public void GetPaperSource()
        {
            if (twSession.defaultScannerName.ToLower().Contains("kodak"))
            {
                capId = TwCap.CAP_PAPERSOURCE;


                CapItem capItem = twSession.GetCapabilitySupportedDataList(TwCap.CAP_PAPERSOURCE);
                CapType       = capItem.listDataType;
                CurrentIntStr = twSession.GetCapabilityCurrentValue(TwCap.CAP_PAPERSOURCE, ref capType);
                DefaultIntStr = twSession.GetCapabilityDefaultValue(TwCap.CAP_PAPERSOURCE, ref capType);

                if (capItem.list != null && capItem.list.Count == 3)
                {
                    hasPlaten = true;
                    if (valueList == null)
                    {
                        valueList = new ArrayList();
                    }
                    valueList.Clear();
                    valueList.Add(PaperSouceString.ADF);
                    valueList.Add(PaperSouceString.Platen);
                }
                //如果是自动模式,则设置为送纸器
                if (currentIntStr.Equals("0"))
                {
                    bool flag = SetCap("1");
                    if (flag)
                    {
                        currentIntStr = "1";
                    }
                }
                capId = TwCap.ECAP_PAPERSOURCE;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置富士通型号的纸张来源
        /// </summary>
        /// <returns></returns>
        private bool SetFujitsuPaperSource()
        {
            bool flag        = false;
            bool loadedFlag  = false; //adf送纸器是否有纸张
            bool AdfOpenFlag = false; //adf送纸器打开标志

            //1:获取送纸器查询值
            TwType twType   = TwType.Null;
            string dataType = twSession.GetCapabilityCurrentValue(TwCap.CAP_FEEDERENABLED, ref twType);

            if (dataType == null)
            {
                logger.Info("cannot get the cap_feederenabled");
            }
            //1.1:当前是ADF进纸器
            if (dataType.Equals("1"))
            {
                // 查询送纸器是否有纸
                String dataStr = twSession.GetCapabilityCurrentValue(TwCap.CAP_FEEDERLOADED, ref twType);
                if (dataStr != null && (dataStr.Equals("1") || dataStr.Equals("1.0")))
                {
                    loadedFlag = true;
                }
                else
                {
                    loadedFlag = false;
                }
                AdfOpenFlag = true;
            }
            //1.2:当前是平板进纸器
            else
            {
                AdfOpenFlag = false;
            }


            //3:根据应用设置进行能力设置
            // CAP_FEEDERENABLED属性:参数为true为ADF进纸,参数为false为平板进纸
            string sourceVal = "1";

            switch (PaperSourceFlag)
            {
            case PaperSource.Auto:
            {
                //支持ADF送纸器并且送纸器有纸,则使用ADF送纸器
                if (AdfOpenFlag && loadedFlag)
                {
                    sourceVal = "1";
                }
                else
                {
                    sourceVal = "0";
                }
                break;
            }

            case PaperSource.Feeder:
                sourceVal = "1";
                break;

            case PaperSource.Platen:
                sourceVal = "0";
                break;

            default:
                break;
            }

            flag = twSession.SetCapability(TwCap.CAP_FEEDERENABLED, sourceVal);
            return(flag);
        }