DipsScripting 9.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. dips/AnchorPointVal.py +103 -0
  2. dips/AngleDataVal.py +62 -0
  3. dips/AnnotativeTools2DVal.py +273 -0
  4. dips/ApplicationManager.py +89 -0
  5. dips/ArrowToolEntityInfoRef.py +43 -0
  6. dips/ArrowToolEntityInfoVal.py +155 -0
  7. dips/AutomaticClusterAnalysisSettingsVal.py +161 -0
  8. dips/BuiltInDataDescriptors.py +81 -0
  9. dips/BuiltInDataFormatters.py +81 -0
  10. dips/CircularWindowVal.py +103 -0
  11. dips/ClusterWindowVal.py +190 -0
  12. dips/ColorSurrogateVal.py +95 -0
  13. dips/ConeToolEntityInfoRef.py +43 -0
  14. dips/ConeToolEntityInfoVal.py +114 -0
  15. dips/ConeVal.py +92 -0
  16. dips/ContourEntityVisibilityVal.py +132 -0
  17. dips/ContourOptionsVal.py +193 -0
  18. dips/CumulativeChartViewRef.py +42 -0
  19. dips/CumulativeChartViewVal.py +100 -0
  20. dips/CumulativePlotSettingsVal.py +94 -0
  21. dips/CurvedWindowVal.py +102 -0
  22. dips/CustomColumnCollectionVal.py +69 -0
  23. dips/CustomHistogramOptionsVal.py +103 -0
  24. dips/CustomRangeVal.py +84 -0
  25. dips/CustomRowRawDataVal.py +74 -0
  26. dips/DataDescriptorVal.py +83 -0
  27. dips/DataFilterRef.py +23 -0
  28. dips/DataFilterVal.py +73 -0
  29. dips/DataFormatterVal.py +62 -0
  30. dips/DataIdentifierVal.py +62 -0
  31. dips/DipsAPI_pb2.py +817 -0
  32. dips/DipsAPI_pb2_grpc.py +12363 -0
  33. dips/DipsApp.py +81 -0
  34. dips/DiscontinuityDataVal.py +164 -0
  35. dips/EllipseToolEntityInfoRef.py +43 -0
  36. dips/EllipseToolEntityInfoVal.py +153 -0
  37. dips/FillFormatVal.py +83 -0
  38. dips/FoldEntityInfoRef.py +23 -0
  39. dips/FoldEntityInfoVal.py +103 -0
  40. dips/FoldEntityOptionsVal.py +106 -0
  41. dips/FoldEntityVisibilityRef.py +38 -0
  42. dips/FoldEntityVisibilityVal.py +100 -0
  43. dips/FoldWindowEntityInfoVal.py +92 -0
  44. dips/FoldWindowEntityVisibilityRef.py +29 -0
  45. dips/FoldWindowEntityVisibilityVal.py +80 -0
  46. dips/FreehandWindowVal.py +80 -0
  47. dips/FullDataFormatVal.py +92 -0
  48. dips/GlobalPlaneEntityVisibilityVal.py +103 -0
  49. dips/HistogramChartViewRef.py +42 -0
  50. dips/HistogramChartViewVal.py +100 -0
  51. dips/HistogramPlotSettingsVal.py +136 -0
  52. dips/IntersectionEntityVisibilityVal.py +83 -0
  53. dips/IntersectionOptionsVal.py +83 -0
  54. dips/IntervalVal.py +102 -0
  55. dips/JointFrequencyAnalysisSettingsVal.py +102 -0
  56. dips/JointFrequencyChartViewRef.py +42 -0
  57. dips/JointFrequencyChartViewVal.py +100 -0
  58. dips/JointSpacingAnalysisSettingsVal.py +138 -0
  59. dips/JointSpacingChartViewRef.py +42 -0
  60. dips/JointSpacingChartViewVal.py +100 -0
  61. dips/KinematicAnalysisEntityVisibilityVal.py +73 -0
  62. dips/KinematicAnalysisSettingsVal.py +140 -0
  63. dips/LatLongVal.py +84 -0
  64. dips/LengthDataVal.py +83 -0
  65. dips/LineFormatVal.py +83 -0
  66. dips/LineIntersectionCalculatorToolEntityInfoRef.py +43 -0
  67. dips/LineIntersectionCalculatorToolEntityInfoVal.py +133 -0
  68. dips/LineToolEntityInfoRef.py +43 -0
  69. dips/LineToolEntityInfoVal.py +133 -0
  70. dips/LineationVal.py +83 -0
  71. dips/MeasureAngleToolEntityInfoRef.py +43 -0
  72. dips/MeasureAngleToolEntityInfoVal.py +133 -0
  73. dips/OrientationDataSetRef.py +23 -0
  74. dips/OrientationDataSetVal.py +453 -0
  75. dips/PitchGridToolEntityInfoRef.py +43 -0
  76. dips/PitchGridToolEntityInfoVal.py +114 -0
  77. dips/PlaneEntityInfoRef.py +23 -0
  78. dips/PlaneEntityInfoVal.py +92 -0
  79. dips/PlaneEntityVisibilityRef.py +38 -0
  80. dips/PlaneEntityVisibilityVal.py +100 -0
  81. dips/PlaneIntersectionCalculatorToolEntityInfoRef.py +43 -0
  82. dips/PlaneIntersectionCalculatorToolEntityInfoVal.py +133 -0
  83. dips/PlaneOptionsVal.py +117 -0
  84. dips/PlaneVal.py +105 -0
  85. dips/PoleEntityOptionsVal.py +84 -0
  86. dips/PoleEntityVisibilityVal.py +83 -0
  87. dips/PolygonToolEntityInfoRef.py +43 -0
  88. dips/PolygonToolEntityInfoVal.py +131 -0
  89. dips/PolylineToolEntityInfoRef.py +43 -0
  90. dips/PolylineToolEntityInfoVal.py +111 -0
  91. dips/ProcessedDataVal.py +94 -0
  92. dips/ProjStubRef.py +388 -0
  93. dips/ProjStubVal.py +52 -0
  94. dips/ProtobufCollectionWrappers.py +108 -0
  95. dips/QualitativeQuantitativeAnalysisSettingsVal.py +151 -0
  96. dips/QualitativeQuantitativeChartViewRef.py +42 -0
  97. dips/QualitativeQuantitativeChartViewVal.py +111 -0
  98. dips/QuantitativeContourSettingsVal.py +103 -0
  99. dips/RQDAnalysisChartViewRef.py +42 -0
  100. dips/RQDAnalysisChartViewVal.py +100 -0
  101. dips/RQDAnalysisSettingsVal.py +111 -0
  102. dips/RectangleToolEntityInfoRef.py +43 -0
  103. dips/RectangleToolEntityInfoVal.py +153 -0
  104. dips/ReportingConventionResultVal.py +62 -0
  105. dips/RosettePresetOptionsVal.py +227 -0
  106. dips/RosetteSettingsVal.py +174 -0
  107. dips/RosetteViewRef.py +296 -0
  108. dips/RosetteViewVal.py +177 -0
  109. dips/ScatterChartViewRef.py +42 -0
  110. dips/ScatterChartViewVal.py +100 -0
  111. dips/ScatterPlotSettingsVal.py +113 -0
  112. dips/SetEntityInfoRef.py +23 -0
  113. dips/SetEntityInfoVal.py +103 -0
  114. dips/SetEntityOptionsVal.py +133 -0
  115. dips/SetEntityVisibilityRef.py +38 -0
  116. dips/SetEntityVisibilityVal.py +100 -0
  117. dips/SetStatisticsSettingsVal.py +106 -0
  118. dips/SetVersusSetVal.py +82 -0
  119. dips/SetWindowEntityInfoVal.py +183 -0
  120. dips/SetWindowEntityVisibilityRef.py +29 -0
  121. dips/SetWindowEntityVisibilityVal.py +80 -0
  122. dips/StatisticalDistributionFilterVal.py +128 -0
  123. dips/Stereonet2DPresetOptionsVal.py +488 -0
  124. dips/Stereonet2DViewRef.py +612 -0
  125. dips/Stereonet2DViewVal.py +363 -0
  126. dips/Stereonet3DPresetOptionsVal.py +281 -0
  127. dips/Stereonet3DViewRef.py +440 -0
  128. dips/Stereonet3DViewVal.py +303 -0
  129. dips/StereonetOverlayEntityVisibilityVal.py +83 -0
  130. dips/StereonetOverlaySettingsVal.py +103 -0
  131. dips/StereonetProjectionModeVal.py +73 -0
  132. dips/SurveyDataVal.py +103 -0
  133. dips/SymbolDisplaySettingVal.py +124 -0
  134. dips/SymbolicSettingsVal.py +89 -0
  135. dips/TextFormatVal.py +105 -0
  136. dips/TextToolEntityInfoRef.py +43 -0
  137. dips/TextToolEntityInfoVal.py +176 -0
  138. dips/TraverseEntityOptionsVal.py +84 -0
  139. dips/TraverseEntityVisibilityRef.py +38 -0
  140. dips/TraverseEntityVisibilityVal.py +100 -0
  141. dips/TrendLineToolEntityInfoRef.py +43 -0
  142. dips/TrendLineToolEntityInfoVal.py +114 -0
  143. dips/TrendPlungeVal.py +91 -0
  144. dips/UnitSystemResultVal.py +62 -0
  145. dips/UserPlaneEntityOptionsVal.py +100 -0
  146. dips/ValidatableResultVal.py +69 -0
  147. dips/ValidatableResult_ProtoReference_ArrowToolEntityInfoVal.py +86 -0
  148. dips/ValidatableResult_ProtoReference_ConeToolEntityInfoVal.py +86 -0
  149. dips/ValidatableResult_ProtoReference_EllipseToolEntityInfoVal.py +86 -0
  150. dips/ValidatableResult_ProtoReference_FoldEntityInfoVal.py +86 -0
  151. dips/ValidatableResult_ProtoReference_LineIntersectionCalculatorToolEntityInfoVal.py +86 -0
  152. dips/ValidatableResult_ProtoReference_LineToolEntityInfoVal.py +86 -0
  153. dips/ValidatableResult_ProtoReference_MeasureAngleToolEntityInfoVal.py +86 -0
  154. dips/ValidatableResult_ProtoReference_OrientationDataSetVal.py +86 -0
  155. dips/ValidatableResult_ProtoReference_PitchGridToolEntityInfoVal.py +86 -0
  156. dips/ValidatableResult_ProtoReference_PlaneEntityInfoVal.py +86 -0
  157. dips/ValidatableResult_ProtoReference_PlaneIntersectionCalculatorToolEntityInfoVal.py +86 -0
  158. dips/ValidatableResult_ProtoReference_PolygonToolEntityInfoVal.py +86 -0
  159. dips/ValidatableResult_ProtoReference_PolylineToolEntityInfoVal.py +86 -0
  160. dips/ValidatableResult_ProtoReference_RectangleToolEntityInfoVal.py +86 -0
  161. dips/ValidatableResult_ProtoReference_SetEntityInfoVal.py +86 -0
  162. dips/ValidatableResult_ProtoReference_TextToolEntityInfoVal.py +86 -0
  163. dips/ValidatableResult_ProtoReference_TrendLineToolEntityInfoVal.py +86 -0
  164. dips/ValidationErrorVal.py +73 -0
  165. dips/Vector2DVal.py +73 -0
  166. dips/Vector3Val.py +84 -0
  167. dips/VectorDensityContourSettingsVal.py +73 -0
  168. dips/WeightingSettingsVal.py +83 -0
  169. dips/WrappedFreehandWindowVal.py +102 -0
  170. dips/__init__.py +29 -0
  171. dipsscripting-9.1.0.dist-info/METADATA +29 -0
  172. dipsscripting-9.1.0.dist-info/RECORD +175 -0
  173. dipsscripting-9.1.0.dist-info/WHEEL +5 -0
  174. dipsscripting-9.1.0.dist-info/licenses/License.txt +20 -0
  175. dipsscripting-9.1.0.dist-info/top_level.txt +1 -0
dips/AnchorPointVal.py ADDED
@@ -0,0 +1,103 @@
1
+ """Generated wrapper for AnchorPoint protobuf message."""
2
+
3
+ from typing import Any, Optional, List, Dict
4
+ from . import DipsAPI_pb2
5
+
6
+ from .ProtobufCollectionWrappers import _ProtobufListWrapper, _ProtobufMapWrapper
7
+
8
+ from .TrendPlungeVal import TrendPlungeVal
9
+ from .Vector2DVal import Vector2DVal
10
+
11
+ class AnchorPointVal:
12
+ """Simple wrapper for AnchorPoint with Pythonic getters and setters."""
13
+
14
+ _proto_class = DipsAPI_pb2.AnchorPoint
15
+
16
+
17
+ def __init__(self, spherical_point: Optional[TrendPlungeVal] = None, logical_point: Optional[Vector2DVal] = None, proto_message: Optional[Any] = None):
18
+ """Initialize the AnchorPoint wrapper."""
19
+ # Initialize the protobuf message
20
+ if proto_message is not None:
21
+ self._proto_message = proto_message
22
+ else:
23
+ self._proto_message = self._proto_class()
24
+
25
+ if spherical_point is not None:
26
+ self._proto_message.SphericalPoint.CopyFrom(spherical_point.to_proto())
27
+ self._spherical_point_wrapper = spherical_point
28
+ if logical_point is not None:
29
+ self._proto_message.LogicalPoint.CopyFrom(logical_point.to_proto())
30
+ self._logical_point_wrapper = logical_point
31
+
32
+
33
+ # Properties
34
+
35
+ @property
36
+ def coordinate_option(self) -> Any:
37
+ """Get the CoordinateOption field value."""
38
+ return self._proto_message.CoordinateOption
39
+
40
+ @coordinate_option.setter
41
+ def coordinate_option(self, value: Any) -> None:
42
+ """Set the CoordinateOption field value."""
43
+ self._proto_message.CoordinateOption = value
44
+
45
+
46
+ @property
47
+ def spherical_point(self) -> TrendPlungeVal:
48
+ """Get the SphericalPoint field as a wrapper."""
49
+ if not hasattr(self, '_spherical_point_wrapper'):
50
+ self._spherical_point_wrapper = TrendPlungeVal(proto_message=self._proto_message.SphericalPoint)
51
+ return self._spherical_point_wrapper
52
+
53
+ @spherical_point.setter
54
+ def spherical_point(self, value: TrendPlungeVal) -> None:
55
+ """Set the SphericalPoint field to a wrapper."""
56
+ self._proto_message.SphericalPoint.CopyFrom(value.to_proto())
57
+ # Update the cached wrapper if it exists
58
+ if hasattr(self, '_spherical_point_wrapper'):
59
+ self._spherical_point_wrapper._proto_message.CopyFrom(self._proto_message.SphericalPoint)
60
+
61
+
62
+ @property
63
+ def logical_point(self) -> Vector2DVal:
64
+ """Get the LogicalPoint field as a wrapper."""
65
+ if not hasattr(self, '_logical_point_wrapper'):
66
+ self._logical_point_wrapper = Vector2DVal(proto_message=self._proto_message.LogicalPoint)
67
+ return self._logical_point_wrapper
68
+
69
+ @logical_point.setter
70
+ def logical_point(self, value: Vector2DVal) -> None:
71
+ """Set the LogicalPoint field to a wrapper."""
72
+ self._proto_message.LogicalPoint.CopyFrom(value.to_proto())
73
+ # Update the cached wrapper if it exists
74
+ if hasattr(self, '_logical_point_wrapper'):
75
+ self._logical_point_wrapper._proto_message.CopyFrom(self._proto_message.LogicalPoint)
76
+
77
+
78
+ # Utility methods
79
+
80
+ def to_proto(self):
81
+ """Get the underlying protobuf message."""
82
+ return self._proto_message
83
+
84
+ @classmethod
85
+ def from_proto(cls, proto_message):
86
+ """Create wrapper from existing protobuf message."""
87
+ wrapper = cls()
88
+ wrapper._proto_message.CopyFrom(proto_message)
89
+ return wrapper
90
+
91
+ def copy(self):
92
+ """Create a copy of this wrapper."""
93
+ new_wrapper = self.__class__()
94
+ new_wrapper._proto_message.CopyFrom(self._proto_message)
95
+ return new_wrapper
96
+
97
+ def __str__(self) -> str:
98
+ """String representation."""
99
+ return f"{self.__class__.__name__}({self._proto_message})"
100
+
101
+ def __repr__(self) -> str:
102
+ """Detailed string representation."""
103
+ return f"{self.__class__.__name__}({self._proto_message})"
dips/AngleDataVal.py ADDED
@@ -0,0 +1,62 @@
1
+ """Generated wrapper for AngleData protobuf message."""
2
+
3
+ from typing import Any, Optional, List, Dict
4
+ from . import DipsAPI_pb2
5
+
6
+ from .ProtobufCollectionWrappers import _ProtobufListWrapper, _ProtobufMapWrapper
7
+
8
+ class AngleDataVal:
9
+ """Simple wrapper for AngleData with Pythonic getters and setters."""
10
+
11
+ _proto_class = DipsAPI_pb2.AngleData
12
+
13
+
14
+ def __init__(self, proto_message: Optional[Any] = None):
15
+ """Initialize the AngleData wrapper."""
16
+ # Initialize the protobuf message
17
+ if proto_message is not None:
18
+ self._proto_message = proto_message
19
+ else:
20
+ self._proto_message = self._proto_class()
21
+
22
+
23
+
24
+ # Properties
25
+
26
+ @property
27
+ def angle_radians(self) -> float:
28
+ """Get the AngleRadians field value."""
29
+ return self._proto_message.AngleRadians
30
+
31
+ @angle_radians.setter
32
+ def angle_radians(self, value: float) -> None:
33
+ """Set the AngleRadians field value."""
34
+ self._proto_message.AngleRadians = value
35
+
36
+
37
+ # Utility methods
38
+
39
+ def to_proto(self):
40
+ """Get the underlying protobuf message."""
41
+ return self._proto_message
42
+
43
+ @classmethod
44
+ def from_proto(cls, proto_message):
45
+ """Create wrapper from existing protobuf message."""
46
+ wrapper = cls()
47
+ wrapper._proto_message.CopyFrom(proto_message)
48
+ return wrapper
49
+
50
+ def copy(self):
51
+ """Create a copy of this wrapper."""
52
+ new_wrapper = self.__class__()
53
+ new_wrapper._proto_message.CopyFrom(self._proto_message)
54
+ return new_wrapper
55
+
56
+ def __str__(self) -> str:
57
+ """String representation."""
58
+ return f"{self.__class__.__name__}({self._proto_message})"
59
+
60
+ def __repr__(self) -> str:
61
+ """Detailed string representation."""
62
+ return f"{self.__class__.__name__}({self._proto_message})"
@@ -0,0 +1,273 @@
1
+ """Generated wrapper for AnnotativeTools2D protobuf message."""
2
+
3
+ from typing import Any, Optional, List, Dict
4
+ from . import DipsAPI_pb2
5
+
6
+ from .ProtobufCollectionWrappers import _ProtobufListWrapper, _ProtobufMapWrapper
7
+
8
+ from .ArrowToolEntityInfoVal import ArrowToolEntityInfoVal
9
+ from .ConeToolEntityInfoVal import ConeToolEntityInfoVal
10
+ from .EllipseToolEntityInfoVal import EllipseToolEntityInfoVal
11
+ from .LineIntersectionCalculatorToolEntityInfoVal import LineIntersectionCalculatorToolEntityInfoVal
12
+ from .LineToolEntityInfoVal import LineToolEntityInfoVal
13
+ from .MeasureAngleToolEntityInfoVal import MeasureAngleToolEntityInfoVal
14
+ from .PitchGridToolEntityInfoVal import PitchGridToolEntityInfoVal
15
+ from .PlaneIntersectionCalculatorToolEntityInfoVal import PlaneIntersectionCalculatorToolEntityInfoVal
16
+ from .PolygonToolEntityInfoVal import PolygonToolEntityInfoVal
17
+ from .PolylineToolEntityInfoVal import PolylineToolEntityInfoVal
18
+ from .RectangleToolEntityInfoVal import RectangleToolEntityInfoVal
19
+ from .TextToolEntityInfoVal import TextToolEntityInfoVal
20
+ from .TrendLineToolEntityInfoVal import TrendLineToolEntityInfoVal
21
+
22
+ class AnnotativeTools2DVal:
23
+ """Simple wrapper for AnnotativeTools2D with Pythonic getters and setters."""
24
+
25
+ _proto_class = DipsAPI_pb2.AnnotativeTools2D
26
+
27
+
28
+ def __init__(self, proto_message: Optional[Any] = None):
29
+ """Initialize the AnnotativeTools2D wrapper."""
30
+ # Initialize the protobuf message
31
+ if proto_message is not None:
32
+ self._proto_message = proto_message
33
+ else:
34
+ self._proto_message = self._proto_class()
35
+
36
+
37
+
38
+ # Properties
39
+
40
+ @property
41
+ def text_tool_entities(self) -> List[TextToolEntityInfoVal]:
42
+ """Get the TextToolEntities field as a list of wrappers."""
43
+ return _ProtobufListWrapper(self._proto_message.TextToolEntities, TextToolEntityInfoVal)
44
+
45
+ @text_tool_entities.setter
46
+ def text_tool_entities(self, value: List[TextToolEntityInfoVal]) -> None:
47
+ """Set the TextToolEntities field to a list of wrappers."""
48
+ if not isinstance(value, (list, tuple)):
49
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
50
+ # Clear the repeated field using slice assignment
51
+ self._proto_message.TextToolEntities[:] = []
52
+ for item in value:
53
+ self._proto_message.TextToolEntities.append(item.to_proto())
54
+
55
+
56
+ @property
57
+ def arrow_tool_entities(self) -> List[ArrowToolEntityInfoVal]:
58
+ """Get the ArrowToolEntities field as a list of wrappers."""
59
+ return _ProtobufListWrapper(self._proto_message.ArrowToolEntities, ArrowToolEntityInfoVal)
60
+
61
+ @arrow_tool_entities.setter
62
+ def arrow_tool_entities(self, value: List[ArrowToolEntityInfoVal]) -> None:
63
+ """Set the ArrowToolEntities field to a list of wrappers."""
64
+ if not isinstance(value, (list, tuple)):
65
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
66
+ # Clear the repeated field using slice assignment
67
+ self._proto_message.ArrowToolEntities[:] = []
68
+ for item in value:
69
+ self._proto_message.ArrowToolEntities.append(item.to_proto())
70
+
71
+
72
+ @property
73
+ def line_tool_entities(self) -> List[LineToolEntityInfoVal]:
74
+ """Get the LineToolEntities field as a list of wrappers."""
75
+ return _ProtobufListWrapper(self._proto_message.LineToolEntities, LineToolEntityInfoVal)
76
+
77
+ @line_tool_entities.setter
78
+ def line_tool_entities(self, value: List[LineToolEntityInfoVal]) -> None:
79
+ """Set the LineToolEntities field to a list of wrappers."""
80
+ if not isinstance(value, (list, tuple)):
81
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
82
+ # Clear the repeated field using slice assignment
83
+ self._proto_message.LineToolEntities[:] = []
84
+ for item in value:
85
+ self._proto_message.LineToolEntities.append(item.to_proto())
86
+
87
+
88
+ @property
89
+ def polyline_tool_entities(self) -> List[PolylineToolEntityInfoVal]:
90
+ """Get the PolylineToolEntities field as a list of wrappers."""
91
+ return _ProtobufListWrapper(self._proto_message.PolylineToolEntities, PolylineToolEntityInfoVal)
92
+
93
+ @polyline_tool_entities.setter
94
+ def polyline_tool_entities(self, value: List[PolylineToolEntityInfoVal]) -> None:
95
+ """Set the PolylineToolEntities field to a list of wrappers."""
96
+ if not isinstance(value, (list, tuple)):
97
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
98
+ # Clear the repeated field using slice assignment
99
+ self._proto_message.PolylineToolEntities[:] = []
100
+ for item in value:
101
+ self._proto_message.PolylineToolEntities.append(item.to_proto())
102
+
103
+
104
+ @property
105
+ def polygon_tool_entities(self) -> List[PolygonToolEntityInfoVal]:
106
+ """Get the PolygonToolEntities field as a list of wrappers."""
107
+ return _ProtobufListWrapper(self._proto_message.PolygonToolEntities, PolygonToolEntityInfoVal)
108
+
109
+ @polygon_tool_entities.setter
110
+ def polygon_tool_entities(self, value: List[PolygonToolEntityInfoVal]) -> None:
111
+ """Set the PolygonToolEntities field to a list of wrappers."""
112
+ if not isinstance(value, (list, tuple)):
113
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
114
+ # Clear the repeated field using slice assignment
115
+ self._proto_message.PolygonToolEntities[:] = []
116
+ for item in value:
117
+ self._proto_message.PolygonToolEntities.append(item.to_proto())
118
+
119
+
120
+ @property
121
+ def rectangle_tool_entities(self) -> List[RectangleToolEntityInfoVal]:
122
+ """Get the RectangleToolEntities field as a list of wrappers."""
123
+ return _ProtobufListWrapper(self._proto_message.RectangleToolEntities, RectangleToolEntityInfoVal)
124
+
125
+ @rectangle_tool_entities.setter
126
+ def rectangle_tool_entities(self, value: List[RectangleToolEntityInfoVal]) -> None:
127
+ """Set the RectangleToolEntities field to a list of wrappers."""
128
+ if not isinstance(value, (list, tuple)):
129
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
130
+ # Clear the repeated field using slice assignment
131
+ self._proto_message.RectangleToolEntities[:] = []
132
+ for item in value:
133
+ self._proto_message.RectangleToolEntities.append(item.to_proto())
134
+
135
+
136
+ @property
137
+ def ellipse_tool_entities(self) -> List[EllipseToolEntityInfoVal]:
138
+ """Get the EllipseToolEntities field as a list of wrappers."""
139
+ return _ProtobufListWrapper(self._proto_message.EllipseToolEntities, EllipseToolEntityInfoVal)
140
+
141
+ @ellipse_tool_entities.setter
142
+ def ellipse_tool_entities(self, value: List[EllipseToolEntityInfoVal]) -> None:
143
+ """Set the EllipseToolEntities field to a list of wrappers."""
144
+ if not isinstance(value, (list, tuple)):
145
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
146
+ # Clear the repeated field using slice assignment
147
+ self._proto_message.EllipseToolEntities[:] = []
148
+ for item in value:
149
+ self._proto_message.EllipseToolEntities.append(item.to_proto())
150
+
151
+
152
+ @property
153
+ def trend_line_tool_entities(self) -> List[TrendLineToolEntityInfoVal]:
154
+ """Get the TrendLineToolEntities field as a list of wrappers."""
155
+ return _ProtobufListWrapper(self._proto_message.TrendLineToolEntities, TrendLineToolEntityInfoVal)
156
+
157
+ @trend_line_tool_entities.setter
158
+ def trend_line_tool_entities(self, value: List[TrendLineToolEntityInfoVal]) -> None:
159
+ """Set the TrendLineToolEntities field to a list of wrappers."""
160
+ if not isinstance(value, (list, tuple)):
161
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
162
+ # Clear the repeated field using slice assignment
163
+ self._proto_message.TrendLineToolEntities[:] = []
164
+ for item in value:
165
+ self._proto_message.TrendLineToolEntities.append(item.to_proto())
166
+
167
+
168
+ @property
169
+ def cone_tool_entities(self) -> List[ConeToolEntityInfoVal]:
170
+ """Get the ConeToolEntities field as a list of wrappers."""
171
+ return _ProtobufListWrapper(self._proto_message.ConeToolEntities, ConeToolEntityInfoVal)
172
+
173
+ @cone_tool_entities.setter
174
+ def cone_tool_entities(self, value: List[ConeToolEntityInfoVal]) -> None:
175
+ """Set the ConeToolEntities field to a list of wrappers."""
176
+ if not isinstance(value, (list, tuple)):
177
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
178
+ # Clear the repeated field using slice assignment
179
+ self._proto_message.ConeToolEntities[:] = []
180
+ for item in value:
181
+ self._proto_message.ConeToolEntities.append(item.to_proto())
182
+
183
+
184
+ @property
185
+ def pitch_grid_tool_entities(self) -> List[PitchGridToolEntityInfoVal]:
186
+ """Get the PitchGridToolEntities field as a list of wrappers."""
187
+ return _ProtobufListWrapper(self._proto_message.PitchGridToolEntities, PitchGridToolEntityInfoVal)
188
+
189
+ @pitch_grid_tool_entities.setter
190
+ def pitch_grid_tool_entities(self, value: List[PitchGridToolEntityInfoVal]) -> None:
191
+ """Set the PitchGridToolEntities field to a list of wrappers."""
192
+ if not isinstance(value, (list, tuple)):
193
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
194
+ # Clear the repeated field using slice assignment
195
+ self._proto_message.PitchGridToolEntities[:] = []
196
+ for item in value:
197
+ self._proto_message.PitchGridToolEntities.append(item.to_proto())
198
+
199
+
200
+ @property
201
+ def measure_angle_tool_entities(self) -> List[MeasureAngleToolEntityInfoVal]:
202
+ """Get the MeasureAngleToolEntities field as a list of wrappers."""
203
+ return _ProtobufListWrapper(self._proto_message.MeasureAngleToolEntities, MeasureAngleToolEntityInfoVal)
204
+
205
+ @measure_angle_tool_entities.setter
206
+ def measure_angle_tool_entities(self, value: List[MeasureAngleToolEntityInfoVal]) -> None:
207
+ """Set the MeasureAngleToolEntities field to a list of wrappers."""
208
+ if not isinstance(value, (list, tuple)):
209
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
210
+ # Clear the repeated field using slice assignment
211
+ self._proto_message.MeasureAngleToolEntities[:] = []
212
+ for item in value:
213
+ self._proto_message.MeasureAngleToolEntities.append(item.to_proto())
214
+
215
+
216
+ @property
217
+ def line_intersection_calculator_tool_entities(self) -> List[LineIntersectionCalculatorToolEntityInfoVal]:
218
+ """Get the LineIntersectionCalculatorToolEntities field as a list of wrappers."""
219
+ return _ProtobufListWrapper(self._proto_message.LineIntersectionCalculatorToolEntities, LineIntersectionCalculatorToolEntityInfoVal)
220
+
221
+ @line_intersection_calculator_tool_entities.setter
222
+ def line_intersection_calculator_tool_entities(self, value: List[LineIntersectionCalculatorToolEntityInfoVal]) -> None:
223
+ """Set the LineIntersectionCalculatorToolEntities field to a list of wrappers."""
224
+ if not isinstance(value, (list, tuple)):
225
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
226
+ # Clear the repeated field using slice assignment
227
+ self._proto_message.LineIntersectionCalculatorToolEntities[:] = []
228
+ for item in value:
229
+ self._proto_message.LineIntersectionCalculatorToolEntities.append(item.to_proto())
230
+
231
+
232
+ @property
233
+ def plane_intersection_calculator_tool_entities(self) -> List[PlaneIntersectionCalculatorToolEntityInfoVal]:
234
+ """Get the PlaneIntersectionCalculatorToolEntities field as a list of wrappers."""
235
+ return _ProtobufListWrapper(self._proto_message.PlaneIntersectionCalculatorToolEntities, PlaneIntersectionCalculatorToolEntityInfoVal)
236
+
237
+ @plane_intersection_calculator_tool_entities.setter
238
+ def plane_intersection_calculator_tool_entities(self, value: List[PlaneIntersectionCalculatorToolEntityInfoVal]) -> None:
239
+ """Set the PlaneIntersectionCalculatorToolEntities field to a list of wrappers."""
240
+ if not isinstance(value, (list, tuple)):
241
+ raise TypeError(f"Expected list or tuple, got {type(value).__name__}")
242
+ # Clear the repeated field using slice assignment
243
+ self._proto_message.PlaneIntersectionCalculatorToolEntities[:] = []
244
+ for item in value:
245
+ self._proto_message.PlaneIntersectionCalculatorToolEntities.append(item.to_proto())
246
+
247
+
248
+ # Utility methods
249
+
250
+ def to_proto(self):
251
+ """Get the underlying protobuf message."""
252
+ return self._proto_message
253
+
254
+ @classmethod
255
+ def from_proto(cls, proto_message):
256
+ """Create wrapper from existing protobuf message."""
257
+ wrapper = cls()
258
+ wrapper._proto_message.CopyFrom(proto_message)
259
+ return wrapper
260
+
261
+ def copy(self):
262
+ """Create a copy of this wrapper."""
263
+ new_wrapper = self.__class__()
264
+ new_wrapper._proto_message.CopyFrom(self._proto_message)
265
+ return new_wrapper
266
+
267
+ def __str__(self) -> str:
268
+ """String representation."""
269
+ return f"{self.__class__.__name__}({self._proto_message})"
270
+
271
+ def __repr__(self) -> str:
272
+ """Detailed string representation."""
273
+ return f"{self.__class__.__name__}({self._proto_message})"
@@ -0,0 +1,89 @@
1
+ import subprocess
2
+ import time
3
+ from multiprocessing.connection import Listener
4
+ from logging import Logger
5
+
6
+ class ApplicationManager:
7
+ minimumPort = 49152
8
+ maximumPort = 65535
9
+ defaultTimeout = 120
10
+ def startApplication(self, pathToExecutable : str, port : int, isServerRunning : callable, logger : Logger, timeout : float = defaultTimeout, headless : bool = False, fileToOpen : str = None):
11
+ """
12
+ Starts the application specified by pathToExecutable and starts the python server on the given port.
13
+ Returns when the server is ready to accept requests.
14
+ Throws TimeoutError exception if the server is not ready within that time.
15
+
16
+ Args:
17
+ pathToExecutable: the full path to the executable of the application you want to start.
18
+ port: the port number you want the python server to bind to.
19
+ isServerRunning: a callable that returns True if the server is ready to accept requests.
20
+ logger: a logger object. It will be disabled while trying to connect to the server.
21
+ timeout: time in seconds before we stop trying to start the application
22
+
23
+ Raises:
24
+ ValueError: Port range must be between 49152 and 65535, otherwise ValueError is raised
25
+ TimeoutError: if timeout is provided, raises TimeoutError if not able to connect to the server within that time.
26
+ """
27
+ if port < self.minimumPort or port > self.maximumPort:
28
+ msg = f"port must be in the range {self.minimumPort} to {self.maximumPort}"
29
+ logger.error(msg)
30
+ raise ValueError(msg)
31
+
32
+ if not self._isPortAvailable(port):
33
+ msg = f"port number {port} is occupied. Please choose another port."
34
+ logger.error(msg)
35
+ raise RuntimeError(msg)
36
+
37
+ logger.info(f"Attempting to start the application at {pathToExecutable} and binding server to port {port}...")
38
+ pathAndArgs = [f"{pathToExecutable}", "--startScriptingServer", f"{port}"]
39
+ if(headless):
40
+ pathAndArgs.append("-headless")
41
+ if(fileToOpen is not None):
42
+ pathAndArgs.append("--filename")
43
+ pathAndArgs.append(fileToOpen)
44
+
45
+ SW_MINIMIZE = 6
46
+ info = subprocess.STARTUPINFO()
47
+ info.dwFlags = subprocess.STARTF_USESHOWWINDOW
48
+ info.wShowWindow = SW_MINIMIZE
49
+
50
+ subprocess.Popen(pathAndArgs, start_new_session = True, creationflags=subprocess.DETACHED_PROCESS, startupinfo=info)
51
+
52
+ self._tryToConnectToServer(port, isServerRunning, timeout, logger)
53
+
54
+
55
+ def _isPortAvailable(self, port):
56
+ portAvailable = False
57
+ listener = None
58
+ try:
59
+ listener = Listener(('localhost', port), 'AF_INET')
60
+ portAvailable = True
61
+ except Exception:
62
+ portAvailable = False
63
+
64
+ if listener:
65
+ listener.close()
66
+
67
+ return portAvailable
68
+
69
+ def _tryToConnectToServer(self, port : int, isServerRunning : callable, timeout, logger : Logger):
70
+
71
+ startTime = time.time()
72
+ serverIsRunning = False
73
+
74
+ while not serverIsRunning:
75
+ if timeout:
76
+ if (time.time() - startTime) > timeout:
77
+ msg = "The application did not start within the given timeout time."
78
+ logger.error(msg)
79
+ raise TimeoutError(msg)
80
+ try:
81
+ logger.debug("Trying to connect to the server...")
82
+ logger.disabled = True
83
+ isServerRunning(port)
84
+ except Exception as e:
85
+ continue
86
+ finally:
87
+ logger.disabled = False
88
+ serverIsRunning = True
89
+ logger.debug("connectied!")
@@ -0,0 +1,43 @@
1
+ from typing import List
2
+ from . import DipsAPI_pb2_grpc
3
+ from . import DipsAPI_pb2
4
+ from .ArrowToolEntityInfoVal import ArrowToolEntityInfoVal
5
+ from .ArrowToolEntityInfoVal import ArrowToolEntityInfoVal
6
+ from .ValidatableResultVal import ValidatableResultVal
7
+
8
+ class ArrowToolEntityInfoRef:
9
+ def __init__(self, channelToConnectOn, ref: DipsAPI_pb2.ProtoReference_ArrowToolEntityInfo):
10
+ self.__modelRef = ref
11
+ self.__refManagerStub = DipsAPI_pb2_grpc.nSameModuleReferenceAccessorStub(channelToConnectOn)
12
+ self.__channelToConnectOn = channelToConnectOn
13
+ self.__EntityServicesStubLocal = DipsAPI_pb2_grpc.EntityServicesStub(channelToConnectOn)
14
+
15
+
16
+ def GetValue(self) -> ArrowToolEntityInfoVal:
17
+ bytes = self.__refManagerStub.GetValue(self.__modelRef.ID)
18
+ ret = DipsAPI_pb2.ArrowToolEntityInfo()
19
+ ret.MergeFromString(bytes.data)
20
+ return ArrowToolEntityInfoVal.from_proto(ret)
21
+
22
+ def get_model_ref(self):
23
+ """Get the underlying model reference for direct protobuf operations."""
24
+ return self.__modelRef
25
+
26
+ def RemoveArrowTool(self):
27
+ functionParam = DipsAPI_pb2.ProtoMemberFunction_ProtoReference_ArrowToolEntityInfo(This=self.__modelRef)
28
+ ret = self.__EntityServicesStubLocal.RemoveArrowTool(functionParam)
29
+
30
+
31
+ def SetArrowToolVisibility(self, Boolean: bool):
32
+ functionParam = DipsAPI_pb2.ProtoMemberFunction_ProtoReference_ArrowToolEntityInfo_Boolean(This=self.__modelRef, Input1=Boolean)
33
+ ret = self.__EntityServicesStubLocal.SetArrowToolVisibility(functionParam)
34
+
35
+
36
+ def UpdateArrowTool(self, ArrowToolEntityInfo: ArrowToolEntityInfoVal) -> ValidatableResultVal:
37
+ functionParam = DipsAPI_pb2.ProtoMemberFunction_ProtoReference_ArrowToolEntityInfo_ArrowToolEntityInfo(This=self.__modelRef, Input1=(ArrowToolEntityInfo.to_proto() if hasattr(ArrowToolEntityInfo, 'to_proto') else ArrowToolEntityInfo))
38
+ ret = self.__EntityServicesStubLocal.UpdateArrowTool(functionParam)
39
+
40
+ return ValidatableResultVal.from_proto(ret)
41
+
42
+
43
+