DICATask.js
Summary
DICA Task
function DICATask(card, url) {
this.card = card;
this.url = url;
this.task = new Task(this);
this.task.setContextMenu([ "Stop" ]);
}
exports.DICATask = DICATask;
DICATask.prototype.start = function() {
this.running = true;
this.task.start();
}
DICATask.prototype.stop = function() {
this.running = false;
this.task.stop();
this.task.dispose();
this.task = undefined;
}
DICATask.prototype.run = function() {
try {
this.card.remoteUpdate(this.url);
}
catch(e) {
GPSystem.log(GPSystem.ERROR, "DICATask", e);
this.task.setMessage(this.reader + " : " + e.message);
throw e;
}
finally {
if (this.card) {
this.card.close();
}
}
}
DICATask.prototype.actionListener = function(source, action) {
switch(action) {
case "Stop":
this.card.cancelRemoteUpdate();
Card.setCardEventListener();
this.stop();
break;
}
}
DICATask.prototype.notify = function() {
this.task.setMessage(this.reader + " : " + this.card.remoteMessage + "(" + this.card.remoteMessageId + ")");
}
DICATask.prototype.toString = function() {
return "DICA connected to " + this.url;
}
Documentation generated by
JSDoc on Sat Feb 24 15:17:19 2024