你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Fix bug when comparing materials
- The functions for comparing materials assumed non compound materials always have a numerical ID less than compound materials. This is usually true, but not always. E.g. when using the add_surface_water user object. This can create the 'water' material after compound materials have been created by a fractal box
这个提交包含在:
@@ -72,8 +72,10 @@ class Material:
|
||||
)
|
||||
elif self.is_compound_material() and value.is_compound_material():
|
||||
return self.ID < value.ID
|
||||
elif not self.is_compound_material() and not value.is_compound_material():
|
||||
return self.numID < value.numID
|
||||
else:
|
||||
return value.is_compound_material() or self.numID < value.numID
|
||||
return value.is_compound_material()
|
||||
|
||||
def __gt__(self, value: "Material") -> bool:
|
||||
"""Greater than comparator for two Materials.
|
||||
@@ -89,8 +91,10 @@ class Material:
|
||||
)
|
||||
elif self.is_compound_material() and value.is_compound_material():
|
||||
return self.ID > value.ID
|
||||
elif not self.is_compound_material() and not value.is_compound_material():
|
||||
return self.numID > value.numID
|
||||
else:
|
||||
return self.is_compound_material() or self.numID > value.numID
|
||||
return self.is_compound_material()
|
||||
|
||||
def is_compound_material(self) -> bool:
|
||||
"""Check if a material is a compound material.
|
||||
|
在新工单中引用
屏蔽一个用户