From d227f1a0e208baa678d91b736e6f77fa0c257b88 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sun, 2 Jun 2019 11:39:22 +0300 Subject: [PATCH] #Studio_Fix #Favico_rev2 --- Robot/Robot.py | 10 +++++++++- Studio/Studio.py | 13 +++---------- Studio/Web/Index.xhtml | 11 ++++++----- Studio/Web/favicon.ico | Bin 5430 -> 5430 bytes 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Robot/Robot.py b/Robot/Robot.py index da9dbe3c..e6e1c8d1 100644 --- a/Robot/Robot.py +++ b/Robot/Robot.py @@ -68,8 +68,8 @@ mProcessGUI_x32 = subprocess.Popen(['..\\Resources\\WPy32-3720\\python-3.7.2\\py #Section: Activity #################### def ActivityRun(inActivitySpecificationDict): - #Выполнить отправку в модуль GUI, если ModuleName == "GUI" + #pdb.set_trace() if inActivitySpecificationDict["ModuleName"] == "GUI": if "ArgumentList" not in inActivitySpecificationDict: inActivitySpecificationDict["ArgumentList"]=[] @@ -104,3 +104,11 @@ def ActivityRun(inActivitySpecificationDict): lResponseObject["ErrorMessage"]=str(e) lResponseObject["ErrorTraceback"]=traceback.format_exc() return lResponseObject +######################################################### +#Run list of activities +######################################################### +def ActivityListRun(inActivitySpecificationDictList): + lResult=[] + for lItem in inActivitySpecificationDictList: + lResult.append(ActivityRun(lItem)) + return lResult \ No newline at end of file diff --git a/Studio/Studio.py b/Studio/Studio.py index 350d5cb6..1ec71723 100644 --- a/Studio/Studio.py +++ b/Studio/Studio.py @@ -145,16 +145,9 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler): lRequestObject=lInputObject lOutputObject=[] #pdb.set_trace() - #Циклическая отправка запросов в дочерний объект - for lItem in lRequestObject: - #Отправить запрос в дочерний процесс, который отвечает за работу с Windows окнами - ProcessCommunicator.ProcessChildSendObject(p,lItem) - #Получить ответ от дочернего процесса - lResponseObject=ProcessCommunicator.ProcessChildReadWaitObject(p) - #Добавить в выходной массив - lOutputObject.append(lResponseObject) + lResponseObject=Robot.ActivityListRun(lRequestObject) #Сформировать текстовый ответ - message = json.dumps(lOutputObject) + message = json.dumps(lResponseObject) # Write content as utf-8 data self.wfile.write(bytes(message, "utf8")) return @@ -166,9 +159,9 @@ def run(): server_address = ('127.0.0.1', 8081) httpd = HTTPServer(server_address, testHTTPServer_RequestHandler) print('running server...') - httpd.serve_forever() #Запуск адреса в браузере os.system("explorer http://127.0.0.1:8081") + httpd.serve_forever() #Start childprocess 32 bit #p = subprocess.Popen(['..\\Resources\\WPy32-3720\\python-3.7.2\\python.exe','winGUI.py'],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) diff --git a/Studio/Web/Index.xhtml b/Studio/Web/Index.xhtml index 2a734a87..5494bd2b 100644 --- a/Studio/Web/Index.xhtml +++ b/Studio/Web/Index.xhtml @@ -344,7 +344,7 @@ $.ajax({ type: "POST", url: 'GUIAction', - data: '{"functionName":"ElementRunAction","argsArray":[[{"handle":'+inHandleId+'}],"draw_outline"]}', + data: '{"ModuleName":"GUI","ActivityName":"UIOSelectorUIOActivity_Run_Dict","ArgumentList":[[{"handle":'+inHandleId+'}],"draw_outline"]}', success: function(lData,l2,l3) { @@ -467,8 +467,8 @@ var lActionArgumentList = $('.rpa-argument-list')[0].value if (lActionArgumentList=="") lActionArgumentList="[]" ///Сформировать строку спецификации действия - lActionSpecificationObject = {"functionName":"ElementRunAction","argsArray":[JSON.parse(lActionElementSpecification),lActionName,JSON.parse(lActionArgumentList)]} - lActionSpecificationString = '{"functionName":"ElementRunAction","argsArray":['+lActionElementSpecification+',"'+lActionName+'",'+lActionArgumentList+']}' + lActionSpecificationObject = {"ModuleName":"GUI","ActivityName":"UIOSelectorUIOActivity_Run_Dict","ArgumentList":[JSON.parse(lActionElementSpecification),lActionName,JSON.parse(lActionArgumentList)]} + lActionSpecificationString = '{"ModuleName":"GUI","ActivityName":"UIOSelectorUIOActivity_Run_Dict","ArgumentList":['+lActionElementSpecification+',"'+lActionName+'",'+lActionArgumentList+']}' ///Добавить в массив действий mGlobal.ActionSpecificationList.push(lActionSpecificationObject) ///Обновить визуализацию @@ -481,8 +481,8 @@ var lActionArgumentList = $('.rpa-argument-list')[0].value if (lActionArgumentList=="") lActionArgumentList="[]" ///Сформировать строку спецификации действия - lActionSpecificationObject = {"functionName":"PywinautoExtElementWaitAppear","argsArray":[JSON.parse(lActionElementSpecification)]} - lActionSpecificationString = '{"functionName":"PywinautoExtElementWaitAppear","argsArray":['+lActionElementSpecification+']}' + lActionSpecificationObject = {"ModuleName":"GUI","ActivityName":"PywinautoExtElementWaitAppear","ArgumentList":[JSON.parse(lActionElementSpecification)]} + lActionSpecificationString = '{"ModuleName":"GUI","ActivityName":"PywinautoExtElementWaitAppear","ArgumentList":['+lActionElementSpecification+']}' ///Добавить в массив действий mGlobal.ActionSpecificationList.push(lActionSpecificationObject) ///Обновить визуализацию @@ -491,6 +491,7 @@ ///Добавить действие сон 2 секунды в список на исполнение mGlobal.GUIActionSleep2sAddToList = function() { ///Сформировать строку спецификации действия + alert("No function GeneralSleep2s in robot") lActionSpecificationObject = {"functionName":"GeneralSleep2s","argsArray":[]} lActionSpecificationString = '{"functionName":"GeneralSleep2s","argsArray":[]}' ///Добавить в массив действий diff --git a/Studio/Web/favicon.ico b/Studio/Web/favicon.ico index 27dd469630f8aa57a617634bd564672777cbf8e5..79e3b24aa2799582bd97e2e6b645f0e00bbef35c 100644 GIT binary patch literal 5430 zcmchXv2GJl5JeZn2jml6AwGeE!b+JkO_VN4g+M|P1qwnaR#Jp2KY)@{k!jMbaB+Ye%3V4o2D6!=I3u+{=Cb* z=yKh*L(KDCXvST>@433V8ed#oOpcF_XNQM}EsHbxzFu%=XJ_r^=H}Ac-Q8_3FE3{` z9%^8=wzk@xot@eC_ICUB!<&{!PEPnU2fFlv0ef(8Fv08l@9)~_@9W9l-rhKK#982^ zj+P6))32v@z4(b7)X;?E=H_OyzrWv}9DSZePI{aNUwDE$&H)}C^6bH@j~*Q2b3fmU z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