Ejemplo n.º 1
0
def show_report12(coal, tws_tech):
    # 生成参数
    params = {}
    # 矿井名称
    mine = SQLClientHelper.GetMineById(coal.mine_id)
    params['mine_name'] = mine.name
    # 工作面名称
    # 搜索矿井的所有工作面中的第一个(按道理应该是从界面中提供工作面名称!!!)
    work_surf_list = CbmClientHelper.GetWorkSurfsOfMine(mine.id)
    if len(work_surf_list) == 0:
        params['face_name'] = 'W292'
    else:
        params['face_name'] = work_surf_list[0].name
    # 条带长度
    params['strip_length'] = tws_tech.l_stripe
    # 上下左右帮距
    params['contrl_range_up'] = tws_tech.top_side
    params['contrl_range_down'] = tws_tech.bottom_side
    params['contrl_range_left'] = tws_tech.left_side
    params['contrl_range_right'] = tws_tech.right_side
    # 孔底间距
    params['gbp'] = tws_tech.gbp
    # 钻孔直径
    params['pore_diameter'] = tws_tech.dp
    # 钻孔间距
    params['pore_gap'] = tws_tech.gp
    # 封孔长度(界面中没有输入,网上搜的一个参照值)
    # http://wenku.baidu.com/link?url=4QOLWZsUfFu5zLewMQCeF_WRzYTWmBYE3SRyk1Cj_JTc1UzbZR54NNkrXUsKc1PDj1Kg4492gfSNaKweJTSWxVqz7VbM-b7G3IAbtcdifBy
    params['close_length'] = tws_tech.close_length
    # 巷道长度
    params['tunnel_length'] = tws_tech.lm
    # 循环个数
    params['cycle_num'] = int(tws_tech.lm /
                              (tws_tech.l_stripe - tws_tech.leading_dist))
    # 模板文件路径(必须参数)
    params['reportlet'] = 'cbm12.cpt'
    # 设计方案id(必须参数)
    params['design_id'] = tws_tech.design_technology_id
    # 是否按页面大小显示
    params['__bypagesize__'] = 'true'
    # 查询所有钻孔
    pore_lists = CbmClientHelper.GetAllPores(tws_tech.design_technology_id)
    # 计算钻孔个数
    params['pore_num'] = len(pore_lists)
    # 计算钻孔总长度
    params['pore_sum'] = sum([pore.length for pore in pore_lists])

    # 显示报表
    # params参数中的字符串数据包括key即可以是utf8编码的str字节数组,也可以是unicode字符串
    # show_report方法内部会自动处理
    show_report(params)
Ejemplo n.º 2
0
    def fillMineDatas(self):
        # 数据库中查找id对应的矿井
        mine = SQLClientHelper.GetMineById(self.mine_id)
        if mine.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:E2)!')
            return

        # 填充数据
        name = mine.name.decode('utf-8')
        capacity = mine.capacity
        province = mine.province.decode('utf-8')
        city = mine.city.decode('utf-8')
        topo_geo = mine.topo_geo
        hydr_geo = mine.hydr_geo
        ground_condition = mine.ground_condition
        protect_layer_condition = mine.protect_layer_condition
        # 查找矿区
        mine_region = SQLClientHelper.GetMineRegionById(mine.mine_region_id)
        # combobox里的text好像不需要unicode,貌似不需要"编码"(encode)
        region_name = 'null' if mine_region.id < 0 else mine_region.name
        # 根据矿区名称反查煤炭基地
        base_name = CbmClientHelper.GetBaseByRegion(region_name)

        # 填充矿井数据
        self.ui.name.setText(name)
        self.ui.capacity.setText(u'%.2f' % capacity)
        self.ui.province.setText(province)
        self.ui.city.setText(city)
        self.ui.topo_geo.setCurrentIndex(topo_geo - 1)
        self.ui.hydr_geo.setCurrentIndex(hydr_geo - 1)
        self.ui.ground_cond.setChecked(ground_condition != 0)
        self.ui.base.setCurrentIndex(self.ui.base.findText(base_name))
        self.ui.region.setCurrentIndex(self.ui.region.findText(region_name))
        self.ui.protect_layer_condition.setChecked(
            protect_layer_condition != 0)
Ejemplo n.º 3
0
 def fillDrillingSurfCombox(self):
     # 填充掘进面列表
     drilling_surf_lists = CbmClientHelper.GetDrillingSurfsOfMine(
         self.mine_id)
     # 添加到掘进面下拉列表
     UiHelper.AddObjectListToCombobox(self.ui.drilling_surf,
                                      drilling_surf_lists)
Ejemplo n.º 4
0
	def onQr2Cacl(self):
		# 当前用户选中的回采面
		index = self.ui.work_surf.currentIndex()
		if index < 0:return

		# 根据id查找回采面
		work_surf_id, ok = self.ui.work_surf.itemData(index).toInt()

		# 弹出邻近层计算对话框
		dlg = WsGasFlowPredictAdjDlg(work_surf_id)
		dlg.exec_()

		# 根据id查找回采面->采区->煤层
		work_surf = SQLClientHelper.GetWorkSurfById(work_surf_id)
		work_area_id = work_surf.work_area_id
		if work_area_id <= 0:
			UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:N4)!')
			return
		work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
		
		# 查找煤层
		coal_id = work_area.coal_id
		if coal_id <= 0:
			UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:N5)!')
			return
		coal = SQLClientHelper.GetCoalById(coal_id)

		# 调用rpc计算工作面瓦斯涌出量
		q2 = CbmClientHelper.WorkSurfGasFlow2(coal, work_area, work_surf)
		# 更新计算结果到界面
		self.ui.qr2.setText(u'%.1f' % q2)
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
    def onSave(self):
        # 矿区名称
        region_name = unicode(self.ui.region.currentText()).encode('utf-8')
        # 根据示范矿区的名称反查内部的虚拟矿井和虚拟煤层
        mine = CbmClientHelper.GetSampleMineOfRegion(region_name)
        if mine.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:S3)!')
            return
        coal = CbmClientHelper.GetSampleCoalOfRegion(region_name)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:S4)!')
            return

        # 保存矿井数据
        mine.topo_geo = self.ui.topo_geo.currentIndex() + 1
        mine.hydr_geo = self.ui.hydr_geo.currentIndex() + 1
        mine.ground_condition = int(self.ui.ground_cond.isChecked())
        if not SQLClientHelper.UpdateMine(mine):
            UiHelper.MessageBox(u'更新矿井数据失败(错误码:S5)!')
            return

        # 读取界面上的数据保存到煤层对象
        coal.thick, ok = self.ui.thick.text().toDouble()
        coal.rank = self.ui.rank.currentIndex() + 1
        coal.minable = int(self.ui.minable.isChecked())
        coal.dip_angle, ok = self.ui.dip_angle.text().toDouble()
        coal.hw, ok = self.ui.hw.text().toDouble()
        coal.f_value, ok = self.ui.f_value.text().toDouble()
        coal.pressure, ok = self.ui.pressure.text().toDouble()
        coal.gas_content, ok = self.ui.gas_content.text().toDouble()
        coal.permeability_k, ok = self.ui.permeability_k.text().toDouble()
        coal.res_abundance = self.ui.res_abundance.currentIndex() + 1
        coal.complexity = self.ui.complexity.currentIndex() + 1
        coal.mine_index, ok = self.ui.mine_index.text().toDouble()
        coal.var_coeff, ok = self.ui.var_coeff.text().toDouble()
        coal.czh, ok = self.ui.caving_zone_height.text().toDouble()
        coal.stability = self.ui.stability.currentIndex() + 1
        coal.layer_gap, ok = self.ui.layer_gap.text().toDouble()
        coal.influence_factor, ok = self.ui.influence_factor.text().toDouble()

        # 提交到数据库
        if not SQLClientHelper.UpdateCoal(coal):
            UiHelper.MessageBox(u'更新煤层数据失败(错误码:S6)!')
            #关闭对话框并返回1
            # self.accept()
        else:
            UiHelper.MessageBox(u'恭喜您,数据更新成功啦!')
Ejemplo n.º 7
0
def sql_is_admin_online():
    admin = SQLClientHelper.GetAccountByField1('username', 'admin')
    if admin.id <= 0:
        return False
    else:
        # 查找当前登录账户
        account_id = CbmClientHelper.GetOnlineAccountId()
        return account_id == admin.id
Ejemplo n.º 8
0
def show_report32(coal, goaf_tech):
    # 生成参数
    params = {}
    # 矿井名称
    mine = SQLClientHelper.GetMineById(coal.mine_id)
    params['mine_name'] = mine.name
    # 工作面名称
    # 搜索矿井的所有工作面中的第一个(按道理应该是从界面中提供工作面名称!!!)
    work_surf_list = CbmClientHelper.GetWorkSurfsOfMine(mine.id)
    if len(work_surf_list) == 0:
        params['face_name'] = 'W292'
    else:
        params['face_name'] = work_surf_list[0].name
    # 工作面走向长度
    params['strike_length'] = goaf_tech.l1
    # 工作面倾向长度
    params['tendency_length'] = goaf_tech.l2
    # 钻孔压茬长度
    params['pore_stubble'] = goaf_tech.pore_stubble
    # 钻孔间距
    params['pore_gap'] = goaf_tech.gp
    # 钻孔直径
    params['pore_diameter'] = goaf_tech.dp
    # 钻孔间距
    params['pore_gap'] = goaf_tech.gp
    # 封孔长度(界面中没有输入,网上搜的一个参照值)
    # http://wenku.baidu.com/link?url=4QOLWZsUfFu5zLewMQCeF_WRzYTWmBYE3SRyk1Cj_JTc1UzbZR54NNkrXUsKc1PDj1Kg4492gfSNaKweJTSWxVqz7VbM-b7G3IAbtcdifBy
    params['close_length'] = goaf_tech.close_length
    # 模板文件路径(必须参数)
    params['reportlet'] = 'cbm32.cpt'
    # 设计方案id(必须参数)
    params['design_id'] = goaf_tech.design_technology_id
    # 是否按页面大小显示
    params['__bypagesize__'] = 'true'
    # 查询所有钻孔
    pore_lists = CbmClientHelper.GetAllPores(goaf_tech.design_technology_id)
    # 计算钻孔个数
    params['pore_num'] = len(pore_lists)
    # 计算钻孔总长度
    params['pore_sum'] = sum([pore.length for pore in pore_lists])

    # 显示报表
    # params参数中的字符串数据包括key即可以是utf8编码的str字节数组,也可以是unicode字符串
    # show_report方法内部会自动处理
    show_report(params)
Ejemplo n.º 9
0
 def verify_user(self, uname, pwd):
     ret = -2
     if uname == '': ret = -4
     elif pwd == '': ret = -3
     else: ret = CbmClientHelper.VerifyMineAccount(uname, pwd)
     # 弹出提示信息
     if ret != 1:
         UiHelper.MessageBox(LOGIN_MESSAGE[ret], error=True)
     return ret
Ejemplo n.º 10
0
    def fillWorkAreaCombox(self):
        if self.mine_id <= 0: return
        # 根据id在数据库中查找矿井
        # mine = SQLClientHelper.GetMineById(self.mine_id)
        # if mine.id <= 0:return

        work_area_lists = CbmClientHelper.GetWorkAreasOfMine(self.mine_id)
        # 添加到采区下拉列表
        UiHelper.AddObjectListToCombobox(self.ui.work_area, work_area_lists)
Ejemplo n.º 11
0
    def onMineRegionChanged(self, index):
        if index < 0: return

        # 矿区名称
        region_name = unicode(self.ui.region.currentText()).encode('utf-8')
        # 根据示范矿区的名称反查内部的虚拟矿井和虚拟煤层
        mine = CbmClientHelper.GetSampleMineOfRegion(region_name)
        if mine.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:S1)!')
            return
        coal = CbmClientHelper.GetSampleCoalOfRegion(region_name)
        if coal.id <= 0:
            UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:S2)!')
            return

        # 填充矿井数据
        self.ui.topo_geo.setCurrentIndex(mine.topo_geo - 1)
        self.ui.hydr_geo.setCurrentIndex(mine.hydr_geo - 1)
        self.ui.ground_cond.setChecked(mine.ground_condition != 0)

        # 填充煤层数据
        self.ui.thick.setText(u'%.1f' % coal.thick)
        self.ui.rank.setCurrentIndex(coal.rank - 1)
        self.ui.minable.setChecked(coal.minable != 0)
        self.ui.dip_angle.setText(u'%.1f' % coal.dip_angle)
        self.ui.hw.setText(u'%.1f' % coal.hw)
        self.ui.f_value.setText(u'%.2f' % coal.f_value)
        self.ui.pressure.setText(u'%.1f' % coal.pressure)
        self.ui.gas_content.setText(u'%.1f' % coal.gas_content)
        self.ui.permeability_k.setText(u'%.1f' % coal.permeability_k)
        self.ui.res_abundance.setCurrentIndex(coal.res_abundance - 1)
        self.ui.complexity.setCurrentIndex(coal.complexity - 1)
        self.ui.mine_index.setText(u'%.1f' % coal.mine_index)
        self.ui.var_coeff.setText(u'%.1f' % coal.var_coeff)
        self.ui.caving_zone_height.setText(u'%.1f' % coal.czh)
        self.ui.stability.setCurrentIndex(coal.stability - 1)
        self.ui.layer_gap.setText(u'%.1f' % coal.layer_gap)
        self.ui.influence_factor.setText(u'%.1f' % coal.influence_factor)
Ejemplo n.º 12
0
 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失败')
Ejemplo n.º 13
0
    def onWorkAreaCacl(self):
        mine = SQLClientHelper.GetMineById(self.mine_id)
        if mine.id <= 0: return

        # 将数据保存到矿井对象中用于后续计算
        mine.gas_k2, ok = self.ui.k2_gas.text().toDouble()
        # 调用rpc进行计算
        qr = CbmClientHelper.MineGasFlow(mine)

        if qr <= 0:
            UiHelper.MessageBox(u'错误:采区的日产量必须要大于0!!!')
            qr = 0.0
        else:
            UiHelper.MessageBox(u'更新"相对瓦斯涌出量"计算结果!')
        # 更新计算结果到界面
        self.ui.qr.setText(u'%.1f' % qr)
Ejemplo n.º 14
0
 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失败')
Ejemplo n.º 15
0
 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失败')
Ejemplo n.º 16
0
def sql_login_status():
    # 查找管理员账户
    admin = SQLClientHelper.GetAccountByField1('username', 'admin')
    if admin.id <= 0:
        return 0  # 内部错误(无管理员账户)
    else:
        # 查找当前登录账户
        account_id = CbmClientHelper.GetOnlineAccountId()
        if account_id <= 0:
            return 2  # 没有用户登录
        elif account_id == admin.id:
            return 3  # 管理员已登录
        else:
            mine_id = SQLClientHelper.GetMineIdByForeignKey(
                'account_id', account_id)
            if mine_id <= 0:  # 内部错误(用户没有关联的矿井)
                return -1
            else:  # 普通用户已登陆
                return 1
Ejemplo n.º 17
0
 def login_or_switch(self, uname, pwd):
     account_id = SQLClientHelper.GetAccountIdByField2(
         'username', uname, 'password', pwd)
     # 查找已登录用户
     pre_account_id = CbmClientHelper.GetOnlineAccountId()
     # 当前没有用户登录
     if pre_account_id <= 0:
         # 用户登陆(记录在sys_info表中)
         DataHelper.sql_login_user(account_id)
         # UiHelper.MessageBox('恭喜您,登录成功!')
     # 当前已有用户登录
     elif pre_account_id == account_id:
         # UiHelper.MessageBox('您已经登录过了!')
         pass
     else:
         reply = UiHelper.MessageBox('是否注销并切换到用户%s?' % uname, True)
         if reply == True:
             # 切换用户
             DataHelper.sql_switch_user(account_id)
Ejemplo n.º 18
0
    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失败!!!')
Ejemplo n.º 19
0
	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失败')
Ejemplo n.º 20
0
	def onQr1Cacl(self):
		# 当前用户选中的回采面
		index = self.ui.work_surf.currentIndex()
		if index < 0:return

		# 根据id查找回采面
		work_surf_id, ok = self.ui.work_surf.itemData(index).toInt()

		# 弹出开采层计算对话框
		dlg = WsGasFlowPredictWorkDlg(work_surf_id)
		dlg.exec_()

		# 根据id查找回采面->采区->煤层
		work_surf = SQLClientHelper.GetWorkSurfById(work_surf_id)
		work_area_id = work_surf.work_area_id
		if work_area_id <= 0:
			UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:N4)!')
			return
		work_area = SQLClientHelper.GetWorkAreaById(work_area_id)
		
		# 查找煤层
		coal_id = work_area.coal_id
		if coal_id <= 0:
			UiHelper.MessageBox(u'sorry,出了点问题,请联系技术人员(错误码:N5)!')
			return
		coal = SQLClientHelper.GetCoalById(coal_id)

		# 从界面中读取数据
		# 开采层厚度(????分层如何考虑???)
		coal.thick, ok = self.ui.thick.text().toDouble()
		# 是否分层开采
		work_surf.layerable = int(not self.ui.method_thin.isChecked())

		# 调用rpc计算工作面瓦斯涌出量
		q1 = CbmClientHelper.WorkSurfGasFlow1(coal, work_area, work_surf)
		# 更新计算结果到界面
		self.ui.qr1.setText(u'%.1f' % q1)
Ejemplo n.º 21
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'数据计算成功,请查看"瓦斯涌出量预测结果"部分的数据!')
Ejemplo n.º 22
0
def sql_check_user(uname, pwd):
    return CbmClientHelper.VerifyMineAccount(uname, pwd) == 1
Ejemplo n.º 23
0
 def run_dialog(self, DialogClass):
     # 启动对话框(传入当前登录用户的)
     mine = CbmClientHelper.GetOnlineMine()
     dlg = DialogClass(mine.id)
     dlg.exec_()
Ejemplo n.º 24
0
	def fillWorkSurfCombox(self):
		# 查找矿井的所有工作面
		work_surf_lists = CbmClientHelper.GetWorkSurfsOfMine(self.mine_id)
		# 添加到工作面下拉列表
		UiHelper.AddObjectListToCombobox(self.ui.work_surf, work_surf_lists)
Ejemplo n.º 25
0
def test_sql():
    print len(CbmClientHelper.GetAllPores(45))
Ejemplo n.º 26
0
def test_draw_desigin_eval_unit():
    coal_id, eval_unit_partition_id = 5, 21
    CbmClientHelper.SendCommandToCAD(
        "JL.DrawEvalUnitGraph %d" % eval_unit_partition_id, True)
Ejemplo n.º 27
0
def test_draw_coal_occurrence_graph():
    mine_id = 4
    CbmClientHelper.SendCommandToCAD(
        "JL.DrawOccurrenceGraph %d %.1f" % (mine_id, 1), True)
Ejemplo n.º 28
0
 def onGraph(self):
     # 给cad发送命令绘制煤层赋存图
     ret = CbmClientHelper.SendCommandToCAD(
         "JL.DrawOccurrenceGraph %d %.1f" % (self.mine_id, 0.5), True)
     if not ret:
         UiHelper.MessageBox(u'启动AutoCAD失败')
Ejemplo n.º 29
0
def test_draw_graph_23():
    coal_id, tech_id = 5, 1
    CbmClientHelper.SendCommandToCAD(
        "JL.DrawPlaneGraph23 %d %d" % (coal_id, tech_id), True)