Skip to content

Commit

Permalink
bugfix divers
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrick-f committed Jan 11, 2021
1 parent 96aa36f commit 6a00262
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 159 deletions.
4 changes: 2 additions & 2 deletions src/draw_cairo_prg2.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def draw(self, ctx, surRect = None, surObj = None):
# ht = tailleZComp[1] / 4
# show_text_rect(ctx, k1, (_x0, posZComp[1], _x-_x0, ht), va = 'c', ha = 'c', b = 0.3, orient = 'h')

rects = TableauV(ctx, l1, _x0, self.posZComp[1],
rects = TableauV(self, l1, _x0, self.posZComp[1],
_x-_x0, self.tailleZComp[1],
0, nlignes = 0, va = 'c', ha = 'g', orient = 'v',
coul = self.ICoulComp[i], b = 0.03).draw()
Expand All @@ -943,7 +943,7 @@ def draw(self, ctx, surRect = None, surObj = None):
# Bilan des Savoirs abordés
#
dicSav, nbrSav = self.prg.GetSavoirsAbordes()
self.DrawBoutonSavoir(ctx, self.prg, None, dicSav, self.posZOrganis[1] + htitre + self.ecartY/2,
self.DrawBoutonSavoir(self.prg, dicSav, self.posZOrganis[1] + htitre + self.ecartY/2,
h = self.posZComp[1] - self.posZOrganis[1] - self.ecartY - htitre,
nbr = nbrSav)

Expand Down
14 changes: 9 additions & 5 deletions src/objects_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@ def GetDocActif(self):
#############################################################################
def HideTip(self, event = None):
# print "HideTip principal"
d = self.GetDocActif()
d = self.GetFenetreActive()
if d is not None:
d.HideTip()
event.Skip()
Expand Down Expand Up @@ -5130,7 +5130,7 @@ def Compute(self):



# BaseFiche = BaseFiche2 # Décommenter pour mod debug
BaseFiche = BaseFiche2 # Décommenter pour mod debug

class FicheDoc(BaseFiche):
def __init__(self, parent, threaded = False):
Expand Down Expand Up @@ -7383,7 +7383,7 @@ def __init__(self, parent, classe, ouverture = False, typedoc = ''):
t = wx.StaticText(pageGen, -1, "Académie :")
sh.Add(t, flag = wx.ALIGN_CENTER_VERTICAL)

lstAcad = sorted([a[0] for a in list(constantes.ETABLISSEMENTS.values())])
lstAcad = sorted([a[0] for a in constantes.ETABLISSEMENTS.values()])
self.cba = wx.ComboBox(pageGen, -1, "sélectionner une académie ...", (-1,-1),
(-1, -1), lstAcad+[""],
wx.CB_DROPDOWN
Expand Down Expand Up @@ -12393,7 +12393,7 @@ def EvtComboBox(self, event):
if newPhase == "Rev":
self.tache.SetDuree(0)
self.tache.SetPhase(newPhase)
for arbre in list(self.arbres.values()):
for arbre in self.arbres.values():
arbre.MiseAJourPhase(newPhase)
self.pageGen.Layout()
self.sendEvent(modif = "Changement de phase de la Tâche", draw = True, verif = True)
Expand Down Expand Up @@ -14099,11 +14099,15 @@ def MiseAJourLien(self):
def OnCheckModele(self):
# print "OnCheckModele"
self.modele.logiciels = self.cb_type.GetAllChecked()
# print self.modele.logiciels
self.modele.SetLogiciel()
# print(self.modele.logiciels)
self.sendEvent(modif = "Modification du logiciel du Modèle",
draw = False, verif = False)





####################################################################################
#
# Classe définissant l'arbre de structure de base d'un document
Expand Down
188 changes: 36 additions & 152 deletions src/pysequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
_S, _Rev, _R1, _R2, _R3, \
revCalculerEffectifs, \
COUL_OK, COUL_NON, COUL_BOF, COUL_BIEN, COUL_ABS, \
toList, COUL_COMPETENCES, COUL_DISCIPLINES, NBR_SYSTEMES_MAXI
toList, COUL_COMPETENCES, COUL_DISCIPLINES, NBR_SYSTEMES_MAXI,\
IMG_LOGICIELS
import constantes

import proprietes
Expand Down Expand Up @@ -2322,7 +2323,7 @@ def GetBulleHTMLDoc(self, param = None, css = False, tip = None):

:i: code pour différentier ...
"""
print("GetBulleHTMLDoc", param)
# print("GetBulleHTMLDoc", param)
ref = self.GetReferentiel()

html = ""
Expand Down Expand Up @@ -4970,6 +4971,11 @@ def SetLiens(self):

self.support.SetLien()

######################################################################################
def SetLogiciel(self):
for e in self.eleves:
pass

# ######################################################################################
# def GetFicheHTML(self, param = None):
# if param is None:
Expand Down Expand Up @@ -6328,7 +6334,7 @@ def enregistrer(self, nomFichier, dialog = True):
def SetTip(self, param = None, obj = None):
""" Mise à jour du TIP (popup)
"""
print("SetTip Projet :", param, obj)
# print("SetTip Projet :", param, obj)

tip = self.GetTip()
if tip is None:
Expand Down Expand Up @@ -13956,6 +13962,11 @@ def SetNom(self, nom):
if hasattr(self, 'arbre'):
self.SetCode()

######################################################################################
def SetLogiciel(self):
if hasattr(self, 'arbre'):
self.SetCode()
self.GetDocument().SetLogiciel()

######################################################################################
def GetNom(self):
Expand All @@ -13968,6 +13979,7 @@ def GetNom(self):

######################################################################################
def GetIcone(self):
# print("GetIcone", self.logiciels, self.arbre.images.keys() )
if len(self.logiciels) > 0 and self.logiciels[0] in self.arbre.images.keys():
image = self.arbre.images[self.logiciels[0]]
else:
Expand Down Expand Up @@ -14755,8 +14767,8 @@ def HasModele(self):

######################################################################################
def GetModele(self, num):
# print "GetModele", num
# print " ",self.GetDocument().support.modeles[num-1]
# print("GetModele", num)
# print(" ",self.GetDocument().support.modeles)
return self.GetDocument().support.modeles[num]

######################################################################################
Expand Down Expand Up @@ -15133,149 +15145,20 @@ def SetCode(self):

if hasattr(self, 'arbre'):
self.arbre.SetItemText(self.branche, t)

# self.SetTip()


# ######################################################################################
# def GetFicheHTML(self, param = None):
# # print "GetFicheHTML"
# # print self.GetProjetRef().listeParties
# dic = {}
# ligne = []
# for ph in self.GetProjetRef().listeParties:
# dic['coul'] = couleur.GetCouleurHTML(getCoulPartie(ph))
# dic['nom'] = self.GetProjetRef().parties[ph]
# dic['id'] = ph
# ligne.append("""<tr id = "le%(id)s" align="right" valign="middle" >
# <td><font color = "%(coul)s"><em>%(nom)s</em></font></td>
# </tr>""" %dic)
#
# ficheHTML = constantes.encap_HTML(constantes.BASE_FICHE_HTML_ELEVE)
#
#
# t = ""
# for l in ligne:
# t += l+"\n"
#
# ficheHTML = ficheHTML.replace('{{tab_eval}}', t)
#
# return ficheHTML




# ######################################################################################
# def SetTip2(self, tip):
# # print("SetTip2", self)
# # Tip
#
#
#
# # self.tip.SetTexte(self.GetNomPrenom(), self.tip_nom)
# coulOK = couleur.GetCouleurHTML(COUL_OK)
# coulNON = couleur.GetCouleurHTML(COUL_NON)
#
# #
# # Durée
# #
# duree = self.GetDuree()
# v = self.getValiditeDuree(duree)
# lab = draw_cairo.getHoraireTxt(duree)
# if v == 0:
# coul = coulOK
# elif v == 1:
# coul = couleur.GetCouleurHTML(COUL_BOF)
# else:
# coul = coulNON
# tip.AjouterCol("ld", lab, coul, bold = True)
#
#
# #
# # Evaluabilité
# #
# ev, ev_tot, _ = self.GetEvaluabilite()
# prj = self.GetProjetRef()
# keys = {}
# for disc, dic in prj._dicoIndicateurs.items():
# # print(" ", dic)
# keys[disc] = sorted(dic.keys())
# # if "O8s" in keys:
# # keys.remove("O8s")
# # print(">>>keys", keys)
#
# lab = {}
# for disc, dic in prj._dicoGrpIndicateur.items():
# # print(" ", disc, dic)
# lab[disc] = {}
# for part in dic:
# lab[disc][part] = [[pourCent2(ev_tot[disc][part][0], True), True]]
# # totalOk = True
# for k in keys[disc]:
# if k in prj._dicoGrpIndicateur[disc][part]:
# if k in ev[disc][part]:
#
# # totalOk = totalOk and (ler[k] >= 0.5)
# lab[disc][part].append([pourCent2(ev[disc][part][k][0], True), ev[disc][part][k][1]])
# else:
# # totalOk = False
# lab[disc][part].append([pourCent2(0, True), False])
# else:
# lab[disc][part].append(["", True])
# lab[disc][part][0][1] = ev_tot[disc][part][1]#totalOk and (er >= 0.5)
#
# # print(">>>lab", lab)
# for disc, dic in prj._dicoGrpIndicateur.items():
# for part in dic:
# # print " ", part
# for i, lo in enumerate(lab[disc][part]):
# # print " ", i, lo
# l, o = lo
# if i == 0:
# size = None
# bold = True
# if o:
# coul = coulOK
# else:
# coul = coulNON
# else:
# size = 2
# bold = False
# if not o:
# coul = coulNON
# else:
# coul = None
# tip.AjouterCol("le"+part, l, coul,
# couleur.GetCouleurHTML(getCoulPartie(part)), size, bold)
#
# for disc in prj._dicoIndicateurs:
# if disc in lab:
# for t in keys[disc]:
# tip.AjouterCol("le", t, size = 2)
#
# #
# # Modèles
# #
# lst_modeles = self.GetModeles()
# if len(lst_modeles) == 0:
# tip.Supprime("mod")
# for m in lst_modeles:
# m.SetTip()
# tip.InsererSoup("mod", m.tip.soup)
#
# # for i, m in enumerate(self.GetModeles()):
# # # print "mod", m
# # for j, (l,bmp) in enumerate(m.GetLogosLogiciels().items()):
# # h = u"<p>" + l + u"</p>"
# # idx = "log"+str(i)+"."+str(j)
# # h +=u'<img id="%s" src="" alt="">' %idx
# # # print " ", h
# # self.tip.AjouterHTML('mod', h)
# # self.tip.AjouterImg(idx, bmp)
#
# tip.SetPage()
# return tip


if self.HasModele():
l = self.GetModele(self.modeles[0]-1)
# print(self.modeles, l)
# print(IMG_LOGICIELS)
if l in IMG_LOGICIELS:
# self.codeBranche.SetImg(constantes.imagesProjet['Mod'].GetBitmap())
self.codeBranche.SetImg(IMG_LOGICIELS[self.GetModele(self.modeles[0]-1)].GetBitmap())
else:
self.codeBranche.DelImg()
else:
self.codeBranche.DelImg()
# self.SetTip()


######################################################################################
Expand All @@ -15290,10 +15173,10 @@ def initCodeBranche(self):
self.codeBranche.Add(disc+part)

self.codeBranche.AddImg()
if self.HasModele():
self.codeBranche.SetImg(constantes.imagesProjet['Mod'].GetBitmap())
else:
self.codeBranche.DelImg()
# if self.HasModele():
# self.codeBranche.SetImg(IMG_LOGICIELS[self.modeles[0][0]].GetBitmap())
# else:
# self.codeBranche.DelImg()



Expand Down Expand Up @@ -15435,8 +15318,9 @@ def GetBulleHTML(self, i = None, css = False, tip = None):
# Modèles
#
lst_modeles = []
# print("modeles", self.modeles)
for m in self.modeles:
lst_modeles.append(m.GetBulleHTML(css = css, tip = tip))
lst_modeles.append(self.GetModele(m-1).GetBulleHTML(css = css, tip = tip))

# lst_modeles = self.GetModeles()
# if len(lst_modeles) == 0:
Expand Down

0 comments on commit 6a00262

Please sign in to comment.