Skip to content

Commit 019c9ea

Browse files
authored
Merge pull request #479 from Systems-Modeling/ST6RI-669
ST6RI-669 Resolved outstanding TODOs in SysML validation cases and examples
2 parents 07258e0 + 467b196 commit 019c9ea

10 files changed

Lines changed: 38 additions & 34 deletions

sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,14 @@ package VehicleGeometryAndCoordinateFrames {
4747
/*
4848
* As an example of a more involved placement of composite parts, constrain the positions of the coordinate frame origins
4949
* of the lugbolts to a circle with radius lbpr distributed evenly over 360°.
50-
*
51-
* Currently casting (lugBolts[i] as LugBolt) is needed to resolve coordinateFrame
52-
* TODO: When origin position is available as position3dVector rather than Point, use SpatialItem::PositionOf to reformulate
53-
* the constraint in terms of the origin postion of each of lugbolts.
5450
*/
5551
attribute <lbpr> lugBoltPlacementRadius :>> radius default 60 [mm];
5652
private attribute lugBoltDistributionAngle :>> planeAngle = 360/numberOfBolts ['°'];
5753
private attribute lbda : Real = lugBoltDistributionAngle.num * (pi/180); // lugBoltDistributionAngle in radian
5854
assert constraint {
59-
1..numberOfBolts->forAll {
55+
(1..numberOfBolts)->forAll {
6056
in i : Natural;
61-
private attribute lbcf = (lugBolts#(i) as LugBolt).coordinateFrame;
57+
private attribute lbcf : CoordinateFrame = lugBolts#(i).coordinateFrame;
6258
private attribute trs : TranslationRotationSequence {
6359
:>> source = wcf;
6460
:>> target = lbcf;

sysml/src/validation/03-Function-based Behavior/3c-Function-based Behavior-structure mod-1.sysml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@ package '3c-Function-based Behavior-structure mod-1' {
3131
}
3232
}
3333

34-
perform action {
34+
action {
3535
// Create a link and assign it as the TrailerHitch connection.
3636
// Link participants are determined from inherited ends.
3737
action 'connect trailer to vehicle'
3838
assign 'vehicle-trailer system'.trailerHitch := TrailerHitch();
3939

40+
// Destroy the link object.
41+
then action 'destroy connection of trailer to vehicle' :
42+
OccurrenceFunctions::destroy {
43+
:>> occ = 'vehicle-trailer system'.trailerHitch;
44+
}
45+
4046
// Remove the link from the TrailerHitch connection.
41-
// TODO: Destroy the link object.
4247
then action 'disconnect trailer from vehicle'
4348
assign 'vehicle-trailer system'.trailerHitch := null;
4449
}

sysml/src/validation/15-Properties-Values-Expressions/15_01-Constants.sysml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ package '15_01-Constants' {
33
import SI::*;
44
import RealFunctions::*;
55

6-
/* TODO: Move mathematical and fundamental physical constants to model library package(s) */
7-
/* TODO: Add concept of precision for Real values */
8-
96
/* Note: Value properties that are bound to specific values are constants and have the specified
107
* values in all contexts. It is not legal to redefine them.
118
*/
@@ -36,7 +33,6 @@ package '15_01-Constants' {
3633
* Standard fundamental physical constants
3734
*
3835
* Physical constants have a standard measured attribute to a finite precision.
39-
* TODO: Represent physical constant attribute error bounds.
4036
*
4137
* The reference source is:
4238
* CODATA - Task Group on Fundamental Physical Constants (TGFC) - 2018 CODATA recommended values

sysml/src/validation/15-Properties-Values-Expressions/15_03-Value Expression.sysml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ package '15_03-Value Expression' {
2323
}
2424

2525
part def Tire {
26-
attribute profileDepth: LengthValue = 6.0 [mm];
27-
/* TODO: Change profileDepth by adding tolerance: profileDepth: LengthValue = @i{6.0 ± 0.5} [mm]; */
26+
attribute profileDepth: LengthValue default 6.0 [mm];
27+
constraint hasLegalProfileDepth {profileDepth >= 3.5 [mm]}
2828
attribute height: LengthValue = 45 [mm];
2929
}
3030
}

sysml/src/validation/15-Properties-Values-Expressions/15_06-System of Quantities.sysml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ package '15_06-System of Quantities' {
2626
*/
2727

2828
/*
29-
* TODO: Support definition of a System Of Quantities package with additional information that records its provenance.
30-
* TODO: Support explicit identification of the base quantities.
31-
* TODO: Add integrated support for vectors, matrices, nth-order tensors in general (prototypes exist).
29+
* Above capabilities were implemented in:
30+
* - standard library Quantities:
31+
* TensorQuantityValue, VectorQuantityValue, ScalarQuantityValue,
32+
* tensorQuantities, vectorQuantities, scalarQuantities,
33+
* SystemOfQuantities
34+
* - standard library MeasurementReferences:
35+
* TensorMeasurementReference, VectorMeasurementReference, ScalarMeasurementReference,
36+
* SystemOfUnits
37+
* - standard library ISQBase:
38+
* attribute <isq> 'International System of Quantities': SystemOfQuantities in ISQBase
3239
*/
3340
}

sysml/src/validation/15-Properties-Values-Expressions/15_07-System of Units and Scales.sysml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ package '15_07-System of Units and Scales' {
3232
*/
3333

3434
/*
35-
* TODO: Allow annotation of a System Of Units and Scales package with additional information that records its provenance.
36-
* TODO: Support explicit identification of the base units.
35+
* Above capabilities were implemented in:
36+
* - standard library MeasurementReferences:
37+
* TensorMeasurementReference, VectorMeasurementReference, ScalarMeasurementReference,
38+
* MeasurementUnit, OrdinalScale, IntervalScale, CyclicRatioScale, LogarithmicScale,
39+
* SystemOfUnits
40+
* - standard library SI:
41+
* attribute <si> 'ISO/IEC 80000 International System of Units' : SystemOfUnits
42+
* :>> systemOfQuantities = isq;
43+
* :>> baseUnits = (m, kg, s, A, K, mol, cd);
44+
* }
3745
*/
3846
}
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
package '15_08-Range Restriction' {
2-
import MeasurementReferences::*;
2+
import ISQ::*;
33
import SI::*;
44
import '15_01-Constants'::'Mathematical Constants'::pi;
55

66
part def HeadLightsTiltKnob {
77
attribute headLightsTile : LightBeamTiltAngleValue[1];
88
}
99

10-
/* TODO: Define a model library for angular units. */
11-
attribute def PlaneAngleValue :> DimensionOneValue;
12-
attribute deg: DimensionOneUnit {
13-
attribute :>> unitConversion: ConversionByConvention { :>> referenceUnit = one; :>> conversionFactor = pi/180.0; }
14-
}
15-
1610
attribute def LightBeamTiltAngleValue :> PlaneAngleValue {
1711
attribute angle: LightBeamTiltAngleValue :>> self {
1812
doc
1913
/*
2014
* Tilt angle shall be limited to the range between 50 and 80 degrees (inclusive).
2115
*/
2216
}
23-
assert constraint { angle >= 50 [deg] and angle <= 80 [deg] }
17+
assert constraint { angle >= 50 ['°'] and angle <= 80 ['°'] }
2418
}
2519
}

sysml/src/validation/15-Properties-Values-Expressions/15_10-Primitive Data Types.sysml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ package '15.10-Primitive Data Types' {
2626

2727
attribute def UnsignedReal :> Real {
2828
doc
29-
/* TODO: Move this to the model library.
30-
* (To be discussed whether Unsigned attribute defs should really be part of the primitive
31-
* data / attribute defs. These are more a computer data type concern.)
29+
/*
30+
* Example of restriction of the base Real datatype.
3231
*/
3332
attribute x: Real :>> self;
3433
assert constraint { x >= 0.0 }
@@ -38,7 +37,6 @@ package '15.10-Primitive Data Types' {
3837
doc
3938
/*
4039
* String attributes are sequences of characters.
41-
* TODO: Specify any requirements on character encoding.
4240
*/
4341
}
4442

@@ -49,7 +47,6 @@ package '15.10-Primitive Data Types' {
4947
*/
5048
}
5149

52-
/* TODO: Specify standardized string encodings. */
5350
import Time::DateTime;
5451

5552
enum def ConditionColor {

sysml/src/validation/15-Properties-Values-Expressions/15_11-Variable Length Collection Types.sysml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package '15_11-Variable Length Collection Types' {
55
part def SparePart;
66
part def Person;
77

8-
/* TODO: Define syntactic sugar for instantiating collection types. */
8+
/* Examples of declaring syntactic sugar-like names for instantiating collection types. */
99

1010
attribute def 'Bag<SparePart>' :> Bag {
1111
ref part :>> elements: SparePart;

sysml/src/validation/15-Properties-Values-Expressions/15_19a-Materials with Properties.sysml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ package '15_19a-Materials with Properties' {
66

77
attribute def AtomicMassValue :> MassValue;
88

9-
// TODO: Move definition of tensile strength and N/mm² to SI
9+
/* Example declarations of a quantity and unit that are not specified in ISQ and SI */
10+
1011
attribute def TensileStrengthUnit :> DerivedUnit {
1112
private attribute lengthPF: QuantityPowerFactor[1] { :>> quantity = isq.L; :>> exponent = -1; }
1213
private attribute massPF: QuantityPowerFactor[1] { :>> quantity = isq.M; :>> exponent = 1; }

0 commit comments

Comments
 (0)