Exemple #1
0
    def fillDatas(self):
        # 查找煤层
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0: return
        # 查找掘进面的抽采技术
        tws_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById(
            self.design_id)
        if tws_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' % tws_tech.l1)
        self.ui.l2.setText(u'%.1f' % tws_tech.l2)
        self.ui.w.setText(u'%.1f' % tws_tech.w)
        self.ui.h.setText(u'%.1f' % tws_tech.h)
        self.ui.wd.setText(u'%.1f' % tws_tech.wd)
        self.ui.hd.setText(u'%.1f' % tws_tech.hd)
        self.ui.v_offset.setText(u'%.1f' % tws_tech.v_offset)
        self.ui.h_offset.setText(u'%.1f' % tws_tech.h_offset)
        self.ui.dp.setText(u'%.1f' % tws_tech.dp)
        self.ui.gp.setText(u'%.1f' % tws_tech.gp)
        self.ui.left.setText(u'%.1f' % tws_tech.left_side)
        self.ui.right.setText(u'%.1f' % tws_tech.right_side)
        self.ui.top.setText(u'%.1f' % tws_tech.top_side)
        self.ui.bottom.setText(u'%.1f' % tws_tech.bottom_side)
        self.ui.ls.setText(u'%.1f' % tws_tech.ls)
        self.ui.ws.setText(u'%.1f' % tws_tech.ws)
        self.ui.gs.setText(u'%.1f' % tws_tech.gs)
        self.ui.hs.setText(u'%.1f' % tws_tech.hs)
        self.ui.close_length.setText(u'%.1f' % tws_tech.close_length)
Exemple #2
0
    def fillDatas(self):
        # 查找煤层
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0: return
        # 查找掘进面的抽采技术
        tws_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById(
            self.design_id)
        if tws_tech.id <= 0: return

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

        # 填充抽采技术参数
        self.ui.lm.setText(u'%.1f' % tws_tech.lm)
        self.ui.w.setText(u'%.1f' % tws_tech.w)
        self.ui.h.setText(u'%.1f' % tws_tech.h)
        self.ui.dp.setText(u'%.1f' % tws_tech.dp)
        self.ui.left.setText(u'%.1f' % tws_tech.left_side)
        self.ui.right.setText(u'%.1f' % tws_tech.right_side)
        self.ui.top.setText(u'%.1f' % tws_tech.top_side)
        self.ui.bottom.setText(u'%.1f' % tws_tech.bottom_side)
        self.ui.leading_dist.setText(u'%.1f' % tws_tech.leading_dist)
        self.ui.l_stripe.setText(u'%.1f' % tws_tech.l_stripe)
        self.ui.gbp.setText(u'%.1f' % tws_tech.gbp)
        self.ui.close_length.setText(u'%.1f' % tws_tech.close_length)
Exemple #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'删除设计方案失败!')
Exemple #4
0
 def dip_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.DrawDipGraph11 %d %d" % (coal.id, tws_tech.id), True)
     if not ret:
         UiHelper.MessageBox(u'启动AutoCAD失败')
Exemple #5
0
    def onSave(self):
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:110)')
            return

        # 查找掘进面的抽采技术
        tws_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById(
            self.design_id)
        if tws_tech.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:111)')
            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,出了点问题,请联系技术人员(错误码:112)')
            return

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

        # 保存到数据库
        if not SQLClientHelper.UpdateDesignDrillingSurfTechnology(tws_tech):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:113)')
        else:
            UiHelper.MessageBox(u'恭喜您,保存数据成功!')
Exemple #6
0
    def onCreatReport(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.GeneratePore11 %d %d" % (coal.id, tws_tech.id), True)
        if ret:
            # 显示钻孔报表
            DataHelper.show_report11(coal, tws_tech)
        else:
            UiHelper.MessageBox(u'启动AutoCAD失败!!!')
Exemple #7
0
    def onSave(self):
        coal = SQLClientHelper.GetCoalById(self.coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:120)')
            return

        # 查找掘进面的抽采技术
        tws_tech = SQLClientHelper.GetDesignDrillingSurfTechnologyById(
            self.design_id)
        if tws_tech.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:121)')
            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,出了点问题,请联系技术人员(错误码:122)')
            return

        # 保存抽采技术参数到数据库
        tws_tech.lm, ok = self.ui.lm.text().toDouble()
        tws_tech.w, ok = self.ui.w.text().toDouble()
        tws_tech.h, ok = self.ui.h.text().toDouble()
        tws_tech.dp, ok = self.ui.dp.text().toDouble()
        tws_tech.left_side, ok = self.ui.left.text().toDouble()
        tws_tech.right_side, ok = self.ui.right.text().toDouble()
        tws_tech.top_side, ok = self.ui.top.text().toDouble()
        tws_tech.bottom_side, ok = self.ui.bottom.text().toDouble()
        tws_tech.leading_dist, ok = self.ui.leading_dist.text().toDouble()
        tws_tech.l_stripe, ok = self.ui.l_stripe.text().toDouble()
        tws_tech.gbp, ok = self.ui.gbp.text().toDouble()
        tws_tech.close_length, ok = self.ui.close_length.text().toDouble()

        # 保存到数据库
        if not SQLClientHelper.UpdateDesignDrillingSurfTechnology(tws_tech):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:123)')
        else:
            UiHelper.MessageBox(u'恭喜您,保存数据成功!')