Skip to content
Snippets Groups Projects
Commit 35ccb25a authored by Luis Dekant's avatar Luis Dekant
Browse files

some description changes

parent cb942282
No related branches found
No related tags found
No related merge requests found
...@@ -199,7 +199,10 @@ class Integrator(Filter): ...@@ -199,7 +199,10 @@ class Integrator(Filter):
@property @property
def description(self): def description(self):
return "Int {0}".format(human_readable(self.corner_frequency, "Hz")) return "Int {0}, Slope {1}".format(
human_readable(self.corner_frequency, "Hz"),
human_readable(self.second_parameter, "Hz"),
)
@property @property
def sF(self): def sF(self):
...@@ -234,7 +237,10 @@ class Differentiator(Filter): ...@@ -234,7 +237,10 @@ class Differentiator(Filter):
@property @property
def description(self): def description(self):
return "Diff {0}".format(human_readable(self.corner_frequency, "Hz")) return "Diff {0}, Slope {1}".format(
human_readable(self.corner_frequency, "Hz"),
human_readable(self.second_parameter, "Hz"),
)
@property @property
def sF(self): def sF(self):
......
...@@ -293,14 +293,14 @@ class TestServoDesign(unittest.TestCase): ...@@ -293,14 +293,14 @@ class TestServoDesign(unittest.TestCase):
def test_description(self): def test_description(self):
self.sd.integrator(438) self.sd.integrator(438)
self.assertEqual(self.sd.filters[0].description, "Int 438 Hz") self.assertEqual(self.sd.filters[0].description, "Int 438 Hz, Slope 438 mHz")
self.sd.filters[0].corner_frequency = 1200 self.sd.filters[0].corner_frequency = 1200
self.assertEqual(self.sd.filters[0].description, "Int 1.2 kHz") self.assertEqual(self.sd.filters[0].description, "Int 1.2 kHz, Slope 438 mHz")
self.sd.differentiator(438) self.sd.differentiator(438)
self.assertEqual(self.sd.filters[1].description, "Diff 438 Hz") self.assertEqual(self.sd.filters[1].description, "Diff 438 Hz, Slope 4.38 kHz")
self.sd.filters[1].corner_frequency = 1200 self.sd.filters[1].corner_frequency = 1200
self.assertEqual(self.sd.filters[1].description, "Diff 1.2 kHz") self.assertEqual(self.sd.filters[1].description, "Diff 1.2 kHz, Slope 4.38 kHz")
self.sd.lowpass(438) self.sd.lowpass(438)
self.assertEqual(self.sd.filters[2].description, "LP2 438 Hz, Q=0.707") self.assertEqual(self.sd.filters[2].description, "LP2 438 Hz, Q=0.707")
...@@ -322,7 +322,7 @@ class TestServoDesign(unittest.TestCase): ...@@ -322,7 +322,7 @@ class TestServoDesign(unittest.TestCase):
"gain": 1.0, "gain": 1.0,
"filters": [ "filters": [
{ {
"description": "Int 500 Hz", "description": "Int 500 Hz, Slope 500 mHz",
"sos": np.array( "sos": np.array(
[1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0]
), ),
...@@ -392,7 +392,7 @@ class TestServoDesign(unittest.TestCase): ...@@ -392,7 +392,7 @@ class TestServoDesign(unittest.TestCase):
"gain": 1.0, "gain": 1.0,
"filters": [ "filters": [
{ {
"description": "Int 500 Hz", "description": "Int 500 Hz, Slope 500 mHz",
"sos": np.array( "sos": np.array(
[1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0]
), ),
...@@ -408,7 +408,7 @@ class TestServoDesign(unittest.TestCase): ...@@ -408,7 +408,7 @@ class TestServoDesign(unittest.TestCase):
"index": 1, "index": 1,
}, },
{ {
"description": "Int 500 Hz", "description": "Int 500 Hz, Slope 500 mHz",
"sos": np.array( "sos": np.array(
[1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0]
), ),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment