10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-23 19:27:42 +02:00

fix bugs and improvement

This commit is contained in:
Mickaël Véril 2019-12-17 09:59:57 +01:00
parent 5d3719332a
commit b54f7a21ca

View File

@ -136,11 +136,11 @@ class excitationBase {
} }
} }
class excitationValue extends excitationBase { class excitationValue extends excitationBase {
constructor(initial, final, type, value,oscilatorForces=null,T1=null) { constructor(initial, final, type, value,oscilatorForces=null,T1=null,isUnsafe=false) {
super(initial, final, type, T1) super(initial, final, type, T1)
this.value = value this.value = value
this.oscilatorForces = oscilatorForces this.oscilatorForces = oscilatorForces
this.isUnsafe = false this.isUnsafe = isUnsafe
} }
} }
@ -231,17 +231,13 @@ class dataFileBase {
} }
} }
function readrow(line) { function readrow(line) {
var vals = line.match(/([^\)]+)|\S+/g); var vals = line.match(/\([^\)]+\)|\S+/g)
while (vals.length < 8) {
vals.push(null);
}
var start = new state(parseInt(vals[0], 10), parseInt(vals[1], 10), vals[2]); var start = new state(parseInt(vals[0], 10), parseInt(vals[1], 10), vals[2]);
var end = new state(parseInt(vals[3], 10), parseInt(vals[4],10), vals[5]); var end = new state(parseInt(vals[3], 10), parseInt(vals[4],10), vals[5]);
var hasType=vals.length>=7 && isNaN(vals[6]) var hasType=vals.length>=7 && isNaN(vals[6])
var type=((vals.length>=7 && hasType) ? vals[6] : null) var type=((vals.length>=7 && hasType) ? vals[6] : null)
if(type) { if(type) {
const m=type.match(/^{([^\\}]*)}$/) const m=type.match(/^{([^\}]*)}$/)
if (m) { if (m) {
type=m[1] type=m[1]
} }
@ -250,7 +246,7 @@ class dataFileBase {
var oscilatorForces=((vals.length>=9+hasType) ? parseFloat(vals[8+hasType],10): NaN) var oscilatorForces=((vals.length>=9+hasType) ? parseFloat(vals[8+hasType],10): NaN)
var T1=((vals.length>=10+hasType) ? parseFloat(vals[9+hasType],10): NaN) var T1=((vals.length>=10+hasType) ? parseFloat(vals[9+hasType],10): NaN)
var isUnsafe=((vals.length>=11+hasType) ? parseFloat(vals[10+hasType],10): false) var isUnsafe=((vals.length>=11+hasType) ? parseFloat(vals[10+hasType],10): false)
var ex = new excitationValue(start, end, type, val,cor,oscilatorForces,T1,isUnsafe); var ex = new excitationValue(start, end, type, val,oscilatorForces,T1,isUnsafe);
dat.excitations.push(ex); dat.excitations.push(ex);
}; };