From b8bbce7c5a1700925463d8a3ce79735af813e190 Mon Sep 17 00:00:00 2001 From: jvonrick Date: Fri, 21 Jul 2023 13:37:43 +0200 Subject: [PATCH 1/2] Add production ply protos --- src/ansys/api/acp/v0/array_types.proto | 12 ++++----- src/ansys/api/acp/v0/base.proto | 19 ++++--------- src/ansys/api/acp/v0/control.proto | 4 +-- src/ansys/api/acp/v0/cut_off_material.proto | 2 +- src/ansys/api/acp/v0/drop_off_material.proto | 3 +-- src/ansys/api/acp/v0/edge_set.proto | 4 +-- src/ansys/api/acp/v0/element_set.proto | 4 +-- src/ansys/api/acp/v0/enum_types.proto | 9 ++++--- src/ansys/api/acp/v0/fabric.proto | 4 +-- src/ansys/api/acp/v0/material.proto | 26 +++++++----------- src/ansys/api/acp/v0/model.proto | 11 +++----- src/ansys/api/acp/v0/modeling_group.proto | 7 ++--- src/ansys/api/acp/v0/modeling_ply.proto | 4 +-- .../api/acp/v0/oriented_selection_set.proto | 4 +-- src/ansys/api/acp/v0/ply_material.proto | 6 ++--- src/ansys/api/acp/v0/production_ply.proto | 27 +++++++++++++++++++ src/ansys/api/acp/v0/rosette.proto | 4 +-- 17 files changed, 70 insertions(+), 80 deletions(-) create mode 100644 src/ansys/api/acp/v0/production_ply.proto diff --git a/src/ansys/api/acp/v0/array_types.proto b/src/ansys/api/acp/v0/array_types.proto index 7bf9b3c..92ffaf5 100644 --- a/src/ansys/api/acp/v0/array_types.proto +++ b/src/ansys/api/acp/v0/array_types.proto @@ -2,16 +2,16 @@ syntax = "proto3"; package ansys.api.acp.v0.array_types; message DoubleArray { - repeated double data = 1 [packed=true]; - repeated int64 shape = 2 [packed=true]; + repeated double data = 1 [ packed = true ]; + repeated int64 shape = 2 [ packed = true ]; } message IntArray { - repeated int64 data = 1 [packed=true]; - repeated int64 shape = 2 [packed=true]; + repeated int64 data = 1 [ packed = true ]; + repeated int64 shape = 2 [ packed = true ]; } message Int32Array { - repeated int32 data = 1 [packed=true]; - repeated int64 shape = 2 [packed=true]; + repeated int32 data = 1 [ packed = true ]; + repeated int64 shape = 2 [ packed = true ]; } diff --git a/src/ansys/api/acp/v0/base.proto b/src/ansys/api/acp/v0/base.proto index 82339d7..75d0a92 100644 --- a/src/ansys/api/acp/v0/base.proto +++ b/src/ansys/api/acp/v0/base.proto @@ -1,16 +1,11 @@ syntax = "proto3"; package ansys.api.acp.v0.base; -message Empty { -} +message Empty {} -message ResourcePath { - string value = 1; -} +message ResourcePath { string value = 1; } -message CollectionPath { - string value = 1; -} +message CollectionPath { string value = 1; } message BasicInfo { ResourcePath resource_path = 1; @@ -19,15 +14,11 @@ message BasicInfo { int64 version = 4; } -message GetRequest { - ResourcePath resource_path = 1; -} +message GetRequest { ResourcePath resource_path = 1; } message DeleteRequest { ResourcePath resource_path = 1; int64 version = 2; } -message ListRequest { - CollectionPath collection_path = 1; -} +message ListRequest { CollectionPath collection_path = 1; } diff --git a/src/ansys/api/acp/v0/control.proto b/src/ansys/api/acp/v0/control.proto index 0e66792..d502316 100644 --- a/src/ansys/api/acp/v0/control.proto +++ b/src/ansys/api/acp/v0/control.proto @@ -3,6 +3,4 @@ package ansys.api.acp.v0.control; import "ansys/api/acp/v0/base.proto"; -service Control { - rpc ShutdownServer(base.Empty) returns (base.Empty); -} +service Control { rpc ShutdownServer(base.Empty) returns (base.Empty); } diff --git a/src/ansys/api/acp/v0/cut_off_material.proto b/src/ansys/api/acp/v0/cut_off_material.proto index eec20b2..7ee9d54 100644 --- a/src/ansys/api/acp/v0/cut_off_material.proto +++ b/src/ansys/api/acp/v0/cut_off_material.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package ansys.api.acp.v0.cut_off_material; -//defines the source of the cut-off material +// defines the source of the cut-off material enum MaterialHandlingType { COMPUTED = 0; GLOBAL = 1; diff --git a/src/ansys/api/acp/v0/drop_off_material.proto b/src/ansys/api/acp/v0/drop_off_material.proto index 293271d..81318a5 100644 --- a/src/ansys/api/acp/v0/drop_off_material.proto +++ b/src/ansys/api/acp/v0/drop_off_material.proto @@ -1,9 +1,8 @@ syntax = "proto3"; package ansys.api.acp.v0.drop_off_material; -//defines the source of the drop-off material +// defines the source of the drop-off material enum MaterialHandlingType { GLOBAL = 0; CUSTOM = 1; } - diff --git a/src/ansys/api/acp/v0/edge_set.proto b/src/ansys/api/acp/v0/edge_set.proto index e3b8d16..41fd1f9 100644 --- a/src/ansys/api/acp/v0/edge_set.proto +++ b/src/ansys/api/acp/v0/edge_set.proto @@ -25,9 +25,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/element_set.proto b/src/ansys/api/acp/v0/element_set.proto index ee3314e..06d34f8 100644 --- a/src/ansys/api/acp/v0/element_set.proto +++ b/src/ansys/api/acp/v0/element_set.proto @@ -17,9 +17,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/enum_types.proto b/src/ansys/api/acp/v0/enum_types.proto index 7472520..e9bd58b 100644 --- a/src/ansys/api/acp/v0/enum_types.proto +++ b/src/ansys/api/acp/v0/enum_types.proto @@ -1,7 +1,8 @@ syntax = "proto3"; package ansys.api.acp.v0.enum_types; -//the initializers are different in the backend but here it has to be zero-based +// the initializers are different in the backend but here it has to be +// zero-based enum StatusType { UNKNOWN = 0; UPTODATE = 1; @@ -19,9 +20,9 @@ enum RosetteSelectionMethod { DIRECTIONS_FROM_TABULAR_VALUES = 7; } -//defines the ply type which is used for instance by the solid model -//extrusion and the post-processing to distinguish between isotropic, -//reinforced, and core materials +// defines the ply type which is used for instance by the solid model +// extrusion and the post-processing to distinguish between isotropic, +// reinforced, and core materials enum PlyType { REGULAR = 0; WOVEN = 1; diff --git a/src/ansys/api/acp/v0/fabric.proto b/src/ansys/api/acp/v0/fabric.proto index 2232689..f807f0f 100644 --- a/src/ansys/api/acp/v0/fabric.proto +++ b/src/ansys/api/acp/v0/fabric.proto @@ -25,9 +25,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/material.proto b/src/ansys/api/acp/v0/material.proto index a2a3f07..defb777 100644 --- a/src/ansys/api/acp/v0/material.proto +++ b/src/ansys/api/acp/v0/material.proto @@ -21,9 +21,7 @@ message InterpolationOptions { } message DensityPropertySet { - message Data { - double rho = 1; - } + message Data { double rho = 1; } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -57,9 +55,7 @@ message OrthotropicEngineeringConstantsPropertySet { } message IsotropicStressLimitsPropertySet { - message Data { - double effective_stress = 1; - } + message Data { double effective_stress = 1; } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -82,9 +78,7 @@ message OrthotropicStressLimitsPropertySet { } message IsotropicStrainLimitsPropertySet { - message Data { - double effective_strain = 1; - } + message Data { double effective_strain = 1; } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -167,9 +161,7 @@ message LaRCConstantsPropertySet { } message FabricFiberAnglePropertySet { - message Data { - double fabric_fiber_angle = 1; - } + message Data { double fabric_fiber_angle = 1; } repeated Data values = 1; repeated FieldVariable field_variables = 2; InterpolationOptions interpolation_options = 3; @@ -199,8 +191,10 @@ message Properties { message PropertySets { DensityPropertySet density = 1; oneof engineering_constants { - IsotropicEngineeringConstantsPropertySet engineering_constants_isotropic = 2; - OrthotropicEngineeringConstantsPropertySet engineering_constants_orthotropic = 3; + IsotropicEngineeringConstantsPropertySet + engineering_constants_isotropic = 2; + OrthotropicEngineeringConstantsPropertySet + engineering_constants_orthotropic = 3; } oneof stress_limits { IsotropicStressLimitsPropertySet stress_limits_isotropic = 4; @@ -235,9 +229,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/model.proto b/src/ansys/api/acp/v0/model.proto index 7bf462d..557fc98 100644 --- a/src/ansys/api/acp/v0/model.proto +++ b/src/ansys/api/acp/v0/model.proto @@ -26,13 +26,9 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } -message LoadFromFileRequest { - string path = 1; -} +message LoadFromFileRequest { string path = 1; } // Special Model messages @@ -99,5 +95,6 @@ service ObjectService { rpc SaveAnalysisModel(SaveAnalysisModelRequest) returns (base.Empty); - rpc SaveShellCompositeDefinitions(SaveShellCompositeDefinitionsRequest) returns (base.Empty); + rpc SaveShellCompositeDefinitions(SaveShellCompositeDefinitionsRequest) + returns (base.Empty); } diff --git a/src/ansys/api/acp/v0/modeling_group.proto b/src/ansys/api/acp/v0/modeling_group.proto index 48095af..c00f65f 100644 --- a/src/ansys/api/acp/v0/modeling_group.proto +++ b/src/ansys/api/acp/v0/modeling_group.proto @@ -3,17 +3,14 @@ package ansys.api.acp.v0.modeling_group; import "ansys/api/acp/v0/base.proto"; -message Properties { -} +message Properties {} message ObjectInfo { base.BasicInfo info = 1; Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/modeling_ply.proto b/src/ansys/api/acp/v0/modeling_ply.proto index bc424c3..6e47cfb 100644 --- a/src/ansys/api/acp/v0/modeling_ply.proto +++ b/src/ansys/api/acp/v0/modeling_ply.proto @@ -19,9 +19,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/oriented_selection_set.proto b/src/ansys/api/acp/v0/oriented_selection_set.proto index ff52788..8e4c084 100644 --- a/src/ansys/api/acp/v0/oriented_selection_set.proto +++ b/src/ansys/api/acp/v0/oriented_selection_set.proto @@ -22,9 +22,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; diff --git a/src/ansys/api/acp/v0/ply_material.proto b/src/ansys/api/acp/v0/ply_material.proto index fc01c7f..2d80152 100644 --- a/src/ansys/api/acp/v0/ply_material.proto +++ b/src/ansys/api/acp/v0/ply_material.proto @@ -1,14 +1,14 @@ syntax = "proto3"; package ansys.api.acp.v0.ply_material; -//defines the draping model (algorithm) +// defines the draping model (algorithm) enum DrapingMaterialType { WOVEN = 0; UD = 1; } -//defines the symmetry-type for stackups, sublaminates etc -enum SymmetryType { +// defines the symmetry-type for stackups, sublaminates etc +enum SymmetryType { NO_SYMMETRY = 0; EVEN_SYMMETRY = 1; ODD_SYMMETRY = 2; diff --git a/src/ansys/api/acp/v0/production_ply.proto b/src/ansys/api/acp/v0/production_ply.proto new file mode 100644 index 0000000..5104de5 --- /dev/null +++ b/src/ansys/api/acp/v0/production_ply.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package ansys.api.acp.v0.production_ply; + +import "ansys/api/acp/v0/base.proto"; +import "ansys/api/acp/v0/enum_types.proto"; + +message Properties { + enum_types.StatusType status = 1; + string material_name = 2; + double thickness = 3; + double angle = 4; +} + +message ObjectInfo { + base.BasicInfo info = 1; + Properties properties = 2; +} + +message ListReply { + repeated ObjectInfo objects = 1; +} + + +service ObjectService { + rpc List(base.ListRequest) returns (ListReply); + rpc Get(base.GetRequest) returns (ObjectInfo); +} diff --git a/src/ansys/api/acp/v0/rosette.proto b/src/ansys/api/acp/v0/rosette.proto index 1693ca1..29e0536 100644 --- a/src/ansys/api/acp/v0/rosette.proto +++ b/src/ansys/api/acp/v0/rosette.proto @@ -27,9 +27,7 @@ message ObjectInfo { Properties properties = 2; } -message ListReply { - repeated ObjectInfo objects = 1; -} +message ListReply { repeated ObjectInfo objects = 1; } message CreateRequest { base.CollectionPath collection_path = 1; From 21c3335d18d0bdfbcf6f145e66319e53e82b17b2 Mon Sep 17 00:00:00 2001 From: jvonrick Date: Mon, 24 Jul 2023 11:39:15 +0200 Subject: [PATCH 2/2] Use resource path for linked material --- src/ansys/api/acp/v0/production_ply.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ansys/api/acp/v0/production_ply.proto b/src/ansys/api/acp/v0/production_ply.proto index 5104de5..77ccf68 100644 --- a/src/ansys/api/acp/v0/production_ply.proto +++ b/src/ansys/api/acp/v0/production_ply.proto @@ -6,7 +6,7 @@ import "ansys/api/acp/v0/enum_types.proto"; message Properties { enum_types.StatusType status = 1; - string material_name = 2; + base.ResourcePath material = 2; double thickness = 3; double angle = 4; } @@ -22,6 +22,8 @@ message ListReply { service ObjectService { + // Object is generated on update and read-only => + // only list and get endpoints. rpc List(base.ListRequest) returns (ListReply); rpc Get(base.GetRequest) returns (ObjectInfo); }