Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • software-control-system/tango-controls-archiving/bensikinarchivinggui
1 result
Select Git revision
Loading items
Show changes
Commits on Source (2)
...@@ -47,7 +47,7 @@ import fr.soleil.bensikin.actions.BensikinAction; ...@@ -47,7 +47,7 @@ import fr.soleil.bensikin.actions.BensikinAction;
import fr.soleil.bensikin.containers.context.ContextDetailPrintPanel; import fr.soleil.bensikin.containers.context.ContextDetailPrintPanel;
import fr.soleil.bensikin.options.Options; import fr.soleil.bensikin.options.Options;
import fr.soleil.bensikin.options.sub.PrintOptions; import fr.soleil.bensikin.options.sub.PrintOptions;
import fr.soleil.lib.project.awt.print.ComponentPrinter; import fr.soleil.lib.project.swing.print.ComponentPrinter;
/** /**
* An action that prints the current snapshot comparison's table to a printer. * An action that prints the current snapshot comparison's table to a printer.
......
...@@ -51,7 +51,7 @@ import fr.soleil.bensikin.components.snapshot.detail.SnapshotCompareTable; ...@@ -51,7 +51,7 @@ import fr.soleil.bensikin.components.snapshot.detail.SnapshotCompareTable;
import fr.soleil.bensikin.models.SnapshotCompareTablePrintModel; import fr.soleil.bensikin.models.SnapshotCompareTablePrintModel;
import fr.soleil.bensikin.options.Options; import fr.soleil.bensikin.options.Options;
import fr.soleil.bensikin.options.sub.PrintOptions; import fr.soleil.bensikin.options.sub.PrintOptions;
import fr.soleil.lib.project.awt.print.ComponentPrinter; import fr.soleil.lib.project.swing.print.ComponentPrinter;
/** /**
* An action that prints the current snapshot comparison's table to a printer. * An action that prints the current snapshot comparison's table to a printer.
......
...@@ -44,7 +44,7 @@ import fr.soleil.bensikin.actions.BensikinAction; ...@@ -44,7 +44,7 @@ import fr.soleil.bensikin.actions.BensikinAction;
import fr.soleil.bensikin.containers.snapshot.SnapshotDetailPrintPanel; import fr.soleil.bensikin.containers.snapshot.SnapshotDetailPrintPanel;
import fr.soleil.bensikin.options.Options; import fr.soleil.bensikin.options.Options;
import fr.soleil.bensikin.options.sub.PrintOptions; import fr.soleil.bensikin.options.sub.PrintOptions;
import fr.soleil.lib.project.awt.print.ComponentPrinter; import fr.soleil.lib.project.swing.print.ComponentPrinter;
/** /**
* An action that prints the current snapshot comparison's table to a printer. * An action that prints the current snapshot comparison's table to a printer.
......
...@@ -73,6 +73,7 @@ import fr.soleil.archiving.snap.api.tools.SnapAttributeExtract; ...@@ -73,6 +73,7 @@ import fr.soleil.archiving.snap.api.tools.SnapAttributeExtract;
import fr.soleil.bensikin.options.Options; import fr.soleil.bensikin.options.Options;
import fr.soleil.bensikin.options.sub.SnapshotOptions; import fr.soleil.bensikin.options.sub.SnapshotOptions;
import fr.soleil.bensikin.xml.BensikinXMLLine; import fr.soleil.bensikin.xml.BensikinXMLLine;
import fr.soleil.lib.project.ObjectUtils;
/** /**
* Represents an attribute attached to a snapshot. A SnapshotAttribute belongs * Represents an attribute attached to a snapshot. A SnapshotAttribute belongs
...@@ -161,7 +162,7 @@ public class SnapshotAttribute { ...@@ -161,7 +162,7 @@ public class SnapshotAttribute {
dataType = _dataType; dataType = _dataType;
dataFormat = _format; dataFormat = _format;
permit = _writable; permit = _writable;
displayFormat = ""; displayFormat = ObjectUtils.EMPTY_STRING;
SnapshotAttributeReadValue _readValue = null; SnapshotAttributeReadValue _readValue = null;
SnapshotAttributeWriteValue _writeValue = null; SnapshotAttributeWriteValue _writeValue = null;
...@@ -260,13 +261,16 @@ public class SnapshotAttribute { ...@@ -260,13 +261,16 @@ public class SnapshotAttribute {
final String[] readst = (String[]) getValue(val, 0); final String[] readst = (String[]) getValue(val, 0);
_readValue = new SnapshotAttributeReadValue(_format, _dataType, readst, nullRead); _readValue = new SnapshotAttributeReadValue(_format, _dataType, readst, nullRead);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_readValue = new SnapshotAttributeReadValue(_format, _dataType, new String[0], null); _readValue = new SnapshotAttributeReadValue(_format, _dataType, new String[0],
null);
} }
try { try {
final String[] writest = (String[]) getValue(val, 1); final String[] writest = (String[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writest, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writest,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new String[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new String[0],
null);
} }
break; break;
case TangoConst.Tango_DEV_BOOLEAN: case TangoConst.Tango_DEV_BOOLEAN:
...@@ -274,13 +278,16 @@ public class SnapshotAttribute { ...@@ -274,13 +278,16 @@ public class SnapshotAttribute {
final boolean[] readb = (boolean[]) getValue(val, 0); final boolean[] readb = (boolean[]) getValue(val, 0);
_readValue = new SnapshotAttributeReadValue(_format, _dataType, readb, nullRead); _readValue = new SnapshotAttributeReadValue(_format, _dataType, readb, nullRead);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_readValue = new SnapshotAttributeReadValue(_format, _dataType, new boolean[0], null); _readValue = new SnapshotAttributeReadValue(_format, _dataType, new boolean[0],
null);
} }
try { try {
final boolean[] writeb = (boolean[]) getValue(val, 1); final boolean[] writeb = (boolean[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writeb, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writeb,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new boolean[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new boolean[0],
null);
} }
break; break;
case TangoConst.Tango_DEV_CHAR: case TangoConst.Tango_DEV_CHAR:
...@@ -293,9 +300,11 @@ public class SnapshotAttribute { ...@@ -293,9 +300,11 @@ public class SnapshotAttribute {
} }
try { try {
final byte[] writec = (byte[]) getValue(val, 1); final byte[] writec = (byte[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writec, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writec,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new byte[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new byte[0],
null);
} }
break; break;
case TangoConst.Tango_DEV_LONG: case TangoConst.Tango_DEV_LONG:
...@@ -308,7 +317,8 @@ public class SnapshotAttribute { ...@@ -308,7 +317,8 @@ public class SnapshotAttribute {
} }
try { try {
final int[] writel = (int[]) getValue(val, 1); final int[] writel = (int[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writel, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writel,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new int[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new int[0], null);
} }
...@@ -323,9 +333,11 @@ public class SnapshotAttribute { ...@@ -323,9 +333,11 @@ public class SnapshotAttribute {
} }
try { try {
final short[] writes = (short[]) getValue(val, 1); final short[] writes = (short[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writes, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writes,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new short[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new short[0],
null);
} }
break; break;
case TangoConst.Tango_DEV_FLOAT: case TangoConst.Tango_DEV_FLOAT:
...@@ -337,9 +349,11 @@ public class SnapshotAttribute { ...@@ -337,9 +349,11 @@ public class SnapshotAttribute {
} }
try { try {
final float[] writef = (float[]) getValue(val, 1); final float[] writef = (float[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writef, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writef,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new float[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new float[0],
null);
} }
break; break;
case TangoConst.Tango_DEV_DOUBLE: case TangoConst.Tango_DEV_DOUBLE:
...@@ -347,13 +361,16 @@ public class SnapshotAttribute { ...@@ -347,13 +361,16 @@ public class SnapshotAttribute {
final double[] readd = (double[]) getValue(val, 0); final double[] readd = (double[]) getValue(val, 0);
_readValue = new SnapshotAttributeReadValue(_format, _dataType, readd, nullRead); _readValue = new SnapshotAttributeReadValue(_format, _dataType, readd, nullRead);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_readValue = new SnapshotAttributeReadValue(_format, _dataType, new double[0], null); _readValue = new SnapshotAttributeReadValue(_format, _dataType, new double[0],
null);
} }
try { try {
final double[] writed = (double[]) getValue(val, 1); final double[] writed = (double[]) getValue(val, 1);
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writed, nullWrite); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, writed,
nullWrite);
} catch (final ClassCastException cce) { } catch (final ClassCastException cce) {
_writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new double[0], null); _writeValue = new SnapshotAttributeWriteValue(_format, _dataType, new double[0],
null);
} }
break; break;
default: // nothing to do default: // nothing to do
...@@ -406,7 +423,8 @@ public class SnapshotAttribute { ...@@ -406,7 +423,8 @@ public class SnapshotAttribute {
if (_readValue != null) { if (_readValue != null) {
readValue = _readValue; readValue = _readValue;
} else { } else {
readValue = new SnapshotAttributeReadValue(SnapshotAttributeValue.NOT_APPLICABLE_DATA_FORMAT, 0, null, null); readValue = new SnapshotAttributeReadValue(SnapshotAttributeValue.NOT_APPLICABLE_DATA_FORMAT, 0, null,
null);
} }
if (_writeValue != null) { if (_writeValue != null) {
...@@ -442,16 +460,16 @@ public class SnapshotAttribute { ...@@ -442,16 +460,16 @@ public class SnapshotAttribute {
public SnapshotAttribute(final String name, final SnapshotAttributes attrs) { public SnapshotAttribute(final String name, final SnapshotAttributes attrs) {
setAttributeCompleteName(name); setAttributeCompleteName(name);
snapshotAttributes = attrs; snapshotAttributes = attrs;
displayFormat = ""; displayFormat = ObjectUtils.EMPTY_STRING;
updateDisplayFormat(); updateDisplayFormat();
} }
/** /**
* Sets the displa format, reading it from Tango. Uses a Thread to avoid * Sets the display format, reading it from Tango. Uses a Thread to avoid
* freezing * freezing
*/ */
public void updateDisplayFormat() { public void updateDisplayFormat() {
new Thread() { new Thread("SnapshotAttribute.updateDisplayFormat()") {
@Override @Override
public void run() { public void run() {
try { try {
...@@ -459,7 +477,7 @@ public class SnapshotAttribute { ...@@ -459,7 +477,7 @@ public class SnapshotAttribute {
proxy = new AttributeProxy(attributeCompleteName); proxy = new AttributeProxy(attributeCompleteName);
displayFormat = proxy.get_info().format; displayFormat = proxy.get_info().format;
} catch (final Exception e) { } catch (final Exception e) {
displayFormat = ""; displayFormat = ObjectUtils.EMPTY_STRING;
} finally { } finally {
if (readValue != null) { if (readValue != null) {
readValue.setDisplayFormat(displayFormat); readValue.setDisplayFormat(displayFormat);
...@@ -481,7 +499,7 @@ public class SnapshotAttribute { ...@@ -481,7 +499,7 @@ public class SnapshotAttribute {
* *
* @return The result conversion * @return The result conversion
*/ */
SnapAttributeExtract toSnapAttributeExtrac() { public SnapAttributeExtract toSnapAttributeExtrac() {
final AttributeLight snapAttributeLight = new AttributeLight(); final AttributeLight snapAttributeLight = new AttributeLight();
snapAttributeLight.setAttributeCompleteName(attributeCompleteName); snapAttributeLight.setAttributeCompleteName(attributeCompleteName);
...@@ -619,10 +637,12 @@ public class SnapshotAttribute { ...@@ -619,10 +637,12 @@ public class SnapshotAttribute {
*/ */
@Override @Override
public String toString() { public String toString() {
String ret = ""; String ret = ObjectUtils.EMPTY_STRING;
final BensikinXMLLine openingLine = new BensikinXMLLine(SnapshotAttribute.XML_TAG, BensikinXMLLine.OPENING_TAG_CATEGORY); final BensikinXMLLine openingLine = new BensikinXMLLine(SnapshotAttribute.XML_TAG,
final BensikinXMLLine closingLine = new BensikinXMLLine(SnapshotAttribute.XML_TAG, BensikinXMLLine.CLOSING_TAG_CATEGORY); BensikinXMLLine.OPENING_TAG_CATEGORY);
final BensikinXMLLine closingLine = new BensikinXMLLine(SnapshotAttribute.XML_TAG,
BensikinXMLLine.CLOSING_TAG_CATEGORY);
openingLine.setAttribute(SnapshotAttribute.ID_PROPERTY_XML_TAG, String.valueOf(attributeId)); openingLine.setAttribute(SnapshotAttribute.ID_PROPERTY_XML_TAG, String.valueOf(attributeId));
openingLine.setAttribute(SnapshotAttribute.DATA_TYPE_PROPERTY_XML_TAG, String.valueOf(dataType)); openingLine.setAttribute(SnapshotAttribute.DATA_TYPE_PROPERTY_XML_TAG, String.valueOf(dataType));
...@@ -921,7 +941,8 @@ public class SnapshotAttribute { ...@@ -921,7 +941,8 @@ public class SnapshotAttribute {
} }
} }
final SnapshotAttributeWriteAbsValue snapshotWriteAbsValue = new SnapshotAttributeWriteAbsValue( final SnapshotAttributeWriteAbsValue snapshotWriteAbsValue = new SnapshotAttributeWriteAbsValue(
writeValue.getDataFormat(), writeValue.getDataType(), writeAbsScalarValue, writeValue.getNullElements()); writeValue.getDataFormat(), writeValue.getDataType(), writeAbsScalarValue,
writeValue.getNullElements());
return snapshotWriteAbsValue; return snapshotWriteAbsValue;
} }
...@@ -964,7 +985,7 @@ public class SnapshotAttribute { ...@@ -964,7 +985,7 @@ public class SnapshotAttribute {
* @return * @return
*/ */
public String toUserFriendlyString() { public String toUserFriendlyString() {
String ret = ""; String ret = ObjectUtils.EMPTY_STRING;
final Options options = Options.getInstance(); final Options options = Options.getInstance();
final SnapshotOptions snapshotOptions = options.getSnapshotOptions(); final SnapshotOptions snapshotOptions = options.getSnapshotOptions();
final String separator = snapshotOptions.getCSVSeparator(); final String separator = snapshotOptions.getCSVSeparator();
......
...@@ -47,6 +47,7 @@ import java.util.Map; ...@@ -47,6 +47,7 @@ import java.util.Map;
import fr.soleil.archiving.gui.tools.GUIUtilities; import fr.soleil.archiving.gui.tools.GUIUtilities;
import fr.soleil.archiving.snap.api.tools.SnapAttributeExtract; import fr.soleil.archiving.snap.api.tools.SnapAttributeExtract;
import fr.soleil.lib.project.ObjectUtils;
/** /**
* A group of snapshot attributes, rattached to a snapshot. * A group of snapshot attributes, rattached to a snapshot.
...@@ -162,7 +163,7 @@ public class SnapshotAttributes { ...@@ -162,7 +163,7 @@ public class SnapshotAttributes {
* *
* @return An ArrayList of SnapAttributeExtract objects. * @return An ArrayList of SnapAttributeExtract objects.
*/ */
ArrayList<SnapAttributeExtract> toArrayList() { public ArrayList<SnapAttributeExtract> toArrayList() {
if (snapshotAttributes == null) { if (snapshotAttributes == null) {
// System.out.println("snapshotAttributes null !!!!"); // System.out.println("snapshotAttributes null !!!!");
return null; return null;
...@@ -204,7 +205,7 @@ public class SnapshotAttributes { ...@@ -204,7 +205,7 @@ public class SnapshotAttributes {
*/ */
@Override @Override
public String toString() { public String toString() {
String ret = ""; String ret = ObjectUtils.EMPTY_STRING;
if (this.snapshotAttributes != null) { if (this.snapshotAttributes != null) {
for (int i = 0; i < this.snapshotAttributes.length; i++) { for (int i = 0; i < this.snapshotAttributes.length; i++) {
...@@ -307,7 +308,7 @@ public class SnapshotAttributes { ...@@ -307,7 +308,7 @@ public class SnapshotAttributes {
* @return * @return
*/ */
public String toUserFriendlyString() { public String toUserFriendlyString() {
String ret = ""; String ret = ObjectUtils.EMPTY_STRING;
if (this.snapshotAttributes != null) { if (this.snapshotAttributes != null) {
for (int i = 0; i < this.snapshotAttributes.length; i++) { for (int i = 0; i < this.snapshotAttributes.length; i++) {
......
...@@ -38,7 +38,7 @@ import fr.soleil.archiving.common.api.exception.ArchivingException; ...@@ -38,7 +38,7 @@ import fr.soleil.archiving.common.api.exception.ArchivingException;
import fr.soleil.bensikin.containers.sub.dialogs.options.OptionsPrintTab; import fr.soleil.bensikin.containers.sub.dialogs.options.OptionsPrintTab;
import fr.soleil.bensikin.options.PushPullOptionBook; import fr.soleil.bensikin.options.PushPullOptionBook;
import fr.soleil.bensikin.options.ReadWriteOptionBook; import fr.soleil.bensikin.options.ReadWriteOptionBook;
import fr.soleil.lib.project.awt.print.ComponentPrinter; import fr.soleil.lib.project.swing.print.ComponentPrinter;
/** /**
* The print options of the application. * The print options of the application.
......