mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 15:24:14 +02:00
Add French and German translations for API Reference
- api_reference-FR.md: Complete French translation of API Reference guide covering scripting (Python), plugins, XML manipulation, and developer resources - api_reference-DE.md: Full German translation with identical comprehensive coverage Tier 3 progress: 6 of 8 developer pages now complete (Contributing, Building, API Reference in FR/DE)
+293
@@ -0,0 +1,293 @@
|
|||||||
|
# API-Referenz
|
||||||
|
|
||||||
|
Erweitern und automatisieren Sie QElectroTech durch Scripting, Plugins und XML-Manipulation.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Überblick
|
||||||
|
|
||||||
|
QElectroTech bietet mehrere Möglichkeiten zur Funktionserweiterung und Workflow-Automatisierung:
|
||||||
|
|
||||||
|
1. **Scripting** — Python-Skripte zur Automatisierung
|
||||||
|
2. **Plugins** — Mit benutzerdefinierten Funktionen erweitern (Python, etc.)
|
||||||
|
3. **XML-Manipulation** — Direkte Dateienbearbeitung für benutzerdefinierte Tools
|
||||||
|
4. **Doxygen-API** — C++-API für Entwickler, die Erweiterungen erstellen
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Erste Schritte
|
||||||
|
|
||||||
|
### Für Wen Dieser Leitfaden
|
||||||
|
|
||||||
|
- **Entwickler** die QET erweitern möchten
|
||||||
|
- **Power-Benutzer** die Workflows automatisieren
|
||||||
|
- **Tool-Builder** die benutzerdefinierte Dienstprogramme erstellen
|
||||||
|
- **Forscher** die QET-Dateien programmatisch verarbeiten
|
||||||
|
|
||||||
|
### Voraussetzungen
|
||||||
|
|
||||||
|
- Grundlegende Programmierkenntnisse (Python empfohlen)
|
||||||
|
- Verständnis von QET-Dateiformaten (XML)
|
||||||
|
- Vertrautheit mit QET-Benutzeroberfläche und Terminologie
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Scripting
|
||||||
|
|
||||||
|
### Python-Scripting
|
||||||
|
|
||||||
|
QElectroTech unterstützt **Python-Scripting** für Automatisierungsaufgaben.
|
||||||
|
|
||||||
|
#### Verfügbare Anwendungsfälle
|
||||||
|
|
||||||
|
- **Leiter-Block-Generierung** — Automatisches Erstellen von Terminalleisten
|
||||||
|
- **Auto-Nummerierung** — Elemente und Leiter programmatisch nummerieren
|
||||||
|
- **Batch-Operationen** — Mehrere Diagramme verarbeiten
|
||||||
|
- **Datenexport** — Informationen aus Projekten extrahieren
|
||||||
|
- **Benutzerdefinierte Berichte** — Spezialisierte Dokumentation generieren
|
||||||
|
|
||||||
|
#### Terminal-Block-Generator (Beispiel)
|
||||||
|
|
||||||
|
Der **Terminal-Block-Generator** ist ein von der Gemeinschaft beigestütztes Python-Plugin, das die Erstellung von Terminalleisten automatisiert.
|
||||||
|
|
||||||
|
**Funktionen:**
|
||||||
|
- Generieren Sie Terminal-Blöcke aus Leiter-Listen
|
||||||
|
- Passen Sie die Terminal-Nummerierung an
|
||||||
|
- Exportieren Sie Terminal-Dokumentation
|
||||||
|
|
||||||
|
**Gemeinschaft:**
|
||||||
|
- 55 Themen, 895 Beiträge im Forum
|
||||||
|
- Aktive Entwicklung und Unterstützung
|
||||||
|
- Verfügbar auf GitHub
|
||||||
|
|
||||||
|
**Erste Schritte:**
|
||||||
|
- Forum: https://qelectrotech.org/forum/viewforum.php?id=14
|
||||||
|
- Python-Plugin-Beispiel für QET
|
||||||
|
|
||||||
|
### Ihre Eigenen Skripte Schreiben
|
||||||
|
|
||||||
|
#### Script-Struktur
|
||||||
|
|
||||||
|
QET-Skripte typischerweise:
|
||||||
|
|
||||||
|
1. **Lesen** Sie Projekt-/Element-Dateien (XML)
|
||||||
|
2. **Verarbeiten** Sie die Daten (Python-Logik)
|
||||||
|
3. **Schreiben** Sie in Datei oder generieren Sie Ausgabe
|
||||||
|
|
||||||
|
#### Beispiel-Workflow
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Pseudo-Code-Beispiel
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# QET-Projekt lesen
|
||||||
|
project = ET.parse('meinprojekt.qet')
|
||||||
|
root = project.getroot()
|
||||||
|
|
||||||
|
# Alle Elemente suchen
|
||||||
|
for element in root.findall('.//element'):
|
||||||
|
# Element verarbeiten
|
||||||
|
ref = element.get('id')
|
||||||
|
print(f"Verarbeite Element: {ref}")
|
||||||
|
|
||||||
|
# Zurück schreiben
|
||||||
|
project.write('meinprojekt_modifiziert.qet')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Häufige Aufgaben
|
||||||
|
|
||||||
|
**Element-Daten Lesen:**
|
||||||
|
- `.elmt` XML-Dateien analysieren
|
||||||
|
- Anschlüsse, Grafiken, Eigenschaften extrahieren
|
||||||
|
- Auf Element-Bibliotheken zugreifen
|
||||||
|
|
||||||
|
**Projekte Ändern:**
|
||||||
|
- Elemente hinzufügen/entfernen
|
||||||
|
- Leiter-Eigenschaften ändern
|
||||||
|
- Nummerierung aktualisieren
|
||||||
|
|
||||||
|
**Berichte Generieren:**
|
||||||
|
- Element-Listen extrahieren
|
||||||
|
- Nomenclature generieren
|
||||||
|
- Verdrahtungsdiagramme erstellen
|
||||||
|
|
||||||
|
### Benötigte Python-Bibliotheken
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# XML-Verarbeitung (in Python integriert)
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# Für fortgeschrittene Aufgaben
|
||||||
|
pip install lxml # Bessere XML-Unterstützung
|
||||||
|
```
|
||||||
|
|
||||||
|
### Forum-Diskussion
|
||||||
|
|
||||||
|
**Script-Forum:** https://qelectrotech.org/forum/viewforum.php?id=14
|
||||||
|
|
||||||
|
Themen umfassen:
|
||||||
|
- Auto-Nummerungs-Skripte
|
||||||
|
- Schrank-Layout-Generatoren
|
||||||
|
- Datenextraktions-Tools
|
||||||
|
- Batch-Verarbeitungs-Beispiele
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
|
||||||
|
### Plugin-System
|
||||||
|
|
||||||
|
QElectroTech unterstützt **Plugins** für tiefe Integration.
|
||||||
|
|
||||||
|
#### Verfügbare Plugins
|
||||||
|
|
||||||
|
**Terminal-Block-Generator**
|
||||||
|
- Typ: Python-Plugin
|
||||||
|
- Zweck: Automatisieren Sie die Erstellung von Terminalleisten
|
||||||
|
- Gemeinschafts-Support: Ja
|
||||||
|
- Forum: Terminal-Block-Generator-Forum (55 Themen)
|
||||||
|
|
||||||
|
#### Plugin-Entwicklung
|
||||||
|
|
||||||
|
**Erstellen Sie ein Plugin:**
|
||||||
|
|
||||||
|
1. **Verstehen Sie die Plugin-Schnittstelle** — Wie QET Ihren Code aufruft
|
||||||
|
2. **Schreiben Sie Plugin-Code** — Python oder C++ je nach Integration
|
||||||
|
3. **Verpacken Sie das Plugin** — Legen Sie es im QET-Plugin-Verzeichnis ab
|
||||||
|
4. **Testen Sie gründlich** — Gewährleisten Sie Stabilität
|
||||||
|
5. **Teilen Sie mit der Gemeinschaft** — Tragen Sie zum Forum bei
|
||||||
|
|
||||||
|
**Plugin-Verzeichnisse:**
|
||||||
|
|
||||||
|
**Linux:**
|
||||||
|
```
|
||||||
|
~/.local/share/QElectroTech/plugins/
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
```
|
||||||
|
%APPDATA%\QElectroTech\plugins\
|
||||||
|
```
|
||||||
|
|
||||||
|
**macOS:**
|
||||||
|
```
|
||||||
|
~/Library/Application Support/QElectroTech/plugins/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Plugin-Beispiele
|
||||||
|
|
||||||
|
**Terminal-Block-Generator:**
|
||||||
|
- Generiert Terminal-Leisten programmatisch
|
||||||
|
- Verarbeitet Leiter-Listen
|
||||||
|
- Erstellt Nomenclature
|
||||||
|
|
||||||
|
**Mögliche Plugin-Ideen:**
|
||||||
|
- Benutzerdefinierte Element-Bibliotheks-Manager
|
||||||
|
- Report-Generatoren
|
||||||
|
- Import/Export-Übersetzer
|
||||||
|
- Design-Regel-Checker
|
||||||
|
- Materialkosten-Tools
|
||||||
|
|
||||||
|
### Forum-Diskussionen
|
||||||
|
|
||||||
|
**Code/Programmierung-Forum:** https://qelectrotech.org/forum/viewforum.php?id=17 (91 Themen, 1.231 Beiträge)
|
||||||
|
|
||||||
|
**Script-Forum:** https://qelectrotech.org/forum/viewforum.php?id=14 (33 Themen, 374 Beiträge)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## XML-Manipulation
|
||||||
|
|
||||||
|
### Projekt-Dateiformat (.qet)
|
||||||
|
|
||||||
|
QET-Projekte werden im XML-Format gespeichert. Grundstruktur:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project>
|
||||||
|
<properties>
|
||||||
|
<author>Name</author>
|
||||||
|
<date>2026-01-01</date>
|
||||||
|
<title>Mein Projekt</title>
|
||||||
|
</properties>
|
||||||
|
<diagrams>
|
||||||
|
<diagram name="Schema 1">
|
||||||
|
<elements>
|
||||||
|
<element name="S1" type="..." x="10" y="20">
|
||||||
|
<!-- Element-Daten -->
|
||||||
|
</element>
|
||||||
|
</elements>
|
||||||
|
<conductors>
|
||||||
|
<conductor num="1">
|
||||||
|
<!-- Leiter-Daten -->
|
||||||
|
</conductor>
|
||||||
|
</conductors>
|
||||||
|
</diagram>
|
||||||
|
</diagrams>
|
||||||
|
</project>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Element-Dateiformat (.elmt)
|
||||||
|
|
||||||
|
Benutzerdefinierte Elemente verwenden das XML-Format:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definition version="0.100">
|
||||||
|
<uuid uuid="..."/>
|
||||||
|
<names>
|
||||||
|
<name lang="en">Mein Element</name>
|
||||||
|
<name lang="de">Mein Element</name>
|
||||||
|
</names>
|
||||||
|
<informations>...</informations>
|
||||||
|
<description>Element-Beschreibung</description>
|
||||||
|
<graphic>
|
||||||
|
<!-- Grafikelemente -->
|
||||||
|
</graphic>
|
||||||
|
<terminals>
|
||||||
|
<!-- Anschluss-Definitionen -->
|
||||||
|
</terminals>
|
||||||
|
</definition>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dateien Bearbeiten
|
||||||
|
|
||||||
|
Sie können XML-Dateien direkt ändern:
|
||||||
|
|
||||||
|
1. **Extrahieren** Sie `.qet`-Datei (Umbenennung in `.zip`)
|
||||||
|
2. **Bearbeiten** Sie XML-Dateien darin
|
||||||
|
3. **Komprimieren** Sie und benennen Sie in `.qet` um
|
||||||
|
4. **Öffnen** Sie in QET
|
||||||
|
|
||||||
|
### XML in Python Analysieren
|
||||||
|
|
||||||
|
```python
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# Projekt laden
|
||||||
|
tree = ET.parse('meinprojekt.qet')
|
||||||
|
root = tree.getroot()
|
||||||
|
|
||||||
|
# Elemente durchlaufen
|
||||||
|
for elem in root.findall('.//element'):
|
||||||
|
name = elem.get('name')
|
||||||
|
elem_type = elem.get('type')
|
||||||
|
print(f"Element: {name}, Typ: {elem_type}")
|
||||||
|
|
||||||
|
# Änderungen speichern
|
||||||
|
tree.write('meinprojekt_modifiziert.qet', encoding='UTF-8')
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Zusätzliche Ressourcen
|
||||||
|
|
||||||
|
- **[QET Erstellen](building-DE)** — Aus Quelle kompilieren
|
||||||
|
- **[Zu QET Beitragen](contributing-DE)** — Code-Beitrag-Anleitung
|
||||||
|
- **[Doxygen-API](https://download.qelectrotech.org/qet/doxygen/html/)** — C++-API-Referenz
|
||||||
|
- **[Script-Forum](https://qelectrotech.org/forum/viewforum.php?id=14)** — Diskutieren und Teilen
|
||||||
|
- **[Code-Forum](https://qelectrotech.org/forum/viewforum.php?id=17)** — Entwickler-Fragen
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**[🌐 Sprache wählen](languages)** — English · Français · Deutsch
|
||||||
+296
@@ -0,0 +1,296 @@
|
|||||||
|
# Référence API
|
||||||
|
|
||||||
|
Étendez et automatisez QElectroTech grâce au scripting, aux plugins et à la manipulation XML.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Aperçu
|
||||||
|
|
||||||
|
QElectroTech fournit plusieurs façons d'étendre les fonctionnalités et d'automatiser les workflows :
|
||||||
|
|
||||||
|
1. **Scripting** — Scripts Python pour automatisation
|
||||||
|
2. **Plugins** — Étendre avec des fonctionnalités personnalisées (Python, etc.)
|
||||||
|
3. **Manipulation XML** — Édition directe de fichiers pour outils personnalisés
|
||||||
|
4. **Doxygen API** — API C++ pour développeurs construisant des extensions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Commencer
|
||||||
|
|
||||||
|
### Pour Qui Ce Guide
|
||||||
|
|
||||||
|
- **Développeurs** voulant étendre QET
|
||||||
|
- **Utilisateurs avancés** automatisant des workflows
|
||||||
|
- **Constructeurs d'outils** créant des utilitaires personnalisés
|
||||||
|
- **Chercheurs** traitant les fichiers QET programmatiquement
|
||||||
|
|
||||||
|
### Prérequis
|
||||||
|
|
||||||
|
- Connaissances de programmation de base (Python recommandé)
|
||||||
|
- Compréhension des formats de fichier QET (XML)
|
||||||
|
- Familiarité avec l'interface et la terminologie de QET
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Scripting
|
||||||
|
|
||||||
|
### Scripting Python
|
||||||
|
|
||||||
|
QElectroTech supporte le **scripting Python** pour les tâches d'automatisation.
|
||||||
|
|
||||||
|
#### Cas d'Utilisation Disponibles
|
||||||
|
|
||||||
|
- **Génération de blocs terminaux** — Créer automatiquement les bandes terminales
|
||||||
|
- **Auto-numérotation** — Numéroter programmatiquement les éléments et conducteurs
|
||||||
|
- **Opérations par lot** — Traiter plusieurs diagrammes
|
||||||
|
- **Export de données** — Extraire les informations des projets
|
||||||
|
- **Rapports personnalisés** — Générer une documentation spécialisée
|
||||||
|
|
||||||
|
#### Générateur de Bloc Terminal (Exemple)
|
||||||
|
|
||||||
|
Le **Générateur de Bloc Terminal** est un plugin Python contribué par la communauté qui automatise la création de bandes terminales.
|
||||||
|
|
||||||
|
**Fonctionnalités :**
|
||||||
|
- Générer des blocs terminaux à partir des listes de conducteurs
|
||||||
|
- Personnaliser la numérotation des bornes
|
||||||
|
- Exporter la documentation terminale
|
||||||
|
|
||||||
|
**Communauté :**
|
||||||
|
- 55 sujets, 895 messages au forum
|
||||||
|
- Développement et support actif
|
||||||
|
- Disponible sur GitHub
|
||||||
|
|
||||||
|
**Débuter :**
|
||||||
|
- Forum : https://qelectrotech.org/forum/viewforum.php?id=14
|
||||||
|
- Exemple de plugin Python pour QET
|
||||||
|
|
||||||
|
### Écrire Vos Propres Scripts
|
||||||
|
|
||||||
|
#### Structure des Scripts
|
||||||
|
|
||||||
|
Les scripts QET généralement :
|
||||||
|
|
||||||
|
1. **Lisent** les fichiers projet/élément (XML)
|
||||||
|
2. **Traitent** les données (logique Python)
|
||||||
|
3. **Écrivent** vers un fichier ou génèrent une sortie
|
||||||
|
|
||||||
|
#### Exemple de Workflow
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Pseudo-code exemple
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# Lire projet QET
|
||||||
|
project = ET.parse('monprojet.qet')
|
||||||
|
root = project.getroot()
|
||||||
|
|
||||||
|
# Trouver tous les éléments
|
||||||
|
for element in root.findall('.//element'):
|
||||||
|
# Traiter l'élément
|
||||||
|
ref = element.get('id')
|
||||||
|
print(f"Traitement l'élément : {ref}")
|
||||||
|
|
||||||
|
# Écrire
|
||||||
|
project.write('monprojet_modifie.qet')
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Tâches Courantes
|
||||||
|
|
||||||
|
**Lecture des Données d'Élément :**
|
||||||
|
- Analyser les fichiers XML `.elmt`
|
||||||
|
- Extraire les bornes, graphiques, propriétés
|
||||||
|
- Accéder aux bibliothèques d'éléments
|
||||||
|
|
||||||
|
**Modification des Projets :**
|
||||||
|
- Ajouter/supprimer des éléments
|
||||||
|
- Modifier les propriétés des conducteurs
|
||||||
|
- Mettre à jour la numérotation
|
||||||
|
|
||||||
|
**Génération de Rapports :**
|
||||||
|
- Extraire les listes d'éléments
|
||||||
|
- Générer la nomenclature
|
||||||
|
- Créer des diagrammes de câblage
|
||||||
|
|
||||||
|
### Bibliothèques Python Nécessaires
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Traitement XML (Python intégré)
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# Pour les tâches avancées
|
||||||
|
pip install lxml # Meilleur support XML
|
||||||
|
```
|
||||||
|
|
||||||
|
### Discussion du Forum
|
||||||
|
|
||||||
|
**Forum des Scripts :** https://qelectrotech.org/forum/viewforum.php?id=14
|
||||||
|
|
||||||
|
Les sujets incluent :
|
||||||
|
- Scripts d'auto-numérotation
|
||||||
|
- Générateurs de mise en page armoire
|
||||||
|
- Outils d'extraction de données
|
||||||
|
- Exemples de traitement par lot
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
|
||||||
|
### Système de Plugins
|
||||||
|
|
||||||
|
QElectroTech supporte les **plugins** pour une intégration profonde.
|
||||||
|
|
||||||
|
#### Plugins Disponibles
|
||||||
|
|
||||||
|
**Générateur de Bloc Terminal**
|
||||||
|
- Type : Plugin Python
|
||||||
|
- Objectif : Automatiser la création de bandes terminales
|
||||||
|
- Support communautaire : Oui
|
||||||
|
- Forum : Forum du générateur de bloc terminal (55 sujets)
|
||||||
|
|
||||||
|
#### Développement de Plugin
|
||||||
|
|
||||||
|
**Créer un Plugin :**
|
||||||
|
|
||||||
|
1. **Comprendre l'interface du plugin** — Comment QET appelle votre code
|
||||||
|
2. **Écrire le code du plugin** — Python ou C++ en fonction de l'intégration
|
||||||
|
3. **Empaqueter le plugin** — Placer dans le répertoire des plugins QET
|
||||||
|
4. **Tester complètement** — Assurer la stabilité
|
||||||
|
5. **Partager avec la communauté** — Contribuer au forum
|
||||||
|
|
||||||
|
**Répertoires de Plugin :**
|
||||||
|
|
||||||
|
**Linux :**
|
||||||
|
```
|
||||||
|
~/.local/share/QElectroTech/plugins/
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows :**
|
||||||
|
```
|
||||||
|
%APPDATA%\QElectroTech\plugins\
|
||||||
|
```
|
||||||
|
|
||||||
|
**macOS :**
|
||||||
|
```
|
||||||
|
~/Library/Application Support/QElectroTech/plugins/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Exemples de Plugin
|
||||||
|
|
||||||
|
**Générateur de Bloc Terminal :**
|
||||||
|
- Génère les bandes terminales programmatiquement
|
||||||
|
- Traite les listes de conducteurs
|
||||||
|
- Crée la nomenclature
|
||||||
|
|
||||||
|
**Idées de Plugin Potentielles :**
|
||||||
|
- Gestionnaires de bibliothèque d'éléments personnalisés
|
||||||
|
- Générateurs de rapports
|
||||||
|
- Traducteurs import/export
|
||||||
|
- Vérificateurs de règles de conception
|
||||||
|
- Outils de nomenclature
|
||||||
|
|
||||||
|
### Discussions du Forum
|
||||||
|
|
||||||
|
**Forum Code/Programmation :** https://qelectrotech.org/forum/viewforum.php?id=17 (91 sujets, 1.231 messages)
|
||||||
|
|
||||||
|
**Forum Scripts :** https://qelectrotech.org/forum/viewforum.php?id=14 (33 sujets, 374 messages)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Manipulation XML
|
||||||
|
|
||||||
|
### Format de Fichier Projet (.qet)
|
||||||
|
|
||||||
|
Les projets QET sont stockés au format XML. Structure de base :
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project>
|
||||||
|
<properties>
|
||||||
|
<author>Nom</author>
|
||||||
|
<date>2026-01-01</date>
|
||||||
|
<title>Mon Projet</title>
|
||||||
|
</properties>
|
||||||
|
<diagrams>
|
||||||
|
<diagram name="Schema 1">
|
||||||
|
<elements>
|
||||||
|
<element name="S1" type="..." x="10" y="20">
|
||||||
|
<!-- données d'élément -->
|
||||||
|
</element>
|
||||||
|
</elements>
|
||||||
|
<conductors>
|
||||||
|
<conductor num="1">
|
||||||
|
<!-- données de conducteur -->
|
||||||
|
</conductor>
|
||||||
|
</conductors>
|
||||||
|
</diagram>
|
||||||
|
</diagrams>
|
||||||
|
</project>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Format de Fichier Élément (.elmt)
|
||||||
|
|
||||||
|
Les éléments personnalisés utilisent le format XML :
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<definition version="0.100">
|
||||||
|
<uuid uuid="..."/>
|
||||||
|
<names>
|
||||||
|
<name lang="en">Mon Élément</name>
|
||||||
|
<name lang="fr">Mon Élément</name>
|
||||||
|
</names>
|
||||||
|
<informations>...</informations>
|
||||||
|
<description>Description de l'élément</description>
|
||||||
|
<kindInformations>
|
||||||
|
<kindInformation name="type">switch</kindInformation>
|
||||||
|
</kindInformations>
|
||||||
|
<graphic>
|
||||||
|
<!-- Éléments graphiques -->
|
||||||
|
</graphic>
|
||||||
|
<terminals>
|
||||||
|
<!-- Définitions de bornes -->
|
||||||
|
</terminals>
|
||||||
|
</definition>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Édition de Fichiers
|
||||||
|
|
||||||
|
Vous pouvez directement modifier les fichiers XML :
|
||||||
|
|
||||||
|
1. **Extraire** le fichier `.qet` (renommer en `.zip`)
|
||||||
|
2. **Éditer** les fichiers XML à l'intérieur
|
||||||
|
3. **Compresser** et renommer en `.qet`
|
||||||
|
4. **Ouvrir** dans QET
|
||||||
|
|
||||||
|
### Parsing XML en Python
|
||||||
|
|
||||||
|
```python
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
# Charger projet
|
||||||
|
tree = ET.parse('myproject.qet')
|
||||||
|
root = tree.getroot()
|
||||||
|
|
||||||
|
# Parcourir les éléments
|
||||||
|
for elem in root.findall('.//element'):
|
||||||
|
name = elem.get('name')
|
||||||
|
elem_type = elem.get('type')
|
||||||
|
print(f"Élément : {name}, Type : {elem_type}")
|
||||||
|
|
||||||
|
# Sauvegarder les modifications
|
||||||
|
tree.write('myproject_modified.qet', encoding='UTF-8')
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Ressources Supplémentaires
|
||||||
|
|
||||||
|
- **[Construire QET](building-FR)** — Compiler à partir de la source
|
||||||
|
- **[Contribuer à QET](contributing-FR)** — Guide de contribution de code
|
||||||
|
- **[API Doxygen](https://download.qelectrotech.org/qet/doxygen/html/)** — Référence API C++
|
||||||
|
- **[Forum Scripts](https://qelectrotech.org/forum/viewforum.php?id=14)** — Discuter et partager
|
||||||
|
- **[Forum Code](https://qelectrotech.org/forum/viewforum.php?id=17)** — Questions de développement
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**[🌐 Choisir la Langue](languages)** — English · Français · Deutsch
|
||||||
Reference in New Issue
Block a user