mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-24 13:23:40 +01:00
Fast loading time
This commit is contained in:
parent
62b92912b6
commit
feaee8acd1
@ -101,9 +101,9 @@ draft: false
|
||||
await loadFiles()
|
||||
}
|
||||
async function loadFiles() {
|
||||
const db = await indexDB.loadAsync()
|
||||
const data = await loadAllData()
|
||||
processingIndicator.isActive = true
|
||||
var data = await loadAllData()
|
||||
let db = await indexDB.loadAsync()
|
||||
|
||||
window.defaultDats = []
|
||||
for (const sub of Object.values(data)) {
|
||||
|
@ -261,17 +261,20 @@ class dataFileBase {
|
||||
})
|
||||
}
|
||||
CopyExcitationsTypeFrom(data) {
|
||||
var exc_strings = data.excitations.map( e => [e, JSON.stringify(e.initial), JSON.stringify(e.final) ] )
|
||||
for (const ex of this.excitations) {
|
||||
const ex2 = data.excitations.find((e) => {
|
||||
return (JSON.stringify(e.initial) === JSON.stringify(ex.initial)) && (JSON.stringify(e.final) === JSON.stringify(ex.final))
|
||||
const exi = JSON.stringify(ex.initial)
|
||||
const exf = JSON.stringify(ex.final)
|
||||
const ex2 = exc_strings.find((e) => {
|
||||
return (e[1]=== exi) && (e[2]=== exf)
|
||||
})
|
||||
if (ex2 !== undefined) {
|
||||
if (DebugMode.Enabled) {
|
||||
const restflag=ex.type.Value & ex2.type.Value
|
||||
const restflag=ex.type.Value & ex2[0].type.Value
|
||||
const result=restflag==ex.type.Value
|
||||
console.assert(result, "Excitation type error", data.molecule, ex, ex2, this.sourceFile)
|
||||
console.assert(result, "Excitation type error", data.molecule, ex, ex2[0], this.sourceFile)
|
||||
}
|
||||
ex.type = ex2.type
|
||||
ex.type = ex2[0].type
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
function uniq(array)
|
||||
{
|
||||
if (array.length == 0) return [];
|
||||
var sortedArray = array.sort().map( x => [x, JSON.stringify(x)] );
|
||||
const sortedArray = array.sort().map( x => [x, JSON.stringify(x)] );
|
||||
var uniqueArray = [ sortedArray[0][0] ];
|
||||
for (let i=1 ; i<sortedArray.length ; i++) {
|
||||
if ( sortedArray[i][1] != sortedArray[i-1][1])
|
||||
|
Loading…
Reference in New Issue
Block a user