|
|
|
@ -9,6 +9,7 @@ import PIL
|
|
|
|
|
from PIL import ImageGrab
|
|
|
|
|
from threading import Thread
|
|
|
|
|
import orchestratorProcessor
|
|
|
|
|
|
|
|
|
|
def SaveScreenshot(inFilePath):
|
|
|
|
|
# grab fullscreen
|
|
|
|
|
lScreenshot = ImageGrab.grab()
|
|
|
|
@ -18,13 +19,17 @@ def SaveScreenshot(inFilePath):
|
|
|
|
|
#Глобальные переменные
|
|
|
|
|
global mActivityLogDict
|
|
|
|
|
|
|
|
|
|
mJSONConfigurationDict={}
|
|
|
|
|
#inGlobalDict
|
|
|
|
|
# "JSONConfigurationDict":<JSON>
|
|
|
|
|
class RobotDaemonServer(Thread):
|
|
|
|
|
def __init__(self,name,inJSONConfigurationDict):
|
|
|
|
|
def __init__(self,name,inGlobalDict):
|
|
|
|
|
Thread.__init__(self)
|
|
|
|
|
self.name = name
|
|
|
|
|
global mJSONConfigurationDict
|
|
|
|
|
mJSONConfigurationDict=inJSONConfigurationDict
|
|
|
|
|
mJSONConfigurationDict=inGlobalDict["JSONConfigurationDict"]
|
|
|
|
|
|
|
|
|
|
#Перенос переменной в orchestratorProcessor
|
|
|
|
|
orchestratorProcessor.mGlobalDict=inGlobalDict
|
|
|
|
|
def run(self,inServerAddress="127.0.0.1",inPort=8081):
|
|
|
|
|
print('starting server...')
|
|
|
|
|
# Server settings
|
|
|
|
@ -111,7 +116,7 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
|
|
|
|
|
self.send_header('Content-type','application/json')
|
|
|
|
|
self.end_headers()
|
|
|
|
|
# Send message back to client
|
|
|
|
|
message = json.dumps(robotDaemonProcessor.ProcessingRun(lInputObject))
|
|
|
|
|
message = json.dumps(orchestratorProcessor.ProcessingRun(lInputObject))
|
|
|
|
|
# Write content as utf-8 data
|
|
|
|
|
self.wfile.write(bytes(message, "utf8"))
|
|
|
|
|
return
|
|
|
|
|