-
Notifications
You must be signed in to change notification settings - Fork 11
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
GSAGH-497 - GsaGH creates releases opposite to what is defined using 'Edit element/member' component #721
base: main
Are you sure you want to change the base?
Conversation
…'Edit element/member' component
GsaGH/Helpers/GH/ReplaceParam.cs
Outdated
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.
why we need this update?
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.
Update is required as opening file will have info of GsaBool6Parameter but that does not know how to parse "FFFRRR" as those cast has been removed from GsaBool6Parameter.
GsaGH/Helpers/StringExtension.cs
Outdated
} else if (mystring == "release" || mystring == "released" || mystring == "hinge" | ||
|| mystring == "hinged" || mystring == "charnier") { |
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.
wrap with a method or two. IsHinged(), IsReleased()
GsaGH/Helpers/StringExtension.cs
Outdated
if (FindString(booleanString, "x☐") || FindString(booleanString, "x✓") | ||
|| FindString(booleanString, "y☐") || FindString(booleanString, "y✓") | ||
|| FindString(booleanString, "z☐") || FindString(booleanString, "z✓") | ||
|| FindString(booleanString, "xx☐") || FindString(booleanString, "xx✓") | ||
|| FindString(booleanString, "yy☐") || FindString(booleanString, "yy✓") | ||
|| FindString(booleanString, "zz☐") || FindString(booleanString, "zz✓")) { | ||
|
||
input.X = FindString(booleanString, "x✓"); | ||
input.Y = FindString(booleanString, "y✓"); | ||
input.Z = FindString(booleanString, "z✓"); | ||
input.Xx = FindString(booleanString, "xx✓"); | ||
input.Yy = FindString(booleanString, "yy✓"); | ||
input.Zz = FindString(booleanString, "zz✓"); | ||
return true; |
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 do we check this? Can we not check the True / False values instead?
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.
Did we not said to create a common ancestor for GsaReleaseParameter and GsaRestrainParameter?
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.
Is this what you are expecting i.e. Parameter inherited from GsaBool6Goo? https://github.com/arup-group/GSA-Grasshopper/pull/721/files#diff-2146e40799484c09b42c0927d6f7fcb4a9490500c84cc3c0b360a3c019ecd183
…GsaBool6Parameter
CI |
@@ -36,5 +38,63 @@ public static string UnsupportedValue(GH_ObjectWrapper ghTypeWrapper) { | |||
type = type.Replace("Goo", string.Empty); | |||
return type; | |||
} | |||
|
|||
public static void UpdateReleaseBool6Parameter(this GH_ComponentParamServer parameters) { |
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.
why not 2 methods? one for input and one for output
} | ||
} | ||
|
||
public static void UpdateRestrainedBool6Parameter(this GH_ComponentParamServer parameters) { |
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.
as above
@@ -83,5 +88,67 @@ public void DuplicateTest(bool x, bool y, bool z, bool xx, bool yy, bool zz) { | |||
Assert.Equal(yy, original.Yy); | |||
Assert.Equal(zz, original.Zz); | |||
} | |||
|
|||
[Fact] | |||
public void ReleaseParameterInfoIsCorrect() { |
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.
split to include one assert per test
|
||
//restraint is the opposite of release | ||
output = StringExtension.ParseRestrain(text); | ||
Assert.Equal(!releaseBool6, output); |
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.
as above
@@ -30,6 +30,17 @@ public static GH_OasysComponent ComponentMother() { | |||
return comp; | |||
} | |||
|
|||
internal static void CompareRelease(GsaBool6 input, GsaBool6 output) { |
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.
as above
@@ -83,5 +88,67 @@ public void DuplicateTest(bool x, bool y, bool z, bool xx, bool yy, bool zz) { | |||
Assert.Equal(yy, original.Yy); | |||
Assert.Equal(zz, original.Zz); | |||
} | |||
|
|||
[Fact] | |||
public void ReleaseParameterInfoIsCorrect() { |
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.
one assert per test
internal static void CompareRelease(GsaBool6 input, GsaBool6 output) { | ||
Assert.Equal(input.ToString(), output.ToString()); | ||
Assert.Equal(input.ToString(), output.ToString()); | ||
Assert.Equal(input.X, output.X); |
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.
as above
@@ -59,7 +59,7 @@ public override bool Read(GH_IReader reader) { | |||
Params.ReplaceInputParameter(new GsaSpringPropertyParameter(), 7, true); | |||
Params.ReplaceOutputParameter(new GsaSpringPropertyParameter(), 7); | |||
} | |||
|
|||
Params.UpdateRestrainedBool6Parameter(); |
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.
is this for upgrading existing components with Bool6Params?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #721 +/- ##
======================================
Coverage 90.1% 90.2%
======================================
Files 520 522 +2
Lines 39296 39408 +112
Branches 4902 4914 +12
======================================
+ Hits 35441 35553 +112
+ Misses 2582 2580 -2
- Partials 1273 1275 +2
|
No description provided.