MaterialProperties.py 1.68 KB
Newer Older
Jiahang Chen's avatar
Jiahang Chen committed
1
2
3
4
5
6
7
8
from ml.ml40.features.properties.values.value import Value


class MaterialProperties(Value):
    def __init__(self, name="", identifier=""):
        super().__init__(
            name=name,
            identifier=identifier)
Jiahang Chen's avatar
Jiahang Chen committed
9
        self.__max_amount_load_change = None
Jiahang Chen's avatar
Jiahang Chen committed
10
11
12
13
14
15
        self.__material_type = None
        self.__yield_strength = None
        self.__young_modulus = None
        self.__json_out = dict()

    @property
Jiahang Chen's avatar
Jiahang Chen committed
16
17
    def maxAmountLoadChange(self):
        return self.__max_amount_load_change
Jiahang Chen's avatar
Jiahang Chen committed
18

Jiahang Chen's avatar
Jiahang Chen committed
19
20
21
    @maxAmountLoadChange.setter
    def maxAmountLoadChange(self, value):
        self.__max_amount_load_change = value
Jiahang Chen's avatar
Jiahang Chen committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

    @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()
Jiahang Chen's avatar
Jiahang Chen committed
49
50
        if self.maxAmountLoadChange is not None:
            self.__json_out["maxAmountLoadChange"] = self.maxAmountLoadChange
Jiahang Chen's avatar
Jiahang Chen committed
51
52
53
54
55
56
57
58
59
60
61

        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