diff --git a/.gitignore b/.gitignore index 4bde02f..9c80401 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ # Origin project -*.xlsm +*.xls* *.zip -code_vba*.txt +*.txt +*.png # Node files node_modules/ diff --git a/frontend/js/chartManager.js b/frontend/js/chartManager.js index f415c49..2b2e224 100644 --- a/frontend/js/chartManager.js +++ b/frontend/js/chartManager.js @@ -1,21 +1,11 @@ import { CLINICAL_THRESHOLDS } from './pkCore.js'; import { t } from './i18n.js'; -// Le texte des zones cliniques (zone.textHex) est calibré pour un fond sombre. -// Sur le thème clair, il faut un texte foncé pour rester lisible sur le même fond pastel. -const LIGHT_THEME_ZONE_TEXT = { - inactive: '#854d0e', - anti_hyperalgesic: '#3f6212', - analgesia: '#92400e', - psychedelic: '#9d174d', - emergence: '#075985', - narcosis: '#1e3a8a', - excessive: '#7f1d1d' -}; - +// Les couleurs de zone sont volontairement fixes (indépendantes du thème d'interface) : +// elles reproduisent le dégradé de référence de l'outil KetaPK original. Seul le texte +// (zone.textHex) est choisi pour rester lisible sur cette couleur de fond opaque. export function updateChartAnnotations(chart, mode, currentYMax) { const thresholds = CLINICAL_THRESHOLDS[mode]; - const theme = document.documentElement.getAttribute('data-theme') || 'dark'; const annotations = {}; thresholds.zones.forEach((zone, index) => { @@ -24,6 +14,7 @@ export function updateChartAnnotations(chart, mode, currentYMax) { annotations[`zone_${index}`] = { type: 'box', + drawTime: 'beforeDraw', yMin: zone.min, yMax: Math.min(zoneMax, currentYMax), backgroundColor: zone.color, @@ -31,7 +22,7 @@ export function updateChartAnnotations(chart, mode, currentYMax) { label: { display: true, content: t(`zones.${zone.zoneKey}`), - color: theme === 'light' ? (LIGHT_THEME_ZONE_TEXT[zone.zoneKey] || '#1e293b') : zone.textHex, + color: zone.textHex, font: { size: 11, weight: 'bold' }, position: 'center' } diff --git a/frontend/js/pkCore.js b/frontend/js/pkCore.js index dcd46d2..81d3f64 100644 --- a/frontend/js/pkCore.js +++ b/frontend/js/pkCore.js @@ -8,7 +8,7 @@ /** * Version unique de l'application (Centralisée) */ -export const APP_VERSION = '0.18.0'; +export const APP_VERSION = '0.19.0'; export const MODES = { ESKETAMINE: 'ESKETAMINE', @@ -49,26 +49,26 @@ export const CLINICAL_THRESHOLDS = { maxScale: 500, defaultConcentration: 5, zones: [ - { zoneKey: "inactive", min: 0, max: 10, color: "rgba(249, 252, 126, 0.25)", textHex: "#fef9c3" }, - { zoneKey: "anti_hyperalgesic", min: 10, max: 50, color: "rgba(218, 247, 166, 0.25)", textHex: "#d9f99d" }, - { zoneKey: "analgesia", min: 50, max: 150, color: "rgba(255, 195, 0, 0.25)", textHex: "#fef08a" }, - { zoneKey: "psychedelic", min: 150, max: 350, color: "rgba(242, 160, 223, 0.25)", textHex: "#fbcfe8" }, - { zoneKey: "emergence", min: 350, max: 500, color: "rgba(89, 196, 240, 0.25)", textHex: "#bae6fd" }, - { zoneKey: "narcosis", min: 500, max: 1000, color: "rgba(43, 122, 244, 0.25)", textHex: "#ffffff" }, - { zoneKey: "excessive", min: 1000, max: Infinity, color: "rgba(255, 87, 51, 0.25)", textHex: "#fecaca" } + { zoneKey: "inactive", min: 0, max: 10, color: "#eaf7d8", textHex: "#4d5a1e" }, + { zoneKey: "anti_hyperalgesic", min: 10, max: 50, color: "#ddf78a", textHex: "#355e1a" }, + { zoneKey: "analgesia", min: 50, max: 150, color: "#ffcc33", textHex: "#7a4a00" }, + { zoneKey: "psychedelic", min: 150, max: 350, color: "#f562f0", textHex: "#6b0f61" }, + { zoneKey: "emergence", min: 350, max: 500, color: "#4fd3f7", textHex: "#013a4d" }, + { zoneKey: "narcosis", min: 500, max: 1000, color: "#0ea5f0", textHex: "#ffffff" }, + { zoneKey: "excessive", min: 1000, max: Infinity, color: "#ff4d4d", textHex: "#ffffff" } ] }, [MODES.RACEMIQUE]: { maxScale: 1000, defaultConcentration: 10, zones: [ - { zoneKey: "inactive", min: 0, max: 20, color: "rgba(249, 252, 126, 0.25)", textHex: "#fef9c3" }, - { zoneKey: "anti_hyperalgesic", min: 20, max: 100, color: "rgba(218, 247, 166, 0.25)", textHex: "#d9f99d" }, - { zoneKey: "analgesia", min: 100, max: 300, color: "rgba(255, 195, 0, 0.25)", textHex: "#fef08a" }, - { zoneKey: "psychedelic", min: 300, max: 700, color: "rgba(242, 160, 223, 0.25)", textHex: "#fbcfe8" }, - { zoneKey: "emergence", min: 700, max: 1000, color: "rgba(89, 196, 240, 0.25)", textHex: "#bae6fd" }, - { zoneKey: "narcosis", min: 1000, max: 2000, color: "rgba(43, 122, 244, 0.25)", textHex: "#ffffff" }, - { zoneKey: "excessive", min: 2000, max: Infinity, color: "rgba(255, 87, 51, 0.25)", textHex: "#fecaca" } + { zoneKey: "inactive", min: 0, max: 20, color: "#eaf7d8", textHex: "#4d5a1e" }, + { zoneKey: "anti_hyperalgesic", min: 20, max: 100, color: "#ddf78a", textHex: "#355e1a" }, + { zoneKey: "analgesia", min: 100, max: 300, color: "#ffcc33", textHex: "#7a4a00" }, + { zoneKey: "psychedelic", min: 300, max: 700, color: "#f562f0", textHex: "#6b0f61" }, + { zoneKey: "emergence", min: 700, max: 1000, color: "#4fd3f7", textHex: "#013a4d" }, + { zoneKey: "narcosis", min: 1000, max: 2000, color: "#0ea5f0", textHex: "#ffffff" }, + { zoneKey: "excessive", min: 2000, max: Infinity, color: "#ff4d4d", textHex: "#ffffff" } ] } }; @@ -191,7 +191,8 @@ export function generateSimulationData({ model, weightKg, timelineInputs, infusi if (!nextEvent) return; const deltaT = nextEvent.time - event.time; - const Rn = infusionRateToMgKgPerMin(event.infusionRate, infusionUnit, weightKg) / refDose; + // Excel applique le débit déclaré à la fin de l'intervalle (colonne d'arrivée), pas celui du départ + const Rn = infusionRateToMgKgPerMin(nextEvent.infusionRate, infusionUnit, weightKg) / refDose; const Falpha = Math.exp(-alpha * deltaT); const Fbeta = Math.exp(-beta * deltaT); diff --git a/pyproject.toml b/pyproject.toml index ecb91ab..f0e9d56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ketapk" -version = "0.1.0" +version = "0.19.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.14" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 298a4ee..226eb4f 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1616,7 +1616,7 @@ dependencies = [ [[package]] name = "ketapk" -version = "0.18.0" +version = "0.19.0" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index dce8cef..1069859 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ketapk" -version = "0.18.0" +version = "0.19.0" description = "KétaPK" authors = ["Pr. Georges MION", "Gauvain BOICHÉ"] license = "Proprietary" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ac60f02..f5dd3b5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "ketapk", - "version": "0.18.0", + "version": "0.19.0", "identifier": "com.ketapk.desktop", "build": { "beforeDevCommand": "",