This commit is contained in:
2026-03-13 15:28:30 +01:00
parent 0b8ceb6cf0
commit e487e4909d
31 changed files with 653 additions and 35 deletions
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="476" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="scanPlot" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="394" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="scanPlot" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="ch.psi.pshell.swing.PlotPanel" name="scanPlot">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="476" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="394" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</SubComponents>
</Form>
+121
View File
@@ -0,0 +1,121 @@
import ch.psi.pshell.framework.ScriptProcessor;
import ch.psi.pshell.framework.Task;
import ch.psi.pshell.utils.State;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class TestScript extends ScriptProcessor {
//TODO: set script name
public static final String SCRIPT_NAME = "TestScript";
public TestScript() {
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() {
scanPlot.initialize();
scanPlot.setActive(true);
System.out.println("OK");
}
@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 SCRIPT_NAME;
}
@Override
public Map<String, Object> getArgs(){
//TODO: add script arguments
Map<String, Object> ret = new HashMap<>();
return ret;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
scanPlot = new ch.psi.pshell.swing.PlotPanel();
javax.swing.GroupLayout scanPlotLayout = new javax.swing.GroupLayout(scanPlot);
scanPlot.setLayout(scanPlotLayout);
scanPlotLayout.setHorizontalGroup(
scanPlotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 476, Short.MAX_VALUE)
);
scanPlotLayout.setVerticalGroup(
scanPlotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 394, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 476, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(scanPlot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 394, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(scanPlot, javax.swing.GroupLayout.Alignment.TRAILING, 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 ch.psi.pshell.swing.PlotPanel scanPlot;
// End of variables declaration//GEN-END:variables
}