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):
if cont.sensors['Init'].positive == False: # 1 seule fois
return False
twin.manip_init() # Manipulation du modèle 3D
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.y = scene.objects['System']['init_ly']
scene.objects['System'].worldPosition.z = scene.objects['System']['init_lz']
for objet in scene.objects['System']['objects'] :
scene.objects[objet].setVisible(True,False)
scene.objects[objet].restorePhysics()
if objet+"_Lines.GP" in scene.objects:
scene.objects[objet+"_Lines.GP"].setVisible(True,False)
# for objet in scene.objects['System']['objects'] :
# scene.objects[objet].setVisible(True,False)
# scene.objects[objet].restorePhysics()
# if objet+"_Lines.GP" in scene.objects:
# scene.objects[objet+"_Lines.GP"].setVisible(True,False)
##
# Position de départ pour la manipulation de la vue
@ -434,7 +434,7 @@ def python_validation(file):
stdout = pylint_stdout.read()
stderr = pylint_stderr.read()
if " error (" in stdout: # Présence d'erreur
print(stdout)
print(stdout) # Affichage console
return False
else:
return True

View File

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

View File

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

View File

@ -181,10 +181,6 @@ def init():
def open():
# 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.objects['Doc_close'].color= color_doc_fct
scene.objects['Doc'].setVisible(True,True)
@ -224,7 +220,9 @@ def open():
# Fermer la documentation
##
def close():
def close(cont):
if cont.sensors['Click'].status == JUST_ACTIVATED and cont.sensors['MO'].positive :
scene.active_camera = scene.objects["Camera"]
chap=("general", "system", "python")
for page in chap:
scene.objects["Doc_chap-"+page].setVisible(False,True)
@ -232,7 +230,6 @@ def close():
scene.objects["Doc_chap-"+page].worldPosition.y = scene.objects["Doc_chap-"+page]['init_ly']
scene.objects["Doc_chap-"+page].worldPosition.z = scene.objects["Doc_chap-"+page]['init_lz']
scene.objects['Doc'].setVisible(False,True)
scene.objects['Doc'].worldPosition = [35, -2, 2]
##
# Highlight
@ -396,7 +393,6 @@ def text_load():
doc_text= scene.addObject('Doc_text-l'+str(i+1), None, 0.00, True)
doc_text.setParent(scene.objects['Doc'])
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.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