diff --git a/README.md b/README.md index b1cabba..d0533e3 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Les applications pédagogique se trouvent dans le [dépôt des ressouces pédago https://forge.aeif.fr/blender-edutech/jumeau-numerique .
 
L'environnement de développement est basé sur : la plateforme de modélisation et d'animation 3D [Blender](https://blender.org), le langage [Python](https://python.org) et le moteur de jeu 3D [UPBGE](https://upbge.org).
 
La version de Blender/UPBGE utilisée pour le développement est la version 0.36.1 (20 août - 2023). + 2023). Etant trop lente sous Windows, la version utilisée pour le déploiement (mise en production) est la version 0.30 (3 décembre 2021). @@ -64,15 +64,15 @@ Les bibliothèques suivantes ne sont pas incluses par défaut dans l'environneme Il faut donc les installer localement (dans UPBGE), les étapes sont : -- **GNU/Linux** : La configuration ici présente est UPBGE installé sur ~ avec Python 3.9 : - - Aller dans le répertoire local de Python de UPBGE: $ cd ~/UPBGE-0.30-linux-x86_64/3.0/python/bin +- **GNU/Linux** : La configuration ici présente est UPBGE installé sur ~ avec Python 3.10 : + - Aller dans le répertoire local de Python de UPBGE: $ cd ~/upbge-0.36.1-linux-x86_64/3.6/python/bin - Télécharger le script ['get-pip.py'](https://bootstrap.pypa.io/get-pip.py) pour installer le gestionnaire de paquet [**Pip**](https://pip.pypa.io) - - Installer le gestionnaire de paquet Pip : $ ./python3.9 get-pip.py + - Installer le gestionnaire de paquet Pip : $ ./python3.10 get-pip.py - Installer Pylint : $ ./pip install pylint - Installer pySerial : $ ./pip install pyserial - Installer pyFirmata : $ ./pip install pyfirmata - Installer Matplotlib : $ ./pip install matplotlib - - Installer PyQt5 : $ ./pip install PyQt5 + - Installer PyQt5 : $ ./pip install PyQt6 @@ -81,10 +81,10 @@ Il faut donc les installer localement (dans UPBGE), les étapes sont : - **Windows** : La configuration ici présente est UPBGE installé sur le bureau utilisateur (prenom.nom) : - Ouvrir un terminal Powershell (éventuellement en passant par Anaconda Navigator) - - Aller dans le répertoire local de Python de UPBGE: cd C:\Users\prenom.nom\Desktop\UPBGE-0.30-windows-x86_64\3.0\python\bin + - Aller dans le répertoire local de Python de UPBGE: cd C:\Users\prenom.nom\Desktop\upbge-0.36.1-windows-x86_64\3.6\python\bin - Télécharger le script ['get-pip.py'](https://bootstrap.pypa.io/get-pip.py) pour installer le gestionnaire de paquet [**Pip**](https://pip.pypa.io) - Installer le gestionnaire de paquet Pip : python.exe get-pip.py - - Aller dans le répertoire 'Scripts' : cd C:\Users\prenom.nom\Desktop\UPBGE-0.30-windows-x86_64\3.0\python\Scripts + - Aller dans le répertoire 'Scripts' : cd C:\Users\prenom.nom\Desktop\upbge-0.36.1-windows-x86_64\3.6\python\Scripts - Installer Pylint : pip.exe install pylint - Installer pySerial : pip.exe install pyserial - Installer pyFirmata : pip.exe install pyfirmata diff --git a/asset/icons/app/AUTHORS.md b/asset/icons/app/AUTHORS.md index 6b73bd9..c237beb 100644 --- a/asset/icons/app/AUTHORS.md +++ b/asset/icons/app/AUTHORS.md @@ -5,3 +5,15 @@ org.gnome.Builder.svg : - Website : https://gitlab.gnome.org/GNOME/gnome-builder - Authors : Jakub Steiner ( https://jimmac.eu/ ), Christian Hergert ( http://hergert.me/ ) - Licence : CC-BY-SA 3 + +la_forge-komit.svg : +- Remix by Philippe Roy ( https://forge.aeif.fr/phroy ) +- Initial file : avatar_Komit_face_transparent.png +- Source repository : https://forge.aeif.fr/framaka/visuel-forge +- Author : Juliette Taka ( https://juliettetaka.com/fr ) +- Licence : Creative Commons BY 4.0 + +upbge.svg : +- TM / ®UPBGE Project +- Website : https://upbge.org + diff --git a/asset/icons/app/la_forge-komit.svg b/asset/icons/app/la_forge-komit.svg new file mode 100644 index 0000000..272ad3a --- /dev/null +++ b/asset/icons/app/la_forge-komit.svg @@ -0,0 +1,179 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/asset/icons/app/upbge.svg b/asset/icons/app/upbge.svg new file mode 100644 index 0000000..ce2517e --- /dev/null +++ b/asset/icons/app/upbge.svg @@ -0,0 +1,109 @@ + + + UPBGE Logo + + + + + + image/svg+xml + + UPBGE Logo + https://upbge.org/ + + + + + + + + + + + + + + + + + + + + diff --git a/portail_coulissant/porcou_cmd.py b/portail_coulissant/porcou_cmd.py index ba86f36..5604855 100644 --- a/portail_coulissant/porcou_cmd.py +++ b/portail_coulissant/porcou_cmd.py @@ -62,15 +62,15 @@ def commandes(): print ("Version sans sécurité : sans réouverture") print ("Mise en place : Fermeture") while fdc_f() ==False : - gyr(True) + gyrr(True) mot_o(False) mot_f(True) mot_f(False) gyr(False) # Jumelage - jumeau(brochage) - jumeau_mode(True, True, True, True) + # jumeau(brochage) + # jumeau_mode(True, True, True, True) # Fonctionnement normal print ("Attente") diff --git a/portail_coulissant/portail_coulissant-18.blend b/portail_coulissant/portail_coulissant-18.blend index 3258253..0b939fd 100644 Binary files a/portail_coulissant/portail_coulissant-18.blend and b/portail_coulissant/portail_coulissant-18.blend differ diff --git a/twin.py b/twin.py index e7f686e..9bafaa2 100644 --- a/twin.py +++ b/twin.py @@ -8,7 +8,6 @@ import math import time import xml.etree.ElementTree as ET # Creating/parsing XML file import runpy # Exécution de script Python légère (sans import) -from pylint import epylint as lint # Mesure de la qualité d'un code Python import twin_doc # Documentation import twin_about # About @@ -218,9 +217,16 @@ def cmd_hl(cont): # Désactivation if cont.sensors['MO'].status == JUST_RELEASED and (scene.objects['System']['manip_mode']==0 or scene.objects['System']['manip_mode']==9): - if scene.objects['Cmd-text']['modal'] != True: + + # Texte + if scene.objects['Cmd-text']['modal']: + scene.objects['Cmd-text']['Text']= "Erreur dans le script ... " + scene.objects['Cmd-text'].setVisible(True,False) + else: scene.objects['Cmd-text']['Text']= "" scene.objects['Cmd-text'].setVisible(False,False) + + # Icone if obj.name!="Run" and obj.name!="Pause" and obj.name!="Stop" and obj.name!="Doc-cmd-colbox": scene.objects[obj.name+'-Hl'].setVisible(False,True) obj.setVisible(True,True) @@ -495,22 +501,35 @@ def file_open(): ## def python_validation(file): - (pylint_stdout, pylint_stderr) = lint.py_run(file+' --disable=C --disable=W --disable=R', return_std=True) - stdout = pylint_stdout.read() - stderr = pylint_stderr.read() - if " error (" in stdout: # Présence d'erreur + + # Terminer le processus fils précédent + if ('pylint_proc' in scene.objects['Commands']): + if scene.objects['Commands']['pylint_proc'].poll()==None: + scene.objects['Commands']['pylint_proc'].terminate() + + # Lancer le processus fils + scene.objects['Commands']['pylint_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_pylint.py"), file], stdout=subprocess.PIPE, encoding = 'utf8') + stout = scene.objects['Commands']['pylint_proc'].communicate() + + # Présence d'erreur + if stout[0][:-1] != 'None' and len(stout[0][:-1])>0 : # UI : information scene.objects['Cmd-text']['modal']= True scene.objects['Cmd-text']['Text']= "Erreur dans le script ... " scene.objects['Cmd-text'].setVisible(True,False) - print(stdout) # Affichage console + + # Affichage console + stout_lines = stout[0].split("\n") + for stout_line in stout_lines: + print ("Pylint :", stout_line) # Affichage console return False - else: - scene.objects['Cmd-text']['modal']= False - scene.objects['Cmd-text']['Text']= "" - scene.objects['Cmd-text'].setVisible(False,False) - return True + + # Absence d'erreur + scene.objects['Cmd-text']['modal']= False + scene.objects['Cmd-text']['Text']= "" + scene.objects['Cmd-text'].setVisible(False,False) + return True ## # Mise en route et pause du cycle diff --git a/twin_file_qt.py b/twin_file_qt.py index 899e53a..095d762 100644 --- a/twin_file_qt.py +++ b/twin_file_qt.py @@ -1,14 +1,14 @@ import sys -from PyQt5 import QtWidgets -from PyQt5.QtWidgets import QApplication, QFileDialog +from PyQt6 import QtWidgets +from PyQt6.QtWidgets import QApplication, QFileDialog ############################################################################### # twin_file_qt.py -# @title: Selecteur de fichier (pyQt5) +# @title: Selecteur de fichier (pyQt6) # @project: Blender-EduTech # @lang: fr # @authors: Philippe Roy -# @copyright: Copyright (C) 2023 Philippe Roy +# @copyright: Copyright (C) 2023-2024 Philippe Roy # @license: GNU GPL ############################################################################### diff --git a/twin_plot_qt.py b/twin_plot_qt.py index ea44d04..972dab0 100644 --- a/twin_plot_qt.py +++ b/twin_plot_qt.py @@ -1,19 +1,19 @@ import sys from twin_plot import plot_config_get_dict, plot_config_get, plot_config_get_enable, plot_nb, csv_read, plots_static # Gestion communes des graphiques (Qt, wx) -from PyQt5 import QtCore, QtGui, QtWidgets # GUI Qt5 +from PyQt6 import QtCore, QtGui, QtWidgets # GUI Qt6 import matplotlib # Grapheur Matplotlib import matplotlib.pyplot as plts -matplotlib.use('Qt5Agg') +matplotlib.use('Qt6Agg') from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar ############################################################################### # twin_plot_qt.py -# @title: Visualisation des données (pyQt5+Matplotlib) +# @title: Visualisation des données (pyQt6+Matplotlib) # @project: Blender-EduTech # @lang: fr # @authors: Philippe Roy -# @copyright: Copyright (C) 2023 Philippe Roy +# @copyright: Copyright (C) 2023-2024 Philippe Roy # @license: GNU GPL ############################################################################### diff --git a/twin_pylint.py b/twin_pylint.py new file mode 100644 index 0000000..cd942fc --- /dev/null +++ b/twin_pylint.py @@ -0,0 +1,21 @@ +import sys +from pylint import run_pylint + +############################################################################### +# twin_pylint.py +# @title: Mesure de la qualité d'un code Python +# @project: Ropy (Blender-EduTech) +# @lang: fr +# @authors: Philippe Roy +# @copyright: Copyright (C) 2024 Philippe Roy +# @license: GNU GPL +############################################################################### + +# print (sys.argv[0]) +# print (sys.argv[1]) +# run_pylint(argv=["--version"]) + +# Détection des erreurs +run_pylint(argv=["--errors-only", sys.argv[1]]) +# run_pylint(argv=["--disable=line-too-long", sys.argv[1]]) +sys.exit(0)