10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-10-02 06:20:58 +02:00

Fixes in the loading process (#14)

* Fix broken link

* Fix bug in indexDB

* Fix sourceFile  for each geometry

* Use valueOf in ex.type

* Fix VertExcitationKind for custom files

* Fix excitationType bug when value is set to Single by default

* Remove the unnecessary valuOf()

* Copy type of excitation from the reference for custom files

* Remove sets dependency for %T1 to allow cross set %T1 reference data

Co-authored-by: Mickaël Véril <mveril@irsamc.ups-tlse.fr>
This commit is contained in:
mveril 2020-12-11 10:44:35 +01:00 committed by GitHub
parent bebcfdd959
commit 78fc5dd673
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 10 deletions

View File

@ -192,16 +192,28 @@ draft: false
}
async function reloadCustomFiles() {
processingIndicator.isActive = true
window.dats = window.defaultDats;
window.customDats = []
window.dats = window.defaultDats
const kinds = new Map([["file_abs", VertExcitationKinds.Absorbtion], ["file_fluo", VertExcitationKinds.Fluorescence]])
for (const el of $('#form_dat > fieldset > fieldset > div > input[type="file"')) {
if (kinds.has(el.name)) {
const kind=kinds.get(el.name)
for (const f of el.files) {
const dat = await VertDataFile.loadAsync(f, kinds.get(this.name))
window.dats.push(dat)
const dat = await VertDataFile.loadAsync(f, kind)
window.customDats.push(dat)
}
}
}
for (const defdat of window.defaultDats) {
if (defdat.method.isTBE) {
for (const custdat of window.customDats) {
if (custdat.molecule===defdat.molecule) {
custdat.CopyExcitationsTypeFrom(defdat)
}
}
}
}
window.dats=window.defaultDats.concat(window.customDats)
processingIndicator.isActive = false
reloadSizeSelector()
reloadSelect("sets")
@ -363,7 +375,7 @@ draft: false
if (!(sdatdic.has(key))) {
sdatdic.set(key, new Map())
}
const myT1s = T1ref.get(SetName).get(d.molecule)
const myT1s = T1ref.get(d.molecule)
for (const exc of d.excitations) {
var allowT1 = false
const T1Key = JSON.stringify((exc.initial, exc.final))
@ -504,10 +516,9 @@ draft: false
publiCache.set(DOI,await PubliData.loadAsync(DOI))
}
const setName = exSet.name
window.T1ref.set(setName, new Map())
for (const mol of mols) {
window.T1ref.get(setName).set(mol, new Map())
var TBESortdat = window.dats.filter((d)=>exSet.name === d.set.name && d.molecule === mol).sort((d1, d2) => {
window.T1ref.set(mol, new Map())
var TBESortdat = window.dats.filter((d)=> d.molecule === mol).sort((d1, d2) => {
if (d1.method.isTBE && !d2.method.isTBE) {
return -1
} else if (!d1.method.isTBE && d2.method.isTBE) {
@ -525,7 +536,7 @@ draft: false
})
if (TBESortdat.length > 0 && TBESortdat[0].method.isTBE) {
for (const exc of TBESortdat[0].excitations) {
window.T1ref.get(setName).get(mol).set(JSON.stringify((exc.initial, exc.final)), exc.T1)
window.T1ref.get(mol).set(JSON.stringify((exc.initial, exc.final)), exc.T1)
}
}
}
@ -598,7 +609,7 @@ draft: false
for (const dat of paperdata) {
const setName = dat.set.name
const key1 = dat.molecule;
const myT1s = T1ref.get(setName).get(dat.molecule)
const myT1s = T1ref.get(dat.molecule)
if (!datadic.has(key1)) {
datadic.set(key1, new Map())
}

View File

@ -203,7 +203,7 @@ class excitationBase {
this.type.Value = excitationTypes.Others.Value;
}
else if (!(this.type & (excitationTypes.Single.Value | excitationTypes.Double.Value))){
this.type.Value = excitationTypes.Single
this.type.Value += excitationTypes.Single.Value
}
this.T1 = T1
}