Skip to content
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-478-Add-static-P-delta-analysis-task #648

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fd83bd4
GSAGH-478 static pdelta
tlmnrnhrdt Mar 14, 2024
449c6a9
Merge remote-tracking branch 'origin/release/10.2.7' into task/GSAGH-…
tlmnrnhrdt Mar 14, 2024
c3641c8
Merge branch 'release/10.2.7' into task/GSAGH-478-Add-static-P-delta-…
tlmnrnhrdt Mar 19, 2024
59e2247
Merge branch 'release/10.2.7' into task/GSAGH-478-Add-static-P-delta-…
tlmnrnhrdt Mar 28, 2024
2b273d1
GSAGH-478 static analysis task
tlmnrnhrdt Mar 28, 2024
36f99f6
GSAGH-478 analysis task info
tlmnrnhrdt Mar 28, 2024
fd26f6c
typos
tlmnrnhrdt Mar 28, 2024
5f53192
GSAGH-478 static p delta
tlmnrnhrdt Mar 28, 2024
24c8241
GSAGH-478 icon
tlmnrnhrdt Mar 28, 2024
5539bdb
Merge branch 'main' into task/GSAGH-478-Add-static-P-delta-analysis-task
tlmnrnhrdt Apr 5, 2024
50d63d2
Merge remote-tracking branch 'origin/main' into task/GSAGH-478-Add-st…
tlmnrnhrdt Apr 15, 2024
e5d54f9
Merge remote-tracking branch 'origin/release/10.2.9' into task/GSAGH-…
tlmnrnhrdt May 6, 2024
e3dc7b5
GSAGH-478 static p-delta task
tlmnrnhrdt May 6, 2024
fc21fe1
Merge remote-tracking branch 'origin/release/10.2.9' into task/GSAGH-…
tlmnrnhrdt May 6, 2024
6a62d0e
GSAGH-478 made component obsolete
tlmnrnhrdt May 8, 2024
6efdf89
GSAGH-478 new guid
tlmnrnhrdt May 8, 2024
d5fc850
GSAGH-478 refactoring
tlmnrnhrdt May 14, 2024
4e94663
GSAGH-478 fixed tests
tlmnrnhrdt May 14, 2024
b871b01
GSAGH-478 _solverTypes dictionary
tlmnrnhrdt May 14, 2024
0dd90d3
Merge remote-tracking branch 'origin/release/10.2.9' into task/GSAGH-…
tlmnrnhrdt May 14, 2024
6a82d05
GSAGH-478 unit tests
tlmnrnhrdt May 15, 2024
df855ff
GSAGH-478 RuntimeMessageLevel
tlmnrnhrdt May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file not shown.
Binary file not shown.
24 changes: 12 additions & 12 deletions GsaGH/Components/1_Properties/EditBool6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public class EditBool6 : GH_OasysComponent {
pManager.AddParameter(new GsaBool6Parameter(), GsaBool6Goo.Name, GsaBool6Goo.NickName,
GsaBool6Goo.Description + " to get or set information for. Leave blank to create a new "
+ GsaBool6Goo.Name, GH_ParamAccess.item);
pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in X-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in Y-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in Z-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around X-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around Y-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around Z-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("X", "X", "Release or restraint for translation in X-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Y", "Y", "Release or restraint for translation in Y-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Z", "Z", "Release or restraint for translation in Z-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("XX", "XX", "Release or restraint for rotation around X-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("YY", "YY", "Release or restraint for rotation around Y-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restraint for rotation around Z-axis", GH_ParamAccess.item);
for (int i = 0; i < pManager.ParamCount; i++) {
pManager[i].Optional = true;
}
Expand All @@ -41,12 +41,12 @@ public class EditBool6 : GH_OasysComponent {
protected override void RegisterOutputParams(GH_OutputParamManager pManager) {
pManager.AddParameter(new GsaBool6Parameter(), GsaBool6Goo.Name, GsaBool6Goo.NickName,
GsaBool6Goo.Description + " with applied changes.", GH_ParamAccess.item);
pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in the X-direction.", GH_ParamAccess.item);
pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in the Y-direction.", GH_ParamAccess.item);
pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in the Z-direction.", GH_ParamAccess.item);
pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around the X-axis.", GH_ParamAccess.item);
pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around the Y-axis.", GH_ParamAccess.item);
pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around the Z-axis.", GH_ParamAccess.item);
pManager.AddBooleanParameter("X", "X", "Release or restrain for translation in X-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Y", "Y", "Release or restrain for translation in Y-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Z", "Z", "Release or restrain for translation in Z-direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("XX", "XX", "Release or restrain for rotation around X-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("YY", "YY", "Release or restrain for rotation around Y-axis", GH_ParamAccess.item);
pManager.AddBooleanParameter("ZZ", "ZZ", "Release or restrain for rotation around Z-axis", GH_ParamAccess.item);
}

protected override void SolveInstance(IGH_DataAccess da) {
Expand Down
2 changes: 1 addition & 1 deletion GsaGH/Components/1_Properties/EditProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class EditProfile : GH_OasysComponent {
protected override void RegisterInputParams(GH_InputParamManager pManager) {
pManager.AddTextParameter("Profile", "Pf", "Profile to edit", GH_ParamAccess.item);
pManager.AddAngleParameter("Orientation Angle", "⭮A",
"Set Profile Orientation Angle in counter-clockwise direction.", GH_ParamAccess.item);
"Set Profile Orientation Angle in counter-clockwise direction", GH_ParamAccess.item);
pManager.AddBooleanParameter("Reflect Horizontal", "Ry",
"True to reflect the profile about the local y-axis", GH_ParamAccess.item, false);
pManager.AddBooleanParameter("Reflect Vertical", "Rz",
Expand Down
9 changes: 4 additions & 5 deletions GsaGH/Components/4_Analysis/AnalysisCaseInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class AnalysisCaseInfo : GH_OasysComponent {
protected override Bitmap Icon => Resources.AnalysisCaseInfo;

public AnalysisCaseInfo() : base("Analysis Case Info", "CaseInfo",
"Get information about the properties of a GSA Analysis Case (Load Case or Combination)",
"Get information about a GSA Analysis Case",
CategoryName.Name(), SubCategoryName.Cat4()) {
Hidden = true;
}
Expand All @@ -43,10 +43,9 @@ public class AnalysisCaseInfo : GH_OasysComponent {
}

if (ghTyp.Value is GsaAnalysisCaseGoo goo) {
GsaAnalysisCase gsaCase = goo.Value.Duplicate();
da.SetData(0, gsaCase.Name);
da.SetData(1, gsaCase.Definition);
da.SetData(2, gsaCase.Id);
da.SetData(0, goo.Value.Name);
da.SetData(1, goo.Value.Definition);
da.SetData(2, goo.Value.Id);
} else {
string type = ghTyp.Value.GetType().ToString();
type = type.Replace("GsaGH.Parameters.", string.Empty);
Expand Down
70 changes: 70 additions & 0 deletions GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Types;
using GsaGH.Helpers.GH;
using GsaGH.Parameters;
using GsaGH.Properties;
using OasysGH;
using OasysGH.Components;

namespace GsaGH.Components {
/// <summary>
/// Component to get information about GSA Analysis Tasks
/// </summary>
public class AnalysisTaskInfo : GH_OasysComponent {
public override Guid ComponentGuid => new Guid("82d76442-cc58-49c6-b6d7-d0ae998ce063");
public override GH_Exposure Exposure => GH_Exposure.secondary | GH_Exposure.obscure;
public override OasysPluginInfo PluginInfo => GsaGH.PluginInfo.Instance;
protected override Bitmap Icon => Resources.AnalysisTaskInfo;

public AnalysisTaskInfo() : base("Analysis Task Info", "TaskInfo",
"Get information about a GSA Analysis Task",
CategoryName.Name(), SubCategoryName.Cat4()) {
Hidden = true;
}

protected override void RegisterInputParams(GH_InputParamManager pManager) {
pManager.AddParameter(new GsaAnalysisTaskParameter(), GsaAnalysisTaskGoo.Name,
GsaAnalysisTaskGoo.NickName, GsaAnalysisTaskGoo.Name, GH_ParamAccess.item);
}

protected override void RegisterOutputParams(GH_OutputParamManager pManager) {
pManager.AddTextParameter("Name", "Na", "Analysis Task Name", GH_ParamAccess.item);
pManager.AddParameter(new GsaAnalysisCaseParameter(), GsaAnalysisCaseGoo.Name + "(s)",
GsaAnalysisCaseGoo.NickName, "List of " + GsaAnalysisCaseGoo.Description,
GH_ParamAccess.list);
pManager.AddTextParameter("Solver Type", "sT", "Solver Type", GH_ParamAccess.item);
pManager.AddIntegerParameter("Task ID", "ID", "The Task number of the Analysis Task",
GH_ParamAccess.item);
}

protected override void SolveInstance(IGH_DataAccess da) {
var ghTyp = new GH_ObjectWrapper();
if (!da.GetData(0, ref ghTyp)) {
return;

Check warning on line 47 in GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs

View check run for this annotation

Codecov / codecov/patch

GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs#L47

Added line #L47 was not covered by tests
}

if (ghTyp.Value is GsaAnalysisTaskGoo goo) {
da.SetData(0, goo.Value.ApiTask.Name);
if (goo.Value.Cases != null) {
da.SetDataList(1, new List<GsaAnalysisCaseGoo>(goo.Value.Cases.Select(x => new GsaAnalysisCaseGoo(x))));
} else {
da.SetData(1, null);

Check warning on line 55 in GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs

View check run for this annotation

Codecov / codecov/patch

GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs#L55

Added line #L55 was not covered by tests
}

var type = (AnalysisTaskType)goo.Value.ApiTask.Type;
da.SetData(2, type.ToString());
da.SetData(3, goo.Value.Id);
} else {
string type = ghTyp.Value.GetType().ToString();
type = type.Replace("GsaGH.Parameters.", string.Empty);
type = type.Replace("Goo", string.Empty);
Params.Owner.AddRuntimeError("Unable to convert Analysis Task input parameter of type "
+ type + " to GsaAnalysisTask");

Check warning on line 66 in GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs

View check run for this annotation

Codecov / codecov/patch

GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs#L62-L66

Added lines #L62 - L66 were not covered by tests
}
}

Check warning on line 68 in GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs

View check run for this annotation

Codecov / codecov/patch

GsaGH/Components/4_Analysis/AnalysisTaskInfo.cs#L68

Added line #L68 was not covered by tests
}
}
2 changes: 1 addition & 1 deletion GsaGH/Components/4_Analysis/CombinationCaseInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CombinationCaseInfo : GH_OasysComponent {
protected override Bitmap Icon => Resources.CombinationCaseInfo;

public CombinationCaseInfo() : base("Combination Case Info", "CombinationInfo",
"Get information of a GSA Combination Case", CategoryName.Name(), SubCategoryName.Cat4()) {
"Get information about a GSA Combination Case", CategoryName.Name(), SubCategoryName.Cat4()) {
Hidden = true;
}

Expand Down