Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KWH40
fml40-reference-implementation
Commits
133afd68
Commit
133afd68
authored
Jun 24, 2021
by
Jiahang Chen
Browse files
add mml40
parent
5ed3fdb6
Changes
23
Hide whitespace changes
Inline
Side-by-side
ml/dt_factory.py
View file @
133afd68
...
...
@@ -58,6 +58,8 @@
from
ml.fml40.roles.dts.forest.forest_segment
import
ForestSegment
from
ml.fml40.roles.dts.forest.tree
import
Tree
from
ml.mml40.roles.dts.parts.cantilever
import
Cantilever
from
ml.ml40.features.properties.associations.association
import
Association
from
ml.ml40.features.properties.associations.composite
import
Composite
from
ml.ml40.features.properties.property
import
Property
...
...
@@ -65,7 +67,9 @@
from
ml.ml40.features.properties.values.address
import
Address
from
ml.ml40.features.properties.values.count
import
Count
from
ml.ml40.features.properties.values.dimensions
import
Dimensions
from
ml.ml40.features.properties.values.distance
import
Distance
from
ml.ml40.features.properties.values.expansion_length
import
ExpansionLength
from
ml.ml40.features.properties.values.force
import
Force
from
ml.ml40.features.properties.values.generic_property
import
GenericProperty
from
ml.ml40.features.properties.values.last_service_check
import
LastServiceCheck
from
ml.ml40.features.properties.values.lot
import
Lot
...
...
@@ -111,7 +115,6 @@
from
ml.fml40.features.properties.values.documents.jobs.forwarding_job
import
ForwardingJob
from
ml.fml40.features.properties.values.documents.jobs.log_transportation_job
import
LogTransportationJob
from
ml.fml40.features.properties.values.documents.reports.afforestation_suggestion
import
AfforestationSuggestion
from
ml.fml40.features.properties.values.documents.reports.felling_tool
import
FellingTool
from
ml.fml40.features.properties.values.documents.reports.log_measurement
import
LogMeasurement
...
...
@@ -121,6 +124,11 @@
from
ml.fml40.features.properties.values.documents.reports.passability_report
import
PassabilityReport
from
ml.fml40.features.properties.values.documents.reports.soil_moisture_measurement
import
SoilMoistureMeasurement
from
ml.mml40.features.properties.values.Displacement
import
Displacement
from
ml.mml40.features.properties.values.GeometryProperties
import
GeometryProperties
from
ml.mml40.features.properties.values.MaterialProperties
import
MaterialProperties
from
ml.mml40.features.properties.values.Stretch
import
Stretch
from
ml.ml40.features.functionalities.accepts_jobs
import
AcceptsJobs
from
ml.ml40.features.functionalities.accepts_reports
import
AcceptsReports
from
ml.ml40.features.functionalities.clears_jobs
import
ClearsJobs
...
...
@@ -168,6 +176,9 @@
from
ml.fml40.features.functionalities.supports_felling
import
SupportsFelling
from
ml.fml40.features.functionalities.transports_logs
import
TransportsLogs
from
ml.mml40.features.functionalities.ProvidesDisplacementData
import
ProvidesDisplacementData
from
ml.mml40.features.functionalities.ProvidesForceData
import
ProvidesForceData
from
ml.mml40.features.functionalities.ProvidesStretchData
import
ProvidesStretchData
# TODO: Get rid of this global variable
# TODO: automatically get all classes in module
DT_FACTORY
=
{}
...
...
ml/feature.py
View file @
133afd68
...
...
@@ -22,6 +22,8 @@ def __init__(self, name="", identifier=""):
# TODO: Move setup code of __class_name into the correct setter method.
if
'ml
\\
fml40'
in
sys
.
modules
[
self
.
__class__
.
__module__
].
__file__
:
self
.
__class_name
=
"fml40::{}"
.
format
(
self
.
__class__
.
__name__
)
elif
'ml
\\
mml40'
in
sys
.
modules
[
self
.
__class__
.
__module__
].
__file__
:
self
.
__class_name
=
"mml40::{}"
.
format
(
self
.
__class__
.
__name__
)
else
:
self
.
__class_name
=
"ml40::{}"
.
format
(
self
.
__class__
.
__name__
)
self
.
__identifier
=
identifier
...
...
ml/ml40/features/properties/values/distance.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
Distance
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__distance
=
None
@
property
def
distance
(
self
):
return
self
.
__distance
@
distance
.
setter
def
distance
(
self
,
value
):
self
.
__distance
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
__distance
is
not
None
:
self
.
__json_out
[
"distance"
]
=
self
.
__distance
return
self
.
__json_out
\ No newline at end of file
ml/ml40/features/properties/values/force.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
Force
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__force
=
None
self
.
__min_force
=
None
self
.
__max_force
=
None
@
property
def
force
(
self
):
return
self
.
__force
@
force
.
setter
def
force
(
self
,
value
):
self
.
__force
=
value
@
property
def
minForce
(
self
):
return
self
.
__min_force
@
minForce
.
setter
def
minForce
(
self
,
value
):
self
.
__min_force
=
value
@
property
def
maxForce
(
self
):
return
self
.
__max_force
@
maxForce
.
setter
def
maxForce
(
self
,
value
):
self
.
__max_force
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
__force
is
not
None
:
self
.
__json_out
[
"force"
]
=
self
.
__force
if
self
.
__min_force
is
not
None
:
self
.
__json_out
[
"minForce"
]
=
self
.
__min_force
if
self
.
__max_force
is
not
None
:
self
.
__json_out
[
"maxForce"
]
=
self
.
__max_force
return
self
.
__json_out
\ No newline at end of file
ml/mml40/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/features/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/features/functionalities/ProvidesDisplacementData.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.functionalities.functionality
import
Functionality
from
ml.mml40.features.properties.values.Displacement
import
Displacement
class
ProvidesDisplacementData
(
Functionality
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
"""Initializes the object.
:param name: Object name
:param identifier: Identifier
"""
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
def
calculateDisplacement
(
self
)
->
Displacement
:
pass
def
getDisplacementData
(
self
,
time
)
->
Displacement
:
pass
def
getDisplacementDataSeries
(
self
,
startTime
,
endTime
):
pass
ml/mml40/features/functionalities/ProvidesForceData.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.functionalities.functionality
import
Functionality
from
ml.ml40.features.properties.values.force
import
Force
class
ProvidesForceData
(
Functionality
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
"""Initializes the object.
:param name: Object name
:param identifier: Identifier
"""
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
def
calculateForce
(
self
)
->
Force
:
pass
def
getForceData
(
self
,
time
)
->
Force
:
pass
def
getForceDataSeries
(
self
,
startTime
,
endTime
):
pass
ml/mml40/features/functionalities/ProvidesStretchData.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.functionalities.functionality
import
Functionality
from
ml.mml40.features.properties.values.Stretch
import
Stretch
class
ProvidesStretchData
(
Functionality
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
"""Initializes the object.
:param name: Object name
:param identifier: Identifier
"""
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
def
getStretchData
(
self
,
time
)
->
Stretch
:
pass
def
getStretchDataSeries
(
self
,
startTime
,
endTime
):
pass
ml/mml40/features/functionalities/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/features/properties/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/features/properties/values/Displacement.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
Displacement
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__displacement
=
None
self
.
__max_displacement
=
None
self
.
__min_displacement
=
None
@
property
def
displacement
(
self
):
return
self
.
__displacement
@
displacement
.
setter
def
displacement
(
self
,
value
):
self
.
__displacement
=
value
@
property
def
maxDisplacement
(
self
):
return
self
.
__max_displacement
@
maxDisplacement
.
setter
def
maxDisplacement
(
self
,
value
):
self
.
__max_displacement
=
value
@
property
def
minDisplacement
(
self
):
return
self
.
__min_displacement
@
minDisplacement
.
setter
def
minDisplacement
(
self
,
value
):
self
.
__min_displacement
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
displacement
is
not
None
:
self
.
__json_out
[
"displacement"
]
=
self
.
displacement
if
self
.
minDisplacement
is
not
None
:
self
.
__json_out
[
"minDisplacement"
]
=
self
.
minDisplacement
if
self
.
maxDisplacement
is
not
None
:
self
.
__json_out
[
"maxDisplacement"
]
=
self
.
maxDisplacement
return
self
.
__json_out
\ No newline at end of file
ml/mml40/features/properties/values/GeometryProperties.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
GeometryProperties
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__geometry_type
=
None
self
.
__height
=
None
self
.
__length
=
None
self
.
__width
=
None
@
property
def
geometryType
(
self
):
return
self
.
__geometry_type
@
geometryType
.
setter
def
geometryType
(
self
,
value
):
self
.
__geometry_type
=
value
@
property
def
height
(
self
):
return
self
.
__height
@
height
.
setter
def
height
(
self
,
value
):
self
.
__height
=
value
@
property
def
length
(
self
):
return
self
.
__length
@
length
.
setter
def
length
(
self
,
value
):
self
.
__length
=
value
@
property
def
width
(
self
):
return
self
.
__width
@
width
.
setter
def
width
(
self
,
value
):
self
.
__width
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
geometryType
is
not
None
:
self
.
__json_out
[
"geometryType"
]
=
self
.
geometryType
if
self
.
height
is
not
None
:
self
.
__json_out
[
"height"
]
=
self
.
height
if
self
.
length
is
not
None
:
self
.
__json_out
[
"length"
]
=
self
.
length
if
self
.
width
is
not
None
:
self
.
__json_out
[
"width"
]
=
self
.
width
return
self
.
__json_out
ml/mml40/features/properties/values/MaterialProperties.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
MaterialProperties
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__load_changes
=
None
self
.
__material_type
=
None
self
.
__yield_strength
=
None
self
.
__young_modulus
=
None
self
.
__json_out
=
dict
()
@
property
def
loadChanges
(
self
):
return
self
.
__load_changes
@
loadChanges
.
setter
def
loadChanges
(
self
,
value
):
self
.
__load_changes
=
value
@
property
def
materialType
(
self
):
return
self
.
__material_type
@
materialType
.
setter
def
materialType
(
self
,
value
):
self
.
__material_type
=
value
@
property
def
yieldStrength
(
self
):
return
self
.
__yield_strength
@
yieldStrength
.
setter
def
yieldStrength
(
self
,
value
):
self
.
__yield_strength
=
value
@
property
def
youngModulus
(
self
):
return
self
.
__young_modulus
@
youngModulus
.
setter
def
youngModulus
(
self
,
value
):
self
.
__young_modulus
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
loadChanges
is
not
None
:
self
.
__json_out
[
"loadChanges"
]
=
self
.
loadChanges
if
self
.
materialType
is
not
None
:
self
.
__json_out
[
"materialType"
]
=
self
.
materialType
if
self
.
yieldStrength
is
not
None
:
self
.
__json_out
[
"yieldStrength"
]
=
self
.
yieldStrength
if
self
.
youngModulus
is
not
None
:
self
.
__json_out
[
"youngModulus"
]
=
self
.
youngModulus
return
self
.
__json_out
ml/mml40/features/properties/values/Stretch.py
0 → 100644
View file @
133afd68
from
ml.ml40.features.properties.values.value
import
Value
class
Stretch
(
Value
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
self
.
__stretch
=
None
self
.
__max_stretch
=
None
self
.
__min_stretch
=
None
@
property
def
stretch
(
self
):
return
self
.
__stretch
@
stretch
.
setter
def
stretch
(
self
,
value
):
self
.
__stretch
=
value
@
property
def
maxStretch
(
self
):
return
self
.
__max_stretch
@
maxStretch
.
setter
def
maxStretch
(
self
,
value
):
self
.
__max_stretch
=
value
@
property
def
minStretch
(
self
):
return
self
.
__min_stretch
@
minStretch
.
setter
def
minStretch
(
self
,
value
):
self
.
__min_stretch
=
value
def
to_json
(
self
):
self
.
__json_out
=
super
().
to_json
()
if
self
.
__stretch
is
not
None
:
self
.
__json_out
[
"stretch"
]
=
self
.
__stretch
if
self
.
__min_stretch
is
not
None
:
self
.
__json_out
[
"minStretch"
]
=
self
.
__min_stretch
if
self
.
__max_stretch
is
not
None
:
self
.
__json_out
[
"maxStretch"
]
=
self
.
__max_stretch
return
self
.
__json_out
ml/mml40/features/properties/values/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/roles/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/roles/dts/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/roles/dts/parts/__init__.py
0 → 100644
View file @
133afd68
ml/mml40/roles/dts/parts/cantilever.py
0 → 100644
View file @
133afd68
from
ml.ml40.roles.dts.parts.part
import
Part
class
Cantilever
(
Part
):
def
__init__
(
self
,
name
=
""
,
identifier
=
""
):
super
().
__init__
(
name
=
name
,
identifier
=
identifier
)
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment