コード例 #1
0
ファイル: aditi.py プロジェクト: Jesus89/aditi
def _read():
    global running
    while running:
        point = scanner.read()
        if point is not None:
            x, y, z = point
            publish('point.cloud', json.dumps({"x": x, "y": y, "z": z}))
コード例 #2
0
ファイル: DLP_Printer.py プロジェクト: gvJaime/DeLePeHost
 def buildBegin(self,filename,params):
     self.building = True
     print filename
     model=self.slicer.parseSVG(filename)
     t = threading.Thread(target=self.buildLoop, args=(model,params))
     t.daemon = True
     t.start()
     publish('printStarted','Build began')
     return "Begin printing"
コード例 #3
0
ファイル: sunrise_server.py プロジェクト: gvJaime/DeLePeHost
def buildTest():
    test_stl_path = os.path.join(os.getcwd(), 'test', 'test.stl')
    print test_stl_path
    with open(test_stl_path, 'w') as file_:
        import base64
        file_.write(base64.b64decode(content))
        sunrise.slicer.file_to_svg(test_stl_path, 50)
        response = name + " successfully sliced"
        loaded = True
        publish('sliced', 'File sliced')
        return response
コード例 #4
0
def buildTest():
    test_stl_path=os.path.join(os.getcwd(),'test','test.stl')
    print test_stl_path
    with open(test_stl_path, 'w') as file_:
        import base64
        file_.write(base64.b64decode(content))
        sunrise.slicer.file_to_svg(test_stl_path,50)
        response = name + " successfully sliced"
        loaded=True
        publish('sliced','File sliced')
        return response
コード例 #5
0
ファイル: DLP_Printer.py プロジェクト: gvJaime/DeLePeHost
 def buildLoop(self,model,params):
     self.projector.init_display()
     for layer in model:
         if not self.building:
             break
         publish('printingLayer',len(layer))
         self.projector.expose(layer)
         time.sleep(params['exposeTime'])
         self.projector.blank()
         self.mechComm.moveAxis(self.buildAxis,3,200)
         self.mechComm.moveAxis(self.buildAxis,-2.95,200)
         time.sleep(params['blankTime'])
     self.mechComm.moveAxis(self.buildAxis,20,200)
     publish('printFinished',"Build finished")
     return False
コード例 #6
0
ファイル: sunrise_server.py プロジェクト: gvJaime/DeLePeHost
def sliceFile(name='name', content='content'):
    global loaded
    try:
        os.mkdir('temp')
    except Exception:
        pass
    temp_stl_path = os.path.join(os.getcwd(), 'temp', 'loaded.stl')
    print temp_stl_path
    with open(temp_stl_path, 'w') as file_:
        import base64
        file_.write(base64.b64decode(content))
        sunrise.slicer.file_to_svg(temp_stl_path, 50)
        response = name + " successfully sliced"
        loaded = True
        publish('sliced', 'File sliced')
        return response
コード例 #7
0
def sliceFile(name='name', content='content'):
    global loaded
    try:
        os.mkdir('temp')
    except Exception:
        pass
    temp_stl_path=os.path.join(os.getcwd(),'temp','loaded.stl')
    print temp_stl_path
    with open(temp_stl_path, 'w') as file_:
        import base64
        file_.write(base64.b64decode(content))
        sunrise.slicer.file_to_svg(temp_stl_path,50)
        response = name + " successfully sliced"
        loaded=True
        publish('sliced','File sliced')
        return response
コード例 #8
0
ファイル: complete_example.py プロジェクト: Jesus89/rainbow
def add(a=0, b=1.2, c=False, d={"item": True}, l=[1, 2, 3]):
    """Add a + b"""
    publish('event.add', '{0} + {1}'.format(a, b))
    return a + b
コード例 #9
0
def pub():
    publish('event', 1234)
コード例 #10
0
ファイル: complete_example.py プロジェクト: Jesus89/rainbow
def sub(a=0, b=3, text="text"):
    """Subtract a - b"""
    publish('event.sub', '{0} - {1}'.format(a, b))
    return a - b
コード例 #11
0
def add(a=0, b=1.2, c=False, d={"item": True}, l=[1, 2, 3]):
    """Add a + b"""
    publish('event.add', '{0} + {1}'.format(a, b))
    return a + b
コード例 #12
0
ファイル: thread_example.py プロジェクト: Jesus89/rainbow
def _start():
    global running
    while running:
        print("Hello, world!")
        publish('event.hello', "Hello, world!")
        time.sleep(3)
コード例 #13
0
def sub(a=0, b=3, text="text"):
    """Subtract a - b"""
    publish('event.sub', '{0} - {1}'.format(a, b))
    return a - b
コード例 #14
0
ファイル: args_example.py プロジェクト: Jesus89/rainbow
def test0():
    "Publish an event"
    publish("event", {"v": 3.14})
コード例 #15
0
ファイル: args_example.py プロジェクト: marciopocebon/rainbow
def test0():
    "Publish an event"
    publish('event', {'v': 3.14})
コード例 #16
0
def _start():
    global running
    while running:
        print("Hello, world!")
        publish('event.hello', "Hello, world!")
        time.sleep(3)
コード例 #17
0
ファイル: publish_example.py プロジェクト: Jesus89/rainbow
def pub():
    publish('event', 1234)