Système de documentation - point d'étape

This commit is contained in:
Philippe Roy 2022-12-16 00:37:11 +01:00
parent 58533d5503
commit 387c36d2ec
6 changed files with 25 additions and 22 deletions

View File

@ -38,6 +38,9 @@ ACTIVATE = bge.logic.KX_INPUT_ACTIVE
############################################################################### ###############################################################################
def init(cont): def init(cont):
if cont.sensors['Init'].positive == False: # 1 seule fois
return False
twin.manip_init() # Manipulation du modèle 3D twin.manip_init() # Manipulation du modèle 3D
twin.cmd_init() # Commandes twin.cmd_init() # Commandes

12
twin.py
View File

@ -333,11 +333,11 @@ def manip_reset():
scene.objects['System'].worldPosition.x = scene.objects['System']['init_lx'] scene.objects['System'].worldPosition.x = scene.objects['System']['init_lx']
scene.objects['System'].worldPosition.y = scene.objects['System']['init_ly'] scene.objects['System'].worldPosition.y = scene.objects['System']['init_ly']
scene.objects['System'].worldPosition.z = scene.objects['System']['init_lz'] scene.objects['System'].worldPosition.z = scene.objects['System']['init_lz']
for objet in scene.objects['System']['objects'] : # for objet in scene.objects['System']['objects'] :
scene.objects[objet].setVisible(True,False) # scene.objects[objet].setVisible(True,False)
scene.objects[objet].restorePhysics() # scene.objects[objet].restorePhysics()
if objet+"_Lines.GP" in scene.objects: # if objet+"_Lines.GP" in scene.objects:
scene.objects[objet+"_Lines.GP"].setVisible(True,False) # scene.objects[objet+"_Lines.GP"].setVisible(True,False)
## ##
# Position de départ pour la manipulation de la vue # Position de départ pour la manipulation de la vue
@ -434,7 +434,7 @@ def python_validation(file):
stdout = pylint_stdout.read() stdout = pylint_stdout.read()
stderr = pylint_stderr.read() stderr = pylint_stderr.read()
if " error (" in stdout: # Présence d'erreur if " error (" in stdout: # Présence d'erreur
print(stdout) print(stdout) # Affichage console
return False return False
else: else:
return True return True

View File

@ -62,6 +62,10 @@ def open():
scene.objects['About_screen-up'].setVisible(True,True) scene.objects['About_screen-up'].setVisible(True,True)
scene.objects['About_screen-up-colbox'].restorePhysics() scene.objects['About_screen-up-colbox'].restorePhysics()
##
# Fermer
##
def close(cont): def close(cont):
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive : if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
scene.active_camera = scene.objects["Camera"] scene.active_camera = scene.objects["Camera"]

View File

@ -1,6 +1,6 @@
<data> <data>
<screen> <screen>
<width>1565</width> <width>1339</width>
<height>928</height> <height>753</height>
</screen> </screen>
</data> </data>

View File

@ -181,10 +181,6 @@ def init():
def open(): def open():
# Placer la tablette # Placer la tablette
# scene.objects['Doc'].worldPosition = [0, -21, 15.75]
# scene.objects['Doc'].worldPosition = [0, -21, 15.8]
# scene.objects['Doc_close'].color = color_doc_chap
# scene.objects['Doc'].setVisible(True,True)
scene.active_camera = scene.objects["Camera-Doc"] scene.active_camera = scene.objects["Camera-Doc"]
scene.objects['Doc_close'].color= color_doc_fct scene.objects['Doc_close'].color= color_doc_fct
scene.objects['Doc'].setVisible(True,True) scene.objects['Doc'].setVisible(True,True)
@ -224,15 +220,16 @@ def open():
# Fermer la documentation # Fermer la documentation
## ##
def close(): def close(cont):
chap=("general", "system", "python") if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
for page in chap: scene.active_camera = scene.objects["Camera"]
scene.objects["Doc_chap-"+page].setVisible(False,True) chap=("general", "system", "python")
scene.objects["Doc_chap-"+page].worldPosition.x = scene.objects["Doc_chap-"+page]['init_lx'] for page in chap:
scene.objects["Doc_chap-"+page].worldPosition.y = scene.objects["Doc_chap-"+page]['init_ly'] scene.objects["Doc_chap-"+page].setVisible(False,True)
scene.objects["Doc_chap-"+page].worldPosition.z = scene.objects["Doc_chap-"+page]['init_lz'] scene.objects["Doc_chap-"+page].worldPosition.x = scene.objects["Doc_chap-"+page]['init_lx']
scene.objects['Doc'].setVisible(False,True) scene.objects["Doc_chap-"+page].worldPosition.y = scene.objects["Doc_chap-"+page]['init_ly']
scene.objects['Doc'].worldPosition = [35, -2, 2] scene.objects["Doc_chap-"+page].worldPosition.z = scene.objects["Doc_chap-"+page]['init_lz']
scene.objects['Doc'].setVisible(False,True)
## ##
# Highlight # Highlight
@ -396,7 +393,6 @@ def text_load():
doc_text= scene.addObject('Doc_text-l'+str(i+1), None, 0.00, True) doc_text= scene.addObject('Doc_text-l'+str(i+1), None, 0.00, True)
doc_text.setParent(scene.objects['Doc']) doc_text.setParent(scene.objects['Doc'])
doc_text.name = 'Doc_text-l'+str(i+1)+'-'+str(card) doc_text.name = 'Doc_text-l'+str(i+1)+'-'+str(card)
print ("Création : "+'Doc_text-l'+str(i+1)+'-'+str(card))
doc_text.worldPosition.x = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.x doc_text.worldPosition.x = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.x
doc_text.worldPosition.y = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.y doc_text.worldPosition.y = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.y
doc_text.worldPosition.z = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.z doc_text.worldPosition.z = scene.objects['Doc_text-l'+str(i+1)+'-ref'].worldPosition.z