How to use addChild method in fMBT

Best Python code snippet using fMBT_python

ocs_nodes.py

Source:ocs_nodes.py Github

copy

Full Screen

...38 for child in elem.children:39 self.children.append(child)40 if id:41 self.setChildValue("id", id)42 def addChild(self, name, value):43 child = ocsElem(self, name, value)44 self.children.append(child)45 return child46 def delChild(self, name, value):47 # Will only delete the first Child with name/value48 for child in self.children:49 if child.name == name and child.value == value:50 children.remove(child)51 return True52 return False53 def getElemFromChild(self, name, value):54 if self.name == name and self.value == value:55 return self.parent56 for child in self.children:57 found = child.getElemFromChild(name, value)58 if found:59 return found60 return None61 def getElemFromName(self, name):62 if self.name == name:63 return self64 for child in self.children:65 found = child.getElemFromName(name)66 if found:67 return found68 return None69 def getChildValue(self, name):70 for child in self.children:71 if child.name == name:72 return child.value73 return None74 def setChildValue(self, name, value):75 for child in self.children:76 if child.name == name:77 child.value = value78 return True79 return False80 def dump(self):81 print("[%s,%s]" % (self.name, self.value))82 for child in self.children:83 child.dump()84 def write(self, file, indent):85 if self.name == "":86 return87 if self.value == "":88 # Node89 file.write(" " * indent + ("<%s>\n" % (self.name)))90 for child in self.children:91 child.write(file, indent + 1)92 file.write(" " * indent + ("</%s>\n" % (self.name)))93 else:94 # Value95 file.write(" " * indent + ("<%s>%s</%s>\n" % (self.name, self.value, self.name)))96 def addParameters(self, value, minvalue, maxvalue, usetexturealphaui, isloglincapable, uselogscale, resolution, modified):97 parameters = self.addChild("parameters", "")98 parameters.addChild("value", str(value))99 parameters.addChild("minvalue", minvalue)100 parameters.addChild("maxvalue", maxvalue)101 parameters.addChild("usetexturealphaui", usetexturealphaui)102 parameters.addChild("isloglincapable", isloglincapable)103 parameters.addChild("uselogscale", uselogscale)104 parameters.addChild("resolution", resolution)105 parameters.addChild("modified", modified)106 def addParametersBool(self, value):107 parameters = self.addChild("parameters", "")108 if value:109 val = "true"110 else:111 val = "false"112 parameters.addChild("value", val)113 parameters.addChild("modified", "true")114 def addParametersStdFloatTexture(self, value):115 self.addParameters(value, "0", "1", "false", "false", "false", "0.001", "true")116 def addParametersRoughnessFloatTexture(self, value):117 self.addParameters(value, "1e-07", "1", "false", "true", "true", "1e-07", "true")118 def addNodePinInternal(self, id, typename, pintype):119 NodePin = self.addChild("NodePin", "")120 NodePin.addChild("typename", typename)121 NodePin.addChild("id", str(id))122 NodePin.addChild("pintype", pintype)123 NodePin.addChild("hasinternalnodegraph", "true")124 NodePin.addChild("basenodeid", "1")125 NodePin.addChild("basenodepinid", "0")126 internalnodegraph = NodePin.addChild("internalnodegraph", "")127 return internalnodegraph128 def addNodeGraph(self, typename):129 NodeGraph = self.addChild("NodeGraph", "")130 NodeGraph.addChild("name", typename)131 NodeGraph.addChild("currentnewnodeid", "2")132 NodeGraph.addChild("currentnewnodepinconnectionid", "1")133 nodes = NodeGraph.addChild("nodes", "")134 # Node = nodes.addChild("Node", "")135 NodeGraph.addChild("nodepinconnections", "")136 return nodes137 def addNode(self, name, typename):138 Node = self.addChild("Node", "")139 Node.addChild("name", name)140 Node.addChild("typename", typename)141 Node.addChild("id", "1")142 Node.addChild("position", "0 0")143 return Node144 def addNodePinExternal(self, id, typename, pintype):145 NodePin = self.addChild("NodePin", "")146 NodePin.addChild("typename", typename)147 NodePin.addChild("id", str(id))148 NodePin.addChild("pintype", pintype)149 NodePin.addChild("hasinternalnodegraph", "false")150 return NodePin151 def addFullNode(self, id, typename1, typename2, pintype):152 internalnodegraph = self.addNodePinInternal(id, typename1, pintype)153 nodes = internalnodegraph.addNodeGraph(typename1)154 Node = nodes.addNode(typename1, typename2)155 return Node, nodes156 def addRGBspectrum(self, id, typename, spectrum):157 Node, nodes = self.addFullNode(id, typename, "RGBspectrum", "20000")158 parameters = Node.addChild("parameters", "")159 parameters.addChild("rgbvalue", "%f %f %f" % tuple([c for c in spectrum]))160 Node.addChild("inputnodepins", "")161 def addFilmWidth(self, id, mat):162 Node, nodes = self.addFullNode(id, "filmwidth", "floattexture", "20000")163 Node.addParametersStdFloatTexture(mat.OCT_filmwidth)164 Node.addChild("inputnodepins", "")165 def addFilmIndex(self, id, mat):166 Node, nodes = self.addFullNode(id, "filmindex", "float", "20001")167 parameters = Node.addChild("parameters", "")168 parameters.addChild("value", str(mat.OCT_filmindex))169 parameters.addChild("minvalue", "1")170 parameters.addChild("maxvalue", "8")171 parameters.addChild("usetextureui", "false")172 parameters.addChild("usetexturealphaui", "false")173 parameters.addChild("isloglincapable", "true")174 parameters.addChild("uselogscale", "true")175 parameters.addChild("modified", "false")176 Node.addChild("inputnodepins", "")177 def addIndex(self, id, mat):178 Node, nodes = self.addFullNode(id, "index", "float", "20001")179 parameters = Node.addChild("parameters", "")180 parameters.addChild("value", str(mat.OCT_index))181 parameters.addChild("minvalue", "1")182 parameters.addChild("maxvalue", "8")183 parameters.addChild("usetextureui", "false")184 parameters.addChild("usetexturealphaui", "false")185 parameters.addChild("isloglincapable", "true")186 parameters.addChild("uselogscale", "true")187 parameters.addChild("modified", "false")188 Node.addChild("inputnodepins", "")189 def addRoughnessFloatTexture(self, id, mat):190 Node, nodes = self.addFullNode(id, "roughness", "floattexture", "20000")191 Node.addParametersRoughnessFloatTexture(mat.OCT_roughnessfloat)192 Node.addChild("inputnodepins", "")193 def addSpecularFloatTexture(self, id, mat):194 Node, nodes = self.addFullNode(id, "specular", "floattexture", "20000")195 Node.addParametersStdFloatTexture(mat.OCT_specular.floattexture)196 Node.addChild("inputnodepins", "")197 def addReflectionFloatTexture(self, id, mat):198 Node, nodes = self.addFullNode(id, "reflection", "floattexture", "20000")199 Node.addParametersStdFloatTexture(mat.OCT_specular.floattexture)200 Node.addChild("inputnodepins", "")201 def addNormalFloatTexture(self, id, mat):202 Node, nodes = self.addFullNode(id, "normal", "floattexture", "20000")203 Node.addParametersStdFloatTexture(0)204 Node.addChild("inputnodepins", "")205 def addSmooth(self, id, mat):206 Node, nodes = self.addFullNode(id, "smooth", "bool", "20003")207 Node.addParametersBool(mat.OCT_smooth)208 Node.addChild("inputnodepins", "")209 def addBumpNone(self, id, mat):210 Node, nodes = self.addFullNode(id, "bump", "floattexture", "20000")211 Node.addParametersStdFloatTexture(0)212 Node.addChild("inputnodepins", "")213 def addNormalNone(self, id, mat):214 Node, nodes = self.addFullNode(id, "normal", "floattexture", "20000")215 Node.addParametersStdFloatTexture(0)216 Node.addChild("inputnodepins", "")217 def addOpacityFloatTexture(self, id, mat):218 Node, nodes = self.addFullNode(id, "opacity", "floattexture", "20000")219 Node.addParameters(mat.OCT_opacity.floattexture, "0", "1", "true", "false", "false", "0.001", "true")220 Node.addChild("inputnodepins", "")221 def addTemperature(self, id, mat):222 Node, nodes = self.addFullNode(id, "temperature", "float", "20001")223 parameters = Node.addChild("parameters", "")224 parameters.addChild("value", str(mat.OCT_temperature))225 parameters.addChild("minvalue", "500")226 parameters.addChild("maxvalue", "12000")227 parameters.addChild("usetextureui", "false")228 parameters.addChild("usetexturealphaui", "false")229 parameters.addChild("isloglincapable", "false")230 parameters.addChild("uselogscale", "false")231 parameters.addChild("modified", "false")232 Node.addChild("inputnodepins", "")233 def addPower(self, id, mat):234 Node, nodes = self.addFullNode(id, "power", "float", "20001")235 parameters = Node.addChild("parameters", "")236 parameters.addChild("value", str(mat.OCT_power))237 parameters.addChild("minvalue", "0.01")238 parameters.addChild("maxvalue", "100")239 parameters.addChild("usetextureui", "false")240 parameters.addChild("usetexturealphaui", "false")241 parameters.addChild("isloglincapable", "true")242 parameters.addChild("uselogscale", "true")243 parameters.addChild("modified", "false")244 Node.addChild("inputnodepins", "")245 def addTexPower(self, id, OCT_tex):246 Node, nodes = self.addFullNode(id, "power", "floattexture", "20000")247 parameters = Node.addChild("parameters", "")248 parameters.addChild("value", str(OCT_tex.power))249 parameters.addChild("minvalue", "0")250 parameters.addChild("maxvalue", "1")251 parameters.addChild("usetexturealphaui", "false")252 parameters.addChild("isloglincapable", "false")253 parameters.addChild("uselogscale", "false")254 parameters.addChild("resolution", "0.001")255 parameters.addChild("modified", "true")256 Node.addChild("inputnodepins", "")257 def addTexGamma(self, id, OCT_tex):258 Node, nodes = self.addFullNode(id, "gamma", "float", "20001")259 parameters = Node.addChild("parameters", "")260 parameters.addChild("value", str(OCT_tex.gamma))261 parameters.addChild("minvalue", "0.1")262 parameters.addChild("maxvalue", "8")263 parameters.addChild("usetextureui", "false")264 parameters.addChild("usetexturealphaui", "false")265 parameters.addChild("isloglincapable", "true")266 parameters.addChild("uselogscale", "true")267 parameters.addChild("modified", "false")268 Node.addChild("inputnodepins", "")269 def addTexScale(self, id, OCT_tex, mat):270 Node, nodes = self.addFullNode(id, "scale", "float2", "20001")271 parameters = Node.addChild("parameters", "")272 scaleX = 1.0273 scaleY = 1.0274 mtex = mat.texture_slots.get(OCT_tex.texture)275 if mtex:276 scaleX = mtex.scale.x277 scaleY = mtex.scale.y278 parameters.addChild("valuexy", "%f %f" % (scaleX, scaleY))279 parameters.addChild("minvalue", "0.001")280 parameters.addChild("maxvalue", "1000")281 parameters.addChild("modified", "false")282 Node.addChild("inputnodepins", "")283 def addTexInvert(self, id, OCT_tex):284 Node, nodes = self.addFullNode(id, "invert", "bool", "20003")285 Node.addParametersBool(OCT_tex.invert)286 Node.addChild("inputnodepins", "")287 def addNormalize(self, id, mat):288 Node, nodes = self.addFullNode(id, "normalize", "bool", "20003")289 Node.addParametersBool(mat.OCT_normalize)290 Node.addChild("inputnodepins", "")291 def addTexture(self, id, mat, OCT_tex, typename, channel):292 Node, nodes = self.addFullNode(id, channel, typename, "20000")293 mtex = mat.texture_slots.get(OCT_tex.texture)294 if mtex and mtex.texture.type == 'IMAGE':295 if not mtex.texture.image:296 error('Check texture slots for material <%s>' % mat.name)297 if mtex.texture.image.source == 'FILE':298 filename = absPath(mtex.texture.image.filepath)299 elif mtex.texture.image.source == 'SEQUENCE':300 tex = mtex.texture301 frame = octanerender.frameCurrent302 seq = get_sequence(tex, frame)303 fn_full = absPath(tex.image.filepath)304 src_dir = os.path.dirname(fn_full)305 dst_dir = octanerender.dst_dir306 name, ext = os.path.splitext(os.path.basename(fn_full))307 root, digits = get_rootname(name)308 fmt = '%%0%dd' % (digits)309 src_file = root + (fmt % seq) + ext310 dst_file = 'SEQ-' + fixName(root) + ext311 src_path = os.path.join(src_dir, src_file)312 dst_path = os.path.join(dst_dir, dst_file)313 filename = dst_path314 else:315 error('Only image types of File and Sequence are supported')316 else:317 error("Check your textures!!!")318 Node.addChild("linkedfilename", filename)319 Node.addChild("parameters", "")320 inputnodepins = Node.addChild("inputnodepins", "")321 inputnodepins.addTexPower(0, OCT_tex)322 inputnodepins.addTexGamma(1, OCT_tex)323 inputnodepins.addTexScale(2, OCT_tex, mat)324 inputnodepins.addTexInvert(3, OCT_tex)325 def addEmissionNull(self, id, mat):326 Node, nodes = self.addFullNode(id, "emission", "null emission", "20006")327 Node.addChild("inputnodepins", "")328 def addEmissionBlackBody(self, id, mat):329 Node, nodes = self.addFullNode(id, "emission", "blackbody", "20006")330 inputnodepins = Node.addChild("inputnodepins", "")331 inputnodepins.addTemperature(0, mat)332 inputnodepins.addPower(1, mat)333 inputnodepins.addNormalize(2, mat)334 nodes.addChild("nodepinconnections", "")335 def addEmissionTexture(self, id, mat):336 Node, nodes = self.addFullNode(id, "emission", "texture emission", "20006")337 inputnodepins = Node.addChild("inputnodepins", "")338 if mat.OCT_emission.emission == "RGBspectrum":339 inputnodepins.addRGBspectrum(0, "texture", mat.specular_color)340 else:341 inputnodepins.addTexture(0, mat, mat.OCT_emission, mat.OCT_emission.emission, "texture")342 inputnodepins.addPower(1, mat)343 def addTransmissionNone(self, id, mat):344 NodePin = self.addChild("NodePin", "")345 NodePin.addChild("typename", "transmission")346 NodePin.addChild("id", str(id))347 NodePin.addChild("pintype", "20000")348 NodePin.addChild("hasinternalnodegraph", "false")349 def addDiffuse(self, id, mat):350 if mat.OCT_diffuse.diffuse == "RGBspectrum":351 self.addRGBspectrum(id, "diffuse", mat.diffuse_color)352 else:353 self.addTexture(id, mat, mat.OCT_diffuse, mat.OCT_diffuse.diffuse, "diffuse")354 def addSpecular(self, id, mat):355 if mat.OCT_specular.specular == "RGBspectrum":356 self.addRGBspectrum(id, "specular", mat.specular_color)357 elif mat.OCT_specular.specular == "floattexture":358 self.addSpecularFloatTexture(id, mat)359 else:360 self.addTexture(id, mat, mat.OCT_specular, mat.OCT_specular.specular, "specular")361 def addTransmission(self, id, mat):362 if mat.OCT_diffuse.diffuse == "RGBspectrum":363 self.addRGBspectrum(id, "transmission", mat.diffuse_color)364 else:365 self.addTexture(id, mat, mat.OCT_diffuse, mat.OCT_diffuse.diffuse, "transmission")366 def addReflection(self, id, mat):367 if mat.OCT_specular.specular == "RGBspectrum":368 self.addRGBspectrum(id, "reflection", mat.specular_color)369 elif mat.OCT_specular.specular == "floattexture":370 self.addSpecularFloatTexture(id, mat)371 else:372 self.addTexture(id, mat, mat.OCT_specular, mat.OCT_specular.specular, "reflection")373 def addBump(self, id, mat):374 if mat.OCT_bump.bump == "none":375 self.addBumpNone(id, mat)376 else:377 self.addTexture(id, mat, mat.OCT_bump, mat.OCT_bump.bump, "bump")378 def addNormal(self, id, mat):379 if mat.OCT_normal.normal == "none":380 self.addNormalNone(id, mat)381 else:382 self.addTexture(id, mat, mat.OCT_normal, mat.OCT_normal.normal, "normal")383 def addOpacity(self, id, mat):384 if mat.OCT_opacity.opacity == "floattexture":385 self.addOpacityFloatTexture(id, mat)386 else:387 self.addTexture(id, mat, mat.OCT_opacity, mat.OCT_opacity.opacity, "opacity")388 def addEmission(self, id, mat):389 if mat.OCT_emitter_type == "null emission":390 self.addEmissionNull(id, mat)391 elif mat.OCT_emitter_type == "blackbody":392 self.addEmissionBlackBody(id, mat)393 else:394 self.addEmissionTexture(id, mat)395 def addRoughness(self, id, mat):396 if mat.OCT_roughness.roughness == "floattexture":397 self.addRoughnessFloatTexture(id, mat)398 else:399 self.addTexture(id, mat, mat.OCT_roughness, mat.OCT_roughness.roughness, "roughness")400 def addExternalMaterial(self, name, inputid):401 mat = self.addChild("NodePin", "")402 mat.addChild("typename", name)403 mat.addChild("id", str(inputid))404 mat.addChild("pintype", "20005")405 mat.addChild("hasinternalnodegraph", "false")406 def addMaterialDiffuse(self, mat):407 currentnewnodeid = 1408 currentnewnodepinconnectionid = 0409 nodes = self.addChild("nodes", "")410 Node = nodes.addChild("Node", "")411 Node.addChild("name", mat.name)412 Node.addChild("typename", "diffuse")413 Node.addChild("id", "1")414 Node.addChild("position", "0 0")415 inputnodepins = Node.addChild("inputnodepins", "")416 inputnodepins.addDiffuse(0, mat)417 inputnodepins.addTransmissionNone(1, mat)418 inputnodepins.addBump(2, mat)419 inputnodepins.addNormal(3, mat)420 inputnodepins.addOpacity(4, mat)421 inputnodepins.addSmooth(5, mat)422 inputnodepins.addEmission(6, mat)423 return 7, 0424 def addMaterialGlossy(self, mat):425 currentnewnodeid = 1426 currentnewnodepinconnectionid = 0427 nodes = self.addChild("nodes", "")428 Node = nodes.addChild("Node", "")429 Node.addChild("name", mat.name)430 Node.addChild("typename", "glossy")431 Node.addChild("id", "1")432 Node.addChild("position", "0 0")433 inputnodepins = Node.addChild("inputnodepins", "")434 inputnodepins.addDiffuse(0, mat)435 inputnodepins.addSpecular(1, mat)436 inputnodepins.addRoughness(2, mat)437 inputnodepins.addFilmWidth(3, mat)438 inputnodepins.addFilmIndex(4, mat)439 inputnodepins.addBump(5, mat)440 inputnodepins.addNormal(6, mat)441 inputnodepins.addOpacity(7, mat)442 inputnodepins.addSmooth(8, mat)443 return 9, 0444 def addMaterialSpecular(self, mat):445 currentnewnodeid = 1446 currentnewnodepinconnectionid = 0447 nodes = self.addChild("nodes", "")448 Node = nodes.addChild("Node", "")449 Node.addChild("name", mat.name)450 Node.addChild("typename", "specular")451 Node.addChild("id", "1")452 Node.addChild("position", "0 0")453 inputnodepins = Node.addChild("inputnodepins", "")454 inputnodepins.addReflection(0, mat)455 inputnodepins.addTransmission(1, mat)456 inputnodepins.addIndex(2, mat)457 inputnodepins.addFilmWidth(3, mat)458 inputnodepins.addFilmIndex(4, mat)459 inputnodepins.addBump(5, mat)460 inputnodepins.addNormal(6, mat)461 inputnodepins.addOpacity(7, mat)462 inputnodepins.addSmooth(8, mat)463 inputnodepins.addRoughness(9, mat)464 return 10, 0465 def addInternalMaterial(self, mat, inputid):466 nodemat = self.addChild("NodePin", "")467 nodemat.addChild("typename", mat.name)468 nodemat.addChild("id", str(inputid))469 nodemat.addChild("pintype", "20005")470 nodemat.addChild("hasinternalnodegraph", "true")471 # if mat.OCT_material_type == "glossy":472 nodemat.addChild("basenodeid", "1")473 # else:474 # nodemat.addChild("basenodeid","8")475 nodemat.addChild("basenodepinid", "0")476 internalnodegraph = nodemat.addChild("internalnodegraph", "")477 NodeGraph = internalnodegraph.addChild("NodeGraph", "")478 currentnewnodeid = 1479 currentnewnodepinconnectionid = 0480 NodeGraph.addChild("name", mat.name)481 NodeGraph.addChild("currentnewnodeid", str(currentnewnodeid))482 NodeGraph.addChild("currentnewnodepinconnectionid", str(currentnewnodepinconnectionid))483 if mat.OCT_material_type == "diffuse":484 currentnewnodeid, currentnewnodepinconnectionid = NodeGraph.addMaterialDiffuse(mat)485 elif mat.OCT_material_type == "glossy":486 currentnewnodeid, currentnewnodepinconnectionid = NodeGraph.addMaterialGlossy(mat)487 elif mat.OCT_material_type == "specular":488 currentnewnodeid, currentnewnodepinconnectionid = NodeGraph.addMaterialSpecular(mat)489 else:490 error("Shouldn't be there: unknown mat type")491 NodeGraph.addChild("nodepinconnections", "")492 NodeGraph.setChildValue("currentnewnodeid", str(currentnewnodeid))493 NodeGraph.setChildValue("currentnewnodepinconnectionid", str(currentnewnodepinconnectionid))494def ocsParse(OCSdata):495 rootElem = ocsElem(None, "", "")496 node = rootElem497 linenumber = 0498 for line in OCSdata:499 linenumber += 1500 line = line.lstrip()501 # print ("Processing line #%d: (%d) [%s]" % (linenumber,len(line),line))502 if len(line) == 0:503 # Empty line - skip504 # print ("Empty line")505 continue506 if line[-1] == "\n":507 line = line[:-1]508 if line[0] != "<":509 # Malformed line510 log("Unexpected line #%d: %s" % (linenumber, line))511 continue512 if line[1] == "/":513 # Line closing a tag - going back514 node = node.parent515 continue516 end = line.find(">")517 name = line[1:end]518 if len(line) == len(name) + 2:519 # No value : create child520 node = node.addChild(name, "")521 continue522 value = line[end + 1:]523 end = value.find("<")524 if end == -1:525 # Malformed line526 log("Unexpected line #%d: %s" % (linenumber, line))527 continue528 value = value[:end]529 node.addChild(name, value)530 return rootElem.children[0]531def ocsParseFile(fileName):532 file = open(fileName)533 if not file:534 return None535 header = file.readline()536 data = file.readlines()537 file.close()538 return ocsParse(data)539def ocsWriteFile(fileName, OCS):540 file = open(fileName, "w")541 file.write(ocs_header + "\n\n\n")542 OCS.write(file, 0)543 file.close...

Full Screen

Full Screen

cgnstypes.py

Source:cgnstypes.py Github

copy

Full Screen

...33 def hasChild(self,ctype):34 for c in self.children:35 if (c[0]==ctype): return True36 return False37 def addChild(self,ctype,cname=UD,dtype=CK.MT,card=C_0N):38 if (type(cname)!=list): lname=[cname]39 else: lname=cname40 self.children.append((ctype,lname,dtype,card))41 def addParent(self,parent):42 self.parents.append(parent)43 def cardinality(self,childtype):44 for c in self.children:45 if (c[0]==childtype): return c[3]46 return C_0047 def isReservedName(self,name):48 for c in self.children:49 if (name in c[1]): return True50 return False51 def hasReservedNameType(self,name):52 nl=[]53 for c in self.children:54 if (name in c[1]): nl.append(c[0])55 return nl56cgt={}57# --------------------------------------------------------58t=CK.CGNSLibraryVersion_ts59cgt[t]=CGNStype(t,dtype=[CK.R4],names=[CK.CGNSLibraryVersion_s])60cgt[t].shape=(1,)61# --------------------------------------------------------62t=CK.Descriptor_ts63cgt[t]=CGNStype(t,dtype=[CK.C1])64cgt[t].shape=(0,)65# --------------------------------------------------------66t=CK.Ordinal_ts67cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.Ordinal_s])68cgt[t].shape=(1,)69# --------------------------------------------------------70t=CK.DataClass_ts71cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.DataClass_s])72cgt[t].shape=(0,)73cgt[t].enumerate=CK.DataClass_l74# --------------------------------------------------------75t=CK.DimensionalUnits_ts76cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.DimensionalUnits_s])77cgt[t].shape=(32,5)78cgt[t].enumerate=CK.AllDimensionalUnits_l79cgt[t].addChild(CK.AdditionalUnits_ts,CK.AdditionalUnits_s)80# --------------------------------------------------------81t=CK.AdditionalUnits_ts82cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.AdditionalUnits_s])83cgt[t].shape=(32,3)84cgt[t].enumerate=CK.AllAdditionalUnits_l85# --------------------------------------------------------86t=CK.DataConversion_ts87cgt[t]=CGNStype(t,dtype=[CK.R4,CK.R8],names=[CK.DataConversion_s])88cgt[t].shape=(2,)89# --------------------------------------------------------90t=CK.DimensionalExponents_ts91cgt[t]=CGNStype(t,dtype=[CK.R4,CK.R8],names=[CK.DimensionalExponents_s])92cgt[t].shape=(5,)93# --------------------------------------------------------94t=CK.AdditionalExponents_ts95cgt[t]=CGNStype(t,dtype=[CK.R4,CK.R8],names=[CK.AdditionalExponents_s])96cgt[t].shape=(3,)97# --------------------------------------------------------98t=CK.DataArray_ts99cgt[t]=CGNStype(t,dtype=allDT)100cgt[t].addChild(CK.DimensionalExponents_ts,CK.DimensionalExponents_s)101cgt[t].addChild(CK.DataConversion_ts,CK.DataConversion_s)102cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)103cgt[t].addChild(CK.Descriptor_ts)104cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)105# --------------------------------------------------------106t=CK.Transform_ts107cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.Transform_s])108cgt[t].shape=(0,)109t=CK.Transform_ts2110cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.Transform_s])111cgt[t].shape=(0,)112# --------------------------------------------------------113t=CK.DiffusionModel_ts114cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.DiffusionModel_s])115cgt[t].shape=(0,)116t=CK.DiffusionModel_ts2117cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.DiffusionModel_s])118cgt[t].shape=(0,)119# --------------------------------------------------------120t=CK.InwardNormalIndex_ts121cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.InwardNormalIndex_s])122cgt[t].shape=(0,)123t=CK.InwardNormalIndex_ts2124cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.InwardNormalIndex_s])125cgt[t].shape=(0,)126# --------------------------------------------------------127t=CK.EquationDimension_ts128cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.EquationDimension_s])129cgt[t].shape=(1,)130t=CK.EquationDimension_ts2131cgt[t]=CGNStype(t,dtype=[CK.I4],names=[CK.EquationDimension_s])132cgt[t].shape=(1,)133# --------------------------------------------------------134t=CK.GridLocation_ts135cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GridLocation_s])136cgt[t].shape=(0,)137# --------------------------------------------------------138t=CK.Rind_ts139cgt[t]=CGNStype(t,dtype=[CK.I4,CK.I8],names=[CK.Rind_s])140cgt[t].shape=(0,)141# --------------------------------------------------------142t=CK.IndexRange_ts143cgt[t]=CGNStype(t,dtype=[CK.I4,CK.I8])144cgt[t].shape=(0,2)145cgt[t].names=[CK.PointRange_s,CK.PointRangeDonor_s,CK.ElementRange_s,UD]146# --------------------------------------------------------147t=CK.IndexArray_ts148cgt[t]=CGNStype(t,dtype=[CK.I4,CK.I8,CK.R4,CK.R8])149cgt[t].shape=(0,0)150cgt[t].names=[CK.PointList_s,CK.PointListDonor_s,CK.CellListDonor_s,151 CK.InwardNormalList_s,UD]152# --------------------------------------------------------153t=CK.ReferenceState_ts154cgt[t]=CGNStype(t,names=[CK.ReferenceState_s])155cgt[t].addChild(CK.Descriptor_ts)156cgt[t].addChild(CK.Descriptor_ts,CK.ReferenceStateDescription_s)157cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)158cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)159cgt[t].addChild(CK.DataArray_ts)160cgt[t].addChild(CK.UserDefinedData_ts)161# --------------------------------------------------------162t=CK.ConvergenceHistory_ts163cgt[t]=CGNStype(t,names=[CK.GlobalConvergenceHistory_s,164 CK.ZoneConvergenceHistory_s],dtype=[CK.I4])165cgt[t].shape=(1,)166cgt[t].addChild(CK.Descriptor_ts)167cgt[t].addChild(CK.Descriptor_ts,CK.NormDefinitions_s)168cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)169cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)170cgt[t].addChild(CK.DataArray_ts)171cgt[t].addChild(CK.UserDefinedData_ts)172# --------------------------------------------------------173t=CK.IntegralData_ts174cgt[t]=CGNStype(t)175cgt[t].addChild(CK.Descriptor_ts)176cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)177cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)178cgt[t].addChild(CK.DataArray_ts)179cgt[t].addChild(CK.UserDefinedData_ts)180# --------------------------------------------------------181t=CK.UserDefinedData_ts182cgt[t]=CGNStype(t)183cgt[t].addChild(CK.Descriptor_ts)184cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)185cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)186cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)187cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)188cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)189cgt[t].addChild(CK.DataArray_ts)190cgt[t].addChild(CK.FamilyName_ts,[CK.FamilyName_s],card=C_01)191cgt[t].addChild(CK.AdditionalFamilyName_ts,card=C_0N)192cgt[t].addChild(CK.UserDefinedData_ts)193cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s)194# --------------------------------------------------------195t=CK.Gravity_ts196cgt[t]=CGNStype(t)197cgt[t].addChild(CK.DataArray_ts,CK.GravityVector_s)198cgt[t].addChild(CK.Descriptor_ts)199cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)200cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)201cgt[t].addChild(CK.UserDefinedData_ts)202# --------------------------------------------------------203t=CK.FlowEquationSet_ts204cgt[t]=CGNStype(t,names=[CK.FlowEquationSet_s])205cgt[t].addChild(CK.GoverningEquations_ts,CK.GoverningEquations_s)206cgt[t].addChild(CK.EquationDimension_ts,CK.EquationDimension_s)207cgt[t].addChild(CK.GasModel_ts,CK.GasModel_s)208cgt[t].addChild(CK.ViscosityModel_ts,CK.ViscosityModel_s)209cgt[t].addChild(CK.ThermalRelaxationModel_ts,CK.ThermalRelaxationModel_s)210cgt[t].addChild(CK.ThermalConductivityModel_ts,CK.ThermalConductivityModel_s)211cgt[t].addChild(CK.TurbulenceModel_ts,CK.TurbulenceModel_s)212cgt[t].addChild(CK.TurbulenceClosure_ts,CK.TurbulenceClosure_s)213cgt[t].addChild(CK.ChemicalKineticsModel_ts,CK.ChemicalKineticsModel_s)214cgt[t].addChild(CK.EMMagneticFieldModel_ts,CK.EMMagneticFieldModel_s)215cgt[t].addChild(CK.EMElectricFieldModel_ts,CK.EMElectricFieldModel_s)216cgt[t].addChild(CK.EMConductivityModel_ts,CK.EMConductivityModel_s)217cgt[t].addChild(CK.Descriptor_ts)218cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)219cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)220cgt[t].addChild(CK.UserDefinedData_ts)221# --------------------------------------------------------222t=CK.GoverningEquations_ts223cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GoverningEquations_s])224cgt[t].shape=(0,)225cgt[t].enumerate=CK.GoverningEquationsType_l226cgt[t].addChild(CK.Descriptor_ts)227cgt[t].addChild(CK.DiffusionModel_ts,CK.DiffusionModel_s)228cgt[t].addChild(CK.UserDefinedData_ts)229# --------------------------------------------------------230t=CK.GasModel_ts231cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GasModel_s])232cgt[t].shape=(0,)233cgt[t].enumerate=CK.GasModelType_l234cgt[t].addChild(CK.Descriptor_ts)235cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)236cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)237cgt[t].addChild(CK.DataArray_ts)238cgt[t].addChild(CK.UserDefinedData_ts)239# --------------------------------------------------------240t=CK.ViscosityModel_ts241cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.ViscosityModel_s])242cgt[t].shape=(0,)243cgt[t].enumerate=CK.ViscosityModelType_l244cgt[t].addChild(CK.Descriptor_ts)245cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)246cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)247cgt[t].addChild(CK.DataArray_ts)248cgt[t].addChild(CK.UserDefinedData_ts)249# --------------------------------------------------------250t=CK.ThermalConductivityModel_ts251cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.ThermalConductivityModel_s])252cgt[t].shape=(0,)253cgt[t].enumerate=CK.ThermalConductivityModelType_l254cgt[t].addChild(CK.Descriptor_ts)255cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)256cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)257cgt[t].addChild(CK.DataArray_ts)258cgt[t].addChild(CK.UserDefinedData_ts)259# --------------------------------------------------------260t=CK.TurbulenceClosure_ts261cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.TurbulenceClosure_s])262cgt[t].shape=(0,)263cgt[t].enumerate=CK.TurbulenceClosureType_l264cgt[t].addChild(CK.Descriptor_ts)265cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)266cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)267cgt[t].addChild(CK.DataArray_ts)268cgt[t].addChild(CK.UserDefinedData_ts)269# --------------------------------------------------------270t=CK.TurbulenceModel_ts271cgt[t]=CGNStype(t)272cgt[t].datatype=[CK.C1]273cgt[t].shape=(0,)274cgt[t].enumerate=CK.TurbulenceModelType_l275cgt[t].addChild(CK.Descriptor_ts)276cgt[t].addChild(CK.DataArray_ts)277cgt[t].addChild(CK.UserDefinedData_ts)278cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)279cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)280cgt[t].addChild(CK.DiffusionModel_ts,CK.DiffusionModel_s)281# --------------------------------------------------------282t=CK.ThermalRelaxationModel_ts283cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.ThermalRelaxationModel_s])284cgt[t].shape=(0,)285cgt[t].enumerate=CK.ThermalRelaxationModelType_l286cgt[t].addChild(CK.Descriptor_ts)287cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)288cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)289cgt[t].addChild(CK.DataArray_ts)290cgt[t].addChild(CK.UserDefinedData_ts)291# --------------------------------------------------------292t=CK.ChemicalKineticsModel_ts293cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.ChemicalKineticsModel_s])294cgt[t].shape=(0,)295cgt[t].enumerate=CK.ChemicalKineticsModelType_l296cgt[t].addChild(CK.Descriptor_ts)297cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)298cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)299cgt[t].addChild(CK.DataArray_ts)300cgt[t].addChild(CK.UserDefinedData_ts)301# --------------------------------------------------------302t=CK.EMElectricFieldModel_ts303cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.EMElectricFieldModel_s])304cgt[t].shape=(0,)305cgt[t].enumerate=CK.EMElectricFieldModelType_l306cgt[t].addChild(CK.Descriptor_ts)307cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)308cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)309cgt[t].addChild(CK.DataArray_ts)310cgt[t].addChild(CK.UserDefinedData_ts)311# --------------------------------------------------------312t=CK.EMMagneticFieldModel_ts313cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.EMMagneticFieldModel_s])314cgt[t].shape=(0,)315cgt[t].enumerate=CK.EMMagneticFieldModelType_l316cgt[t].addChild(CK.Descriptor_ts)317cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)318cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)319cgt[t].addChild(CK.DataArray_ts)320cgt[t].addChild(CK.UserDefinedData_ts)321# --------------------------------------------------------322t=CK.EMConductivityModel_ts323cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.EMConductivityModel_s])324cgt[t].shape=(0,)325cgt[t].enumerate=CK.EMConductivityModelType_l326cgt[t].addChild(CK.Descriptor_ts)327cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)328cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)329cgt[t].addChild(CK.DataArray_ts)330cgt[t].addChild(CK.UserDefinedData_ts)331# --------------------------------------------------------332t=CK.ZoneType_ts333cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.ZoneType_s])334cgt[t].shape=(0,)335cgt[t].enumerate=CK.ZoneType_l336# --------------------------------------------------------337t=CK.SimulationType_ts338cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.SimulationType_s])339cgt[t].shape=(0,)340cgt[t].enumerate=CK.SimulationType_l341# --------------------------------------------------------342t=CK.GridConnectivityType_ts343cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GridConnectivityType_s])344cgt[t].shape=(0,)345cgt[t].enumerate=CK.GridConnectivityType_l346# --------------------------------------------------------347t=CK.Family_ts348cgt[t]=CGNStype(t)349cgt[t].addChild(CK.Descriptor_ts)350cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s)351cgt[t].addChild(CK.FamilyBC_ts)352cgt[t].addChild(CK.GeometryReference_ts)353cgt[t].addChild(CK.RotatingCoordinates_ts,CK.RotatingCoordinates_s)354cgt[t].addChild(CK.UserDefinedData_ts)355# --------------------------------------------------------356t=CK.FamilyName_ts357cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.FamilyName_s])358cgt[t].shape=(0,)359# --------------------------------------------------------360t=CK.AdditionalFamilyName_ts361cgt[t]=CGNStype(t,dtype=[CK.C1])362cgt[t].shape=(0,)363# --------------------------------------------------------364t=CK.FamilyBC_ts365cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.FamilyBC_s])366cgt[t].shape=(0,)367cgt[t].enumerate=CK.BCType_l368cgt[t].addChild(CK.BCDataSet_ts)369# --------------------------------------------------------370t=CK.GeometryReference_ts371cgt[t]=CGNStype(t)372cgt[t].addChild(CK.Descriptor_ts)373cgt[t].addChild(CK.GeometryFile_ts,CK.GeometryFile_s)374cgt[t].addChild(CK.GeometryFormat_ts,CK.GeometryFormat_s)375cgt[t].addChild(CK.GeometryEntity_ts)376cgt[t].addChild(CK.UserDefinedData_ts)377# --------------------------------------------------------378t=CK.GeometryFile_ts379cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GeometryFile_s])380cgt[t].shape=(0,)381# --------------------------------------------------------382t=CK.GeometryFormat_ts383cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GeometryFormat_s])384cgt[t].shape=(0,)385# --------------------------------------------------------386t=CK.GeometryEntity_ts387cgt[t]=CGNStype(t)388# --------------------------------------------------------389t=CK.CGNSTree_ts390cgt[t]=CGNStype(t,names=[CK.CGNSTree_s,UD])391cgt[t].addChild(CK.CGNSLibraryVersion_ts,[CK.CGNSLibraryVersion_s],card=C_11)392cgt[t].addChild(CK.CGNSBase_ts,card=C_0N)393# --------------------------------------------------------394t=CK.CGNSBase_ts395cgt[t]=CGNStype(t,dtype=[CK.I4])396cgt[t].shape=(0,0)397cgt[t].addChild(CK.Zone_ts,card=C_0N)398cgt[t].addChild(CK.SimulationType_ts,[CK.SimulationType_s],card=C_01)399cgt[t].addChild(CK.BaseIterativeData_ts,card=C_01)400cgt[t].addChild(CK.IntegralData_ts,card=C_0N)401cgt[t].addChild(CK.ConvergenceHistory_ts,[CK.GlobalConvergenceHistory_s],card=C_01)402cgt[t].addChild(CK.Family_ts,card=C_0N)403cgt[t].addChild(CK.FlowEquationSet_ts,[CK.FlowEquationSet_s],card=C_01)404cgt[t].addChild(CK.ReferenceState_ts,[CK.ReferenceState_s],card=C_01)405cgt[t].addChild(CK.Axisymmetry_ts,[CK.Axisymmetry_s],card=C_01)406cgt[t].addChild(CK.RotatingCoordinates_ts,[CK.RotatingCoordinates_s],card=C_01)407cgt[t].addChild(CK.Gravity_ts,[CK.Gravity_s],card=C_01)408cgt[t].addChild(CK.DataClass_ts,[CK.DataClass_s],card=C_01)409cgt[t].addChild(CK.DimensionalUnits_ts,[CK.DimensionalUnits_s],card=C_01)410cgt[t].addChild(CK.Descriptor_ts,card=C_0N)411cgt[t].addChild(CK.UserDefinedData_ts,card=C_0N)412# --------------------------------------------------------413t=CK.Zone_ts414cgt[t]=CGNStype(t,dtype=[CK.I4,CK.I8])415cgt[t].shape=(0,3)416cgt[t].addChild(CK.GridCoordinates_ts,card=C_0N)417cgt[t].addChild(CK.DiscreteData_ts,card=C_0N)418cgt[t].addChild(CK.Elements_ts,card=C_0N)419cgt[t].addChild(CK.ZoneBC_ts,CK.ZoneBC_s,card=C_01)420cgt[t].addChild(CK.FlowSolution_ts,card=C_0N)421cgt[t].addChild(CK.ZoneSubRegion_ts,card=C_0N)422cgt[t].addChild(CK.ZoneType_ts,CK.ZoneType_s,card=C_11)423cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s,card=C_01)424cgt[t].addChild(CK.ZoneGridConnectivity_ts,CK.ZoneGridConnectivity_s,card=C_01)425cgt[t].addChild(CK.ZoneIterativeData_ts,card=C_01)426cgt[t].addChild(CK.RigidGridMotion_ts,card=C_0N)427cgt[t].addChild(CK.ReferenceState_ts,CK.ReferenceState_s,card=C_01)428cgt[t].addChild(CK.IntegralData_ts,card=C_0N)429cgt[t].addChild(CK.ArbitraryGridMotion_ts,card=C_0N)430cgt[t].addChild(CK.FamilyName_ts,CK.FamilyName_s,card=C_01)431cgt[t].addChild(CK.AdditionalFamilyName_ts,card=C_0N)432cgt[t].addChild(CK.FlowEquationSet_ts,CK.FlowEquationSet_s,card=C_01)433cgt[t].addChild(CK.ConvergenceHistory_ts,CK.ZoneConvergenceHistory_s,card=C_01)434cgt[t].addChild(CK.RotatingCoordinates_ts,CK.RotatingCoordinates_s,card=C_01)435cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s,card=C_01)436cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s,card=C_01)437cgt[t].addChild(CK.Descriptor_ts,card=C_0N)438cgt[t].addChild(CK.UserDefinedData_ts,card=C_0N)439# --------------------------------------------------------440t=CK.GridCoordinates_ts441cgt[t]=CGNStype(t,names=[CK.GridCoordinates_s,UD])442cgt[t].addChild(CK.DataArray_ts,card=C_0N)443cgt[t].addChild(CK.Rind_ts,CK.Rind_s,card=C_01)444cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s,card=C_01)445cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s,card=C_01)446cgt[t].addChild(CK.Descriptor_ts,card=C_0N)447cgt[t].addChild(CK.UserDefinedData_ts,card=C_0N)448# --------------------------------------------------------449t=CK.ZoneSubRegion_ts450cgt[t]=CGNStype(t,dtype=[CK.I4])451cgt[t].shape=(1,)452cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)453cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s,card=C_01)454cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s,card=C_01)455cgt[t].addChild(CK.FamilyName_ts,CK.FamilyName_s,card=C_01)456cgt[t].addChild(CK.AdditionalFamilyName_ts,card=C_0N)457cgt[t].addChild(CK.DataArray_ts,card=C_0N)458cgt[t].addChild(CK.Rind_ts,CK.Rind_s,card=C_01)459cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s,card=C_01)460cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s,card=C_01)461cgt[t].addChild(CK.Descriptor_ts,[CK.BCRegionName_s,CK.GridConnectivityRegionName_s],card=C_0N)462cgt[t].addChild(CK.UserDefinedData_ts,card=C_0N)463# --------------------------------------------------------464t=CK.Elements_ts465cgt[t]=CGNStype(t,dtype=[CK.I4])466cgt[t].shape=(2,)467cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)468cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)469cgt[t].addChild(CK.DataArray_ts,CK.ElementConnectivity_s,card=C_0N)470cgt[t].addChild(CK.DataArray_ts,CK.ParentElements_s,card=C_01)471cgt[t].addChild(CK.DataArray_ts,CK.ParentElementsPosition_s,card=C_01)472cgt[t].addChild(CK.DataArray_ts,CK.ParentData_s,card=C_01)473cgt[t].addChild(CK.Rind_ts,CK.Rind_s,card=C_01)474cgt[t].addChild(CK.Descriptor_ts,card=C_0N)475cgt[t].addChild(CK.UserDefinedData_ts,card=C_0N)476# --------------------------------------------------------477t=CK.Axisymmetry_ts478cgt[t]=CGNStype(t,names=[CK.Axisymmetry_s])479cgt[t].addChild(CK.DataArray_ts,CK.AxisymmetryReferencePoint_s)480cgt[t].addChild(CK.DataArray_ts,CK.AxisymmetryAxisVector_s)481cgt[t].addChild(CK.DataArray_ts,CK.AxisymmetryAngle_s)482cgt[t].addChild(CK.DataArray_ts,CK.CoordinateNames_s)483cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)484cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)485cgt[t].addChild(CK.Descriptor_ts)486cgt[t].addChild(CK.UserDefinedData_ts)487# --------------------------------------------------------488t=CK.RotatingCoordinates_ts489cgt[t]=CGNStype(t,names=[CK.RotatingCoordinates_s])490cgt[t].addChild(CK.DataArray_ts,CK.RotationCenter_s)491cgt[t].addChild(CK.DataArray_ts,CK.RotationRateVector_s)492cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)493cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)494cgt[t].addChild(CK.Descriptor_ts)495cgt[t].addChild(CK.UserDefinedData_ts)496# --------------------------------------------------------497t=CK.FlowSolution_ts498cgt[t]=CGNStype(t)499cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)500cgt[t].addChild(CK.DataArray_ts)501cgt[t].addChild(CK.Rind_ts,CK.Rind_s)502cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)503cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)504cgt[t].addChild(CK.Descriptor_ts)505cgt[t].addChild(CK.UserDefinedData_ts)506# --------------------------------------------------------507t=CK.DiscreteData_ts508cgt[t]=CGNStype(t)509cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)510cgt[t].addChild(CK.DataArray_ts)511cgt[t].addChild(CK.Rind_ts,CK.Rind_s)512cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)513cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)514cgt[t].addChild(CK.Descriptor_ts)515cgt[t].addChild(CK.UserDefinedData_ts)516# --------------------------------------------------------517t=CK.ZoneBC_ts518cgt[t]=CGNStype(t,names=[CK.ZoneBC_s])519cgt[t].addChild(CK.BC_ts)520cgt[t].addChild(CK.ReferenceState_ts,CK.ReferenceState_s)521cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)522cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)523cgt[t].addChild(CK.Descriptor_ts)524cgt[t].addChild(CK.UserDefinedData_ts)525# --------------------------------------------------------526t=CK.BCProperty_ts527cgt[t]=CGNStype(t,names=[CK.BCProperty_s])528cgt[t].addChild(CK.Descriptor_ts)529cgt[t].addChild(CK.UserDefinedData_ts)530cgt[t].addChild(CK.WallFunction_ts,CK.WallFunction_s)531cgt[t].addChild(CK.Area_ts,CK.Area_s)532# --------------------------------------------------------533t=CK.BCData_ts534cgt[t]=CGNStype(t,names=[CK.DirichletData_s,CK.NeumannData_s])535cgt[t].addChild(CK.DataArray_ts)536cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)537cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)538cgt[t].addChild(CK.Descriptor_ts)539cgt[t].addChild(CK.UserDefinedData_ts)540# --------------------------------------------------------541t=CK.BCDataSet_ts542cgt[t]=CGNStype(t,dtype=[CK.C1])543cgt[t].enumerate=CK.BCTypeSimple_l544cgt[t].addChild(CK.BCData_ts,CK.NeumannData_s)545cgt[t].addChild(CK.BCData_ts,CK.DirichletData_s)546cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)547cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)548cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)549cgt[t].addChild(CK.Descriptor_ts)550cgt[t].addChild(CK.ReferenceState_ts,CK.ReferenceState_s)551cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)552cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)553cgt[t].addChild(CK.UserDefinedData_ts)554# --------------------------------------------------------555t=CK.BC_ts556cgt[t]=CGNStype(t,dtype=[CK.C1])557cgt[t].enumerate=CK.BCType_l558cgt[t].shape=(0,)559cgt[t].addChild(CK.ReferenceState_ts,CK.ReferenceState_s)560cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)561cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)562cgt[t].addChild(CK.Descriptor_ts)563cgt[t].addChild(CK.UserDefinedData_ts)564cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s)565cgt[t].addChild(CK.FamilyName_ts,CK.FamilyName_s)566cgt[t].addChild(CK.AdditionalFamilyName_ts,card=C_0N)567cgt[t].addChild(CK.IndexArray_ts,CK.InwardNormalList_s)568cgt[t].addChild(CK.BCDataSet_ts)569cgt[t].addChild(CK.InwardNormalIndex_ts,CK.InwardNormalIndex_s)570cgt[t].addChild(CK.IndexArray_ts,CK.ElementList_s)571cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)572cgt[t].addChild(CK.IndexRange_ts,CK.ElementRange_s)573cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)574cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)575cgt[t].addChild(CK.BCProperty_ts,CK.BCProperty_s)576# --------------------------------------------------------577t=CK.ArbitraryGridMotionType_ts578cgt[t]=CGNStype(t,dtype=[CK.C1],579 names=[CK.ArbitraryGridMotionType_s])580cgt[t].shape=(0,)581# --------------------------------------------------------582t=CK.RigidGridMotionType_ts583cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.RigidGridMotionType_s])584cgt[t].shape=(0,)585# --------------------------------------------------------586t=CK.WallFunctionType_ts587cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.WallFunctionType_s])588cgt[t].shape=(0,)589# --------------------------------------------------------590t=CK.WallFunction_ts591cgt[t]=CGNStype(t,names=[CK.WallFunction_s])592cgt[t].addChild(CK.Descriptor_ts)593cgt[t].addChild(CK.UserDefinedData_ts)594cgt[t].addChild(CK.WallFunctionType_ts,CK.WallFunctionType_s)595# --------------------------------------------------------596t=CK.AreaType_ts597cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.AreaType_s])598cgt[t].shape=(0,)599# --------------------------------------------------------600t=CK.Area_ts601cgt[t]=CGNStype(t,names=[CK.Area_s])602cgt[t].addChild(CK.Descriptor_ts)603cgt[t].addChild(CK.UserDefinedData_ts)604cgt[t].addChild(CK.AreaType_ts,CK.AreaType_s)605cgt[t].addChild(CK.DataArray_ts,CK.SurfaceArea_s)606cgt[t].addChild(CK.DataArray_ts,CK.RegionName_s)607# --------------------------------------------------------608t=CK.BaseIterativeData_ts609cgt[t]=CGNStype(t,dtype=[CK.I4])610cgt[t].shape=(1,)611cgt[t].addChild(CK.DataClass_ts,[CK.DataClass_s],card=C_01)612cgt[t].addChild(CK.DimensionalUnits_ts,[CK.DimensionalUnits_s],card=C_01)613cgt[t].addChild(CK.Descriptor_ts)614cgt[t].addChild(CK.UserDefinedData_ts)615cgt[t].addChild(CK.DataArray_ts)616# --------------------------------------------------------617t=CK.ZoneIterativeData_ts618cgt[t]=CGNStype(t)619cgt[t].addChild(CK.DataClass_ts,[CK.DataClass_s],card=C_01)620cgt[t].addChild(CK.DimensionalUnits_ts,[CK.DimensionalUnits_s],card=C_01)621cgt[t].addChild(CK.Descriptor_ts)622cgt[t].addChild(CK.UserDefinedData_ts)623cgt[t].addChild(CK.DataArray_ts,[CK.RigidGridMotionPointers_s,624 CK.ArbitraryGridMotionPointers_s,625 CK.FlowSolutionPointers_s,626 CK.ZoneGridConnectivityPointers_s,627 CK.ZoneSubRegionPointers_s])628# --------------------------------------------------------629t=CK.RigidGridMotion_ts630cgt[t]=CGNStype(t,dtype=[CK.C1])631cgt[t].shape=(0,)632cgt[t].enumerate=CK.RigidGridMotionType_l633cgt[t].addChild(CK.DataClass_ts,[CK.DataClass_s],card=C_01)634cgt[t].addChild(CK.DimensionalUnits_ts,[CK.DimensionalUnits_s],card=C_01)635cgt[t].addChild(CK.Descriptor_ts)636cgt[t].addChild(CK.UserDefinedData_ts)637cgt[t].addChild(CK.DataArray_ts,[CK.OriginLocation_s,638 CK.RigidRotationAngle_s,639 CK.RigidRotationRate_s,640 CK.RigidVelocity_s])641# --------------------------------------------------------642t=CK.ArbitraryGridMotion_ts643cgt[t]=CGNStype(t,dtype=[CK.C1])644cgt[t].shape=(0,)645cgt[t].enumerate=CK.ArbitraryGridMotionType_l646cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)647cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)648cgt[t].addChild(CK.Descriptor_ts)649cgt[t].addChild(CK.UserDefinedData_ts)650cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)651cgt[t].addChild(CK.Rind_ts,CK.Rind_s)652cgt[t].addChild(CK.DataArray_ts)653# --------------------------------------------------------654t=CK.ZoneGridConnectivity_ts655cgt[t]=CGNStype(t,names=[CK.ZoneGridConnectivity_s])656cgt[t].addChild(CK.GridConnectivity1to1_ts)657cgt[t].addChild(CK.GridConnectivity_ts)658cgt[t].addChild(CK.OversetHoles_ts)659cgt[t].addChild(CK.Descriptor_ts)660cgt[t].addChild(CK.UserDefinedData_ts)661# --------------------------------------------------------662t=CK.GridConnectivityProperty_ts663cgt[t]=CGNStype(t,names=[CK.GridConnectivityProperty_s])664cgt[t].addChild(CK.Descriptor_ts)665cgt[t].addChild(CK.UserDefinedData_ts)666cgt[t].addChild(CK.Periodic_ts,CK.Periodic_s)667cgt[t].addChild(CK.AverageInterface_ts,CK.AverageInterface_s)668# --------------------------------------------------------669t=CK.Periodic_ts670cgt[t]=CGNStype(t,names=[CK.Periodic_s])671cgt[t].addChild(CK.DataClass_ts,CK.DataClass_s)672cgt[t].addChild(CK.DimensionalUnits_ts,CK.DimensionalUnits_s)673cgt[t].addChild(CK.Descriptor_ts)674cgt[t].addChild(CK.UserDefinedData_ts)675cgt[t].addChild(CK.DataArray_ts,CK.RotationCenter_s)676cgt[t].addChild(CK.DataArray_ts,CK.RotationAngle_s)677cgt[t].addChild(CK.DataArray_ts,CK.Translation_s)678# --------------------------------------------------------679t=CK.AverageInterfaceType_ts680cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.AverageInterfaceType_s])681cgt[t].shape=(0,)682# --------------------------------------------------------683t=CK.AverageInterface_ts684cgt[t]=CGNStype(t,names=[CK.AverageInterface_s])685cgt[t].addChild(CK.Descriptor_ts)686cgt[t].addChild(CK.UserDefinedData_ts)687cgt[t].addChild(CK.AverageInterfaceType_ts,CK.AverageInterfaceType_s)688# --------------------------------------------------------689t=CK.GridConnectivity1to1_ts690cgt[t]=CGNStype(t,dtype=[CK.C1])691cgt[t].shape=(0,)692cgt[t].addChild(CK.Transform_ts,CK.Transform_s)693cgt[t].addChild(CK.IntIndexDimension_ts,CK.Transform_s)694cgt[t].addChild(CK.Transform_ts2,CK.Transform_s)695cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)696cgt[t].addChild(CK.IndexRange_ts,CK.PointRangeDonor_s)697cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s)698cgt[t].addChild(CK.GridConnectivityProperty_ts,CK.GridConnectivityProperty_s)699cgt[t].addChild(CK.Descriptor_ts)700cgt[t].addChild(CK.UserDefinedData_ts)701# --------------------------------------------------------702t=CK.GridConnectivityType_ts703cgt[t]=CGNStype(t,dtype=[CK.C1],names=[CK.GridConnectivityType_s])704cgt[t].shape=(0,)705# --------------------------------------------------------706t=CK.GridConnectivity_ts707cgt[t]=CGNStype(t,dtype=[CK.C1])708cgt[t].shape=(0,)709cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)710cgt[t].addChild(CK.Ordinal_ts,CK.Ordinal_s)711cgt[t].addChild(CK.Descriptor_ts)712cgt[t].addChild(CK.IndexRange_ts,CK.PointRange_s)713cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)714cgt[t].addChild(CK.IndexArray_ts,CK.PointListDonor_s)715cgt[t].addChild(CK.IndexArray_ts,CK.CellListDonor_s)716cgt[t].addChild(CK.GridConnectivityProperty_ts,CK.GridConnectivityProperty_s)717cgt[t].addChild(CK.GridConnectivityType_ts,CK.GridConnectivityType_s)718cgt[t].addChild(CK.DataArray_ts,CK.InterpolantsDonor_s)719cgt[t].addChild(CK.UserDefinedData_ts)720# --------------------------------------------------------721t=CK.OversetHoles_ts722cgt[t]=CGNStype(t)723cgt[t].addChild(CK.Descriptor_ts)724cgt[t].addChild(CK.IndexArray_ts,CK.PointList_s)725cgt[t].addChild(CK.GridLocation_ts,CK.GridLocation_s)726cgt[t].addChild(CK.IndexRange_ts)727cgt[t].addChild(CK.UserDefinedData_ts)728# --------------------------------------------------------729types=cgt730tk=types.keys()731tk.sort()732for pk in tk:733 for ck in tk:734 if ((ck!=pk) and (types[pk].hasChild(ck))):735 types[ck].addParent(pk)736 ...

Full Screen

Full Screen

compare.py

Source:compare.py Github

copy

Full Screen

...28 #reference to related object29 self._ref = ref30 self._changes = changes31 self._children = []32 def addChild(self, child):33 self._children.append(child)34def propagateChanges(res):35 change = 036 for child in res._children:37 change += propagateChanges(child)38 if change != 0:39 res._result = "changed"40 if res._result != "equal":41 return 142 else:43 return 044def compareDb(db1, db2, ignore = None):45 result = compareResult() 46 for f1 in db1._fl._list:47 f2 = db2.frameById(f1._Id)48 if f2 is None:49 result.addChild(compareResult("deleted", "FRAME", f1))50 else:51 result.addChild(compareFrame(f1, f2, ignore))52 for f2 in db2._fl._list:53 f1 = db1.frameById(f2._Id)54 if f1 is None:55 result.addChild(compareResult("added", "FRAME", f2))56 if ignore is not None and "ATTRIBUTE" in ignore and ignore["ATTRIBUTE"] == "*":57 pass58 else:59 result.addChild(compareAttributes(db1, db2, ignore))60 61 for bu1 in db1._BUs._list:62 bu2 = db2.boardUnitByName(bu1._name)63 if bu2 is None:64 result.addChild(compareResult("deleted", "ecu", bu1))65 else:66 result.addChild(compareBu(bu1, bu2, ignore))67 for bu2 in db2._BUs._list:68 bu1 = db1.boardUnitByName(bu2._name)69 if bu1 is None:70 result.addChild(compareResult("added", "ecu", bu2))71 72 if ignore is not None and "DEFINE" in ignore and ignore["DEFINE"] == "*":73 pass74 else:75 result.addChild(compareDefineList(db1._globalDefines, db2._globalDefines))76 temp = compareDefineList(db1._buDefines, db2._buDefines)77 temp._type = "ECU Defines"78 result.addChild(temp)79 temp = compareDefineList(db1._frameDefines, db2._frameDefines)80 temp._type = "Frame Defines"81 result.addChild(temp)82 temp = compareDefineList(db1._signalDefines, db2._signalDefines)83 temp._type = "Signal Defines"84 result.addChild(temp)85 for vt1 in db1._valueTables:86 if vt1 not in db2._valueTables:87 result.addChild(compareResult("deleted", "valuetable " + vt1, db1._valueTables))88 else:89 result.addChild(compareValueTable(db1._valueTables[vt1], db2._valueTables[vt1]))90 91 92 for vt2 in db2._valueTables:93 if vt2 not in db1._valueTables:94 result.addChild(compareResult("added", "valuetable " + vt2, db2._valueTables))95 propagateChanges(result)96 return result97def compareValueTable(vt1, vt2):98 result = compareResult("equal", "Valuetable", vt1)99 for value in vt1:100 if value not in vt2:101 result.addChild(compareResult("removed", "Value " + str(value), vt1[value]))102 elif vt1[value] != vt2[value]:103 result.addChild(compareResult("changed", "Value " + str(value) + " " + str(vt1[value]), [vt1[value], vt2[value]])) 104 for value in vt2:105 if value not in vt1:106 result.addChild(compareResult("added", "Value " + str(value), vt2[value]))107 return result108def compareSignalGroup(sg1, sg2):109 result = compareResult("equal", "SignalGroup", sg1)110 if sg1._name != sg2._name:111 result.addChild(compareResult("changed", "SignalName", [sg1._name, sg2._name] ))112 if sg1._Id != sg2._Id:113 result.addChild(compareResult("changed", "SignalName", [str(sg1._Id), str(sg2._Id)] ))114 if sg1._members == None or sg2._members == None:115 print "Strange - sg wo members???"116 return result117 for member in sg1._members:118 if sg2.byName(member._name) is None:119 result.addChild(compareResult("deleted", str(member._name), member))120 for member in sg2._members:121 if sg1.byName(member._name) is None:122 result.addChild(compareResult("added", str(member._name), member))123 return result 124 125def compareDefineList(d1list, d2list):126 result = compareResult("equal", "DefineList", d1list)127 for definition in d1list:128 if definition not in d2list:129 result.addChild(compareResult("deleted", "Define" + str(definition), d1list))130 else:131 d2 = d2list[definition]132 d1 = d1list[definition]133 if d1._definition != d2._definition:134 result.addChild(compareResult("changed", "Definition", d1._definition, [d1._definition, d2._definition] ))135 if d1._defaultValue != d2._defaultValue:136 result.addChild(compareResult("changed", "DefaultValue", d1._definition, [d1._defaultValue, d2._defaultValue] ))137 for definition in d2list:138 if definition not in d1list:139 result.addChild(compareResult("added", "Define" + str(definition), d2list))140 return result141 142def compareAttributes(ele1, ele2, ignore = None):143 result = compareResult("equal", "ATTRIBUTES", ele1) 144 if ignore is not None and "ATTRIBUTE" in ignore and (ignore["ATTRIBUTE"] == "*" or ignore["ATTRIBUTE"] == ele1): 145 return result 146 for attribute in ele1._attributes:147 if attribute not in ele2._attributes:148 result.addChild(compareResult("deleted", str(attribute), ele1._attributes[attribute]))149 elif ele1._attributes[attribute] != ele2._attributes[attribute]:150 result.addChild(compareResult("changed", str(attribute), ele1._attributes[attribute], [ ele1._attributes[attribute] , ele2._attributes[attribute]] ))151 for attribute in ele2._attributes:152 if attribute not in ele1._attributes:153 result.addChild(compareResult("added", str(attribute), ele2._attributes[attribute]))154 return result155 156def compareBu(bu1, bu2, ignore=None):157 result = compareResult("equal", "ECU", bu1)158 if bu1._comment != bu2._comment:159 result.addChild(compareResult("changed", "ECU", bu1, [ bu1._comment, bu2._comment]))160 if ignore is not None and "ATTRIBUTE" in ignore and ignore["ATTRIBUTE"] == "*":161 pass162 else:163 result.addChild(compareAttributes(bu1, bu2, ignore))164 return result165 166def compareFrame(f1, f2, ignore= None):167 result = compareResult("equal", "FRAME", f1)168 for s1 in f1._signals:169 s2 = f2.signalByName(s1._name)170 if not s2:171 result.addChild(compareResult("deleted", "SIGNAL", s1))172 else:173 result.addChild(compareSignal(s1, s2, ignore))174 if f1._name != f2._name:175 result.addChild(compareResult("changed", "Name", f1, [f1._name, f2._name]))176 if f1._Size != f2._Size:177 result.addChild(compareResult("changed", "dlc", f1, ["dlc: %d" % f1._Size, "dlc: %d" % f2._Size]))178 if f1._extended != f2._extended:179 result.addChild(compareResult("changed", "FRAME", f1, ["extended-Flag: %d" % f1._extended, "extended-Flag: %d" % f2._extended]))180 if f2._comment == None:181 f2._comment = "" 182 if f1._comment == None:183 f1._comment = "" 184 if f1._comment != f2._comment:185 result.addChild(compareResult("changed", "FRAME", f1, ["comment: " + f1._comment , "comment: " + f2._comment]))186 187 for s2 in f2._signals:188 s1 = f1.signalByName(s2._name)189 if not s1:190 result.addChild(compareResult("added", "SIGNAL", s2))191 if ignore is not None and "ATTRIBUTE" in ignore and ignore["ATTRIBUTE"] == "*": 192 pass193 else:194 result.addChild(compareAttributes(f1, f2, ignore))195 for transmitter in f1._Transmitter:196 if transmitter not in f2._Transmitter:197 result.addChild(compareResult("removed", "Frame-Transmitter", f1))198 for transmitter in f2._Transmitter:199 if transmitter not in f1._Transmitter:200 result.addChild(compareResult("added", "Frame-Transmitter", f2))201 for sg1 in f1._SignalGroups:202 sg2 = f2.signalGroupbyName(sg1._name)203 if sg2 is None:204 result.addChild(compareResult("removed", "Signalgroup", sg1))205 else:206 result.addChild(compareSignalGroup(sg1,sg2))207 for sg2 in f2._SignalGroups:208 if f1.signalGroupbyName(sg2._name) is None:209 result.addChild(compareResult("added", "Signalgroup", sg1))210 return result211def compareSignal(s1,s2, ignore = None):212 result = compareResult("equal", "SIGNAL", s1)213 if s1._startbit != s2._startbit:214 result.addChild(compareResult("changed", "startbit", s1, [" %d" % s1._startbit, " %d" % s2._startbit]))215 if s1._signalsize != s2._signalsize:216 result.addChild(compareResult("changed", "signalsize", s1, [" %d" % s1._signalsize, " %d" % s2._signalsize]))217 if s1._factor != s2._factor:218 result.addChild(compareResult("changed", "factor", s1, [s1._factor, s2._factor]))219 if s1._offset != s2._offset:220 result.addChild(compareResult("changed", "offset", s1, [ s1._offset, s2._offset]))221 if s1._min != s2._min:222 result.addChild(compareResult("changed", "min", s1, [ s1._min, s2._min]))223 if s1._max != s2._max:224 result.addChild(compareResult("changed", "max", s1, [ s1._max, s2._max]))225 if s1._byteorder != s2._byteorder:226 result.addChild(compareResult("changed", "byteorder", s1, [" %d" % s1._byteorder, " %d" % s2._byteorder]))227 if s1._valuetype != s2._valuetype:228 result.addChild(compareResult("changed", "valuetype", s1, [" %d" % s1._valuetype, " %d" % s2._valuetype]))229 if s1._multiplex != s2._multiplex:230 result.addChild(compareResult("changed", "multiplex", s1, [str(s1._multiplex), str(s2._multiplex)]))231 if s1._unit != s2._unit:232 result.addChild(compareResult("changed", "unit", s1, [ s1._unit, s2._unit]))233 if s1._comment is not None and s2._comment is not None and s1._comment != s2._comment:234 if s1._comment.replace("\n"," ") != s2._comment.replace("\n"," "):235 result.addChild(compareResult("changed", "comment", s1, [ s1._comment, s2._comment]))236 else:237 result.addChild(compareResult("changed", "comment", s1, ["only whitespaces differ", ""]))238 for reciever in s1._reciever:239 if reciever not in s2._reciever:240 result.addChild(compareResult("removed", "Reciever " + reciever, s1._reciever))241 for reciever in s2._reciever:242 if reciever not in s1._reciever:243 result.addChild(compareResult("added", "Reciever " + reciever, s1._reciever))244 if ignore is not None and "ATTRIBUTE" in ignore and ignore["ATTRIBUTE"] == "*":245 pass246 else:247 result.addChild(compareAttributes(s1, s2, ignore))248 result.addChild(compareValueTable(s1._values,s2._values))249 ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful