Hiding puck detection errors from users.
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
package ch.psi.mxsc;
|
||||
|
||||
import ch.psi.mxsc.BasePlatePanel.SelectionMode;
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.pshell.core.JsonSerializer;
|
||||
import ch.psi.pshell.core.Plugin;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
@@ -90,11 +88,11 @@ public class MainPanel extends Panel {
|
||||
if (e.getValueIsAdjusting() == false) {
|
||||
int selection = tableSamples.getSelectedRow();
|
||||
if (selection>=0){
|
||||
String add = String.valueOf(tableSamples.getModel().getValueAt(selection, 5));
|
||||
String add = String.valueOf(tableSamples.getModel().getValueAt(selection, COLUMN_PUCK_ADDRESS));
|
||||
if (!add.trim().isEmpty()) {
|
||||
int pos = -1;
|
||||
try{
|
||||
pos = Integer.valueOf(String.valueOf(tableSamples.getModel().getValueAt(selection, 7)));
|
||||
pos = Integer.valueOf(String.valueOf(tableSamples.getModel().getValueAt(selection, COLUMN_SAMPLE_POSITION)));
|
||||
} catch (Exception ex){
|
||||
}
|
||||
String curSelection = Controller.getInstance().getCurrentSelection();
|
||||
@@ -464,13 +462,16 @@ public class MainPanel extends Panel {
|
||||
return panelDetail.getSize();
|
||||
}
|
||||
|
||||
final int COLUMN_PUCK_ADDRESS = 3;
|
||||
final int COLUMN_SAMPLE_POSITION = 5;
|
||||
|
||||
void setSamplesTable(Object[][] sampleData) {
|
||||
tableSamples.setModel(new DefaultTableModel(
|
||||
sampleData,
|
||||
new String[]{
|
||||
"User Name", "Dewar Name",
|
||||
//"User Name", "Dewar Name",
|
||||
"Puck Name", "Puck Type", "Puck Id", "Puck Address",
|
||||
"Sample Name", "Sample Position", "Sample Status", "Mount Count"
|
||||
"Sample Name", "Sample Position", "Sample Id", "Sample Status", "Mount Count"
|
||||
}
|
||||
) {
|
||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||
@@ -494,9 +495,9 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
|
||||
for (int i = 0; i < tableSamples.getModel().getRowCount(); i++) {
|
||||
if (add.equals(tableSamples.getModel().getValueAt(i, 5))) {
|
||||
if (add.equals(tableSamples.getModel().getValueAt(i, COLUMN_PUCK_ADDRESS))) {
|
||||
if (sample!=null){
|
||||
if (!sample.equals(tableSamples.getModel().getValueAt(i, 7))){
|
||||
if (!sample.equals(tableSamples.getModel().getValueAt(i, COLUMN_SAMPLE_POSITION))){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user