武汉 [更换]

欢迎光临![登录] [注册]
 信任登录:
  • 正品保障
  • 提供发票
  • 七天退换
  • 价格保护
  • 一件代发

商城文章

新大陆MT66、MT90的数据编辑功能

发布者 :高自盟 发布时间:2020/11/6 13:26:56

数据编辑功能可用JS写一个脚本,将原始条码数据处理成目标格式输出。JS脚本要用生成器生成为QR码,再进入扫描头设置里的 数据编辑 功能,扫一下所生成的QR码,就可以写入PDA中。操作过程请参考以下视频:

示例代码:


function JSDataFormat(codeType,aimid,aimidLength,decodeResult,ResultLength) {

    //==========Changeable Area Start===================
    var startPos=0;  // Required. This paramater means the position where to start the extraction. The first position should be 0;
    var length = ResultLength - 2;  //cut off last 2 chars // Required. This paramater means the number of characters to cut.
     //==========Changeable Area End===================
    
    //===========Unchangeable Area Start==================
     var CodeTypeMap={
        0:"ZASetup", 1:"Setup 128", 2:"Code 128", 3:"UCC/EAN-128", 4:"AIM128", 5:"GS1-128", 6:"ISBT128", 7:"EAN-8", 8:"EAN-13", 9:"UPC-E", 10:"UPC-A",
        11:"ISBN", 12:"ISSN", 13:"Code 39", 14:"Code 93", 15:"93I", 16:"CodaBar", 17:"ITF", 18:"ITF6", 19:"ITF14", 20:"DpleitCode", 21:"DpidentCode",
        22:"ChinaPost25", 23:"Standard 25", 23:"IATA25", 24:"Matrix 2 of 5", 25:"Industrial 25", 26:"COOP25", 27:"Code 11", 28:"MSI Plessey",
        29:"Plessey", 30:"RSS 14", 31:"RSS Limited", 32:"RSS Expanded", 33:"TELEPEN", 34:"Channel Code", 35:"Code 32", 36:"CODEZ", 37:"CODABLOCKF",
        38:"CODABLOCKA", 39:"Code 49", 40:"CODE16K", 41:"HIBC128", 42:"HIBC39", 43:"RSS Family", 44:"TriopticCODE39", 45:"UPC_E1", 256:"PDF417",
        257:"Micro PDF", 258:"QR Code", 259:"Micro QR", 260:"AZTEC", 261:"DataMatrix", 262:"MAXICODE", 263:"CSCODE", 264:"GRIDMATRIX", 265:"EARMARK",
        266:"VERICODE", 267:"CCA", 268:"CCB", 269:"CCC", 270:"Composite"
    };
    // Use the codeType to find the code name from CodeTypeMap
    var CodeTypeString=CodeTypeMap[codeType];
    var returnArray = new Array();
    // when the barcode is QR or MicroQR get the cropped decode result otherwise return the full decode result
    if(CodeTypeString == "Code 128"){ //if it's code 128
for(i=startPos; i<startPos+length; i++){ //i<startPos+length: set the length to start+length, that's the original string without last 2 chars.
    returnArray.push(decodeResult[i]);
    }
    } else {
       returnArray = decodeResult;
    }
    return returnArray;
     //===========Unchangeable Area End==================
}

代码说明:

1、以上代码中,标黄的是关键代码,由于代码中不能含有中文,包括注释,所以用英文写了注释。

2、这段代码的效果是截去条码的最后2位,但没有对不足2位的条码作判断,所以有替在的异常。

3、第1处标黄中,ResultLength是条码的原长度,此时将原长度-2,赋给length。

4、第2处标黄中,输出结果从原条码的 startPos(即0) 开始,直到length,所以输出结果就是截去了最后2位。


生成器使用说明及开发接口http://kb.newland-id.com/index.php?n=Android.DataEdit

生成器:http://res.newland-id.com/mt90Scripts/


用户评论
共0条记录,共1页,每页10条,第1页  [ 首页 | 上一页 | 下一页 | 末页 ]  转到
发表评论
* 用户名:
评论等级:
* 评论标题:
* 评论内容:
验证码:
  • 品质保障 品牌厂家 官方授权
  • 无忧退货 完美售后 15天退货
  • 厂家直销 5-7折供货 全网最低
  • 价格保护 买贵包退 实惠到家
  • 一件代发 无需囤货 省心省力
友情链接:   扫描模组

深圳市信华翰科技有限公司

公司地址: 深圳市福田区深南中路3007号国际科技大厦37楼

粤ICP备11079526号

深圳市市场监督管理局企业主体身份公示
扫一扫,快速进入高自盟微信商城!
扫一扫,加我为微信好友吧!