DB6B3MEDBTEEIS6KOSJH7L5JFXKDMATJARZ6AR7TF2HCCKTFRZJQC
let re = /.*\/([^\/]*)\.csv/
for (const modulePath in profileModules) {
console.log("module", modulePath)
let matches = modulePath.match(re)
console.log(matches)
if(matches) {
prt.push(matches[1])
}
"Résidentiel 6>kVA≤36":{
"profils":[ "RES11-P1" ]
},
"Résidentiel ≤36kVA HPHC":{
"profils":[ "RES2" ]
},
"Professionel ≤36kVA":{
"profils":[ "PRO1-P1" ]
},
"Professionnel ≤36kVA HWE":{
"profils":[ "PRO1WE" ]
},
"Professionnel ≤36kVA HPHC":{
"profils":[ "PRO2" ]
},
"Entreprise 36<kVA<250 HPHC ETE-HIV":{
"profils":[ "ENT1" ]
},
/*
"Production hydraulique":{
"profils":[ "PRD1-P1" ]
},
"Production cogénération":{
"profils":[ "PRD2-P1" ]
},
"Production photovoltaïque":{
"profils":[ "PRD3-P1" ]
},
*/
let resp = await fetch(
`${base}/profiles/${name}.csv`,
)
let profiles = await Promise.all(profils[name].profils.map(async (x) => {
let resp = await fetch(
`${base}/profiles/${x}.csv`,
)
return await resp.text()
}))
for(let line of p.split('\n')) {
if(!line) {
continue
let file = 0;
for(let p of profiles) {
let l = 0;
for(let line of p.split('\n')) {
if(!line) {
continue
}
const col = line.split(',')
// const week = parseInt(col[0])
// const dow = parseInt(col[1])
const cs = parseFloat(col[2])
const cj = parseFloat(col[3])
for(let i = 0; i < 48; i++) {
let ch = parseFloat(col[5+i])
const c = cs * cj * ch
if(file == 0) {
annee.push(c)
} else {
annee[l] += c
}
total += c
}
l += 1
const col = line.split(';')
// const week = parseInt(col[0])
// const dow = parseInt(col[1])
const cs = parseFloat(col[2])
const cj = parseFloat(col[3])
for(let i = 0; i < 48; i++) {
let ch = parseFloat(col[5+i])
const c = cs * cj * ch
annee.push(c)
total += c
}
file += 1