Exemplo n.º 1
0
    def onWcCacl(self):
        index = self.ui.drilling_surf.currentIndex()
        if index < 0: return

        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G11)!')
            return

        # 保存煤层数据
        work_area_id = drilling_surf.work_area_id
        work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
        if work_area.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G12)!')
            return
        coal_id = work_area.coal_id
        coal = SQLClientHelper.GetCoalById(coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G13)!')
            return

        # 查看煤质
        if coal.quality < 3 or caol.gas_w0 > 10:
            pass
            # UiHelper.MessageBox(u'弹出对话框让用户选择(尚未实现)')
        else:
            # 通过经验公式计算
            W0 = coal.gas_w0
            Wc = 10.385 * exp(-7.207 * W0)
            coal.gas_wc2 = Wc
        # 更新到界面
        self.ui.gas_wc2.setText(u'%.1f' % coal.gas_wc2)
Exemplo n.º 2
0
    def onDrillingSurfChanged(self, index):
        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0: return

        # 提取数据到界面
        self.ui.drilling_surf_qa.setText(u'%.1f' % drilling_surf.qa)
Exemplo n.º 3
0
    def onDrillingSurfChanged(self, index):
        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G1)!')
            return

        # 填充掘进面的数据
        self.ui.q4.setText(u'%.1f' % drilling_surf.q4)
        self.ui.qa.setText(u'%.1f' % drilling_surf.qa)

        # 填充煤层数据
        work_area_id = drilling_surf.work_area_id
        work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
        if work_area.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G2)!')
            return
        coal_id = work_area.coal_id
        coal = SQLClientHelper.GetCoalById(coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G3)!')
            return

        # 填充煤层数据
        self.ui.vr.setText(u'%.1f' % coal.vr)
        self.ui.rho.setText(u'%.1f' % coal.rho)
        self.ui.gas_w0.setText(u'%.1f' % coal.gas_w0)
        self.ui.gas_wc2.setText(u'%.1f' % coal.gas_wc2)

        # 填充掘进巷道数据
        tunnel_id = drilling_surf.tunnel_id
        if tunnel_id <= 0:
            self.ui.d.setText(u'0.0')
            self.ui.v.setText(u'0.0')
            self.ui.l.setText(u'0.0')
            self.ui.s.setText(u'0.0')
            self.ui.q0.setText(u'0.0')
            self.ui.q3.setText(u'0.0')
        else:
            tunnel = SQLClientHelper.GetTunnelById(tunnel_id)
            self.ui.d.setText(u'%.1f' % tunnel.d)
            self.ui.v.setText(u'%.1f' % tunnel.v)
            self.ui.l.setText(u'%.1f' % tunnel.l)
            self.ui.s.setText(u'%.1f' % tunnel.s)
            self.ui.q0.setText(u'%.1f' % tunnel.q0)
            self.ui.q3.setText(u'%.1f' % tunnel.q3)
Exemplo n.º 4
0
    def onSave(self):
        # 从数据库中查找当前的回采工作面
        index = self.ui.work_surf.currentIndex()
        if index < 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:L6)!')
            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,出了点问题,请联系技术人员(错误码:L5)!')
            return

        # 从界面中读取数据
        work_surf.a, ok = self.ui.work_surf_a.text().toDouble()
        work_surf.qr, ok = self.ui.work_surf_qr.text().toDouble()
        # 提交工作面数据到数据库
        if not SQLClientHelper.UpdateWorkSurf(work_surf):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:L1)!')
            return

        # 从数据库中查找当前的掘进面
        index = self.ui.drilling_surf.currentIndex()
        if index < 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:L3)!')
            return

        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:L4)!')
            return

        # 从界面中读取数据
        drilling_surf.qa, ok = self.ui.drilling_surf_qa.text().toDouble()
        # 提交掘进面数据到数据库
        if not SQLClientHelper.UpdateDrillingSurf(drilling_surf):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:L2)!')
        #关闭对话框并返回1
        # self.accept()
        UiHelper.MessageBox(u'恭喜您,更新数据成功啦!')
Exemplo n.º 5
0
    def onSave(self):
        index = self.ui.drilling_surf.currentIndex()
        if index < 0: return

        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G4)!')
            return

        # 保存煤层数据
        work_area_id = drilling_surf.work_area_id
        work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
        if work_area.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G9)!')
            return
        coal_id = work_area.coal_id
        coal = SQLClientHelper.GetCoalById(coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G5)!')
            return

        # 保存掘进巷道数据
        tunnel = SQLClientHelper.GetTunnelById(drilling_surf.tunnel_id)
        tunnel_id = tunnel.id
        if tunnel_id <= 0:
            # 新建一条巷道,提交到数据库得到id
            tunnel = Tunnel()
            tunnel_id = SQLClientHelper.AddTunnel(tunnel)
        # 更新掘进面关联的掘进巷道id
        drilling_surf.tunnel_id = tunnel_id
        # 从界面中读取掘进巷道的数据
        tunnel.d, ok = self.ui.d.text().toDouble()
        tunnel.v, ok = self.ui.v.text().toDouble()
        tunnel.l, ok = self.ui.l.text().toDouble()
        tunnel.s, ok = self.ui.s.text().toDouble()
        tunnel.q0, ok = self.ui.q0.text().toDouble()
        tunnel.q3, ok = self.ui.q3.text().toDouble()

        # 从界面中读取掘进面数据
        drilling_surf.q4, ok = self.ui.q4.text().toDouble()
        drilling_surf.qa, ok = self.ui.qa.text().toDouble()

        # 从界面中读取煤层数据
        coal.vr, ok = self.ui.vr.text().toDouble()
        coal.rho, ok = self.ui.rho.text().toDouble()
        coal.gas_w0, ok = self.ui.gas_w0.text().toDouble()
        coal.gas_wc2, ok = self.ui.gas_wc2.text().toDouble()

        # 提交到数据库
        if not SQLClientHelper.UpdateDrillingSurf(drilling_surf):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G6)!')
            return
        if not SQLClientHelper.UpdateTunnel(tunnel):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G7)!')
            return
        if not SQLClientHelper.UpdateCoal(coal):
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G8)!')
            return
        #关闭对话框并返回1
        # self.accept()
        UiHelper.MessageBox(u'恭喜您,更新数据成功啦!')
Exemplo n.º 6
0
    def onCacl(self):
        index = self.ui.drilling_surf.currentIndex()
        if index < 0: return

        drilling_surf_id, ok = self.ui.drilling_surf.itemData(index).toInt()
        drilling_surf = SQLClientHelper.GetDrillingSurfById(drilling_surf_id)
        if drilling_surf.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G14)!')
            return

        # 保存煤层数据
        work_area_id = drilling_surf.work_area_id
        work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
        if work_area.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G15)!')
            return
        coal_id = work_area.coal_id
        coal = SQLClientHelper.GetCoalById(coal_id)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:G16)!')
            return

        # 保存掘进巷道数据
        tunnel = SQLClientHelper.GetTunnelById(drilling_surf.tunnel_id)
        tunnel_id = tunnel.id
        if tunnel_id <= 0:
            # 新建一条巷道
            tunnel = Tunnel()

        # 更新掘进面关联的掘进巷道id
        drilling_surf.tunnel_id = tunnel_id
        # 从界面中读取掘进巷道的数据
        tunnel.d, ok = self.ui.d.text().toDouble()
        tunnel.v, ok = self.ui.v.text().toDouble()
        tunnel.l, ok = self.ui.l.text().toDouble()
        tunnel.s, ok = self.ui.s.text().toDouble()
        tunnel.q0, ok = self.ui.q0.text().toDouble()
        tunnel.q3, ok = self.ui.q3.text().toDouble()

        # 从界面中读取掘进面数据
        drilling_surf.q4, ok = self.ui.q4.text().toDouble()
        drilling_surf.qa, ok = self.ui.qa.text().toDouble()

        # 从界面中读取煤层数据
        coal.vr, ok = self.ui.vr.text().toDouble()
        coal.rho, ok = self.ui.rho.text().toDouble()
        coal.gas_w0, ok = self.ui.gas_w0.text().toDouble()
        coal.gas_wc2, ok = self.ui.gas_wc2.text().toDouble()

        # 数据检查
        if tunnel.v <= 0:
            UiHelper.MessageBox(u'巷道掘进速度v必须取大于0的值')
            return

        # 调用rpc计算掘进面瓦斯涌出量
        ret = CbmClientHelper.DrillingSurfGasFlow(coal, drilling_surf, tunnel)
        # 计算结果更新到界面
        tunnel.q0 = ret.q0
        tunnel.q3 = ret.q3
        drilling_surf.q4 = ret.q4
        drilling_surf.qa = ret.qa
        UiHelper.MessageBox(u'数据计算成功,请查看"瓦斯涌出量预测结果"部分的数据!')