Ajout de la fonctionnalité Favoris (V1.6)
- Nouvelle catégorie Favoris dans la navigation principale - js/getFavorites.dg5 : téléchargement du Project.gfx, décompression côté navigateur (JSZip) et extraction des favoris vers data/ - js/libraries/ : bibliothèques tierces (jQuery, JSZip) - pages/menuFavorites.dg5 : menu des favoris regroupés par groupe - pages/showDataFav.dg5 : affichage des points d'un groupe de favoris - index.dg5 : correction des libellés FR (Entrées Digitales/Multi-états) - _proj.json : passage en version 1.6 - README.md : documentation des Favoris + changelog - .gitignore : exclusion de dev/ et .claude/
This commit is contained in:
@@ -38,3 +38,6 @@ build/
|
|||||||
.idea/
|
.idea/
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
|
dev/
|
||||||
|
.claude/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
*English version below*
|
*English version below*
|
||||||
|
|
||||||
**Version:** 1.5\
|
**Version:** 1.6\
|
||||||
**Auteur:** Charles-Arthur DAVID\
|
**Auteur:** Charles-Arthur DAVID\
|
||||||
**Plateforme:** Distech Controls Designer\
|
**Plateforme:** Distech Controls Designer\
|
||||||
**Compatibilité:** Automates Eclypse (Version V1.19)\
|
**Compatibilité:** Automates Eclypse (Version V1.19)\
|
||||||
@@ -19,6 +19,7 @@ Ce projet offre une navigation structurée par catégories de points (entrées/s
|
|||||||
## Fonctionnalités
|
## Fonctionnalités
|
||||||
|
|
||||||
- **Navigation par catégories** : Organisation automatique des points BACnet par type
|
- **Navigation par catégories** : Organisation automatique des points BACnet par type
|
||||||
|
- Favoris (Favorites)
|
||||||
- Entrées Analogiques (Analog Input)
|
- Entrées Analogiques (Analog Input)
|
||||||
- Sorties Analogiques (Analog Output)
|
- Sorties Analogiques (Analog Output)
|
||||||
- Valeurs Analogiques (Analog Value)
|
- Valeurs Analogiques (Analog Value)
|
||||||
@@ -32,6 +33,7 @@ Ce projet offre une navigation structurée par catégories de points (entrées/s
|
|||||||
- Dérogations (Override)
|
- Dérogations (Override)
|
||||||
- Alarmes (Alarms)
|
- Alarmes (Alarms)
|
||||||
|
|
||||||
|
- **Favoris** : Récupération automatique des favoris configurés dans l'automate (fichier `Project.gfx`) et affichage regroupé par groupe de favoris
|
||||||
- **Support multilingue** : Interface disponible en Français et Anglais
|
- **Support multilingue** : Interface disponible en Français et Anglais
|
||||||
- **Thème clair/sombre** : Personnalisation de l'apparence selon les préférences
|
- **Thème clair/sombre** : Personnalisation de l'apparence selon les préférences
|
||||||
- **Interface responsive** : Adaptation automatique à différentes tailles d'écran
|
- **Interface responsive** : Adaptation automatique à différentes tailles d'écran
|
||||||
@@ -49,7 +51,8 @@ Ce projet offre une navigation structurée par catégories de points (entrées/s
|
|||||||
|
|
||||||
Téléchargez la version souhaitée dans la section Paquets:
|
Téléchargez la version souhaitée dans la section Paquets:
|
||||||
|
|
||||||
[cadMyDC_V1.5.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.5/cadMyDC_V1.5.zip)
|
- [cadMyDC_V1.6.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.6/cadMyDC_V1.6.zip) (avec Favoris)
|
||||||
|
- [cadMyDC_V1.5.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.5/cadMyDC_V1.5.zip) (sans Favoris)
|
||||||
|
|
||||||
### 2. Importation dans Designer
|
### 2. Importation dans Designer
|
||||||
|
|
||||||
@@ -84,11 +87,17 @@ cadMyDC/
|
|||||||
├── pages/ # Pages spécialisées
|
├── pages/ # Pages spécialisées
|
||||||
│ ├── alarms.dg5 # Gestion des alarmes
|
│ ├── alarms.dg5 # Gestion des alarmes
|
||||||
│ ├── loadingPage.dg5 # Page de chargement
|
│ ├── loadingPage.dg5 # Page de chargement
|
||||||
|
│ ├── menuFavorites.dg5 # Menu des favoris (regroupement par groupe)
|
||||||
│ ├── noData.dg5 # Page sans données
|
│ ├── noData.dg5 # Page sans données
|
||||||
│ ├── override.dg5 # Gestion des dérogations
|
│ ├── override.dg5 # Gestion des dérogations
|
||||||
│ ├── schedule.dg5 # Gestion des programmes horaires
|
│ ├── schedule.dg5 # Gestion des programmes horaires
|
||||||
│ ├── showData.dg5 # Affichage des données
|
│ ├── showData.dg5 # Affichage des données
|
||||||
|
│ ├── showDataFav.dg5 # Affichage des points favoris
|
||||||
│ └── trend.dg5 # Affichage des tendances
|
│ └── trend.dg5 # Affichage des tendances
|
||||||
|
├── js/ # Scripts et bibliothèques
|
||||||
|
│ ├── getFavorites.dg5 # Récupération/parsing des favoris depuis Project.gfx
|
||||||
|
│ └── libraries/ # Bibliothèques tierces (jQuery, JSZip) pour la décompression
|
||||||
|
├── data/ # Fichiers CSV générés (favoris, utilisateurs, groupes)
|
||||||
├── palette/ # Widgets personnalisés (vide actuellement)
|
├── palette/ # Widgets personnalisés (vide actuellement)
|
||||||
└── fonts/ # Polices personnalisées
|
└── fonts/ # Polices personnalisées
|
||||||
```
|
```
|
||||||
@@ -122,6 +131,7 @@ L'interface présente un menu latéral avec toutes les catégories de points dé
|
|||||||
|
|
||||||
### Visualisation des données
|
### Visualisation des données
|
||||||
|
|
||||||
|
- Les **favoris** (Favorites) affichent les points marqués comme favoris dans l'automate, regroupés par groupe de favoris
|
||||||
- Les **points standards** (AI, AO, AV, BI, BO, BV, MSI, MSV) affichent leurs valeurs et permettent les modifications (selon les droits)
|
- Les **points standards** (AI, AO, AV, BI, BO, BV, MSI, MSV) affichent leurs valeurs et permettent les modifications (selon les droits)
|
||||||
- Les **tendances** (Trend Log) affichent les graphiques historiques
|
- Les **tendances** (Trend Log) affichent les graphiques historiques
|
||||||
- Les **programmes** (Schedule) permettent la visualisation et modification des plannings
|
- Les **programmes** (Schedule) permettent la visualisation et modification des plannings
|
||||||
@@ -174,7 +184,11 @@ Toute demande de support adressée à Distech Controls concernant ce projet sera
|
|||||||
|
|
||||||
## Historique des versions
|
## Historique des versions
|
||||||
|
|
||||||
### Version 1.5 (Actuelle)
|
### Version 1.6 (Actuelle)
|
||||||
|
- Nouvelle catégorie **Favoris** : récupération automatique des favoris depuis le `Project.gfx` de l'automate, affichage regroupé par groupe de favoris
|
||||||
|
- Correction des libellés français du menu (« Entrées Digitales », « Entrées Multi-états »)
|
||||||
|
|
||||||
|
### Version 1.5
|
||||||
- Interface de navigation structurée par catégories
|
- Interface de navigation structurée par catégories
|
||||||
- Support multilingue FR/EN (via paramètre URL)
|
- Support multilingue FR/EN (via paramètre URL)
|
||||||
- Thèmes clair/sombre
|
- Thèmes clair/sombre
|
||||||
@@ -186,7 +200,7 @@ Toute demande de support adressée à Distech Controls concernant ce projet sera
|
|||||||
|
|
||||||
# cadMyDC - MyDC Controls of Equivalence
|
# cadMyDC - MyDC Controls of Equivalence
|
||||||
|
|
||||||
**Version:** 1.5\
|
**Version:** 1.6\
|
||||||
**Author:** Charles-Arthur DAVID\
|
**Author:** Charles-Arthur DAVID\
|
||||||
**Platform:** Distech Controls Designer\
|
**Platform:** Distech Controls Designer\
|
||||||
**Compatibility:** Eclypse Controllers (Version V1.19)\
|
**Compatibility:** Eclypse Controllers (Version V1.19)\
|
||||||
@@ -203,6 +217,7 @@ This project offers structured navigation by point categories (analog/digital/mu
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Navigation by categories**: Automatic organization of BACnet points by type
|
- **Navigation by categories**: Automatic organization of BACnet points by type
|
||||||
|
- Favorites
|
||||||
- Analog Inputs
|
- Analog Inputs
|
||||||
- Analog Outputs
|
- Analog Outputs
|
||||||
- Analog Values
|
- Analog Values
|
||||||
@@ -216,6 +231,7 @@ This project offers structured navigation by point categories (analog/digital/mu
|
|||||||
- Overrides
|
- Overrides
|
||||||
- Alarms
|
- Alarms
|
||||||
|
|
||||||
|
- **Favorites**: Automatic retrieval of the favorites configured in the controller (`Project.gfx` file) and display grouped by favorite group
|
||||||
- **Multilingual support**: Interface available in French and English
|
- **Multilingual support**: Interface available in French and English
|
||||||
- **Light/Dark theme**: Appearance customization according to preferences
|
- **Light/Dark theme**: Appearance customization according to preferences
|
||||||
- **Responsive interface**: Automatic adaptation to different screen sizes
|
- **Responsive interface**: Automatic adaptation to different screen sizes
|
||||||
@@ -233,7 +249,8 @@ This project offers structured navigation by point categories (analog/digital/mu
|
|||||||
|
|
||||||
Download the desired version from the Packages section:
|
Download the desired version from the Packages section:
|
||||||
|
|
||||||
[cadMyDC_V1.5.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.5/cadMyDC_V1.5.zip)
|
- [cadMyDC_V1.6.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.6/cadMyDC_V1.6.zip) (with Favorites)
|
||||||
|
- [cadMyDC_V1.5.zip](https://git.cadjou.net/api/packages/DistechControls/generic/cadMyDC/1.5/cadMyDC_V1.5.zip) (without Favorites)
|
||||||
|
|
||||||
### 2. Import into Designer
|
### 2. Import into Designer
|
||||||
|
|
||||||
@@ -268,11 +285,17 @@ cadMyDC/
|
|||||||
├── pages/ # Specialized pages
|
├── pages/ # Specialized pages
|
||||||
│ ├── alarms.dg5 # Alarm management
|
│ ├── alarms.dg5 # Alarm management
|
||||||
│ ├── loadingPage.dg5 # Loading page
|
│ ├── loadingPage.dg5 # Loading page
|
||||||
|
│ ├── menuFavorites.dg5 # Favorites menu (grouped by group)
|
||||||
│ ├── noData.dg5 # No data page
|
│ ├── noData.dg5 # No data page
|
||||||
│ ├── override.dg5 # Override management
|
│ ├── override.dg5 # Override management
|
||||||
│ ├── schedule.dg5 # Schedule management
|
│ ├── schedule.dg5 # Schedule management
|
||||||
│ ├── showData.dg5 # Data display
|
│ ├── showData.dg5 # Data display
|
||||||
|
│ ├── showDataFav.dg5 # Favorite points display
|
||||||
│ └── trend.dg5 # Trend display
|
│ └── trend.dg5 # Trend display
|
||||||
|
├── js/ # Scripts and libraries
|
||||||
|
│ ├── getFavorites.dg5 # Favorites retrieval/parsing from Project.gfx
|
||||||
|
│ └── libraries/ # Third-party libraries (jQuery, JSZip) for unzipping
|
||||||
|
├── data/ # Generated CSV files (favorites, users, groups)
|
||||||
├── palette/ # Custom widgets (currently empty)
|
├── palette/ # Custom widgets (currently empty)
|
||||||
└── fonts/ # Custom fonts
|
└── fonts/ # Custom fonts
|
||||||
```
|
```
|
||||||
@@ -306,6 +329,7 @@ The interface presents a side menu with all automatically detected point categor
|
|||||||
|
|
||||||
### Data Visualization
|
### Data Visualization
|
||||||
|
|
||||||
|
- **Favorites** display the points marked as favorites in the controller, grouped by favorite group
|
||||||
- **Standard points** (AI, AO, AV, BI, BO, BV, MSI, MSV) display their values and allow modifications (according to rights)
|
- **Standard points** (AI, AO, AV, BI, BO, BV, MSI, MSV) display their values and allow modifications (according to rights)
|
||||||
- **Trends** (Trend Log) display historical graphs
|
- **Trends** (Trend Log) display historical graphs
|
||||||
- **Schedules** allow visualization and modification of schedules
|
- **Schedules** allow visualization and modification of schedules
|
||||||
@@ -358,10 +382,42 @@ Any support request sent to Distech Controls regarding this project will be refu
|
|||||||
|
|
||||||
## Version History
|
## Version History
|
||||||
|
|
||||||
### Version 1.5 (Current)
|
### Version 1.6 (Current)
|
||||||
|
- New **Favorites** category: automatic retrieval of favorites from the controller's `Project.gfx`, displayed grouped by favorite group
|
||||||
|
- Fixed French menu labels (« Entrées Digitales », « Entrées Multi-états »)
|
||||||
|
|
||||||
|
### Version 1.5
|
||||||
- Structured navigation interface by categories
|
- Structured navigation interface by categories
|
||||||
- Multilingual support FR/EN (via URL parameter)
|
- Multilingual support FR/EN (via URL parameter)
|
||||||
- Light/dark themes
|
- Light/dark themes
|
||||||
- Specialized pages for alarms, trends, schedules, overrides
|
- Specialized pages for alarms, trends, schedules, overrides
|
||||||
- Auto-discovery of BACnet points
|
- Auto-discovery of BACnet points
|
||||||
- Compatible with Eclypse V1.19+
|
- Compatible with Eclypse V1.19+
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
Le format est basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/).
|
||||||
|
|
||||||
|
### [1.6] - 2026-06-10
|
||||||
|
|
||||||
|
#### Ajouté
|
||||||
|
- Catégorie **Favoris** dans la navigation principale.
|
||||||
|
- `js/getFavorites.dg5` : téléchargement du `Project.gfx` de l'automate, décompression côté navigateur (JSZip) et extraction de `Favorites.xml` vers `data/Favorites.csv`.
|
||||||
|
- `js/libraries/` : bibliothèques tierces (jQuery, JSZip, `getZip.html`, `dgframe.js`) pour la décompression.
|
||||||
|
- `pages/menuFavorites.dg5` : menu des favoris regroupés par groupe.
|
||||||
|
- `pages/showDataFav.dg5` : affichage des points d'un groupe de favoris.
|
||||||
|
|
||||||
|
#### Corrigé
|
||||||
|
- Libellés français du menu (`index.dg5`) : « Entrées Digitales » et « Entrées Multi-états ».
|
||||||
|
|
||||||
|
### [1.5]
|
||||||
|
|
||||||
|
#### Ajouté
|
||||||
|
- Interface de navigation structurée par catégories de points BACnet.
|
||||||
|
- Support multilingue FR/EN (via paramètre URL).
|
||||||
|
- Thèmes clair/sombre.
|
||||||
|
- Pages spécialisées pour les alarmes, tendances, programmes horaires et dérogations.
|
||||||
|
- Auto-découverte des points BACnet.
|
||||||
|
- Compatibilité Eclypse V1.19+.
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
"isLibrary" : false,
|
"isLibrary" : false,
|
||||||
"category" : null,
|
"category" : null,
|
||||||
"description" : "MyDC Controls of Equivalence by Charles-Arthur DAVID",
|
"description" : "MyDC Controls of Equivalence by Charles-Arthur DAVID",
|
||||||
"version" : "1.5",
|
"version" : "1.6",
|
||||||
"firstDayOfWeek" : 0,
|
"firstDayOfWeek" : 0,
|
||||||
"loadExternalConfig" : false,
|
"loadExternalConfig" : false,
|
||||||
"protected" : false,
|
"protected" : false,
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,37 @@
|
|||||||
|
// test if a parameter value is designer table
|
||||||
|
let dgIframeId;
|
||||||
|
function dgIsParamTable(val){
|
||||||
|
return (val !== null && typeof(val)=='object' && val.hasOwnProperty('cols')
|
||||||
|
&& val.hasOwnProperty('rows'));
|
||||||
|
}
|
||||||
|
// interface to the dglux5 application
|
||||||
|
function onDGFrameMessage(e){
|
||||||
|
var data = e.data;
|
||||||
|
if (typeof(data)=='object'){
|
||||||
|
if (data.hasOwnProperty('dgIframeInit')){
|
||||||
|
dgIframeId = data['dgIframeInit'];
|
||||||
|
console.log(dgIframeId);
|
||||||
|
if (window.parent !== null){
|
||||||
|
// the first post back shouldn't contain any data change
|
||||||
|
window.parent.postMessage({'dgIframe':dgIframeId},'*');
|
||||||
|
}
|
||||||
|
} else if (data.hasOwnProperty('dgIframeUpdate')){
|
||||||
|
var updates = data['updates'];
|
||||||
|
if (typeof(updates)=='object'){
|
||||||
|
if (typeof(dgParams) == 'object'){
|
||||||
|
for (key in dgParams){
|
||||||
|
if (updates.hasOwnProperty(key)){
|
||||||
|
dgParams[key](updates[key]);
|
||||||
|
}}}
|
||||||
|
if (typeof(dgParamsUpdated) == 'function'){
|
||||||
|
dgParamsUpdated();
|
||||||
|
}}}}}
|
||||||
|
window.addEventListener('message',onDGFrameMessage);
|
||||||
|
// push parameter changes back to dglux
|
||||||
|
function dgUpdateParams(changes) {
|
||||||
|
if (dgIframeId !== null) {
|
||||||
|
window.parent.postMessage({'dgIframe':dgIframeId, changes:changes},'*');
|
||||||
|
} else {
|
||||||
|
throw 'dgUpdateParams failed, handshake not finished';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script type='text/javascript' src='jquery-3.7.1.min.js'></script>
|
||||||
|
<script type='text/javascript' src='jszip.min.js'></script>
|
||||||
|
<script type='text/javascript' src='jszip-utils.min.js'></script>
|
||||||
|
<script type='text/javascript' src='dgframe.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="fetch"></div>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
"use strict";
|
||||||
|
let zipSource = "";
|
||||||
|
let fileContent;
|
||||||
|
let blacklistFiles = "";
|
||||||
|
let blacklistSet = new Set();
|
||||||
|
let dgParams = {
|
||||||
|
"zipSource": function(val) {
|
||||||
|
zipSource = val;
|
||||||
|
unzip(zipSource);
|
||||||
|
},
|
||||||
|
"blacklistFiles": function(val) {
|
||||||
|
blacklistFiles = val;
|
||||||
|
blacklistSet = parseBlacklist(val);
|
||||||
|
},
|
||||||
|
"fileContent": function(val) {
|
||||||
|
fileContent = val;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// "chemin1,chemin2,..." -> Set de chemins normalises (slashes en /)
|
||||||
|
function parseBlacklist(str) {
|
||||||
|
let set = new Set();
|
||||||
|
if (!str) {
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
str.split(",").forEach(function(p) {
|
||||||
|
let norm = p.trim().replace(/\\/g, "/");
|
||||||
|
if (norm) {
|
||||||
|
set.add(norm);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return set;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare la donnee a charger par JSZip selon la forme recue.
|
||||||
|
// JSZip.loadAsync accepte aussi bien une chaine binaire qu'un Uint8Array.
|
||||||
|
function toZipData(input) {
|
||||||
|
if (typeof input === "string") {
|
||||||
|
let trimmed = input.trim();
|
||||||
|
|
||||||
|
// Reponse JSON {"binary":"<base64>"} -> decoder le base64
|
||||||
|
if (trimmed.charAt(0) === "{") {
|
||||||
|
let base64 = JSON.parse(trimmed).binary;
|
||||||
|
let bin = atob(base64);
|
||||||
|
let out = new Uint8Array(bin.length);
|
||||||
|
for (let i = 0; i < bin.length; i++) {
|
||||||
|
out[i] = bin.charCodeAt(i);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tableau d'octets en texte "[123,34,...]"
|
||||||
|
if (trimmed.charAt(0) === "[") {
|
||||||
|
return Uint8Array.from(JSON.parse(trimmed));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zip brut en chaine binaire (commence par "PK") -> JSZip l'accepte tel quel
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ArrayBuffer / TypedArray / tableau d'octets -> JSZip l'accepte tel quel
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Octets -> base64 (navigateur)
|
||||||
|
function bytesToBase64(bytes) {
|
||||||
|
let bin = "";
|
||||||
|
for (let i = 0; i < bytes.length; i++) {
|
||||||
|
bin += String.fromCharCode(bytes[i]);
|
||||||
|
}
|
||||||
|
return btoa(bin);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type MIME a partir de l'extension du fichier
|
||||||
|
function mimeFromName(name) {
|
||||||
|
let ext = name.split(".").pop().toLowerCase();
|
||||||
|
let map = {
|
||||||
|
png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg",
|
||||||
|
gif: "image/gif", bmp: "image/bmp", webp: "image/webp",
|
||||||
|
ico: "image/x-icon", svg: "image/svg+xml"
|
||||||
|
};
|
||||||
|
return map[ext] || "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decode le contenu d'un fichier selon son encodage reel.
|
||||||
|
// Texte: UTF-16 (BOM) ou UTF-8. Binaire (image): data URI base64 pour <img src="">.
|
||||||
|
function decodeContent(bytes, name) {
|
||||||
|
if (bytes.length >= 2 && bytes[0] === 0xFF && bytes[1] === 0xFE) {
|
||||||
|
return new TextDecoder("utf-16le").decode(bytes);
|
||||||
|
}
|
||||||
|
if (bytes.length >= 2 && bytes[0] === 0xFE && bytes[1] === 0xFF) {
|
||||||
|
return new TextDecoder("utf-16be").decode(bytes);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
||||||
|
} catch (e) {
|
||||||
|
return "data:" + mimeFromName(name) + ";base64," + bytesToBase64(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unzip(source) {
|
||||||
|
let zipData;
|
||||||
|
try {
|
||||||
|
zipData = toZipData(source);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Erreur de decodage de l'entree:", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSZip.loadAsync(zipData)
|
||||||
|
.then(function(zip) {
|
||||||
|
let promises = [];
|
||||||
|
|
||||||
|
zip.forEach(function (relativePath, zipEntry) {
|
||||||
|
if (zipEntry.dir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Exclu: ni dans la table, ni chargement du contenu (memoire)
|
||||||
|
if (blacklistSet.has(relativePath.replace(/\\/g, "/"))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
promises.push(
|
||||||
|
zipEntry.async("uint8array").then(function(bytes) {
|
||||||
|
return {
|
||||||
|
name: zipEntry.name.split("/").pop().split("\\").pop(),
|
||||||
|
path: relativePath,
|
||||||
|
content: decodeContent(bytes, zipEntry.name)
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return Promise.all(promises);
|
||||||
|
})
|
||||||
|
.then(function success(table) {
|
||||||
|
dgUpdateParams({ 'fileContent': JSON.stringify(table, null, 2) });
|
||||||
|
}, function error(e) {
|
||||||
|
console.log("Erreur de lecture du zip:", e);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+2
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
|||||||
|
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){return function o(i,f,u){function s(n,e){if(!f[n]){if(!i[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(a)return a(n,!0);throw new Error("Cannot find module '"+n+"'")}var r=f[n]={exports:{}};i[n][0].call(r.exports,function(e){var t=i[n][1][e];return s(t||e)},r,r.exports,o,i,f,u)}return f[n].exports}for(var a="function"==typeof require&&require,e=0;e<u.length;e++)s(u[e]);return s}({1:[function(e,t,n){"use strict";var u={};function r(){try{return new window.XMLHttpRequest}catch(e){}}u._getBinaryFromXHR=function(e){return e.response||e.responseText};var s="undefined"!=typeof window&&window.ActiveXObject?function(){return r()||function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:r;u.getBinaryContent=function(t,n){var e,r,o,i;"function"==typeof(n=n||{})?(i=n,n={}):"function"==typeof n.callback&&(i=n.callback),i||"undefined"==typeof Promise?(r=function(e){i(null,e)},o=function(e){i(e,null)}):e=new Promise(function(e,t){r=e,o=t});try{var f=s();f.open("GET",t,!0),"responseType"in f&&(f.responseType="arraybuffer"),f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined"),f.onreadystatechange=function(e){if(4===f.readyState)if(200===f.status||0===f.status)try{r(u._getBinaryFromXHR(f))}catch(e){o(new Error(e))}else o(new Error("Ajax error for "+t+" : "+this.status+" "+this.statusText))},n.progress&&(f.onprogress=function(e){n.progress({path:t,originalEvent:e,percent:e.loaded/e.total*100,loaded:e.loaded,total:e.total})}),f.send()}catch(e){o(new Error(e),null)}return e},t.exports=u},{}]},{},[1])(1)});
|
||||||
Vendored
+13
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
|||||||
|
{"@type":"group","Left":{"@type":"symbol","height":"100.0%","creationPolicy":"onDisplay","symbol":"lib/dcWidgets/palette/widgets:Navigation.Left","!df":true,"tabData":["tabData1.data"],"tabData1":{"@type":"table","data":{"@type":"tabledata","cols":[{"name":"row","type":"number","meta":{"name":"row","type":"number"}},{"name":"label","meta":{"name":"v1"}},{"name":"path","meta":{"name":"v2"}},{"name":"icons","meta":{"name":"icons"}},{"name":"dataPath","meta":{"name":"dataPath"}}],"rows":[[0,"Home","samplePath/index.dg5","",""],[1,"Alarms","samplePath/pages/Schedules.dg5","",""],[2,"Schedule","samplePath/pages/Alarms.dg5","",""],[3,"Trends","samplePath/pages/Trends.dg5","",""]]},"!ps":["data"],"!x":32,"!y":102},"tabLabels":"Tab1,Tab2,Tab3","paths":"pages/charts.dg5,pages/gagues.dg5,pages/text.dg5","!paletteIcon":"assets/widgetIcons/VerticalNav.png","initialIndex":0,"Initial_Index":0,"Tab_Data":["tabData1.data"],"Default_Tab":0,"Data":["@parent.tableColumnMapping.output"],"Default":0,"designerResize":"vertical","allowResize":"vertical","autoSize":true,"!label":"Barre de navigation sur le côté","Dark_Theme":false,"Main_Nav_Width":180,"Follow_Global_Theme":true},"Inclusion_de_pages":{"@type":"pageInclude","width":"100%","height":"100%","creationPolicy":"onDisplay","flexShrink":1,"path":["@parent.Left.Path"],"dataPath":["@parent.Left.Datapath"]},"tableColumnMapping":{"@type":"tableColumnMapping","!ps":["input","retainColumns","0","1","2","3","4","5","6","7","output"],"!x":632,"!y":40,"input":["@parent.tableGroupBy.output"],"@array":["label","group","path","=\"pages/showDataFav.dg5\"","icons","s","dataPath","group"]},"width":"100%","height":"100%","clipContent":true,"layout":"horizontal","csvParser":{"@type":"csvParser","!ps":["input","withHeader","delimiter","parseError","output"],"!x":227,"!y":33,"input":["@parent.strLoader.output"],"withHeader":true},"strLoader":{"@type":"strLoader","autoRun":true,"!ps":["invoke","path","status","output"],"!x":56,"!y":31,"path":"data/Favorites.csv"},"!df":true,"minWidth":"auto","tableGroupBy":{"@type":"tableGroupBy","!ps":["input","baseColumn","nestedData","0","1","2","output"],"!x":436,"!y":39,"input":["@parent.csvParser.output"],"baseColumn":"group","@array":[null,null,null]},"@array":[["Left"],["Inclusion_de_pages"]],"@ver":10322}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"@type":"group","Group":{"@type":"group","symbol":"dataBoxRow","renderer":{"map":{"dataPath":["@parent.@data.path"]}},"data":["tableFilter.output"],"tableFilter":{"@type":"tableFilter","!ps":["input","condition","output"],"!x":461,"!y":169,"input":["@parent.csvParser.output"],"condition":["@parent.concat.output"]},"csvParser":{"@type":"csvParser","!ps":["input","withHeader","delimiter","parseError","output"],"!x":276,"!y":88,"input":["@parent.strLoader.output"],"withHeader":true},"concat":{"@type":"concat","!ps":["0","1","2","strict","output"],"!x":274,"!y":235,"strict":true,"@array":["group===\"",["@stage.@params.dataPath"],"\""]},"strLoader":{"@type":"strLoader","autoRun":true,"!ps":["invoke","path","status","output"],"!x":102.0103759765625,"!y":83.03121948242188,"path":"data/Favorites.csv"},"!df":true,"layout":"vertical","alignItems":"flex-start","width":"100.0%","@array":[]},"width":"100%","height":"100%","clipContent":true,"layout":"absolute","alignItems":"flex-start","vScroll":"auto","symbol":"","renderer":{"map":{"dataPath":""}},"@array":[["Group"]],"@params":{"!var":[{"n":"dataPath","t":"nodepath"}],"!layout":{"type":"vbox","children":["dataPath"]},"dataPath":"g3"},"@symbols":{"dataBoxRow":{"@type":"group","WidgetDataBox":{"@type":"jswidget","height":"100%","js":"lib/dcUtilities/widget.js#WidgetDataBox@DistechControls","width":"100%","background":{"@type":"fill"},"shadows":{"@type":"shadows","@array":[{"type":"dropShadow","color":0,"alpha":0.1,"x":0,"y":2,"blur":8}]},"!label":"Databox","showHeader":false,"allowResize":"horizontal","nodeList":["bind!nodeList.output"],"bind!nodeList":{"@type":"propMapBinding","!ps":["output"],"@array":[{"@type":"propMapItem","path":["@stage.replace.output"],"dg!getNode":{"@type":"getNode","service":["@parent.service"],"path":["@parent.path"]},"dg!Time":1706521306,"!ps":["path"],"@params":{"!var":[{"n":"label","t":"string","isOutput":true},{"n":"numberFormat","t":"string","isOutput":true},{"n":"showPriority","t":"bool","isOutput":true},{"n":"showUnits","t":"bool","isOutput":true},{"n":"showPriorityParameter","t":"bool","isOutput":true},{"n":"showTrends","t":"bool","isOutput":true},{"n":"bindingRefreshRate","t":"number","isOutput":true},{"n":"inlineActions","t":"bool","isOutput":true},{"n":"showActions","t":"bool","isOutput":true},{"n":"actions","t":"multiselectEnum","isOutput":true}],"label":["@parent.dg!getNode.name"]}}]},"!df":true},"replace":{"@type":"replace","!ps":["input","regexp","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","output"],"!x":967,"!y":52,"input":["@parent.concat.output"],"!w":202,"@array":["AnalogValue","Analog+Value","HardwareInput0","Analog+Input","HardwareOutput1","Analog+Output","BinaryValue","Binary+Value","HardwareInput3","Binary+Input","HardwareOutput4","Binary+Output","MultiStateValue","Multi+State+Value","HardwareInput13","Multi+State+Input"," ","+"]},"concat":{"@type":"concat","!ps":["0","1","2","3","strict","output"],"!x":446,"!y":44,"strict":true,"!w":403,"@array":["/Data/Local+Device/",["@parent.if.output"],"/",["@stage.mapToTable.output.0_name"]]},"mapToTable":{"@type":"mapToTable","input":["@parent.@data"],"!ps":["input","output"],"!x":39,"!y":15},"if":{"@type":"if","!ps":["op","0","1","then","else","output"],"!x":245,"!y":38,"op":"contains","then":["@parent.concat1.output"],"else":["@parent.concat1.0"],"@array":["HardwareInput,HardwareOutput",["@stage.mapToTable.output.0_type"]]},"concat1":{"@type":"concat","!ps":["0","1","strict","output"],"!x":55,"!y":125,"@array":[["@stage.mapToTable.output.0_type"],["@stage.mapToTable.output.0_typeId"]]},"add":{"@type":"add","!ps":["0","1","output"],"!x":253,"!y":202,"@array":[["@stage.mapToTable.output.0_index"],1]},"width":"100.0%","height":41,"clipContent":true,"scaleContent":"none","layout":"absolute","creationPolicy":"onDisplay","!df":true,"@array":[["WidgetDataBox"]],"@params":{"!reuse":true,"!var":[{"n":"dataPath","t":"string"}],"!layout":{"type":"vbox","children":["dataPath"]}},"@W":1306,"@H":41}},"@ver":10284}
|
||||||
Reference in New Issue
Block a user