Ejemplo n.º 1
0
 def startUpdater(self, mpUpdater):
     queueCmd = aioprocessing.AioQueue()
     queueData = aioprocessing.AioQueue()
     self.updater = aioprocessing.AioProcess(name='updater', target=startcoUpdater, args=(queueCmd, queueData))
     self.updater.start()
     StartCoroutine(mpUpdater(self.updater, queueCmd, queueData), self)
     return queueCmd, queueData
Ejemplo n.º 2
0
 def AppStart(self):
     self.BackgroundInitialization()
     self.CreateUI()
     self.CloseSplash()
     self.ShowUI()
     if self.test:
         StartCoroutine(self.frame.test, self.frame)
         self.app.ExitMainLoop()
Ejemplo n.º 3
0
    def __init__(self, confnodesroot, comportstr):

        self.TransactionLock = Lock()
        self.PLCStatus = "Disconnected"
        self.confnodesroot = confnodesroot
        self.PLCprint = confnodesroot.logger.write
        self._Idxs = []
        self.ip = comportstr
        self.TransactionLock.acquire()
        try:
            self.Connection = YAPLCProto(comportstr, 8888, 1)
        except Exception as e:
            print(str(e) + "\n")
            self.Connection = None
            self.PLCStatus = None  # ProjectController is responsible to set "Disconnected" status
            StartCoroutine(self.confnodesroot._SetConnector(None), self.confnodesroot.AppFrame)
        self.TransactionLock.release()
        self.errCount = 0
        self.lasttime = 0
Ejemplo n.º 4
0
    def startWeb(self, loop):

        self.app = web.Application(loop=loop)
        # GraphQLView.attach(app,schema=schema,graphiql=True)
        gql_view = GraphQLView(schema=schema, graphiql=True, executor=AsyncioExecutor(loop=loop), )
        self.app.router.add_route('GET', '/graphql', gql_view, name='graphql')
        post = self.app.router.add_route('POST', '/graphql', gql_view, name='graphql')
        cors = aiohttp_cors.setup(
            self.app,
            defaults={
                "*": aiohttp_cors.ResourceOptions(
                    allow_credentials=True,
                    expose_headers="*",
                    allow_headers="*",
                )
            }
        )
        cors.add(post)
        self.app.add_routes(routes)
        static = self.app.router.add_static("/", os.path.join(application_path, 'dist'), show_index=True)
        static = self.app.router.add_static("/help", os.path.join(application_path, 'kvpac_beremiz', 'dist'),
                                            show_index=True)
        StartCoroutine(web._run_app(self.app, port=65000), self)
Ejemplo n.º 5
0
 def __init__(self, parent):
     self.reader = None
     self.writer = None
     self.lock = asyncio.Lock()
     self.lock.locked()
     StartCoroutine(self.connect(parent), self)