...
As a child of entity Decks
you have already included included the multiple (select one of more) entity Deck
(see Developing a ship design process).
Thw The entity Decks
can contain one or more Deck
entities, each containing the same parameters and relations. However, the user can provide different input values for every Deck
.
During the computation, the user will be asked the number of Deck
entities he/she wants to include. If you include the Nr
parameter in the "container” entity “ Decks
, this will be the parameter which determines the number of Deck
entities that will be placed, because Nr
contains an @NRINST attribute in the Data, as explained in Some handy attributes.
Top Goals/Undefined
: Excel
.The class Exce
l is a container for everything that will be calculated by Excel later on.
Parameter name | Dimension | Determined by | Reference | In Class |
| [m^2] | USR: User or system/equation | Total deck area | Excel
|
| [Telitab] | USL: User or system/function | Table of deck data | Excel Dimensions |
| [m^2] | USR: User or system/equation | Total accommodation deck area | Dimensions |
| [Telitab] | USL: User or system/function | Table of all accommodation deck data | Dimensions |
...
Decks
: Nr
, Total_deck_area
, Deck_data#
, Total_accommodation_area
, Total_accommodation_area#
, QEntityRef
.Info | ||
---|---|---|
| ||
If you forgot in which class you put a parameter, use the seach box at the top of the Knowledge Browser to find it for you. |
...
Deck
: Name$
, Area
, B
, Deck_function$
, L
, Weight_area_factor
, X_aft
, X_aft_plane_ID
, X_front
, X_front_plane_ID
, Z
, and Z_plane_ID
....
B = ENTITY#(
...
12).Boa
(
...
12 is the value of QEntityId
of entity MainDimensions)
Area = L*B
L = X_front - X_aft
QEntityData
...
Weight_factor_area
We will come back to this last parameter in Mass calculation.
How to connect the start and end position to the reference planes will be discussed next.
...
Now, you will create a selection list from available data to position a deck according with respect to specified reference planes.
...
X_aft_plane_ID:
:14
(QEntityID of Transverse planes)
.The entity Transverse planes
is used to create a selection list from with the other attributes.CaseID
. The parameter CaseID
is the parameter (of entity Transverse planes
) whose values must be listed for selection.Name$
. The parameter Name$
defines the case description that must be displayed in the selection list....
Note that you may have a different value than 14 here, because it depends on the sequence of creating Entities entities in a Taxonomy Entity the tree!
By including the attributes as described above, the user can select a reference plane from a drop down list, containing the names of all defined transverse reference planes. The result of the selection is a value of parameter CaseID
, but the value of parameter Name$
is shown to the user instead.
...
X_aft = ENTITY#(14).X.X_aft_plane_ID
This means the following: entity Transverse planes
(in this example 14) contains a table of transverse planes, in which each column (case) represents a transverse plane. When the user has selected the second name from the table, the value of X_aft_ID
will be 2 (although Name$
was presented to the user). So, the value of X_aft
will become the second “X” value from the table within entity Transverse planes
(X_aft = ENTITY#(14).X.2
)
X_front_plane_ID
as you did for X_aft_plane_IID
.X_front = ENTITY#(14).X.X_front_plane_ID
“ZZ_plane_ID.
Here, you have to refer to the QEntityID
of entity Horizontal planes
, in our example “ 15”.Z = ENTITY#(15).Z.Z_plane_ID
...
As shown in the calculation result above, each Deck
entity node name contains the name and height of a deck. This can be accomplished by using the attribute @OBJECTTITLE in parameter QEntityData of entity Deck. You can provide a flexible string, for example:
@OBJECTTITLE:"Deck_" + Name$ + "; deck height = " + STR$(Z) + " m"
Here, everything between quotes will be presented as text. The value of a string parameter like Name$
will also be shown as text. And, if you also want to present the value of a parameter which is not of the string type, you first have to convert it to a string, for example STR$(Z)
.
...
You now will create a table with a subset of parameter values of all defined decks.
The QEntity()
expression collects parameters of all child entities.
Decks
:Deck_data# = QEntity(@Name$, @Deck_function$, @Z, @X_aft, @X_front, @Area)
The total accommodation area will be shown separately. For this, parameter “Total_accommodation_area#
, which is a Telitab (as its name ends with #). It should only contains contain data of decks for which Deck_function$
returns Accommodation
. Use the QUERY# QUERY# function, which returns a Telitab subset on the basis of a set of search criteria.
Decks
:Total_accommodation_area# = QUERY#(Deck_data#, "NullString",
...
"Accommodation":"Deck_function$")
Next sums of the datasets are will be made using the SUM SUM function.
Total_deck_area = SUM(Deck_data#, 1, "Area")
Total_accommodation_area = INCASE(Total_accommodation_area# = "0" + Qcrlf, THEN, 0, ELSE, SUM(Total_accommodation_area#, 1, "Area"))
You see that the The second relation has a condition (the INCASE()
function). If “Total_accommodation_area#
” is an empty table (which is possible if the user do does not create decks with "Deck_function$" = "Accommodation"
) then the total accommodation deck area is 0 [m2]. Because the content of an empty table in Quaestor will be: "0" + Qcrlf (in which Qcrlf is a Carriage return-line feed string constant) this should be the value to test the parameter onagainst.
Please note see in the rest of the wiki for more detailed information about functions used above.
QEntityRef
parameter to Decks
Combined data of all decks
” as explanation to the user.QEntityRef
QEntityData
Bulkheads
As mentioned in Developing a ship design processAs mentioned in the first part, this ship configurator uses a different Entity entity structure for defining (transverse) bulkheads in comparison with defining decks. Of course the same Entity entity structure could be used, but it is more instructive to present (and develop) a different approach.
The development of the Bulkhead Entity Bulkheads
entity is comparable to the Decks
Entity entity. However, in the previous paragraphs we used a multiple Entity entity was used to enable the user to define one or more decks. Now we will develop an Entity Here an entity is developed where the user can create one table to define one or more transverse bulkheads instead of several Deck
entities. Create another child Entity “Bulkheads” below the existing Entity “Bulkheads”.
Bulkheads | child of “Bulkheads” | Entity type: singular obligatory |
Contrary to Deck
(child of Decks)
, which is multiple, the child entity Bulkheads
(child of Bulkheads)
is singular.
Parameter name | Dimension | Determined by | Reference | In Class |
| [m] | USR: User or system/equation | Height | Dimensions |
| [ID] | VR: User only | Define X position of bulkhead by selecting a transverse reference plane | Dimensions |
| [m] | VR: User only | Bottom position bulkhead in Z (vertical) direction | Dimensions |
| [m] | VR: User only | Top position bulkhead in Z (vertical) direction | Dimensions |
| [ID] | VR: User only | Define bottom Z (vertical) position of bulkhead by selecting a horizontal reference plane | Dimensions |
| [ID] | VR: User only | Define top Z (vertical) position of bulkhead by selecting a horizontal reference plane |
Dimensions |
Bulkheads: Nr
, Name$
, Area
, B
, H
, Next include the following parameters in last created Entity “Bulkheads“: “Nr”, “Name$”, “Area”, “B”, “H”, “Weight_area_factor
”, “X
”, “X_plane_ID
”, “Z_bottom
”, “Z_bottom_plane_ID
”, “Z_top
”, “and Z_top_plane_ID
and “QEntityData”.Take care that with With exception of parameter “Nr
” and “QEntityData” and the QEntity
* parameters all parameters are must be placed within the table view (if not, instantiate view.
...
QEntityData
Again, Again we want to create a selection list must be created from data in the reference Entities entities to position , in this case, position a bulkhead. In section 2.3.9.1 of this part we section 3 it was explained how to achieve this for decks.
...
X_plane_ID
...
...
Z_bottom_plane_ID
...
...
Z_top_plane_ID
...
Area = B*H
B = ENTITY#(
...
12).Boa
(
...
12 is the value of QEntityId
of
...
entity MainDimensions)
H = Z_top - Z_bottom
X = ENTITY#(
...
14).X.X_plane_ID
(
...
14 is the value of QEntityId
of
...
entity Transverse planes
...
)
Z_bottom = ENTITY#(
...
15).Z.Z_bottom_plane_ID
(
...
15 is the value of QEntityId
of
...
entity Horizontal planes
...
)
...
Z
...
_
...
top = ENTITY#(
...
15).Z.Z_top_plane_ID
(
...
15 is the value of QEntityId
of
...
entity Horizontal planes
...
)
...
As for the parameter in Deck, the parameter “Weight_factor_area” show be instantiated and be provided with the @HIDE attribute. We will come back to this parameter in section 2.4.1.3 of this part.
The end result of Entity “Bulkheads” is presented in Figure 78.
Figure 78: Entity "Bulkheads"
...
...