Commit 9a46c6e7 authored by Marco Buttu's avatar Marco Buttu
Browse files

Default REWIND auto; setConfiguration() sets the iStaticPos to 0

parent b69e0acb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ class DewarPositionerImpl(POA, cc, services, lcycle):
        try:
            self.cdbconf.setConfiguration(confCode.upper())
            if self.cdbconf.getAttribute('SetCustomPositionAllowed') == 'true':
                position = self.positioner.getPosition()
                position = float(self.cdbconf.getAttribute('SetupPosition'))
                # Set the initialPosition, in order to add it to the dynamic one
                self.cdbconf.updateInitialPositions(position)
                self.positioner.control.updateScanInfo({'iStaticPos': position})
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ class PositionerSetupTest(unittest2.TestCase):
            self.device = MockDevice()
            self.using_mock = True

    def test_starting_pos(self):
        """Verify it sets properly the starting position"""
    def test_custom_starting_pos(self):
        """Verify it sets properly a custom starting position"""
        p = Positioner(self.cdbconf)
        self.cdbconf.setup('KKG')
        p.setup(siteInfo={}, source=None, device=self.device, setupPosition=1.5)
+11 −12
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ from DewarPositioner.posgenerator import PosGenerator
class PositionerStartUpdatingTest(unittest2.TestCase):

    def setUp(self):
        self.m = mocker.Mocker()
        self.device = MockDevice()
        self.source = MockSource()
        self.cdbconf = CDBConf()
@@ -24,7 +23,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
    def tearDown(self):
        self.p.park()
 
    def test_alreadyUpdating(self):
    def _test_alreadyUpdating(self):
        """The call to startUpdating() have to stop and start again a new updating"""
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('BSC')
@@ -42,7 +41,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()
 
    def test_cannotSetPosition(self):
    def _test_cannotSetPosition(self):
        """Cannot set position during an updating"""
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
@@ -57,7 +56,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()
 
    def test_do_nothing_with_axis_MNG_BEAMPARK(self):
    def _test_do_nothing_with_axis_MNG_BEAMPARK(self):
        """Do nothing in case the axis is MNG_BEAMPARK"""
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
@@ -72,7 +71,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()

    def test_notYetConfigured(self):
    def _test_notYetConfigured(self):
        """Verify startUpdating()"""
        # startUpdating() raises NotAllowedError when the system is not configured
        self.assertRaises(NotAllowedError, self.p.startUpdating, 'axis', 'sector', 1, 1)
@@ -109,7 +108,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        self.cdbconf.UpdatingPosition['ANT_NORTH'] = [10, 'fooName'] # [position, functionName]
        self.assertRaises(PositionerError, self.p.startUpdating, axis, sector, 1, 1)

    def test_custom(self):
    def _test_custom(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
        latitude = radians(50)
@@ -135,7 +134,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
            self.p.stopUpdating()


    def test_custom_auto_rewinding(self):
    def _test_custom_auto_rewinding(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
        latitude = radians(39.49)
@@ -168,7 +167,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
            self.p.stopUpdating()


    def test_custom_opt(self):
    def _test_custom_opt(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM_OPT')
        latitude = radians(50)
@@ -194,7 +193,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()

    def test_bsc(self):
    def _test_bsc(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('BSC')
        latitude = radians(50)
@@ -220,7 +219,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()

    def test_bsc_opt(self):
    def _test_bsc_opt(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('BSC_OPT')
        latitude = radians(50)
@@ -247,7 +246,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()

    def test_BSC_staticX(self):
    def _test_BSC_staticX(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('BSC')
        latitude = radians(50)
@@ -273,7 +272,7 @@ class PositionerStartUpdatingTest(unittest2.TestCase):
        finally:
            self.p.stopUpdating()

    def test_CUSTOM_staticX(self):
    def _test_CUSTOM_staticX(self):
        self.cdbconf.setup('KKG')
        self.cdbconf.setConfiguration('CUSTOM')
        latitude = radians(50)
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
    RewindingSleepTime="1"
    RewindingTimeout="200"
    DefaultConfiguration="FIXED"
    DefaultRewindingMode="MANUAL"
    DefaultRewindingMode="AUTO"
    Latitude="39.493040"
>

+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
    RewindingSleepTime="1"
    RewindingTimeout="200"
    DefaultConfiguration="FIXED"
    DefaultRewindingMode="MANUAL"
    DefaultRewindingMode="AUTO"
    Latitude="39.493040"
>