예제 #1
0
 def setUp(self):
     emotion.load_cfg_fromstring(config_xml % 
         (hostname, address, address2, address))
 def setUp(self):
     emotion.load_cfg_fromstring(config_xml)
예제 #3
0
      <low_limit value="-1000"/>
      <high_limit value="1E9"/>
    </axis>
    <axis name="m2">
      <steps_per_unit value="10000"/>
      <!-- degrees per second -->
      <velocity value="100"/>
      <acceleration value="3"/>
      <low_limit value="-1000"/>
      <high_limit value="1E9"/>
    </axis>
  </controller>
</config>
"""

emotion.load_cfg_fromstring(config_xml)

m0 = emotion.get_axis("m0")
m1 = emotion.get_axis("m1")
m2 = emotion.get_axis("m2")

class dummy_diode(CounterBase):
    def __init__(self, name, gain_factors=None):
        CounterBase.__init__(self, name)
        self.gain_factors = gain_factors

    def read(self, count_time=0):
        time.sleep(count_time)
        raw_value = randint(0,9999)
        if self.gain_factors != None:
            gain = self.gain_factors[randint(0,len(self.gain_factors)-1)]
예제 #4
0
 def setUp(self):
     emotion.load_cfg_fromstring(config_xml)
     self.grp = emotion.Group(emotion.get_axis("robz"),
                               emotion.get_axis("robz2"),
                               emotion.get_axis("roby"))
예제 #5
0
 def setUp(self):
     # elog.level(10)
     emotion.load_cfg_fromstring(config_xml)
예제 #6
0
sys.path.insert(0, os.path.abspath(
    os.path.join(os.path.dirname(__file__), "..")))

import emotion
import emotion.log as elog

elog.level(10)

xml_config = """
<config>
  <controller class="VSCANNER">
    <serial_line value = "/dev/ttyS0" />
    <axis name="px">
      <chan_letter value="X"/>
      <velocity value="0" />
      <steps_per_unit value="1" />
   </axis>
  </controller>
</config>
"""

emotion.load_cfg_fromstring(xml_config)
my_axis = emotion.get_axis("px")

while True:
    for ii in range(10):
        print ii
        time.sleep(0.4)
        my_axis.move(ii)