-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bjorn/cnx 829 add root object builder and create collection structure #435
bjorn/cnx 829 add root object builder and create collection structure #435
Conversation
- Implemented ETABSShared projects for Connectors and Converters to account for ETABS specific things that SAP 2000 doesn't account for such as levels or frames being further classified as Column, Beam or Brace or shells as wall or floor
- POC for ETABS collection structure - Logic for getting further classificiations of Frames as either Column, Beam or Brace - Same for Shells: either Wall or Floor etc. - Placeholders for object properties
- Putting thoughts to "paper" - A lot of the TODOs will be part of next milestone
…ate-collection-structure
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #435 +/- ##
=====================================
Coverage 9.45% 9.45%
=====================================
Files 223 223
Lines 4199 4199
Branches 483 483
=====================================
Hits 397 397
Misses 3786 3786
Partials 16 16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a neat PR! Thanks for many notes and TODOs. you know already next steps!
My comments are mostly questions, willing to understand some needs better.
{ | ||
protected override HostAppVersion GetVersion() => HostAppVersion.v2021; | ||
protected override HostAppVersion GetVersion() => HostAppVersion.v2021; // TODO: We need a v21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be forgotten adding v21
and v22
before release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// TODO: This is gross. Too many strings. Improve as part of next milestone. Out of scope of "First Send". | ||
private string GetObjectType(Base convertedObject, Dictionary<string, object>? properties) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit confused on why we mutate properties on collection manager instead of converter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Probably better to add a collection parameter during the conversions and just simply use that on the collection manager to group (and not mix design concerns)
// TODO: This is gross. Too many strings. Improve as part of next milestone. Out of scope of "First Send". | ||
public override Collection AddObjectCollectionToRoot(Base convertedObject, Collection rootObject) | ||
{ | ||
var properties = convertedObject["properties"] as Dictionary<string, object>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, why we need properties in collection manager? this looks like anti-pattern with other connectors. happy to chat and understand if i am missing something on ETABS side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely room for improvement here. Happy to sync
Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs
Outdated
Show resolved
Hide resolved
{ | ||
// frame points | ||
// TODO: Better exception handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally you should not necessarily handle exceptions here in typed converters. We handle conversion exceptions on RootObjectBuilders to report them UI. see here . But not sure you have special cases around line, let me know if so, i would like to know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 => new CSiSolidWrapper { Name = name }, | ||
7 => new CSiLinkWrapper { Name = name }, | ||
6 => new CSiSolidWrapper { Name = name }, // TODO: CSiSolidWrapper | ||
7 => new CSiLinkWrapper { Name = name }, // TODO: CSiLinkWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious on this wrappers. Do they needed to detect different objects in converters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, a bit of a workaround, since the API doesn't give us the instances, we can only query the selection.
So here we don't get objects, but an int
telling us what objectType
it is and an objectName
which is unique for that objectType
only. So, in order to be able to ResolveConverter
we need to wrap this info into an "object" that keeps Etabs / Csi name
and type
dependencies.
else if (target is CSiShellWrapper) | ||
{ | ||
_ = _settingsStore.Current.SapModel.AreaObj.GetGUID(target.Name, ref applicationId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess we have assumption here if the target
is unknown, we let applicationId as empty string. Just a side note for later, applicationIds are important once you start to get automation results in ETABS UI to be able highlight them etc. But this is maybe for later. For now it is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! We have it earmarked for next milestone, here CNX-881. I am currently not happy with the state of applicationId
. It is currently this way because Etabs doesn't use those when querying the model, but the name
, so I haven't paid much attention to it.
return properties; | ||
} | ||
|
||
private void AddCommonClassProperties(CSiFrameWrapper frame, Dictionary<string, object> properties) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will let @clairekuang to judge mutating properties on abstract class, bc we were doing them with some extractors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure just a placeholder for now. We discussed for CNX-882 how to do it better, so changes are coming on these definitions.
Description & motivation
Changes:
Screenshots:
Testing stream here.
Validation of changes:
Checklist: