def onCreatReport(self): coal = SQLClientHelper.GetCoalById(self.coal_id) if coal.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:144)') return # 查找掘进面的抽采技术 ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById( self.design_id) if ws_tech.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:145)') return # 向cad发送命令请求生成钻孔数据 ret = CbmClientHelper.SendCommandToCAD( "JL.GeneratePore23 %d %d" % (coal.id, ws_tech.id), True) if ret: # 显示钻孔报表 DataHelper.show_report23(coal, ws_tech) else: UiHelper.MessageBox(u'启动AutoCAD失败!!!') # json文件路径(使用绝对路径,避免出错!!!) # json_file = os.path.abspath('.\\help\\json\\reportP21.json') # 生成json文件 # self.make_json(coal.id, tws_tech.id, json_file) # 生成word报单 # doc.CreatReport(json_file)
def dip_graph(self): coal = SQLClientHelper.GetCoalById(self.coal_id) if coal.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:144)') return # 查找掘进面的抽采技术 goaf_tech = SQLClientHelper.GetDesignGoafTechnologyById(self.design_id) if goaf_tech.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:145)') return # 向cad发送命令请求绘图 ret = CbmClientHelper.SendCommandToCAD( "JL.DrawDipGraph32 %d %d" % (coal.id, goaf_tech.id), True) if not ret: UiHelper.MessageBox(u'启动AutoCAD失败')
def head_graph(self): coal = SQLClientHelper.GetCoalById(self.coal_id) if coal.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:144)') return # 查找掘进面的抽采技术 ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById( self.design_id) if ws_tech.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:145)') return # 向cad发送命令请求绘图 ret = CbmClientHelper.SendCommandToCAD( "JL.DrawHeadGraph23 %d %d" % (coal.id, ws_tech.id), True) if not ret: UiHelper.MessageBox(u'启动AutoCAD失败')
def plane_graph(self): coal = SQLClientHelper.GetCoalById(self.coal_id) if coal.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:114)') return # 查找掘进面的抽采技术 tws_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById( self.design_id) if tws_tech.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:115)') return # 向cad发送命令请求绘图 ret = CbmClientHelper.SendCommandToCAD( "JL.DrawPlaneGraph11 %d %d" % (coal.id, tws_tech.id), True) if not ret: UiHelper.MessageBox(u'启动AutoCAD失败')
def onCreatReport(self): coal = SQLClientHelper.GetCoalById(self.coal_id) if coal.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:144)') return # 查找掘进面的抽采技术 goaf_tech = SQLClientHelper.GetDesignGoafTechnologyById(self.design_id) if goaf_tech.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:145)') return # 向cad发送命令请求生成钻孔数据 ret = CbmClientHelper.SendCommandToCAD( "JL.GeneratePore32 %d %d" % (coal.id, goaf_tech.id), True) if ret: # 显示钻孔报表 DataHelper.show_report32(coal, goaf_tech) else: UiHelper.MessageBox(u'启动AutoCAD失败!!!')
def onPartition(self): index = self.ui.work_surf.currentIndex() if index < 0: UiHelper.MessageBox(u'请指定一个工作面进行设计!') return work_surf_id, ok = self.ui.work_surf.itemData(index).toInt() work_surf = SQLClientHelper.GetWorkSurfById(work_surf_id) if work_surf.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:Z9)') return deup = SQLClientHelper.GetDesignEvalUnitPartitionByForeignKey('work_surf_id', work_surf_id) if deup.id <= 0: UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:Z12)') return # 设计评价单元 DataHelper.design_eval_unit(deup.id) # 给cad发送命令请求绘制评价单元示意图 ret = CbmClientHelper.SendCommandToCAD("JL.DrawEvalUnitGraph %d" % deup.id, True) if not ret: UiHelper.MessageBox(u'启动AutoCAD失败')
def onGraph(self): # 给cad发送命令绘制煤层赋存图 ret = CbmClientHelper.SendCommandToCAD( "JL.DrawOccurrenceGraph %d %.1f" % (self.mine_id, 0.5), True) if not ret: UiHelper.MessageBox(u'启动AutoCAD失败')
def test_draw_graph_23(): coal_id, tech_id = 5, 1 CbmClientHelper.SendCommandToCAD( "JL.DrawPlaneGraph23 %d %d" % (coal_id, tech_id), True)
def test_draw_coal_occurrence_graph(): mine_id = 4 CbmClientHelper.SendCommandToCAD( "JL.DrawOccurrenceGraph %d %.1f" % (mine_id, 1), True)
def test_draw_desigin_eval_unit(): coal_id, eval_unit_partition_id = 5, 21 CbmClientHelper.SendCommandToCAD( "JL.DrawEvalUnitGraph %d" % eval_unit_partition_id, True)