Closedown
This commit is contained in:
@@ -17,16 +17,17 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonStart" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="411" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonStart" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel2" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="plot" pref="393" max="32767" attributes="0"/>
|
||||
@@ -39,22 +40,19 @@
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="plot" pref="383" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonStart" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="plot" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="buttonStart" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonAbort" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="17" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -158,7 +156,7 @@
|
||||
<Component class="javax.swing.JSpinner" name="spinnerStep">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="5.0" maximum="90.0" minimum="0.1" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
<SpinnerModel initial="10.0" maximum="90.0" minimum="0.1" numberType="java.lang.Double" stepSize="1.0" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
@@ -256,7 +254,7 @@
|
||||
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerPhaseRef" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="116" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="80" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
||||
@@ -128,7 +128,7 @@ public class ReturnBug extends Panel {
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameters"));
|
||||
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(5.0d, 0.1d, 90.0d, 1.0d));
|
||||
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(10.0d, 0.1d, 90.0d, 1.0d));
|
||||
|
||||
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel5.setText("Latency:");
|
||||
@@ -245,7 +245,7 @@ public class ReturnBug extends Panel {
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel7)
|
||||
.addComponent(spinnerPhaseRef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(116, Short.MAX_VALUE))
|
||||
.addContainerGap(80, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
@@ -253,15 +253,15 @@ public class ReturnBug extends Panel {
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart)
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(buttonAbort)
|
||||
.addGap(0, 411, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonStart)
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(buttonAbort))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
@@ -274,18 +274,16 @@ public class ReturnBug extends Panel {
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
|
||||
.addGap(18, 18, 18))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonStart)
|
||||
.addComponent(buttonAbort))
|
||||
.addGap(17, 17, 17))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonStart)
|
||||
.addComponent(buttonAbort))
|
||||
.addGap(17, 17, 17))
|
||||
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
@@ -27,6 +27,27 @@ else:
|
||||
lat = args[4]
|
||||
|
||||
|
||||
class AnalogOutput(RegisterBase):
|
||||
def doRead(self):
|
||||
return self.val if hasattr(self, 'val') else 0.0
|
||||
|
||||
def doWrite(self, val):
|
||||
self.val = val
|
||||
|
||||
class AnalogInput(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
time.sleep(0.001)
|
||||
self.val = to_array(self.calc(), 'd')
|
||||
return self.val
|
||||
class SinusoidSample(AnalogInput):
|
||||
def calc(self):
|
||||
self.x = self.x + 0.1 if hasattr(self, 'x') else 0.0
|
||||
noise = (random.random() - 0.5) / 10.0
|
||||
return math.sin(self.x) + noise
|
||||
|
||||
add_device(AnalogOutput("ao1"), True)
|
||||
add_device(SinusoidSample("ai1"), True)
|
||||
|
||||
r = lscan(ao1, ai1, start, stop, step, latency=lat)
|
||||
|
||||
#Setting the return value
|
||||
|
||||
Reference in New Issue
Block a user