Commit ddf35735 authored by Bartosz Borucki's avatar Bartosz Borucki

Merge branch 'feature/removed_grid' into 'develop'

Removed grid

See merge request !91
parents 80d7712d 6c9c38e6
Pipeline #26431937 passed with stage
in 0 seconds
This diff is collapsed.
......@@ -45,8 +45,6 @@ import pl.edu.icm.visnow.engine.core.ParameterChangeListener;
import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.engine.core.ProgressAgent;
import static pl.edu.icm.visnow.lib.basic.readers.ReadCSV.ReadCSVShared.*;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPException;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPLocalUtils;
import pl.edu.icm.visnow.lib.templates.visualization.modules.OutFieldVisualizationModule;
import pl.edu.icm.visnow.lib.types.VNRegularField;
import pl.edu.icm.visnow.lib.utils.SwingInstancer;
......@@ -60,6 +58,7 @@ import pl.edu.icm.visnow.system.utils.usermessage.Level;
*/
public class ReadCSV extends OutFieldVisualizationModule
{
private static final Logger LOGGER = Logger.getLogger(ReadCSV.class);
public static OutputEgg[] outputEggs = null;
private ReadCSVGUI computeUI = null;
......@@ -109,25 +108,25 @@ public class ReadCSV extends OutFieldVisualizationModule
{
Parameters p = parameters.getReadOnlyClone();
notifyGUIs(p, isFromVNA(), false);
if (p.get(FILENAME).isEmpty()) outRegularField = null;
else {
ProgressAgent progressAgent = getProgressAgent(140); //20 for download from gsiftp, 100 for read, 20 for geometry
File f;
try {
f = GridFTPLocalUtils.getFileOrLocalGSIFTPCopy(p.get(ReadCSVShared.FILENAME), progressAgent.getSubAgent(20));
outRegularField = CsvFieldReader.readCsvField1D(f, p.get(FIELD_SEPARATOR), p.get(HAS_HEADER_LINE));
} catch (GridFTPException ex) {
LOGGER.error("Error while reading file " + p.get(ReadCSVShared.FILENAME), ex);
VisNow.get().userMessageSend(this, "Error reading file: " + p.get(ReadCSVShared.FILENAME), "See log for details", Level.ERROR);
}
ProgressAgent progressAgent = getProgressAgent(120); //100 for read, 20 for geometry
if (p.get(FILENAME).isEmpty()) {
outRegularField = null;
} else {
File f = new File(p.get(ReadCSVShared.FILENAME));
outRegularField = CsvFieldReader.readCsvField1D(f, p.get(FIELD_SEPARATOR), p.get(HAS_HEADER_LINE));
}
outField = outRegularField;
if (outRegularField == null) {
setOutputValue("outField", null);
}
else {
setOutputValue("outField", new VNRegularField(outRegularField));
}
progressAgent.setProgressStep(100);
prepareOutputGeometry();
show();
if (outRegularField == null) setOutputValue("outField", null);
else setOutputValue("outField", new VNRegularField(outRegularField));
}
@Override
......
......@@ -46,7 +46,6 @@ import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.gui.swingwrappers.TextField;
import static pl.edu.icm.visnow.lib.basic.readers.ReadEnSightGoldCase.ReadEnSightGoldCaseShared.*;
import pl.edu.icm.visnow.lib.gui.Browser;
import pl.edu.icm.visnow.lib.gui.grid.GridFrame;
import pl.edu.icm.visnow.lib.utils.io.InputSource;
import pl.edu.icm.visnow.system.main.VisNow;
......@@ -58,7 +57,6 @@ public class GUI extends javax.swing.JPanel
{
private JFileChooser dataFileChooser = new JFileChooser();
private GridFrame gridFrame = new GridFrame();
private FileNameExtensionFilter dataFilter;
private Parameters parameters;
private String lastPath = null;
......@@ -82,17 +80,6 @@ public class GUI extends javax.swing.JPanel
parameters.set(INPUT_SOURCE, InputSource.URL, FILENAME, browser.getCurrentURL());
}
});
gridFrame.setVisible(false);
gridFrame.setFileExtensions(extensions);
gridFrame.setSingleFile(true);
gridFrame.addChangeListener(new ChangeListener()
{
public void stateChanged(ChangeEvent e)
{
parameters.set(INPUT_SOURCE, InputSource.GRID, FILENAME, VisNow.getTmpDirPath() + File.separator + gridFrame.getTransferredFileNames()[0]);
}
});
}
public GUI(String title, String dataFileDesc, String[] extensions)
......@@ -125,17 +112,6 @@ public class GUI extends javax.swing.JPanel
parameters.set(INPUT_SOURCE, InputSource.URL, FILENAME, browser.getCurrentURL());
}
});
gridFrame.setVisible(false);
gridFrame.setFileExtensions(extensions);
gridFrame.setSingleFile(true);
gridFrame.addChangeListener(new ChangeListener()
{
public void stateChanged(ChangeEvent e)
{
parameters.set(INPUT_SOURCE, InputSource.GRID, FILENAME, VisNow.getTmpDirPath() + File.separator + gridFrame.getTransferredFileNames()[0]);
}
});
}
/**
......
......@@ -58,8 +58,6 @@ import pl.edu.icm.visnow.engine.core.ParameterChangeListener;
import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.engine.core.ProgressAgent;
import static pl.edu.icm.visnow.lib.basic.readers.ReadSTL.ReadSTLShared.PATH;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPException;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPLocalUtils;
import pl.edu.icm.visnow.lib.templates.visualization.modules.OutFieldVisualizationModule;
import pl.edu.icm.visnow.lib.types.VNIrregularField;
import pl.edu.icm.visnow.lib.utils.SwingInstancer;
......@@ -104,16 +102,17 @@ public class ReadSTL extends OutFieldVisualizationModule {
notifyGUIs(parametersClone, false, false);
String path = parametersClone.get(PATH);
ProgressAgent progressAgent = getProgressAgent(120); //100 for read, 20 for geometry
if (path.isEmpty()) {
outIrregularField = null;
} else {
try {
ProgressAgent progressAgent = getProgressAgent(140); //20 for download from gsiftp, 100 for read, 20 for geometry
File f = GridFTPLocalUtils.getFileOrLocalGSIFTPCopy(path, progressAgent.getSubAgent(20));
File f = new File(path);
outIrregularField = readSTL(f, progressAgent);
if (outIrregularField != null)
VisNow.get().userMessageSend(this, "Successfully read: " + path, "", Level.INFO);
} catch (IOException | GridFTPException ex) {
} catch (IOException ex) {
outIrregularField = null;
LOGGER.error("", ex);
VisNow.get().userMessageSend(this, "Error reading file: " + path, "See log for details", Level.ERROR);
......@@ -126,6 +125,7 @@ public class ReadSTL extends OutFieldVisualizationModule {
} else {
setOutputValue("outField", null);
}
progressAgent.setProgressStep(100);
prepareOutputGeometry();
show();
}
......@@ -133,7 +133,7 @@ public class ReadSTL extends OutFieldVisualizationModule {
@Override
protected Parameter[] createDefaultParameters() {
return new Parameter[]{
new Parameter<>(PATH, new String()),};
new Parameter<>(PATH, new String())};
}
@Override
......
......@@ -179,19 +179,6 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JRadioButton" name="gridButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="grid"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="materialAsSetsCheckBox">
<Properties>
<Property name="text" type="java.lang.String" value="materials as cell sets"/>
......
......@@ -44,7 +44,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import pl.edu.icm.visnow.lib.gui.Browser;
import pl.edu.icm.visnow.lib.gui.grid.GridFrame;
import pl.edu.icm.visnow.lib.utils.io.InputSource;
import pl.edu.icm.visnow.system.main.VisNow;
......@@ -56,7 +55,6 @@ public class GUI extends javax.swing.JPanel
{
private JFileChooser dataFileChooser = new JFileChooser();
private GridFrame gridFrame = new GridFrame();
private FileNameExtensionFilter dataFilter;
private Params params = new Params();
private String lastPath = null;
......@@ -85,22 +83,6 @@ public class GUI extends javax.swing.JPanel
params.fireStateChanged();
}
});
gridFrame.setVisible(false);
gridFrame.setFileExtensions(dataFilter.getExtensions());
gridFrame.setSingleFile(true);
gridFrame.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
params.setSource(InputSource.GRID);
params.setFileName(VisNow.getTmpDirPath() + File.separator + gridFrame.getTransferredFileNames()[0]);
fileNameField.setText(params.getFileName());
params.setMaterialsAsSets(materialAsSetsCheckBox.isSelected());
params.fireStateChanged();
}
});
}
/**
......@@ -123,7 +105,6 @@ public class GUI extends javax.swing.JPanel
fieldDescription = new javax.swing.JLabel();
fileButton = new javax.swing.JRadioButton();
urlButton = new javax.swing.JRadioButton();
gridButton = new javax.swing.JRadioButton();
materialAsSetsCheckBox = new javax.swing.JCheckBox();
setBorder(javax.swing.BorderFactory.createTitledBorder(""));
......@@ -206,7 +187,7 @@ public class GUI extends javax.swing.JPanel
add(displayBox, gridBagConstraints);
fieldDescription.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
fieldDescription.setText(null);
fieldDescription.setText("null");
fieldDescription.setVerticalAlignment(javax.swing.SwingConstants.TOP);
fieldDescription.setMaximumSize(new java.awt.Dimension(700, 250));
fieldDescription.setMinimumSize(new java.awt.Dimension(400, 170));
......@@ -241,15 +222,6 @@ public class GUI extends javax.swing.JPanel
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
add(urlButton, gridBagConstraints);
buttonGroup1.add(gridButton);
gridButton.setText("grid");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
add(gridButton, gridBagConstraints);
materialAsSetsCheckBox.setText("materials as cell sets");
materialAsSetsCheckBox.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
......@@ -283,9 +255,7 @@ public class GUI extends javax.swing.JPanel
}
} else if (urlButton.isSelected()) {
browser.setVisible(true);
} else if (gridButton.isSelected()) {
gridFrame.setVisible(true);
}
}
}//GEN-LAST:event_selectButtonActionPerformed
private void rereadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rereadButtonActionPerformed
......@@ -313,14 +283,12 @@ public class GUI extends javax.swing.JPanel
private javax.swing.JLabel fieldDescription;
private javax.swing.JRadioButton fileButton;
private javax.swing.JTextField fileNameField;
private javax.swing.JRadioButton gridButton;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JCheckBox materialAsSetsCheckBox;
private javax.swing.JLabel moduleLabel;
private javax.swing.JButton rereadButton;
private javax.swing.JButton selectButton;
private javax.swing.JRadioButton urlButton;
// End of variables declaration//GEN-END:variables
/**
* @param params the params to set
......
......@@ -128,19 +128,6 @@
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JRadioButton" name="gridButton">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buttonGroup1"/>
</Property>
<Property name="text" type="java.lang.String" value="grid"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="materialAsSetsCheckBox">
<Properties>
<Property name="text" type="java.lang.String" value="materials as cell sets"/>
......
......@@ -46,7 +46,6 @@ import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.gui.swingwrappers.TextField;
import static pl.edu.icm.visnow.lib.basic.readers.ReadUCD.ReadUCDShared.*;
import pl.edu.icm.visnow.lib.gui.Browser;
import pl.edu.icm.visnow.lib.gui.grid.GridFrame;
import pl.edu.icm.visnow.lib.utils.io.InputSource;
import pl.edu.icm.visnow.system.main.VisNow;
......@@ -58,7 +57,6 @@ public class GUI extends javax.swing.JPanel
{
private JFileChooser dataFileChooser = new JFileChooser();
private GridFrame gridFrame = new GridFrame();
private FileNameExtensionFilter dataFilter;
private Parameters parameters;
private String lastPath = null;
......@@ -83,18 +81,6 @@ public class GUI extends javax.swing.JPanel
parameters.set(INPUT_SOURCE, InputSource.URL, FILENAME, browser.getCurrentURL(), MATERIAL_AS_SETS, materialAsSetsCheckBox.isSelected());
}
});
gridFrame.setVisible(false);
gridFrame.setFileExtensions(dataFilter.getExtensions());
gridFrame.setSingleFile(true);
gridFrame.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
{
parameters.set(INPUT_SOURCE, InputSource.GRID, FILENAME, VisNow.getTmpDirPath() + File.separator + gridFrame.getTransferredFileNames()[0], MATERIAL_AS_SETS, materialAsSetsCheckBox.isSelected());
}
});
}
/**
......@@ -114,7 +100,6 @@ public class GUI extends javax.swing.JPanel
fieldDescription = new javax.swing.JLabel();
fileButton = new javax.swing.JRadioButton();
urlButton = new javax.swing.JRadioButton();
gridButton = new javax.swing.JRadioButton();
materialAsSetsCheckBox = new javax.swing.JCheckBox();
indicesBox = new javax.swing.JCheckBox();
fileNameField = new pl.edu.icm.visnow.gui.swingwrappers.TextField();
......@@ -193,16 +178,6 @@ public class GUI extends javax.swing.JPanel
gridBagConstraints.weightx = 1.0;
add(urlButton, gridBagConstraints);
buttonGroup1.add(gridButton);
gridButton.setText("grid");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
add(gridButton, gridBagConstraints);
materialAsSetsCheckBox.setText("materials as cell sets");
materialAsSetsCheckBox.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
......@@ -229,12 +204,12 @@ public class GUI extends javax.swing.JPanel
fileNameField.addUserActionListener(new pl.edu.icm.visnow.gui.swingwrappers.UserActionListener()
{
public void userAction(pl.edu.icm.visnow.gui.swingwrappers.UserEvent evt)
public void userChangeAction(pl.edu.icm.visnow.gui.swingwrappers.UserEvent evt)
{
fileNameFieldUserAction(evt);
}
public void userChangeAction(pl.edu.icm.visnow.gui.swingwrappers.UserEvent evt)
public void userAction(pl.edu.icm.visnow.gui.swingwrappers.UserEvent evt)
{
fileNameFieldUserAction(evt);
}
});
fileNameField.addFocusListener(new java.awt.event.FocusAdapter()
......@@ -304,8 +279,6 @@ public class GUI extends javax.swing.JPanel
}
} else if (urlButton.isSelected()) {
browser.setVisible(true);
} else if (gridButton.isSelected()) {
gridFrame.setVisible(true);
}
}//GEN-LAST:event_selectButtonActionPerformed
......@@ -350,7 +323,6 @@ public class GUI extends javax.swing.JPanel
private javax.swing.JLabel fieldDescription;
private javax.swing.JRadioButton fileButton;
private pl.edu.icm.visnow.gui.swingwrappers.TextField fileNameField;
private javax.swing.JRadioButton gridButton;
private javax.swing.JCheckBox indicesBox;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JCheckBox materialAsSetsCheckBox;
......@@ -384,6 +356,5 @@ public class GUI extends javax.swing.JPanel
fileButton.setSelected(input_type == 0);
urlButton.setSelected(input_type == 1);
gridButton.setSelected(input_type == 2);
}
}
......@@ -38,7 +38,6 @@ package pl.edu.icm.visnow.lib.basic.readers.ReadVTK;
import java.io.File;
import java.nio.ByteOrder;
import java.util.logging.Logger;
import pl.edu.icm.jscic.IrregularField;
import pl.edu.icm.jscic.RegularField;
import pl.edu.icm.visnow.engine.core.OutputEgg;
......@@ -47,8 +46,6 @@ import pl.edu.icm.visnow.engine.core.ParameterChangeListener;
import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.engine.core.ProgressAgent;
import static pl.edu.icm.visnow.lib.basic.readers.ReadVTK.ReadVTKShared.*;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPException;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPLocalUtils;
import pl.edu.icm.visnow.lib.templates.visualization.modules.OutFieldVisualizationModule;
import pl.edu.icm.visnow.lib.types.VNIrregularField;
import pl.edu.icm.visnow.lib.types.VNRegularField;
......@@ -63,6 +60,7 @@ import pl.edu.icm.visnow.system.utils.usermessage.Level;
*/
public class ReadVTK extends OutFieldVisualizationModule
{
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(ReadVTK.class);
private GUI computeUI = null;
......@@ -128,43 +126,34 @@ public class ReadVTK extends OutFieldVisualizationModule
setOutputValue("outRegularField", null);
setOutputValue("outIrregularField", null);
} else {
ProgressAgent progressAgent = getProgressAgent(140); //20 for download from gsiftp, 100 for read, 20 for geometry
ProgressAgent progressAgent = getProgressAgent(120); //100 for read, 20 for geometry
File f;
try {
f = GridFTPLocalUtils.getFileOrLocalGSIFTPCopy(p.get(FILENAME), progressAgent.getSubAgent(20));
outField = core.readVTK(f, p.get(BIG_ENDIAN) == true ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN);
if (outField == null) {
VisNow.get().userMessageSend(this, "Error loading file.", "Cannot read file " + p.get(FILENAME), Level.ERROR);
}
if (outField != null && outField instanceof RegularField) {
outRegularField = (RegularField) outField;
outIrregularField = null;
setOutputValue("outRegularField", new VNRegularField(outRegularField));
setOutputValue("outIrregularField", null);
VisNow.get().userMessageSend(this, "<html>File successfully loaded", outRegularField.toMultilineString(), Level.INFO);
} else if (outField != null && outField instanceof IrregularField) {
outRegularField = null;
outIrregularField = (IrregularField) outField;
setOutputValue("outRegularField", null);
setOutputValue("outIrregularField", new VNIrregularField(outIrregularField));
VisNow.get().userMessageSend(this, "<html>File successfully loaded.", outIrregularField.toMultilineString(), Level.INFO);
} else {
outRegularField = null;
outIrregularField = null;
setOutputValue("outRegularField", null);
setOutputValue("outIrregularField", null);
}
} catch (GridFTPException ex) {
f = new File(p.get(FILENAME));
outField = core.readVTK(f, p.get(BIG_ENDIAN) == true ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN);
if (outField == null) {
VisNow.get().userMessageSend(this, "Error loading file.", "Cannot read file " + p.get(FILENAME), Level.ERROR);
}
if (outField != null && outField instanceof RegularField) {
outRegularField = (RegularField) outField;
outIrregularField = null;
setOutputValue("outRegularField", new VNRegularField(outRegularField));
setOutputValue("outIrregularField", null);
VisNow.get().userMessageSend(this, "<html>File successfully loaded", outRegularField.toMultilineString(), Level.INFO);
} else if (outField != null && outField instanceof IrregularField) {
outRegularField = null;
outIrregularField = (IrregularField) outField;
setOutputValue("outRegularField", null);
setOutputValue("outIrregularField", new VNIrregularField(outIrregularField));
VisNow.get().userMessageSend(this, "<html>File successfully loaded.", outIrregularField.toMultilineString(), Level.INFO);
} else {
outRegularField = null;
outIrregularField = null;
setOutputValue("outRegularField", null);
setOutputValue("outIrregularField", null);
VisNow.get().userMessageSend(this, "Error loading file " + p.get(FILENAME), "See log for details", Level.ERROR);
LOGGER.error("Error while loading file " + p.get(FILENAME), ex);
}
progressAgent.setProgressStep(120);
progressAgent.setProgressStep(100);
prepareOutputGeometry();
show();
}
......
......@@ -64,8 +64,6 @@ import pl.edu.icm.visnow.engine.core.ParameterChangeListener;
import pl.edu.icm.visnow.engine.core.Parameters;
import pl.edu.icm.visnow.engine.core.ProgressAgent;
import static pl.edu.icm.visnow.lib.basic.readers.material_science.ReadVASP.ReadVASPShared.*;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPException;
import pl.edu.icm.visnow.lib.grid.gridftp.GridFTPLocalUtils;
import pl.edu.icm.visnow.lib.templates.visualization.modules.OutFieldVisualizationModule;
import pl.edu.icm.visnow.lib.types.VNIrregularField;
import pl.edu.icm.visnow.lib.types.VNRegularField;
......@@ -80,6 +78,7 @@ import pl.edu.icm.visnow.system.utils.usermessage.Level;
*/
public class ReadVASP extends OutFieldVisualizationModule
{
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(ReadVASP.class);
protected GUI computeUI = null;
protected boolean fromGUI = false;
......@@ -104,7 +103,7 @@ public class ReadVASP extends OutFieldVisualizationModule
startAction();
}
});
SwingInstancer.swingRunAndWait(new Runnable()
{
@Override
......@@ -117,7 +116,7 @@ public class ReadVASP extends OutFieldVisualizationModule
}
});
}
@Override
protected Parameter[] createDefaultParameters()
{
......@@ -206,7 +205,7 @@ public class ReadVASP extends OutFieldVisualizationModule
for (int i = 0, k = 0; i < nAtomsOfType.length; i++)
for (int j = 0; j < nAtomsOfType[i]; j++, k++)
typesInCell[k] = AtomGeometryTemplates.getTemplateIndex(atomNames[i]);
FloatLargeArray coords = new FloatLargeArray(3 * (long)gMult * nAtoms, false);
FloatLargeArray coords = new FloatLargeArray(3 * (long) gMult * nAtoms, false);
int[] types = new int[gMult * nAtoms];
VisualAtomTemplate[] atoms = new VisualAtomTemplate[gMult * nAtoms];
for (int i = 0, n = 0, na = 0; i < mult[2]; i++)
......@@ -328,7 +327,7 @@ public class ReadVASP extends OutFieldVisualizationModule
}
return null;
}
@Override
protected void notifySwingGUIs(final pl.edu.icm.visnow.engine.core.ParameterProxy clonedParameterProxy, boolean resetFully, boolean setRunButtonPending)
{
......@@ -340,21 +339,17 @@ public class ReadVASP extends OutFieldVisualizationModule
{
Parameters p = parameters.getReadOnlyClone();
notifyGUIs(p, isFromVNA(), false);
if (p.get(FILENAME) == null || p.get(FILENAME).isEmpty())
return;
ProgressAgent progressAgent = getProgressAgent(140); //20 for download from gsiftp, 100 for read, 20 for geometry
String userFileName = p.get(FILENAME);
try {
if (!GridFTPLocalUtils.isGSIUri(userFileName));
{
File potCarFile = new File(new File(userFileName).getParentFile().getCanonicalPath() + File.separator + "POTCAR");
if (potCarFile.canRead())
templates = getAtoms(potCarFile);
}
File densityFile = GridFTPLocalUtils.getFileOrLocalGSIFTPCopy(userFileName, progressAgent.getSubAgent(20));
File potCarFile = new File(new File(userFileName).getParentFile().getCanonicalPath() + File.separator + "POTCAR");
if (potCarFile.canRead())
templates = getAtoms(potCarFile);
File densityFile = new File(userFileName);
readVASP(densityFile.getAbsolutePath(), p);
} catch (GridFTPException | IOException ex) {
} catch (IOException ex) {
LOGGER.error("Error while reading file " + userFileName, ex);
VisNow.get().userMessageSend(this, "Error reading file: " + userFileName, "See log for details", Level.ERROR);
}
......
/* VisNow
Copyright (C) 2006-2013 University of Warsaw, ICM
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
University of Warsaw, Interdisciplinary Centre for Mathematical and
Computational Modelling, Pawinskiego 5a, 02-106 Warsaw, Poland.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package pl.edu.icm.visnow.lib.grid;
/**
*
* @author szpak
*/
public class GridException extends Exception
{
public GridException(String message)
{
super(message);
}
public GridException(Throwable cause)
{
super(cause);
}
}
This diff is collapsed.
/* VisNow
Copyright (C) 2006-2013 University of Warsaw, ICM
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
University of Warsaw, Interdisciplinary Centre for Mathematical and
Computational Modelling, Pawinskiego 5a, 02-106 Warsaw, Poland.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package pl.edu.icm.visnow.lib.grid;
import eu.unicore.hila.exceptions.HiLAException;
import eu.unicore.hila.grid.Task;
import eu.unicore.hila.grid.TaskStatus;
import java.io.File;
import org.apache.log4j.Logger;
/**
* @author szpak
*/