feat(wafer): introduce layout metadata modeling and shape resolution helpers
- Define WaferLayout subclass to wrap sensor lists with shape and size attributes. - Add resolve_shape_and_size resolver to infer wafer shape/size from filename prefix or sensor count. - Update Sensor dataclass to support dynamic side alignments and coordinates offsets. - Expose waferShape and waferSize properties from SessionController for QML data-bindings.
This commit is contained in:
@@ -25,8 +25,8 @@ class CSVFileMetadata:
|
||||
try:
|
||||
return datetime.strptime(self.date, date_format)
|
||||
except (ValueError, TypeError):
|
||||
# If format is wrong or date is None, return current time
|
||||
return datetime.now()
|
||||
# If format is wrong or date is None, return None
|
||||
return None
|
||||
|
||||
# ===== Formatting =====
|
||||
@staticmethod
|
||||
@@ -48,4 +48,5 @@ class CSVFileMetadata:
|
||||
|
||||
def string_date_format(self) -> str:
|
||||
"""Helper to ensure the date is always a string for JSON."""
|
||||
return self.format_date(self.get_date())
|
||||
dt = self.get_date()
|
||||
return self.format_date(dt) if dt else self.date
|
||||
|
||||
Reference in New Issue
Block a user