Beispiel #1
0
    def test_creation(self):
        """
        Doesn't even try to acquire an image, just create and delete components
        """
        sem = tescan_sem.TescanSEM(**CONFIG_SEM)
        self.assertEqual(len(sem.children.value), 6)

        for child in sem.children.value:
            if child.name == CONFIG_SED["name"]:
                sed = child
            elif child.name == CONFIG_SCANNER["name"]:
                scanner = child
            elif child.name == CONFIG_STG["name"]:
                stage = child
            elif child.name == CONFIG_FOCUS["name"]:
                focus = child
            elif child.name == CONFIG_CM["name"]:
                camera = child
            elif child.name == CONFIG_PRESSURE["name"]:
                pressure = child

        self.assertEqual(len(scanner.resolution.value), 2)
        self.assertIsInstance(sed.data, model.DataFlow)

        self.assertTrue(sem.selfTest(), "SEM self test failed.")
        sem.terminate()
Beispiel #2
0
    def test_pickle(self):
        try:
            os.remove("test")
        except OSError:
            pass
        daemon = Pyro4.Daemon(unixsocket="test")

        sem = tescan_sem.TescanSEM(daemon=daemon, **CONFIG_SEM)

        dump = pickle.dumps(sem, pickle.HIGHEST_PROTOCOL)
        #        print "dump size is", len(dump)
        sem_unpickled = pickle.loads(dump)
        self.assertEqual(len(sem_unpickled.children.value), 6)
        sem.terminate()
Beispiel #3
0
    def setUpClass(cls):
        cls.sem = tescan_sem.TescanSEM(**CONFIG_SEM)

        for child in cls.sem.children.value:
            if child.name == CONFIG_SED["name"]:
                cls.sed = child
            elif child.name == CONFIG_SCANNER["name"]:
                cls.scanner = child
            elif child.name == CONFIG_STG["name"]:
                cls.stage = child
            elif child.name == CONFIG_FOCUS["name"]:
                cls.focus = child
            elif child.name == CONFIG_CM["name"]:
                cls.camera = child
            elif child.name == CONFIG_PRESSURE["name"]:
                cls.pressure = child