|
@@ -111,6 +111,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def callFirstOptionShortCutKey(self):
|
|
|
if 'shortcut_key' in self.__optionPaths['First']:
|
|
|
COptionAction.__redRat3.sendKey(self.__optionPaths['First']['shortcut_key'])
|
|
@@ -123,6 +124,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def callCurOptionBackKey(self, curOptionName):
|
|
|
curOptionInfo = self.__optionExcel.getOptionInfo(curOptionName)
|
|
|
if 'toparent_key' in self.__optionPaths[curOptionInfo['level']]:
|
|
@@ -179,11 +181,7 @@ class COptionAction(CBaseLog):
|
|
|
curOthers = json.loads(self.__optionPaths[curLevel]['others'])
|
|
|
firstParent = self.__optionPaths['First']['option']
|
|
|
# 是否在value表中;
|
|
|
- if self.__optionValue == "":
|
|
|
- isValueSheet = False
|
|
|
- else:
|
|
|
- isValueSheet = True if self.__pos >= self.__optionPaths.__len__() else False
|
|
|
-
|
|
|
+ isValueSheet = self.isOnValueSheet()
|
|
|
self.info(u"当前层级在:%s" % ("value表" if isValueSheet else "路径表"))
|
|
|
|
|
|
# 获取文本识别的参数;
|
|
@@ -224,6 +222,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def move2NextSiblingOption(self):
|
|
|
# 获取当前option信息;
|
|
|
self.getCurOptionInfo()
|
|
@@ -239,6 +238,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def move2PrevSiblingOption(self):
|
|
|
# 获取当前option信息;
|
|
|
self.getCurOptionInfo()
|
|
@@ -254,6 +254,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def back2ParentOption(self):
|
|
|
# 获取当前option信息;
|
|
|
self.getCurOptionInfo()
|
|
@@ -269,6 +270,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def enterOption(self):
|
|
|
# 获取当前option信息;
|
|
|
self.getCurOptionInfo()
|
|
@@ -284,6 +286,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def setCurOptionValue(self, value):
|
|
|
# 获取当前option信息;
|
|
|
self.getCurOptionInfo()
|
|
@@ -295,6 +298,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def getCurOptionInfo(self):
|
|
|
if self.__pos >= self.__optionPaths.__len__():
|
|
|
self.warn(u"已到达value节点,无法获取路径信息")
|
|
@@ -307,6 +311,35 @@ class COptionAction(CBaseLog):
|
|
|
|
|
|
return True
|
|
|
|
|
|
+ '''
|
|
|
+ 函数:当前节点是否在value sheet层级中;
|
|
|
+ 参数:
|
|
|
+ 返回:
|
|
|
+ '''
|
|
|
+
|
|
|
+ def isOnValueSheet(self):
|
|
|
+ if self.__optionValue == "": # 该值空,表明不会移动到value sheet中;
|
|
|
+ return False
|
|
|
+ else:
|
|
|
+ return True if self.__pos >= self.__optionPaths.__len__() else False
|
|
|
+
|
|
|
+ '''
|
|
|
+ 函数:
|
|
|
+ 参数:
|
|
|
+ 返回:
|
|
|
+ '''
|
|
|
+ def isNumberText(self, textList):
|
|
|
+ # 是否获取数值文本;
|
|
|
+ isNumberText = False
|
|
|
+ # 如果是value表,且兄弟项文本为range
|
|
|
+ # 注:value表中的option实际并没有兄弟项,取的是所有value项
|
|
|
+ if self.isOnValueSheet() and textList.__len__():
|
|
|
+ if textList[0].startswith('range('):
|
|
|
+ self.info(u"识别的内容是value表数字内容(range(0,xx)类型)")
|
|
|
+ isNumberText = True
|
|
|
+
|
|
|
+ return isNumberText
|
|
|
+
|
|
|
|
|
|
'''
|
|
|
函数:获取静态图片文本内容
|
|
@@ -407,6 +440,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def __getDynamicPicText(self, optionName, optionTextList, siblingTextList, ocrConfigList, ocrThreshold, marqueeDict,
|
|
|
isNumberText, isValueSheet):
|
|
|
# 判断图片是否动态:截图两次,判断两次文本内容是否相同;
|
|
@@ -493,6 +527,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def __getOptionInfoDict(self, optionNameList):
|
|
|
OptionInfoDict = {}
|
|
|
for optionName in optionNameList:
|
|
@@ -509,6 +544,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def __findDuplicateString(self, str1, str2, direction="right"):
|
|
|
index = 0
|
|
|
if direction == "right":
|
|
@@ -537,6 +573,7 @@ class COptionAction(CBaseLog):
|
|
|
参数:
|
|
|
返回:
|
|
|
'''
|
|
|
+
|
|
|
def __removeDuplicateString(self, strList):
|
|
|
finishedList = strList
|
|
|
directionList = ["left", "right"]
|