Einstellen
RFID-App anpassen
// for you.
showSettingsPage(showAdvancedSettings) {
app.showPage(new
turck.ui.SettingsPage({
titleText: "@string/HomePageSettingsButton",
showAdvancedSettings: showAdvancedSettings
}));
}
// showScanPage shows the scan page.
showScanPage(startScanning, launchAction, launchPath, launchParameters) {
app.showPage(new
turck.ui.ScanPage({
startScanning: startScanning,
launchAction: launchAction,
launchPath: launchPath,
launchParameters: launchParameters,
titleText: "@string/HomePageScanButton",
// these define what each footer button DOES, not the text they display.
// here, we set the left footer button to pause and resume RFID scans,
// the center footer button stops and starts RFID scans, and the right
// footer button opens the scan configuration menu. You can set any
// of the 3 footer buttons to any of these 3 options.
footerLeft: "pauseResume",
footerCenter: "startStop",
footerRight: "configure",
// this function is expected to return the scan configuration, which is
// set up by the scan configuration menu. Don't touch this.
getScanConfiguration: function() {
return
turck.settings.scanConfiguration;
},
// this function is expected to return the destination for scanned data.
// destination is configured in the scan configuration menu.
// Don't touch this.
getDestination: function() {
return
turck.settings.destination;
},
// the tagFound() function gets called when a tag is found during a scan.
// if the function returns true, the tag will be added to the list of
// found tags on the screen. If the function returns false, the tag
// will not be added to that list.
tagFound: function(tag) {
// calling this will cause the tag data to be sent to the destination
// defined in the scan configuration menu.
this.sendTag(tag);
return
true;
},
// afterScan gets called when a scan has finished.
afterScan: function(tags, displayResultToUser, completion) {
// sendTags sends all the tags as a group.
this.sendTags(tags, displayResultToUser, completion);
},
// tagTouched gets called when the user taps a tag in the scan page.
tagTouched: function(tag) {
if
(!turck.settings.destination) {
// shows the read-write page, loading it with this tag's epc. Then,
// finishes this page.
app.showReadWritePage(tag.epc);
this.finish();
}
},
// this function is called when the PD67's left programmable button is
// pressed. Change this function to change the left programmable button's
// behavior. Any page (this scan page, the read/write page, the gadget
// page from before, etc) can have a function like this.
50
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | more@turck.com | www.turck.com