This commit is contained in:
gac-S_Changer
2018-10-17 11:44:20 +02:00
parent 3d86c27140
commit b75f7d0ac8
10 changed files with 152 additions and 67 deletions

View File

@@ -161,9 +161,10 @@
<Component id="buttonMount" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonUnmount" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPin" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPin1" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPuck" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="checkAuxiliary" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" pref="31" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -171,19 +172,21 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="buttonMount" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonUnmount" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonScanPin" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonScanPin1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="buttonMount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonUnmount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonScanPin" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonScanPuck" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkAuxiliary" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -205,7 +208,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
@@ -213,7 +216,7 @@
<Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="spinnerPuck" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="checkForce" min="-2" max="-2" attributes="0"/>
@@ -221,7 +224,7 @@
<Component id="spinnerSample" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="spinnerSegment" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -248,12 +251,11 @@
<Component id="jLabel4" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="checkForce" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel5" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="checkDatamatrix" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -355,12 +357,20 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPinActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonScanPin1">
<Component class="javax.swing.JButton" name="buttonScanPuck">
<Properties>
<Property name="text" type="java.lang.String" value="Scan Puck"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPin1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPuckActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkAuxiliary">
<Properties>
<Property name="text" type="java.lang.String" value="Auxiliary"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkAuxiliaryActionPerformed"/>
</Events>
</Component>
</SubComponents>

View File

@@ -50,10 +50,13 @@ public class Commands extends Panel {
@Override
public void onStateChange(State state, State former) {
boolean enabled = (state == State.Ready);
for (Component c: SwingUtils.getComponentsByType(this, JComponent.class)){
c.setEnabled(state == State.Ready);
c.setEnabled(enabled);
}
buttonMoveAux.setEnabled(state == State.Ready);
spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected());
spinnerPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
}
@Override
@@ -135,7 +138,8 @@ public class Commands extends Panel {
checkDatamatrix = new javax.swing.JCheckBox();
buttonUnmount = new javax.swing.JButton();
buttonScanPin = new javax.swing.JButton();
buttonScanPin1 = new javax.swing.JButton();
buttonScanPuck = new javax.swing.JButton();
checkAuxiliary = new javax.swing.JCheckBox();
pnLowLevel = new javax.swing.JPanel();
buttonMovePark = new javax.swing.JButton();
buttonMoveCold = new javax.swing.JButton();
@@ -297,11 +301,10 @@ public class Commands extends Panel {
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel4)
.addComponent(checkForce))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel5)
.addComponent(checkDatamatrix))
.addGap(0, 0, 0))
.addComponent(checkDatamatrix)))
);
buttonUnmount.setText("Unmount");
@@ -318,10 +321,17 @@ public class Commands extends Panel {
}
});
buttonScanPin1.setText("Scan Puck");
buttonScanPin1.addActionListener(new java.awt.event.ActionListener() {
buttonScanPuck.setText("Scan Puck");
buttonScanPuck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonScanPin1ActionPerformed(evt);
buttonScanPuckActionPerformed(evt);
}
});
checkAuxiliary.setText("Auxiliary");
checkAuxiliary.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkAuxiliaryActionPerformed(evt);
}
});
@@ -335,8 +345,9 @@ public class Commands extends Panel {
.addComponent(buttonMount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonUnmount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonScanPin, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonScanPin1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 31, Short.MAX_VALUE)
.addComponent(buttonScanPuck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(checkAuxiliary))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
@@ -348,15 +359,17 @@ public class Commands extends Panel {
.addGroup(pnTransferLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(pnTransferLayout.createSequentialGroup()
.addComponent(buttonMount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonUnmount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonScanPin)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonScanPuck)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonScanPin1))
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(checkAuxiliary)))
.addContainerGap())
);
@@ -633,8 +646,8 @@ public class Commands extends Panel {
}//GEN-LAST:event_buttonEnableAllActionPerformed
private void buttonMountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMountActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
String readDatamatrix = checkDatamatrix.isSelected() ? "True" : "False";
@@ -647,8 +660,8 @@ public class Commands extends Panel {
}//GEN-LAST:event_buttonMoveAuxActionPerformed
private void buttonUnmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUnmountActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("unmount('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
@@ -729,19 +742,19 @@ public class Commands extends Panel {
}//GEN-LAST:event_buttonResetPuckIdsActionPerformed
private void buttonScanPinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPinActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("scan_pin('" + segment + "'," + puck + "," + sample + ", force=" + force + ")", false, true);
}//GEN-LAST:event_buttonScanPinActionPerformed
private void buttonScanPin1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPin1ActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
private void buttonScanPuckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPuckActionPerformed
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("scan_puck('" + segment + "'," + puck + ", force=" + force + ")", false, true);
}//GEN-LAST:event_buttonScanPin1ActionPerformed
}//GEN-LAST:event_buttonScanPuckActionPerformed
private void buttonGetAuxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGetAuxActionPerformed
int sample = (Integer) spinnerSample.getValue();
@@ -753,6 +766,10 @@ public class Commands extends Panel {
execute("put_aux('" + sample + ")");
}//GEN-LAST:event_buttonPutAuxActionPerformed
private void checkAuxiliaryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAuxiliaryActionPerformed
onStateChange(getState(), null);
}//GEN-LAST:event_checkAuxiliaryActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonClearSampleDb;
private javax.swing.JButton buttonDry;
@@ -775,8 +792,9 @@ public class Commands extends Panel {
private javax.swing.JButton buttonRecover;
private javax.swing.JButton buttonResetPuckIds;
private javax.swing.JButton buttonScanPin;
private javax.swing.JButton buttonScanPin1;
private javax.swing.JButton buttonScanPuck;
private javax.swing.JButton buttonUnmount;
private javax.swing.JCheckBox checkAuxiliary;
private javax.swing.JCheckBox checkDatamatrix;
private javax.swing.JCheckBox checkForce;
private javax.swing.JCheckBox ckeckParkOnDry;

View File

@@ -99,10 +99,10 @@ class SmartMagnet(DeviceBase):
self.set_resting_current()
def is_resting_current(self):
return self.get_current() != self.config.getFieldValue("restingCurrent")
return self.get_current() == self.config.getFieldValue("restingCurrent")
#Setting resting curren t to better detect sample
#Setting resting current to better detect sample
def enforce_sample_detection(self):
if not self.is_resting_current():
self.set_resting_current()

View File

@@ -97,6 +97,7 @@ run("motion/move_aux")
run("motion/get_aux")
run("motion/put_aux")
run("motion/dry")
run("motion/trash")
run("motion/homing_hexiposi")
run("motion/scan_pin")
run("motion/robot_recover")

View File

@@ -0,0 +1,18 @@
def calibrate_tool():
"""
"""
print "calibrate_tool"
#Initial checks
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
robot.assert_cleared()
#robot.assert_in_known_point()
#Enabling
enable_motion()
if not robot.is_gonio():
robot.move_gonio()
robot.put_gonio()

View File

@@ -9,7 +9,7 @@ def mount(segment, puck, sample, force=False, read_dm=False):
start = time.time()
is_aux = segment == AUX_SEGMENT
is_aux = (segment == AUX_SEGMENT)
puck_address = get_puck_address(puck)
if puck_address is None:
puck_obj = get_puck_obj_by_id(puck)
@@ -46,8 +46,7 @@ def mount(segment, puck, sample, force=False, read_dm=False):
robot.move_aux()
robot.get_aux(sample)
robot.move_home()
else:
set_hexiposi(segment)

View File

@@ -6,15 +6,15 @@ RECOVER_DESC = "mRecovery"
RECOVER_TOOL = TOOL_DEFAULT
known_segments = [ ("pHome", "pPark", 50), \
("pHome", "pGonioH", 30), \
("pHome", "pGonio", 30), \
("pHome", "pScan", 25), \
("pHome", "pHeater", 75), \
("pHome", "pDewar", 10), \
("pHome", "pHelium", 230), \
("pGonioH", "pGonioG", 10), \
("pGonio", "pGonioG", 10), \
("pPark", "pHeat", 40), \
("pHeater", "pHeatB", 10), \
("pPark", "pAux", 30), \
("pPark", "pAux", 50), \
]
def get_dist_to_line(segment):

View File

@@ -5,6 +5,7 @@ def scan_pin(segment, puck, sample, force=False):
#Initial checks
assert_valid_address(segment, puck, sample)
assert_puck_detected(segment, puck)
is_aux = (segment == AUX_SEGMENT)
robot.assert_no_task()
robot.reset_motion()
@@ -17,20 +18,31 @@ def scan_pin(segment, puck, sample, force=False):
set_status("Scanning pin: " + str(pin_name))
enable_motion()
set_hexiposi(segment)
if not force:
visual_check_hexiposi(segment)
if not robot.is_dewar():
robot.move_dewar()
if is_aux:
if not robot.is_aux():
robot.move_aux()
robot.get_dewar(segment, puck, sample)
robot.get_aux(sample)
else:
set_hexiposi(segment)
if not force:
visual_check_hexiposi(segment)
if not robot.is_dewar():
robot.move_dewar()
robot.get_dewar(segment, puck, sample)
(detected, dm) = move_scanner()
update_samples_info_sample_scan(get_puck_name(segment, puck), sample, detected, dm)
robot.move_dewar()
robot.put_dewar(segment, puck, sample)
if is_aux:
robot.move_aux()
robot.put_aux( sample)
else:
robot.move_dewar()
robot.put_dewar(segment, puck, sample)
ret = "Empty"
if detected:
if (dm is None) or (len(dm.strip())==0):
@@ -41,6 +53,8 @@ def scan_pin(segment, puck, sample, force=False):
def scan_puck(segment, puck, force=False):
if segment == AUX_SEGMENT:
raise Exception("Cannot scan auxiliary puck")
ret = []
for i in range(16):
ret.append(scan_pin (segment, puck, i+1, force))

27
script/motion/trash.py Normal file
View File

@@ -0,0 +1,27 @@
def trash():
"""
"""
print "trash"
#Initial checks
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
robot.assert_cleared()
#robot.assert_in_known_point()
#Enabling
enable_motion()
robot.move_heater(to_bottom = False)
robot.move_heater(to_bottom = True)
for i in range(3):
robot.open_tool()
time.sleep(1.0)
robot.close_tool()
robot.move_heater(to_bottom = False)
robot.move_home()

View File

@@ -9,7 +9,7 @@ def unmount(segment = None, puck = None, sample = None, force=False):
raise Exception("Mounted sample position is not defined")
segment, puck , sample = pos[0:1], int(pos[1]), int(pos[2])
print "Mounted sample position: ", segment, puck , sample
is_aux = segment == AUX_SEGMENT
is_aux = (segment == AUX_SEGMENT)
#Initial checks
assert_valid_address(segment, puck, sample)
@@ -49,10 +49,8 @@ def unmount(segment = None, puck = None, sample = None, force=False):
robot.get_gonio()
if is_aux:
robot.move_dewar()
robot.move_aux()
robot.put_aux( sample)
robot.move_home()
else:
#TODO: Shuld check if smart magnet detection is off?
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)