Hiding puck detection errors from users.

This commit is contained in:
gac-S_Changer
2018-09-20 18:07:39 +02:00
parent dc78eb382f
commit 90292bbba2
3 changed files with 16 additions and 13 deletions

View File

@@ -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;
}
}