Skip to content

Commit

Permalink
Final cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonPacewic committed Jun 20, 2024
1 parent 8907702 commit 4b5f889
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
6 changes: 3 additions & 3 deletions exporter/SynthesisFusionAddin/src/Analytics/poster.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def __send(self, body) -> bool:
try:
# define user agent so this works
headers = {}
headers[
"User-Agent"
] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
headers["User-Agent"] = (
"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
)

# print(f"{self.url}/collect?{body}")

Expand Down
31 changes: 18 additions & 13 deletions exporter/SynthesisFusionAddin/src/Parser/ExporterOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ class ExporterOptions:
joints: list[Joint] = field(default=None)
gamepieces: list[Gamepiece] = field(default=None)
preferredUnits: PreferredUnits = field(default=PreferredUnits.IMPERIAL)
robotWeight: float = field(
default=0.0
) # Always stored in kg regardless of 'preferredUnits'

# Always stored in kg regardless of 'preferredUnits'
robotWeight: float = field(default=0.0)

compressOutput: bool = field(default=True)
exportAsPart: bool = field(default=False)

Expand Down Expand Up @@ -120,16 +121,20 @@ def writeToDesign(self) -> None:
default=lambda obj: (
obj.value
if isinstance(obj, Enum)
else {
key: (
lambda value: value
if not isinstance(value, Enum)
else value.value
)(value)
for key, value in obj.__dict__.items()
}
if hasattr(obj, "__dict__")
else obj
else (
{
key: (
lambda value: (
value
if not isinstance(value, Enum)
else value.value
)
)(value)
for key, value in obj.__dict__.items()
}
if hasattr(obj, "__dict__")
else obj
)
),
indent=4,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ def __parseChildOccurrence(
if options.exportMode == ExporterOptions.ExportMode.FIELD:
for x in options.gamepieces:
if x.occurrenceToken == mapConstant:
partsData.part_definitions[
part.part_definition_reference
].dynamic = True
partsData.part_definitions[part.part_definition_reference].dynamic = (
True
)
break

part.transform.spatial_matrix.extend(occurrence.transform.asArray())
Expand Down
18 changes: 9 additions & 9 deletions exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -1833,22 +1833,22 @@ def notify(self, args):
gamepieceConfig.isVisible = False
weightTableInput.isVisible = True

addFieldInput.isEnabled = (
wheelConfig.isVisible
) = jointConfig.isVisible = True
addFieldInput.isEnabled = wheelConfig.isVisible = (
jointConfig.isVisible
) = True

elif modeDropdown.selectedItem.index == 1:
if gamepieceConfig:
gm.ui.activeSelections.clear()
gm.app.activeDocument.design.rootComponent.opacity = 1

addWheelInput.isEnabled = (
addJointInput.isEnabled
) = gamepieceConfig.isVisible = True
addWheelInput.isEnabled = addJointInput.isEnabled = (
gamepieceConfig.isVisible
) = True

jointConfig.isVisible = (
wheelConfig.isVisible
) = weightTableInput.isVisible = False
jointConfig.isVisible = wheelConfig.isVisible = (
weightTableInput.isVisible
) = False

elif cmdInput.id == "joint_config":
gm.app.activeDocument.design.rootComponent.opacity = 1
Expand Down

0 comments on commit 4b5f889

Please sign in to comment.