예제 #1
0
    def fillDatas(self):
        # 查找煤层
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0: return
        # 查找掘进面的抽采技术
        ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById(
            self.design_id)
        if ws_tech.id <= 0: return

        # 填充煤层数据
        self.ui.thick.setText(u'%.1f' % coal.thick)
        self.ui.dip_angle.setText(u'%.1f' % coal.dip_angle)

        # 填充抽采技术参数
        self.ui.l1.setText(u'%.1f' % ws_tech.l1)
        self.ui.l2.setText(u'%.1f' % ws_tech.l2)
        self.ui.w.setText(u'%.1f' % ws_tech.w)
        self.ui.h.setText(u'%.1f' % ws_tech.h)
        self.ui.dp.setText(u'%.1f' % ws_tech.dp)
        self.ui.gp.setText(u'%.1f' % ws_tech.gp)
        self.ui.pore_stubble.setText(u'%.1f' % ws_tech.pore_stubble)
        self.ui.pore_angle.setText(u'%.1f' % ws_tech.pore_angle)
        self.ui.close_length.setText(u'%.1f' % ws_tech.close_length)

        pore_type = ws_tech.pore_type
        if pore_type == 1:
            self.ui.pore_type1.setChecked(True)
        elif pore_type == 2:
            self.ui.pore_type2.setChecked(True)
        elif pore_type == 3:
            self.ui.pore_type3.setChecked(True)
        elif pore_type == 4:
            self.ui.pore_type4.setChecked(True)
예제 #2
0
    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)
예제 #3
0
    def onDelDesign(self):
        index = self.ui.design.currentIndex()
        if index < 0: return

        # 从数据库中删除
        design_tech_id, ok = self.ui.design.itemData(index).toInt()
        design_tech = None
        if self.region == 1:
            design_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById(
                design_tech_id)
        elif self.region == 2:
            design_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById(
                design_tech_id)
        elif self.region == 3:
            design_tech = SQLClientHelper.GetDesignGoafTechnologyById(
                design_tech_id)

        ret = False
        if design_tech is None or design_tech.id <= 0:
            pass
        else:
            # 外键的级联规则可以保证关联的详细设计方案以及钻场和钻孔都被删除掉!!!
            ret = SQLClientHelper.DeleteDesignTechnology(
                design_tech.design_technology_id)

        # 从列表中删除
        if ret:
            self.ui.design.removeItem(index)
            UiHelper.MessageBox(u'删除设计方案成功!')
        else:
            UiHelper.MessageBox(u'删除设计方案失败!')
예제 #4
0
    def onSave(self):
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:130)')
            return

        # 查找掘进面的抽采技术
        ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById(
            self.design_id)
        if ws_tech.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:131)')
            return

        # 保存煤层数据到数据库
        coal.thick, ok = self.ui.thick.text().toDouble()
        coal.dip_angle, ok = self.ui.dip_angle.text().toDouble()
        if not SQLClientHelper.UpdateCoal(coal):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:132)')
            return

        # 保存抽采技术参数到数据库
        ws_tech.l1, ok = self.ui.l1.text().toDouble()
        ws_tech.l2, ok = self.ui.l2.text().toDouble()
        ws_tech.w, ok = self.ui.w.text().toDouble()
        ws_tech.h, ok = self.ui.h.text().toDouble()
        ws_tech.wd, ok = self.ui.wd.text().toDouble()
        ws_tech.hd, ok = self.ui.hd.text().toDouble()
        ws_tech.v_offset, ok = self.ui.v_offset.text().toDouble()
        ws_tech.h_offset, ok = self.ui.h_offset.text().toDouble()
        ws_tech.dp, ok = self.ui.dp.text().toDouble()
        ws_tech.gp, ok = self.ui.gp.text().toDouble()
        ws_tech.left_side, ok = self.ui.left.text().toDouble()
        ws_tech.right_side, ok = self.ui.right.text().toDouble()
        ws_tech.top_side, ok = self.ui.top.text().toDouble()
        ws_tech.bottom_side, ok = self.ui.bottom.text().toDouble()
        ws_tech.ls, ok = self.ui.ls.text().toDouble()
        ws_tech.ws, ok = self.ui.ws.text().toDouble()
        ws_tech.gs, ok = self.ui.gs.text().toDouble()
        ws_tech.hs, ok = self.ui.hs.text().toDouble()
        ws_tech.single_rock_tunnel = int(
            self.ui.single_rock_tunnel.isChecked())
        ws_tech.d_offset, ok = self.ui.d_offset.text().toDouble()
        ws_tech.p_offset, ok = self.ui.p_offset.text().toDouble()
        ws_tech.close_length, ok = self.ui.close_length.text().toDouble()

        # 保存到数据库
        if not SQLClientHelper.UpdateDesignWorkSurfTechnology(ws_tech):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:133)')
        else:
            UiHelper.MessageBox(u'恭喜您,保存数据成功!')
예제 #5
0
 def dip_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.DrawDipGraph23 %d %d" % (coal.id, ws_tech.id), True)
     if not ret:
         UiHelper.MessageBox(u'启动AutoCAD失败')
예제 #6
0
    def onSave(self):
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:140)')
            return

        # 查找掘进面的抽采技术
        ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById(
            self.design_id)
        if ws_tech.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:141)')
            return

        # 保存煤层数据到数据库
        coal.thick, ok = self.ui.thick.text().toDouble()
        coal.dip_angle, ok = self.ui.dip_angle.text().toDouble()
        if not SQLClientHelper.UpdateCoal(coal):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:142)')
            return

        # 保存抽采技术参数到数据库
        ws_tech.l1, ok = self.ui.l1.text().toDouble()
        ws_tech.l2, ok = self.ui.l2.text().toDouble()
        ws_tech.w, ok = self.ui.w.text().toDouble()
        ws_tech.h, ok = self.ui.h.text().toDouble()
        ws_tech.dp, ok = self.ui.dp.text().toDouble()
        ws_tech.gp, ok = self.ui.gp.text().toDouble()
        ws_tech.pore_stubble, ok = self.ui.pore_stubble.text().toDouble()
        ws_tech.pore_angle, ok = self.ui.pore_angle.text().toDouble()
        ws_tech.close_length, ok = self.ui.close_length.text().toDouble()

        if self.ui.pore_type1.isChecked():
            ws_tech.pore_type = 1
        elif self.ui.pore_type2.isChecked():
            ws_tech.pore_type = 2
        elif self.ui.pore_type3.isChecked():
            ws_tech.pore_type = 3
        elif self.ui.pore_type4.isChecked():
            ws_tech.pore_type = 4

        # 保存到数据库
        if not SQLClientHelper.UpdateDesignWorkSurfTechnology(ws_tech):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:143)')
        else:
            UiHelper.MessageBox(u'恭喜您,保存数据成功!')
예제 #7
0
    def fillDatas(self):
        # 查找煤层
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0: return
        # 查找掘进面的抽采技术
        ws_tech = SQLClientHelper.GetDesignWorkSurfTechnologyById(
            self.design_id)
        if ws_tech.id <= 0: return

        # 填充煤层数据
        self.ui.thick.setText(u'%.1f' % coal.thick)
        self.ui.dip_angle.setText(u'%.1f' % coal.dip_angle)

        # 填充抽采技术参数
        self.ui.l1.setText(u'%.1f' % ws_tech.l1)
        self.ui.l2.setText(u'%.1f' % ws_tech.l2)
        self.ui.w.setText(u'%.1f' % ws_tech.w)
        self.ui.h.setText(u'%.1f' % ws_tech.h)
        self.ui.wd.setText(u'%.1f' % ws_tech.wd)
        self.ui.hd.setText(u'%.1f' % ws_tech.hd)
        self.ui.v_offset.setText(u'%.1f' % ws_tech.v_offset)
        self.ui.h_offset.setText(u'%.1f' % ws_tech.h_offset)
        self.ui.dp.setText(u'%.1f' % ws_tech.dp)
        self.ui.gp.setText(u'%.1f' % ws_tech.gp)
        self.ui.left.setText(u'%.1f' % ws_tech.left_side)
        self.ui.right.setText(u'%.1f' % ws_tech.right_side)
        self.ui.top.setText(u'%.1f' % ws_tech.top_side)
        self.ui.bottom.setText(u'%.1f' % ws_tech.bottom_side)
        self.ui.ls.setText(u'%.1f' % ws_tech.ls)
        self.ui.ws.setText(u'%.1f' % ws_tech.ws)
        self.ui.gs.setText(u'%.1f' % ws_tech.gs)
        self.ui.hs.setText(u'%.1f' % ws_tech.hs)
        self.ui.single_rock_tunnel.setChecked(ws_tech.single_rock_tunnel != 0)
        self.ui.d_offset.setText(u'%.1f' % ws_tech.d_offset)
        self.ui.p_offset.setText(u'%.1f' % ws_tech.p_offset)
        self.ui.close_length.setText(u'%.1f' % ws_tech.close_length)