File size: 3,962 Bytes
233f6d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | Clazz.declarePackage ("JSV.source");
Clazz.load (["JU.Lst"], "JSV.source.JDXHeader", null, function () {
c$ = Clazz.decorateAsClass (function () {
this.title = "";
this.jcampdx = "5.01";
this.dataType = "";
this.dataClass = "";
this.origin = "";
this.owner = "PUBLIC DOMAIN";
this.longDate = "";
this.date = "";
this.time = "";
this.qualifiedType = null;
this.headerTable = null;
Clazz.instantialize (this, arguments);
}, JSV.source, "JDXHeader");
Clazz.prepareFields (c$, function () {
this.headerTable = new JU.Lst ();
});
Clazz.defineMethod (c$, "setTitle",
function (title) {
this.title = title;
}, "~S");
Clazz.defineMethod (c$, "setJcampdx",
function (versionNum) {
this.jcampdx = versionNum;
}, "~S");
Clazz.defineMethod (c$, "setDataType",
function (dataType) {
this.dataType = dataType;
}, "~S");
Clazz.defineMethod (c$, "setDataClass",
function (dataClass) {
this.dataClass = dataClass;
}, "~S");
Clazz.defineMethod (c$, "setOrigin",
function (origin) {
this.origin = origin;
}, "~S");
Clazz.defineMethod (c$, "setOwner",
function (owner) {
this.owner = owner;
}, "~S");
Clazz.defineMethod (c$, "setLongDate",
function (longDate) {
this.longDate = longDate;
}, "~S");
Clazz.defineMethod (c$, "setDate",
function (date) {
this.date = date;
}, "~S");
Clazz.defineMethod (c$, "setTime",
function (time) {
this.time = time;
}, "~S");
Clazz.defineMethod (c$, "getTitle",
function () {
return this.title;
});
c$.getTypeName = Clazz.defineMethod (c$, "getTypeName",
function (type) {
type = type.toUpperCase ();
for (var i = 0; i < JSV.source.JDXHeader.typeNames.length; i++) if (JSV.source.JDXHeader.typeNames[i].startsWith (type)) {
return JSV.source.JDXHeader.typeNames[i].substring (18);
}
return type;
}, "~S");
Clazz.defineMethod (c$, "getQualifiedDataType",
function () {
return (this.qualifiedType == null ? (this.qualifiedType = JSV.source.JDXHeader.getTypeName (this.dataType)) : this.qualifiedType);
});
Clazz.defineMethod (c$, "getJcampdx",
function () {
return this.jcampdx;
});
Clazz.defineMethod (c$, "getDataType",
function () {
return this.dataType;
});
Clazz.defineMethod (c$, "getOrigin",
function () {
return this.origin;
});
Clazz.defineMethod (c$, "getOwner",
function () {
return this.owner;
});
Clazz.defineMethod (c$, "getLongDate",
function () {
return this.longDate;
});
Clazz.defineMethod (c$, "getDate",
function () {
return this.date;
});
Clazz.defineMethod (c$, "getTime",
function () {
return this.time;
});
Clazz.defineMethod (c$, "getDataClass",
function () {
return this.dataClass;
});
Clazz.defineMethod (c$, "setHeaderTable",
function (table) {
this.headerTable = table;
}, "JU.Lst");
Clazz.defineMethod (c$, "getHeaderTable",
function () {
return this.headerTable;
});
Clazz.defineMethod (c$, "getHeaderRowDataAsArray",
function (addDataClass, nMore) {
var rowData = new Array ((addDataClass ? 6 : 5) + this.headerTable.size () + nMore);
var i = 0;
rowData[i++] = Clazz.newArray (-1, ["##TITLE", this.title]);
rowData[i++] = Clazz.newArray (-1, ["##JCAMP-DX", this.jcampdx]);
rowData[i++] = Clazz.newArray (-1, ["##DATA TYPE", this.dataType]);
if (addDataClass) rowData[i++] = Clazz.newArray (-1, ["##DATA CLASS", this.dataClass]);
rowData[i++] = Clazz.newArray (-1, ["##ORIGIN", this.origin]);
rowData[i++] = Clazz.newArray (-1, ["##OWNER", this.owner]);
for (var j = 0; j < this.headerTable.size (); j++) rowData[i++] = this.getRow (j);
return rowData;
}, "~B,~N");
Clazz.defineMethod (c$, "getRow",
function (j) {
var s = this.headerTable.get (j);
{
return [s[0], JU.PT.rep(s[1], "<", "<")];
}}, "~N");
Clazz.defineStatics (c$,
"typeNames", Clazz.newArray (-1, ["ND NMR SPECTRUM NMR", "NMR SPECTRUM NMR", "INFRARED SPECTRUM IR", "MASS SPECTRUM MS", "RAMAN SPECTRUM RAMAN", "GAS CHROMATOGRAM GC", "UV/VIS SPECTRUM UV/VIS"]));
});
|