예제 #1
0
class CalibrationObjectTestCase(unittest.TestCase):
    def setUp(self):
        self._cal_obj = CalibrationObject(cx=0, cy=0)

    def test_calc_rotation_east_counter_clockwise(self):
        rot = self._cal_obj.calculate_rotation(1, 1)
        self.assertEqual(rot, 45.0)

    def test_calc_rotation_west_counter_clockwise(self):
        rot = self._cal_obj.calculate_rotation(-1, -1, 'west')
        self.assertEqual(rot, 45.0)

    def test_calc_rotation_south_counter_clockwise(self):
        rot = self._cal_obj.calculate_rotation(1, -1, 'south')
        self.assertEqual(rot, 45.0)

    def test_calc_rotation_north_counter_clockwise(self):
        rot = self._cal_obj.calculate_rotation(-1, 1, 'north')
        self.assertEqual(rot, 45.0)

    def test_calc_rotation_east_clockwise(self):
        rot = self._cal_obj.calculate_rotation(1, -1)
        self.assertEqual(rot, -45.0)

    def test_calc_rotation_west_clockwise(self):
        rot = self._cal_obj.calculate_rotation(-1, 1, 'west')
        self.assertEqual(rot, -45.0)

    def test_calc_rotation_south_clockwise(self):
        rot = self._cal_obj.calculate_rotation(-1, -1, 'south')
        self.assertEqual(rot, -45.0)

    def test_calc_rotation_north_clockwise(self):
        rot = self._cal_obj.calculate_rotation(1, 1, 'north')
        self.assertEqual(rot, -45.0)
예제 #2
0
    def new_calibration_item(self):
        #        if kind in ['MassSpec', 'pychron-auto']:
        #            ci = CalibrationObject()
        #        else:
        #            ci = CalibrationItem(x, y, rotation, canvas=self)

        ci = CalibrationObject()
        self.calibration_item = ci
        return ci
예제 #3
0
 def new_calibration_item(self):
     ci = CalibrationObject()
     self.calibration_item = ci
     return ci
예제 #4
0
 def setUp(self):
     self._cal_obj = CalibrationObject(cx=0, cy=0)