-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwave_data.py
More file actions
134 lines (99 loc) · 2.91 KB
/
Copy pathwave_data.py
File metadata and controls
134 lines (99 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import json
class WaveData:
def __init__(self, order: int = None, tau: float = None, radians: float = None,
sin: float = None, cos: float = None, tan: float = None, sinh: float = None,
cosh: float = None, tanh: float = None):
self.Order = order
self.Tau = tau
self.Radians = radians
self.Sin = sin
self.Cos = cos
self.Tan = tan
self.Sinh = sinh
self.Cosh = cosh
self.Tanh = tanh
@property
def Order(self) -> int:
return self._order
@Order.setter
def Order(self, value: int):
self._order = value
@property
def Tau(self) -> float:
return self._tau
@Tau.setter
def Tau(self, value: float):
self._tau = value
@property
def Radians(self) -> float:
return self._radians
@Radians.setter
def Radians(self, value: float):
self._radians = value
@property
def Sin(self) -> float:
return self._sin
@Sin.setter
def Sin(self, value: float):
self._sin = value
@property
def Cos(self) -> float:
return self._cos
@Cos.setter
def Cos(self, value: float):
self._cos = value
@property
def Tan(self) -> float:
return self._tan
@Tan.setter
def Tan(self, value: float):
self._tan = value
@property
def Sinh(self) -> float:
return self._sinh
@Sinh.setter
def Sinh(self, value: float):
self._sinh = value
@property
def Cosh(self) -> float:
return self._cosh
@Cosh.setter
def Cosh(self, value: float):
self._cosh = value
@property
def Tanh(self) -> float:
return self._tanh
@Tanh.setter
def Tanh(self, value: float):
self._tanh = value
def toJson(self):
return json.dumps(self.toDictionary())
def toDictionary(self):
result = {'Order': self.Order, 'Tau': self.Tau, 'Radians': self.Radians, 'Sin': self.Sin,
'Cos': self.Cos, 'Tan': self.Tan, 'Sinh': self.Sinh, 'Cosh': self.Cosh,
'Tanh': self.Tanh}
return result
@staticmethod
def fromJson(content):
result = WaveData()
if not content:
return result
if 'Order' in content:
result.Order = content['Order']
if 'Tau' in content:
result.Tau = content['Tau']
if 'Radians' in content:
result.Radians = content['Radians']
if 'Sin' in content:
result.Sin = content['Sin']
if 'Cos' in content:
result.Cos = content['Cos']
if 'Tan' in content:
result.Tan = content['Tan']
if 'Sinh' in content:
result.Sinh = content['Sinh']
if 'Cosh' in content:
result.Cosh = content['Cosh']
if 'Tanh' in content:
result.Tanh = content['Tanh']
return result