Exemplo n.º 1
0
 def clear_cache(self):
     """清理缓存"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.系统[0],
                  screen_point.系统[1])
         m1.click(self.BECivilWin, '', screen_point.清除[0],
                  screen_point.清除[1])
         sleep(2)
         if w0.exists():
             w0.wait(3)
             t1 = w0.getPos()
             if t1 == (832, 437, 1088, 603):
                 pass
             else:
                 raise Exception('Something went wrong.')
             w0.controlClick('[CLASS:Button; INSTANCE:1]')
             sleep(3)
             if w0.exists():
                 w0.wait(3)
                 t2 = w0.getPos()
                 if t2 == (845, 438, 1075, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick('[CLASS:Button; INSTANCE:2]')
             else:
                 raise Exception("没有弹出退出确认窗口")
         else:
             raise Exception("没有弹出清理缓存窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 2
0
 def manage_working_set(self):
     """管理工作集"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.系统[0],
                  screen_point.系统[1])
         m1.click(self.BECivilWin, '', screen_point.管理工作集[0],
                  screen_point.管理工作集[1])
         sleep(2)
         w1 = WinControl('管理工作集')
         if w1.exists():
             w1.wait(3)
             #w1.setState(3)
             w1.controlSetText('[CLASS:Edit; INSTANCE:1]', '测试脚本用创建工作集')
             sleep(3)
             # 选中要删除的工作集
             m1.click('管理工作集', '', 880, 390)
             sleep(2)
             # 点击删除
             m1.click('管理工作集', '', 870, 760)
             sleep(2)
             if w0.exists():
                 sleep(2)
                 t1 = w0.getPos()
                 if t1 == (844, 438, 1076, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick('[CLASS:Button; INSTANCE:1]')
                 sleep(3)
                 if w0.exists():
                     t2 = w0.getPos()
                     if t2 == (880, 438, 1040, 602):
                         pass
                     else:
                         raise Exception('Something went wrong.')
                     sleep(2)
                     if w0.exists():
                         t3 = w0.getPos()
                         if t3 == (880, 438, 1040, 602):
                             pass
                         else:
                             raise Exception('Something went wrong.')
                         w0.controlClick('[CLASS:Button; INSTANCE:1]')
                     else:
                         raise Exception('未弹出删除确认框')
                 else:
                     raise Exception('未弹出删除成功选择框')
             else:
                 raise Exception('未弹出删除工作集选择框')
             sleep(2)
             # 关闭管理工作集窗口
             m1.click('管理工作集', '', 1114, 263)
         else:
             raise Exception("未弹出管理工作集窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 3
0
 def format_painter(self):
     """格式刷"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.格式刷[0],
                  screen_point.格式刷[1])
         sleep(2)
         # 勾选“未定义状态”构件
         w0.controlClick("[CLASS:Button; INSTANCE:14]")
         sleep(2)
         # 选择需要使用格式刷的构件
         m1.click(self.BECivilWin, '', 1060, 505)
         sleep(1)
         m1.click(self.BECivilWin, '', 980, 640)
         sleep(1)
         m1.click(self.BECivilWin, '', 980, 640, button='right')
         sleep(2)
         if w0.exists():
             w0.wait(3)
             t = w0.getPos()
             if t == (832, 437, 1088, 603):
                 pass
             else:
                 raise Exception('Something went wrong.')
             w0.controlClick('[CLASS:Button; INSTANCE:1]')
         else:
             raise Exception("未弹出刷新状态确认框")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 4
0
	def monitoring_panel(self):
		"""监控面板"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.沙盘[0], screen_point.沙盘[1])
			m1.click(self.BECivilWin, '', screen_point.监控面板[0], screen_point.监控面板[1])
			sleep(1)
			# 启用沙盘模式
			if w0.exists():
				w0.wait(3)
				t = w0.getPos()
				if t == (830, 438, 1090, 602):
					pass
				else:
					raise Exception('Something went wrong.')
				w0.controlClick('[CLASS:Button; INSTANCE:1]')
			else:
				raise Exception('未打开开启沙盘模式窗口')
			sleep(13)
			# 点击添加监控
			m1.click(self.BECivilWin, '', 1800, 320)
			sleep(7)
			w1 = WinControl('添加监控')
			if w1.exists():
				w1.wait(3)
				w1.controlClick("[CLASS:Button; INSTANCE:1]")
			else:
				raise Exception("未弹出添加监控窗口")
			sleep(4)
			m1.click(self.BECivilWin, '', screen_point.沙盘模式[0], screen_point.沙盘模式[1])
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 5
0
 def quit_BECivil(self):
     """退出BECivil"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         m1 = MouseControl()
         w0.wait(3)
         m1.click(self.BECivilWin, '', 1900, 13)
         if w0.exists():
             w0.wait(3)
             t = w0.getPos()
             if t == (845, 438, 1075, 602):
                 pass
             else:
                 raise Exception('Something went wrong.')
             sleep(1)
             w0.controlClick('[CLASS:Button; INSTANCE:1]')
         else:
             raise Exception('未弹出确认关闭软件窗口')
     else:
         raise Exception('未识别BECivil打开的窗口')
     sleep(5)
     if w0.exists():
         raise Exception('关闭软件未成功')
     else:
         pass
Exemplo n.º 6
0
	def add_monitor(self):
		""" """
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.沙盘[0], screen_point.沙盘[1])
			m1.click(self.BECivilWin, '', screen_point.沙盘模式[0], screen_point.沙盘模式[1])
			sleep(2)
			# 使视图视角变为俯视视角
			m1.click(self.BECivilWin, '', 440, 440, button='right')
			m1.click(self.BECivilWin, '', 490, 475)
			sleep(2)
			m1.click(self.BECivilWin, '', screen_point.插入监控[0], screen_point.插入监控[1])
			w1 = WinControl('插入监控')
			sleep(2)
			if w1.exists():
				w1.wait(3)
				# 关联监控
				w1.controlClick('[CLASS:Button; INSTANCE:3]')
				sleep(8)
				w2 = WinControl('关联监控')
				if w2.exists():
					w2.wait(3)
					m1.click('关联监控', '', 623, 375)
					sleep(2)
					w2.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未打开关联监控窗口")
				sleep(1)
				# 详细位置
				w1.controlClick("[CLASS:Button; INSTANCE:4]")
				sleep(1)
				m1.click(self.BECivilWin, '', 1050, 520)
				sleep(1)
				m1.click(self.BECivilWin, '', 1050, 520, button='right')
				sleep(2)
				m1.click(self.BECivilWin, '', 1100, 535)
				sleep(1)
				if w1.exists():
					w1.wait(3)
					w1.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未打开插入监控窗口")
			else:
				raise Exception("未打开插入监控窗口")
			sleep(2)
			if w0.exists():
				w0.wait(3)
				t = w0.getPos()
				if t == (862, 438, 1058, 602):
					pass
				else:
					raise Exception('Something went wrong.')
				w0.controlClick("[CLASS:Button; INSTANCE:1]")
			else:
				raise Exception("未显示插入监控成功窗口")
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 7
0
	def add_node(self):
		"""添加钢筋节点"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			sleep(2)
			# 使视图视角变为俯视视角
			m1.click(self.BECivilWin, '', 440, 440, button='right')
			m1.click(self.BECivilWin, '', 490, 475)
			m1.click(self.BECivilWin, '', screen_point.操作[0], screen_point.操作[1])
			m1.click(self.BECivilWin, '', screen_point.插入节点[0], screen_point.插入节点[1])
			w1 = WinControl('插入节点')
			sleep(1)
			if w1.exists():
				w1.wait(3)
				# 上传文件
				m1.click('插入节点', '', 970, 360)
				sleep(1)
				w2 = WinControl('打开')
				if w2.exists():
					w2.wait(3)
					m1.click('打开', '', 1000, 50)
					w2.controlSetText('[CLASS:Edit; INSTANCE:2]', self.uploadaddress)
					autoit.send("{ENTER}")
					sleep(1)
					w2.controlSetText('[CLASS:Edit; INSTANCE:1]', '钢筋节点 (2).lbg')
					w2.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					raise Exception('未打开上传节点文件窗口')
				sleep(2)
				# 详细位置
				m1.click('插入节点', '', 970, 450)
				sleep(1)
				# 选择要插入节点的位置
				m1.click(self.BECivilWin, '', 1050, 504)
				m1.click(self.BECivilWin, '', 1050, 504, button='right')
				sleep(1)
				m1.click(self.BECivilWin, '', 1100, 514)
				sleep(2)
				w1.controlClick('[CLASS:Button; INSTANCE:1]')
				sleep(5)
				if w0.exists():
					w0.wait(3)
					t = w0.getPos()
					if t == (862, 438, 1058, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					raise Exception('节点插入未成功')
			else:
				raise Exception('未打开插入节点窗口')
		else:
			raise Exception('未识别BECivil窗口')
Exemplo n.º 8
0
	def service_setting(self):
		""" 、服务设置"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.沙盘[0], screen_point.沙盘[1])
			m1.click(self.BECivilWin, '', screen_point.服务设置[0], screen_point.服务设置[1])
			sleep(1)
			w1 = WinControl("第三方监控服务设置")
			if w1.exists():
				w1.wait(3)
				# 检测
				w1.controlClick("[CLASS:Button; INSTANCE:1]")
				sleep(7)
				if w0.exists():
					w0.wait(3)
					t1 = w0.getPos()
					if t1 == (880, 438, 1040, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未弹出检测成功窗口")
				sleep(2)
				# 确定
				w1.controlClick("[CLASS:Button; INSTANCE:2]")
				sleep(7)
				if w0.exists():
					w0.wait(3)
					t2 = w0.getPos()
					if t2 == (868, 438, 1052, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未弹出保存设置成功窗口")
			else:
				raise Exception("未弹出第三方监控服务设置")
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 9
0
	def monitor_management(self):
		"""监控管理"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.沙盘[0], screen_point.沙盘[1])
			m1.click(self.BECivilWin, '', screen_point.监控管理[0], screen_point.监控管理[1])
			sleep(1)
			w1 = WinControl("监控管理")
			if w1.exists():
				w1.wait(3)
				# 监控查看
				m1.click('监控管理', '', 1140, 300)
				sleep(7)
				w2 = WinControl("监控查看")
				if w2.exists():
					w2.wait(3)
					w2.controlClick("[CLASS:Button; INSTANCE:3]")
					sleep(2)
					w2.controlClick("[CLASS:Button; INSTANCE:4]")
				else:
					raise Exception("未打开监控查看窗口")
				sleep(2)
				# 编辑监控
				m1.click('监控管理', '', 1180, 300)
				sleep(2)
				w3 = WinControl("编辑监控")
				if w3.exists():
					w3.wait(3)
					w3.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未打开编辑监控窗口")
				sleep(2)
				# 删除
				m1.click('监控管理', '', 1260, 300)
				sleep(1)
				if w0.exists():
					w0.wait(3)
					t = w0.getPos()
					if t == (845, 438, 1075, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception("未识别确认删除窗口")
				# 关闭监控管理窗口
				m1.click('监控管理', '', 1360, 210)
			else:
				raise Exception('未识别监控管理窗口')
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 10
0
 def creat_working_set(self):
     """创建工作集"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.系统[0],
                  screen_point.系统[1])
         m1.click(self.BECivilWin, '', screen_point.创建工作集[0],
                  screen_point.创建工作集[1])
         w1 = WinControl('创建工作集')
         sleep(2)
         if w1.exists():
             w1.wait(3)
             w1.controlSetText('[CLASS:Edit; INSTANCE:1]', '测试脚本用创建工作集')
             w1.controlClick('[CLASS:Button; INSTANCE:1]')
             w2 = WinControl('选择所属项目部')
             sleep(2)
             if w2.exists():
                 # 选择IM测试
                 m1.click('选择所属项目部', '', 850, 385)
                 w2.controlClick('[CLASS:Button; INSTANCE:1]')
             else:
                 raise Exception("未选中选择所属项目部窗口")
             sleep(2)
             # 选中需要创建工作集的两个工程
             m1.click('创建工作集', '', 780, 390)
             m1.click('创建工作集', '', 780, 420)
             w1.controlClick('[CLASS:Button; INSTANCE:3]')
             sleep(2)
             if w0.exists():
                 w0.wait(3)
                 t = w0.getPos()
                 if t == (826, 438, 1094, 602):
                     pass
                 else:
                     raise Exception('未弹出打开工作集选择框')
                 sleep(1)
                 w0.controlClick('[CLASS:Button; INSTANCE:2]')
             else:
                 raise Exception('未弹出打开工作集选择框')
         else:
             raise Exception("未选中创建工作集窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 11
0
 def state_statistics(self):
     """状态统计"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.状态统计[0],
                  screen_point.状态统计[1])
         sleep(2)
         w0.controlClick("[CLASS:Button; INSTANCE:24]")
         sleep(2)
         w0.controlClick("[CLASS:Button; INSTANCE:25]")
         sleep(3)
         w1 = WinControl("另存为")
         if w1.exists():
             w1.wait(3)
             w1.setState(3)
             m1.click('另存为', '', 1060, 50)
             autoit.send(self.downloadaddress)
             autoit.send("{ENTER}")
             sleep(2)
             w1.controlClick("[CLASS:Button; INSTANCE:1]")
             sleep(1)
             w2 = WinControl("确认另存为")
             if w2.exists():
                 w2.wait(3)
                 w2.controlClick("[CLASS:Button; INSTANCE:1]")
             else:
                 pass
             sleep(35)
             if w0.exists():
                 w0.wait(3)
                 t = w0.getPos()
                 if t == (832, 438, 1088, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick("[CLASS:Button; INSTANCE:2]")
         else:
             raise Exception("未能打开另存为窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 12
0
	def download_porject(self):
		"""下载工程"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.系统[0], screen_point.系统[1])
			m1.click(self.BECivilWin, '', screen_point.下载工程[0], screen_point.下载工程[1])
			sleep(2)
			w1 = WinControl('浏览文件夹')
			if w1.exists():
				w1.wait(3)
				# 选择下载的目标地址
				w1.controlTreeView('[CLASS:SysTreeView32; INSTANCE:1]', 'Select', extra='桌面')
				choose_direction(6)
				choose_direction(3)
				choose_direction(1)
				choose_direction(2)
				sleep(2)
				w1.controlClick('Button1')
				if w0.exists():
					w0.wait(3)
					t = w0.getPos()
					# 目标文件夹没有下载过该工程
					if t == (0, 0, 1920, 1040):
						pass
					# 目标文件夹曾经下载过该工程
					elif t == (832, 438, 1088, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					sleep(2)
					w0.controlClick('[CLASS:Button; INSTANCE:1]')
				else:
					pass
				sleep(1)
				w2 = WinControl('下载管理器')
				if w2.exists():
					pass
				else:
					raise Exception('未弹出下载管理器窗口')
			else:
				raise Exception("未选中浏览文件夹窗口")
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 13
0
 def refresh_data(self):
     """刷新数据"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.刷新数据[0],
                  screen_point.刷新数据[1])
         sleep(4)
         if w0.exists():
             w0.wait(3)
             t = w0.getPos()
             if t == (838, 438, 1082, 602):
                 pass
             else:
                 raise Exception('Something went wrong.')
             w0.controlClick("[CLASS:Button; INSTANCE:1]")
         else:
             raise Exception("数据刷新未完成")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 14
0
 def sand_table_cockpit(self):
     """沙盘驾驶舱"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.沙盘模式[0],
                  screen_point.沙盘模式[1])
         m1.click(self.BECivilWin, '', screen_point.沙盘驾驶舱[0],
                  screen_point.沙盘驾驶舱[1])
         sleep(3)
         w1 = WinControl(" 沙盘驾驶舱")
         if w1.exists():
             w1.wait(3)
             # 播放
             m1.click(' 沙盘驾驶舱', '', 190, 970)
             sleep(3)
             # 刷新
             m1.click(' 沙盘驾驶舱', '', 450, 40)
             sleep(3)
             if w0.exists():
                 w0.wait(3)
                 t = w0.getPos()
                 if t == (838, 438, 1082, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 sleep(1)
                 w0.controlClick("[CLASS:Button; INSTANCE:1]")
             else:
                 raise Exception("未弹出刷新完成窗口")
             # 关闭沙盘驾驶舱窗口
             m1.click(' 沙盘驾驶舱', '', 1905, 10)
         else:
             raise Exception("未打开沙盘驾驶舱窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 15
0
 def upload_picture(self):
     """ """
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.上传图片[0],
                  screen_point.上传图片[1])
         sleep(1)
         w1 = WinControl('打开')
         if w1.exists():
             w1.wait(3)
             m1.click('打开', '', 1110, 45)
             sleep(1)
             w1.controlSetText('[CLASS:Edit; INSTANCE:2]',
                               self.uploadaddress)
             autoit.send("{ENTER}")
             sleep(1)
             w1.controlSetText('[CLASS:Edit; INSTANCE:1]', r'picture1.jpg')
             sleep(1)
             w1.controlClick("[CLASS:Button; INSTANCE:1]")
             sleep(3)
             if w0.exists():
                 w0.wait(3)
                 t = w0.getPos()
                 if t == (874, 438, 1046, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick("[CLASS:Button; INSTANCE:1]")
             else:
                 raise Exception("未弹出上传成功窗口")
         else:
             raise Exception("未弹出打开窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 16
0
 def quit_BECivil(self):
     """退出"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.系统[0],
                  screen_point.系统[1])
         m1.click(self.BECivilWin, '', screen_point.退出[0],
                  screen_point.退出[1])
         sleep(2)
         if w0.exists():
             w0.wait(3)
             t = w0.getPos()
             if t == (845, 438, 1075, 602):
                 pass
             else:
                 raise Exception('Something went wrong.')
             w0.controlClick('[CLASS:Button; INSTANCE:1]')
         else:
             raise Exception("没有弹出退出确认窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 17
0
	def local_task(self):
		"""本地任务"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.系统[0], screen_point.系统[1])
			m1.click(self.BECivilWin, '', screen_point.本地任务[0], screen_point.本地任务[1])
			w1 = WinControl("  本机处理任务")
			if w1.exists():
				w1.wait(3)
				w1.setState(3)
				# 历史记录
				m1.click("  本机处理任务", '', 85, 30)
				# 删除此次上传的两条记录
				for i in range(2):
					m1.click("  本机处理任务", '', 50, 90)
					w1.controlClick('Button1')
					if w0.exists():
						w0.waitActive(3)
						# 识别确定删除窗口关联的进程ID
						t = w0.getPos()
						if t == (845, 438, 1075, 602):
							pass
						else:
							raise Exception("未成功删除该任务")
						sleep(1)
						w0.controlClick('Button1')
						sleep(1)
					else:
						raise Exception("未成功删除该任务")
				sleep(1)
				# 关闭本机处理任务
				m1.click("  本机处理任务", '', 1905, 5)
			else:
				raise Exception("未选中本机任务窗口")
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 18
0
	def export_the_qr_code(self):
		"""导出二维码"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.操作[0], screen_point.操作[1])
			m1.click(self.BECivilWin, '', screen_point.导出二维码[0], screen_point.导出二维码[1])
			# 选中需要导出二维码的构件
			m1.click(self.BECivilWin, '', 810, 500)
			# 右键导出
			m1.click(self.BECivilWin, '', 810, 500, button='right')
			m1.click(self.BECivilWin, '', 730, 510)
			sleep(2)
			w1 = WinControl('选择文件夹')
			if w1.exists():
				w1.wait(3)
				w1.controlSetText('[CLASS:Edit; INSTANCE:1]', self.downloadaddress + '\二维码下载')
				sleep(1)
				w1.controlClick('[CLASS:Button; INSTANCE:1]')
			else:
				raise Exception("未打开选择文件夹窗口")
			sleep(3)
			if w0.exists():
				w0.wait(3)
				t = w0.getPos()
				if t == (862, 438, 1058, 602):
					pass
				else:
					raise Exception('Something went wrong.')
				sleep(1)
				w0.controlClick('[CLASS:Button; INSTANCE:1]')
			else:
				raise Exception("未弹出导出二维码成功窗口")
		else:
			raise Exception("未识别BECivil窗口")
Exemplo n.º 19
0
 def sand_table_pattern(self):
     """沙盘模式"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.沙盘模式[0],
                  screen_point.沙盘模式[1])
         sleep(2)
         w1 = WinControl('欢迎使用沙盘功能')
         if w1.exists():
             w1.wait(3)
             w1.controlClick('[CLASS:Button; INSTANCE:3]')
             sleep(1)
             # 设置开工和竣工时间
             m1.click('欢迎使用沙盘功能', '', 890, 640)
             sleep(3)
             w2 = WinControl('工程时间')
             if w2.exists():
                 w2.wait(3)
                 w2.controlClick('[CLASS:Button; INSTANCE:1]')
             else:
                 raise Exception('未能打开工程时间窗口')
             sleep(1)
             w1.controlClick('[CLASS:Button; INSTANCE:3]')
             sleep(2)
             # 设置监控服务
             m1.click('欢迎使用沙盘功能', '', 830, 640)
             sleep(3)
             w3 = WinControl('第三方监控服务设置')
             if w3.exists():
                 w3.wait(3)
                 # 选择对接平台
                 m1.click('第三方监控服务设置', '', 950, 460)
                 m1.click('第三方监控服务设置', '', 950, 480)
                 w3.controlSetText('[CLASS:Edit; INSTANCE:1]',
                                   self.messgae1)
                 w3.controlSetText('[CLASS:Edit; INSTANCE:2]',
                                   self.messgae2)
                 w3.controlSetText('[CLASS:Edit; INSTANCE:3]',
                                   self.messgae3)
                 w3.controlSetText('[CLASS:Edit; INSTANCE:4]',
                                   self.messgae4)
                 sleep(1)
                 w3.controlClick('[CLASS:Button; INSTANCE:2]')
                 sleep(12)
                 if w0.exists():
                     w0.wait(3)
                     t = w0.getPos()
                     if t == (868, 438, 1052, 602):
                         pass
                     else:
                         raise Exception('Something went wrong.')
                     w0.controlClick('[CLASS:Button; INSTANCE:1]')
                 else:
                     raise Exception('未能成功设置监控服务')
                 w1.controlClick('[CLASS:Button; INSTANCE:3]')
                 sleep(1)
                 w1.controlClick('[CLASS:Button; INSTANCE:3]')
                 sleep(1)
                 w1.controlClick('[CLASS:Button; INSTANCE:3]')
                 sleep(1)
                 w1.controlClick('[CLASS:Button; INSTANCE:3]')
             else:
                 raise Exception('未能打开第三方监控服务设置')
         else:
             raise Exception('未能打开欢迎使用沙盘功能')
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 20
0
 def status_manage(self):
     """状态管理"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.沙盘[0],
                  screen_point.沙盘[1])
         m1.click(self.BECivilWin, '', screen_point.状态管理[0],
                  screen_point.状态管理[1])
         sleep(3)
         w1 = WinControl('状态管理')
         if w1.exists():
             w1.wait(3)
             # 添加新节点
             m1.click('状态管理', '', 750, 300)
             sleep(1)
             # 添加三个新状态
             m1.click('状态管理', '', 810, 300, clicks=3)
             # 使最后一个状态更名为重命名状态1
             autoit.send("重命名状态1")
             autoit.send("{ENTER}")
             sleep(1)
             # 选中新状态
             m1.click('状态管理', '', 830, 730)
             sleep(1)
             # 复制状态
             m1.click('状态管理', '', 830, 730, button='right')
             m1.click('状态管理', '', 890, 785)
             m1.click('状态管理', '', 830, 730, button='right')
             m1.click('状态管理', '', 890, 810)
             sleep(1)
             # 重命名
             m1.click('状态管理', '', 910, 300)
             autoit.send("重命名状态2")
             autoit.send("{ENTER}")
             sleep(1)
             # 上移
             m1.click('状态管理', '', 960, 300)
             sleep(1)
             # 下移
             m1.click('状态管理', '', 1000, 300)
             sleep(1)
             # 升级
             m1.click('状态管理', '', 1045, 300)
             sleep(1)
             # 降级
             m1.click('状态管理', '', 1090, 300)
             sleep(1)
             # 删除
             m1.click('状态管理', '', 860, 300)
             sleep(1)
             if w0.exists():
                 w0.wait(3)
                 t1 = w0.getPos()
                 if t1 == (791, 411, 1127, 628):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick("[CLASS:Button; INSTANCE:1]")
             else:
                 raise Exception("未弹出确认删除窗口")
             # 上传
             m1.click('状态管理', '', 1180, 300)
             sleep(2)
             w2 = WinControl('另存为EDS模板')
             if w2.exists():
                 w2.wait()
                 w2.controlSetText('[CLASS:Edit; INSTANCE:1]', '测试脚本用新增模板')
                 w2.controlClick('[CLASS:Button; INSTANCE:2]')
                 sleep(2)
                 if w0.exists():
                     w0.wait(3)
                     t2 = w0.getPos()
                     if t2 == (835, 436, 1084, 602):
                         pass
                     else:
                         raise Exception('Something went wrong.')
                     w0.controlClick("[CLASS:Button; INSTANCE:1]")
                 else:
                     pass
             else:
                 raise Exception("未打开另存模板窗口")
             sleep(2)
             # 下载
             m1.click('状态管理', '', 1135, 300)
             sleep(5)
             w3 = WinControl('选择EDS模板')
             if w3.exists():
                 w3.wait(3)
                 w3.controlClick("[CLASS:Button; INSTANCE:2]")
             else:
                 raise Exception("未打开选择EDS模板窗口")
             sleep(2)
             w1.controlClick("[CLASS:Button; INSTANCE:1]")
         else:
             raise Exception("未打开状态管理窗口")
     else:
         raise Exception("未识别BECivil窗口")
Exemplo n.º 21
0
	def node_management(self):
		"""节点管理"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.操作[0], screen_point.操作[1])
			m1.click(self.BECivilWin, '', screen_point.节点管理[0], screen_point.节点管理[1])
			w1 = WinControl('节点管理')
			sleep(1)
			if w1.exists():
				w1.wait(3)
				w1.setState(3)
				# 点击预览
				m1.click('节点管理', '', 1510, 100)
				sleep(2)
				w2 = WinControl('预览窗口 ')
				if w2.exists():
					w2.wait(3)
					w2.setState(3)
					# 关闭预览窗口
					m1.click('预览窗口 ', '', 1910, 10)
				else:
					raise Exception('未打开预览窗口')
				sleep(2)
				# 点击编辑
				m1.click('节点管理', '', 1550, 100)
				sleep(2)
				w3 = WinControl('编辑节点')
				if w3.exists():
					w3.wait(3)
					# 点击节点名称
					m1.click('编辑节点', '', 970, 390, clicks=2)
					autoit.send('新建1')
					# 更改图钉颜色
					m1.click('编辑节点', '', 970, 425)
					sleep(0.5)
					m1.click('编辑节点', '', 970, 490)
					sleep(1)
					# 添加节点备注
					m1.click('编辑节点', '', 970, 520)
					autoit.send('备注123')
					sleep(1)
					w3.controlClick("[CLASS:Button; INSTANCE:1]")
					sleep(2)
					if w0.exists():
						w0.wait(3)
						t1 = w0.getPos()
						if t1 == (862, 438, 1058, 602):
							pass
						else:
							raise Exception('Something went wrong.')
						w0.controlClick('[CLASS:Button; INSTANCE:1]')
					else:
						raise Exception("未成功编辑节点")
				else:
					raise Exception('未打开编辑节点窗口')
				# 点击删除
				m1.click('节点管理', '', 1630, 100)
				sleep(1)
				if w0.exists():
					w0.wait(3)
					t2 = w0.getPos()
					if t2 == (845, 438, 1075, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					raise Exception('未成功删除节点')
				sleep(1)
				# 关闭节点管理窗口
				m1.click('节点管理', '', 1910, 10)
			else:
				raise Exception('未打开节点管理窗口')
		else:
			raise Exception('未识别BECivil窗口')
Exemplo n.º 22
0
	def measure_report(self):
		"""监测报告"""
		w0 = WinControl(self.BECivilWin)
		if w0.exists():
			w0.wait(3)
			m1 = MouseControl()
			m1.click(self.BECivilWin, '', screen_point.任务[0], screen_point.任务[1])
			m1.click(self.BECivilWin, '', screen_point.监测报告[0], screen_point.监测报告[1])
			sleep(1)
			# 创建报告
			m1.click(self.BECivilWin, '', 1190, 270)
			sleep(1)
			w1 = WinControl("新建报告")
			if w1.exists():
				w1.wait(3)
				# 报告名称
				m1.click('新建报告', '', 980, 400)
				autoit.send('测试脚本用报告')
				# 期号
				m1.click('新建报告', '', 980, 440)
				autoit.send('1')
				# 编号
				m1.click('新建报告', '', 980, 480)
				autoit.send('123456')
				# 承包单位
				m1.click('新建报告', '', 980, 570)
				autoit.send('测试脚本用承包单位')
				# 监理单位
				m1.click('新建报告', '', 980, 615)
				autoit.send('测试脚本用监理单位')
				sleep(1)
				w1.controlClick('[CLASS:Button; INSTANCE:1]')
			else:
				raise Exception('未打开新建报告窗口')
			# 点击名称
			m1.click(self.BECivilWin, '', 1320, 340)
			sleep(2)
			w2 = WinControl("表单列表")
			if w2.exists():
				w2.wait(3)
				w2.controlClick("[CLASS:Button; INSTANCE:1]")
				sleep(1)
				MissionFunctions().add_form()
				sleep(1)
				w2.controlClick("[CLASS:Button; INSTANCE:1]")
				sleep(1)
				MissionFunctions().add_form(565, '脚本测试用监测成果分析报告')
				m1.click('表单列表', '', 1260, 235)
			else:
				raise Exception('未打开表单列表窗口')
			# 点击编辑
			m1.click(self.BECivilWin, '', 1800, 340)
			sleep(1)
			w3 = WinControl("编辑报告")
			if w3.exists():
				w3.wait(3)
				m1.click('编辑报告', '', 960, 400)
				autoit.send('测试脚本用报告更改')
				sleep(1)
				w3.controlClick("[CLASS:Button; INSTANCE:1]")
			else:
				raise Exception("未打开编辑报告窗口")
			# 点击导出
			m1.click(self.BECivilWin, '', 1860, 340)
			sleep(1)
			w4 = WinControl('另存为')
			if w4.exists():
				w4.wait(3)
				m1.click('另存为', '', 1030, 45)
				w4.controlSetText("[CLASS:Edit; INSTANCE:2]", self.downloadaddress)
				sleep(1)
				w4.controlClick('[CLASS:Button; INSTANCE:1]')
				sleep(1)
				w5 = WinControl('确认另存为')
				if w5.exists():
					w5.wait(3)
					w5.controlClick("[CLASS:Button; INSTANCE:1]")
				else:
					pass
				sleep(2)
				if w0.exists():
					w0.wait(3)
					t1 = w0.getPos()
					if t1 == (845, 438, 1075, 602):
						pass
					else:
						raise Exception('Something went wrong.')
					w0.controlClick("[CLASS:Button; INSTANCE:2]")
				else:
					pass
			else:
				raise Exception('未成功导出报告')
			sleep(2)
			# 全部勾选报告
			m1.click(self.BECivilWin, '', 1172, 340)
			sleep(1)
			# 删除
			m1.click(self.BECivilWin, '', 1290, 270)
			sleep(1)
			if w0.exists():
				w0.wait(3)
				t2 = w0.getPos()
				if t2 == (845, 438, 1075, 602):
					pass
				else:
					raise Exception('Something went wrong.')
				w0.controlClick("[CLASS:Button; INSTANCE:1]")
			else:
				raise Exception('删除报告失败')
				sleep(1)
			m1.click(self.BECivilWin, '', screen_point.监测报告[0], screen_point.监测报告[1])
		else:
			raise Exception('未识别市政窗口')
Exemplo n.º 23
0
 def information_management(self):
     """资料管理"""
     w0 = WinControl(self.BECivilWin)
     if w0.exists():
         w0.wait(3)
         m1 = MouseControl()
         m1.click(self.BECivilWin, '', screen_point.资料[0],
                  screen_point.资料[1])
         m1.click(self.BECivilWin, '', screen_point.资料管理[0],
                  screen_point.资料管理[1])
         w1 = WinControl('资料管理')
         sleep(3)
         if w1.exists():
             w1.wait(3)
             w1.setState(3)
             # 关联
             m1.click('资料管理', '', 1695, 160)
             sleep(1)
             w2 = WinControl(' 设置资料信息')
             if w2.exists():
                 w2.wait(3)
                 w2.controlClick('[CLASS:Button; INSTANCE:6]')
                 m1.click(' 设置资料信息', '', 805, 440)
                 sleep(2)
                 w2.controlClick('[CLASS:Button; INSTANCE:1]')
             else:
                 raise Exception('未打开设置资料信息窗口')
             sleep(2)
             w1.setState(3)
             # 反查
             m1.click('资料管理', '', 1785, 160)
             sleep(1)
             if w0.exists():
                 w0.wait(3)
                 t1 = w0.getPos()
                 if t1 == (0, 0, 1920, 1040):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 sleep(2)
                 # 退出反查
                 m1.click(self.BECivilWin, '', 1100, 490, button='right')
                 sleep(0.5)
                 m1.click(self.BECivilWin, '', 1170, 505)
                 sleep(2)
                 if w1.exists():
                     w1.wait(3)
                     w1.setState(3)
                 else:
                     raise Exception('退出反查失败')
             else:
                 raise Exception('反查失败')
             sleep(2)
             # 下载
             m1.click('资料管理', '', 1835, 160)
             sleep(2)
             w3 = WinControl('另存为')
             if w3.exists():
                 w3.wait(3)
                 m1.click('另存为', '', 1030, 45)
                 w3.controlSetText('[CLASS:Edit; INSTANCE:2]',
                                   self.downloadaddress)
                 sleep(1)
                 w3.controlClick('[CLASS:Button; INSTANCE:1]')
                 sleep(1)
                 w4 = WinControl('确认另存为')
                 if w4.exists():
                     w4.wait(3)
                     w4.controlClick('[CLASS:Button; INSTANCE:1]')
                 else:
                     pass
             else:
                 raise Exception('未打开另存为窗口')
             # 勾选上传资料
             m1.click('资料管理', '', 425, 160)
             sleep(1)
             # 关联
             w1.controlClick('[CLASS:Button; INSTANCE:6]')
             sleep(1)
             if w2.exists():
                 w2.wait(3)
                 w2.controlClick('[CLASS:Button; INSTANCE:3]')
                 sleep(2)
                 w2.controlClick('[CLASS:Button; INSTANCE:1]')
             else:
                 raise Exception('未打开设置资料信息窗口')
             sleep(3)
             w1.setState(3)
             # 勾选上传资料
             m1.click('资料管理', '', 425, 160)
             # 打印
             w1.controlClick('[CLASS:Button; INSTANCE:7]')
             sleep(1)
             w5 = WinControl('打印')
             if w5.exists():
                 w5.wait(3)
                 w5.controlClick('[CLASS:Button; INSTANCE:14]')
             else:
                 raise Exception('未打开打印窗口')
             sleep(3)
             w1.setState(3)
             # 删除
             w1.controlClick('[CLASS:Button; INSTANCE:8]')
             sleep(2)
             if w0.exists():
                 w0.wait(3)
                 t2 = w0.getPos()
                 if t2 == (844, 438, 1076, 602):
                     pass
                 else:
                     raise Exception('Something went wrong.')
                 w0.controlClick('[CLASS:Button; INSTANCE:1]')
             else:
                 raise Exception('删除未成功')
             sleep(3)
             w1.setState(3)
             # 关闭资料管理窗口
             m1.click('资料管理', '', 1905, 10)
         else:
             raise Exception('未打开资料管理窗口')
     else:
         raise Exception('未识别BECivil窗口')