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