V2
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
|
||||
import ch.psi.pshell.framework.Context;
|
||||
import ch.psi.pshell.scan.Scan;
|
||||
import ch.psi.pshell.ui.ScriptProcessor;
|
||||
import ch.psi.utils.EncoderJson;
|
||||
import ch.psi.utils.IO;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.pshell.framework.ScriptProcessor;
|
||||
import ch.psi.pshell.framework.Setup;
|
||||
import ch.psi.pshell.utils.EncoderJson;
|
||||
import ch.psi.pshell.utils.IO;
|
||||
import ch.psi.pshell.utils.State;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
@@ -89,11 +91,11 @@ public class TimeResolved extends ScriptProcessor {
|
||||
public void onTimer() {
|
||||
try{
|
||||
if (isRunning()){
|
||||
Scan scan = getContext().getExecutionPars().getCurrentScan();
|
||||
Scan scan = Context.getExecutionPars().getScan();
|
||||
if (scan!=null){
|
||||
int index = scan.getRecordIndex();
|
||||
textCurScan.setText(String.valueOf(index));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch(Exception ex){
|
||||
@@ -104,7 +106,7 @@ public class TimeResolved extends ScriptProcessor {
|
||||
|
||||
void updateSeq() {
|
||||
try {
|
||||
textFileId.setText(String.valueOf(getContext().getFileSequentialNumber()));
|
||||
textFileId.setText(String.valueOf(Context.getFileSequentialNumber()));
|
||||
} catch (Exception ex) {
|
||||
textFileId.setText("");
|
||||
}
|
||||
@@ -396,7 +398,7 @@ public class TimeResolved extends ScriptProcessor {
|
||||
|
||||
private void buttonResetIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonResetIdActionPerformed
|
||||
try {
|
||||
this.getContext().setFileSequentialNumber(0);
|
||||
Context.setFileSequentialNumber(0);
|
||||
updateSeq();
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
@@ -413,7 +415,7 @@ public class TimeResolved extends ScriptProcessor {
|
||||
|
||||
private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
|
||||
try {
|
||||
JFileChooser chooser = new JFileChooser(getContext().getSetup().expandPath(getHomePath()));
|
||||
JFileChooser chooser = new JFileChooser(Setup.expandPath(getHomePath()));
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter(getDescription(), getExtensions());
|
||||
chooser.setFileFilter(filter);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user