def C_MESURE(): return FACT( statut='d', max=1, TABLE=SIMP(statut='f', typ='TXM', defaut="NON", into=("OUI", "NON")), UNITE=SIMP(statut='f', typ=UnitType(), val_min=1, inout='out'), )
def check_unit(self, nom): """Vérification ayant besoin du nom""" from code_aster.Cata.DataStructure import UnitType # As UnitType() is not an object, this forbids UNITE* keywords # for another kind of 'int'. if nom.startswith('UNITE') and UnitType() in self.type: if not self.inout: self.cr.fatal( _(u"L'attribut 'inout' est obligatoire pour le type " u"UnitType()."))
def check_inout(self): """Vérifie l'attribut inout.""" from code_aster.Cata.DataStructure import UnitType if self.inout is None: return elif self.inout not in ('in', 'out', 'inout'): self.cr.fatal( _(u"L'attribut 'inout' doit valoir 'in','out' ou 'inout' : %r" ), self.inout) elif UnitType() not in self.type or len(self.type) != 1: self.cr.fatal(_(u"L'attribut 'typ' doit valoir UnitType() : %r"), self.type)
def check_unit(self, step): """Vérification ayant besoin du nom""" # As UnitType() is not an object, this forbids UNITE* keywords # for another kind of 'int'. inout = step.definition.get("inout") typ = force_list(step.definition.get("typ")) if step.name.startswith('UNITE') and UnitType() in typ: if not inout: self.cr.fatal("Attribute 'inout' is required with 'typ' " "UnitType().") if step.defaultValue() == 6: self.cr.fatal("Unauthorized default value: 6")
def C_AFFICHAGE(): return FACT( statut='f', max=1, INFO_RESIDU=SIMP(statut='f', typ='TXM', defaut="NON", into=("OUI", "NON")), INFO_TEMPS=SIMP(statut='f', typ='TXM', defaut="NON", into=("OUI", "NON")), UNITE=SIMP(statut='f', typ=UnitType(), val_min=1, inout='out'), PAS=SIMP(statut='f', typ='I', val_min=1), )