This commit is contained in:
2024-06-10 10:44:16 +02:00
parent 9256184430
commit 3093557c99
79 changed files with 2747 additions and 189 deletions

162
plugins/Scan.java Normal file
View File

@@ -0,0 +1,162 @@
import ch.psi.pshell.ui.ScriptProcessor;
import ch.psi.pshell.ui.Task;
import ch.psi.utils.State;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class Scan extends ScriptProcessor {
public Scan() {
initComponents();
}
//Overridable callbacks
@Override
public void onInitialize(int runCount) {
}
@Override
public void onStateChange(State state, State former) {
}
@Override
public void onExecutedFile(String fileName, Object result) {
}
@Override
public void onTaskFinished(Task task) {
}
@Override
protected void onTimer() {
}
@Override
protected void onLoaded() {
}
@Override
protected void onUnloaded() {
}
@Override
protected void onStartingExecution(Map<String, Object> args) throws Exception{
}
@Override
protected void onFinishedExecution(Map<String, Object> args, Object ret, Throwable t) throws Exception{
}
//Invoked by 'update()' to update components in the event thread
@Override
protected void doUpdate() {
}
@Override
public String getScript(){
return ("DemoScan");
}
@Override
public Map<String, Object> getArgs(){
Map<String, Object> ret = new HashMap();
ret.put("START", spStart.getValue());
ret.put("END", spEnd.getValue());
ret.put("STEPS", spSteps.getValue());
ret.put("PLOT", plot);
return ret;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
spStart = new javax.swing.JSpinner();
spEnd = new javax.swing.JSpinner();
jLabel2 = new javax.swing.JLabel();
spSteps = new javax.swing.JSpinner();
jLabel3 = new javax.swing.JLabel();
plot = new ch.psi.pshell.plot.LinePlotJFree();
jLabel1.setText("Start:");
spStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -10.0d, 10.0d, 1.0d));
spEnd.setModel(new javax.swing.SpinnerNumberModel(0.5d, -10.0d, 10.0d, 1.0d));
jLabel2.setText("End:");
spSteps.setModel(new javax.swing.SpinnerNumberModel(10, 1, 100, 1));
jLabel3.setText("Steps");
plot.setTitle("");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(54, 54, 54)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spSteps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(spStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(47, 47, 47)
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(spStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(spEnd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(spSteps, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(7, 7, 7)
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private ch.psi.pshell.plot.LinePlotJFree plot;
private javax.swing.JSpinner spEnd;
private javax.swing.JSpinner spStart;
private javax.swing.JSpinner spSteps;
// End of variables declaration//GEN-END:variables
}