Startup
This commit is contained in:
@@ -36,7 +36,7 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
setPersistedComponents(persistedComponents.toArray(new Component[0]));
|
||||
startTimer(1000);
|
||||
}
|
||||
boolean running;
|
||||
//boolean running;
|
||||
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
@@ -71,7 +71,7 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
ScanListener scanListener = new ScanListener() {
|
||||
@Override
|
||||
public void onScanStarted(Scan scan, String string) {
|
||||
if (running) {
|
||||
if (isRunning()) {
|
||||
table.setRowSelectionInterval(0, 0);
|
||||
SwingUtils.scrollToVisible(table, 0, 0);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
|
||||
@Override
|
||||
public void onNewRecord(Scan scan, ScanRecord rec) {
|
||||
if (running) {
|
||||
if (isRunning()) {
|
||||
int index = rec.getIndex() + 1;
|
||||
if (index < table.getRowCount()) {
|
||||
table.setRowSelectionInterval(index, index);
|
||||
@@ -90,7 +90,7 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
|
||||
@Override
|
||||
public void onScanEnded(Scan scan, Exception ex) {
|
||||
if (running) {
|
||||
if (isRunning()) {
|
||||
table.clearSelection();
|
||||
}
|
||||
}
|
||||
@@ -99,9 +99,9 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
@Override
|
||||
public void onStateChange(State state, State former) {
|
||||
setEnabled(isEnabled());
|
||||
if (!state.isProcessing()) {
|
||||
running = false;
|
||||
}
|
||||
//if (!state.isProcessing()) {
|
||||
// running = false;
|
||||
//}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,11 +179,13 @@ public class PhotonEnergy extends ScriptProcessor {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
super.execute();
|
||||
running = true;
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String getScript() {
|
||||
|
||||
Reference in New Issue
Block a user