示例#1
0
 def test_UseMultiCoordinate(self):
     th.msleep(500)
     # 勾选“使用多坐标系”
     P[4305] = 1
     th.msleep(1000)
     # # 设置每个坐标系的工件坐标和材料厚度
     lineEdit_x = self.win.ui.offset_x
     lineEdit_y = self.win.ui.offset_y
     thickness = self.win.ui.groupBox_4.findChildren(QtWidgets.QLineEdit)
     th.msleep(1000)
     offsetx = 160
     offsety = -160
     for wcs in ["G54", "G55", "G56", "G57", "G58", "G59"]:
         offsetx = offsetx - 10
         offsety = offsety + 10
         th.clickButton(self.win, wcs)
         th.lineEditTypewrite(str(offsetx), lineEdit_x)
         th.lineEditTypewrite(str(offsety), lineEdit_y)
         for i in thickness:
             th.lineEditTypewrite("-50", i)
         th.msleep(1000)
     th.close(self.win)
     th.msleep(1000)
     self.win = th.assertActiveWindow(basic.mainWindow)
     # 加载NC程序
     th.loadProgram("E:/NC/自动测试程序/多坐标系.NC")
     th.msleep(2000)
     # 进行仿真
     th.clickButton(basic.mainWindow, "仿真")
     th.msleep(1000)
     self.win = th.assertActiveWindow(Simu3dDialog)
     th.moveTo(widget=self.win.ui.widget)
     th.msleep(1000)
     th.rightClick()
     th.msleep(1000)
     th.assertActiveMenu()
     th.clickMenu("俯视图")
     th.msleep(1000)
     th.rightClick()
     th.msleep(1000)
     th.assertActiveMenu()
     th.clickMenu("标尺")
     self.win = th.assertActiveWindow(Simu3dDialog)
     th.clickButton(self.win, "连续仿真")
     th.msleep(1000)
     # 输出仿真图形
     th.screenshot()
     th.msleep(1000)
     # 关闭仿真对话框
     th.close(self.win)
     # # 取消勾选“使用多坐标系”
     P[4305] = 0
     th.msleep(1000)
     th.assertActiveWindow(basic.mainWindow)
     th.clickButton(basic.mainWindow, "坐标设定")
     th.msleep(1000)
     self.win = th.assertActiveWindow(CoordinateDialog)
     self.assertTrue(self.win.ui.G54.isEnabled())
     self.assertFalse(self.win.ui.G55.isEnabled())
示例#2
0
 def setUp(self):
     th.startSetup()
     # 加载NC程序
     th.loadProgram("E:/NC/自动测试程序/自动上下料(1)")
示例#3
0
 def setUp(self):
     th.startSetup()
     # 加载NC程序
     th.loadProgram("E:/NC/自动测试程序/兰亭集序.NC")