示例#1
0
        /// <summary>
        ///     开切眼
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnChooseQY_Click(object sender, EventArgs e)
        {
            if (_workingFace == null)
            {
                Alert.alert("请先选择工作面");
                return;
            }

            //巷道选择窗体
            var tunnelChoose = new SelectTunnelDlg(_workingFace);

            //巷道选择完毕
            if (DialogResult.OK == tunnelChoose.ShowDialog())
            {
                if (_tunnelQy != null)
                {
                    var ent = Tunnel.Find(_tunnelQy.TunnelId);
                    ent.TunnelType = TunnelTypeEnum.OTHER;
                    _tunnelSet.Add(ent);
                }

                //巷道选择按钮Text改变
                btnChooseQY.Text = tunnelChoose.SelectedTunnel.TunnelName;
                //实体赋值
                _tunnelQy = Tunnel.Find(tunnelChoose.SelectedTunnel.TunnelId);
                if (_tunnelQy != null)
                {
                    _tunnelQy.TunnelType = TunnelTypeEnum.STOPING_QY;
                    _tunnelSet.Add(_tunnelQy);
                }
            }
        }
示例#2
0
        private void bindInfo()
        {
            //关联巷道1
            var tunnel = Tunnel.Find(tunnelHChuanEntity.TunnelId1);

            if (tunnel != null)
            {
                btnTunnelChoose1.Text = tunnel.TunnelName;
            }
            //关联巷道2
            tunnel = Tunnel.Find(tunnelHChuanEntity.TunnelId2);
            if (tunnel != null)
            {
                btnTunnelChoose2.Text = tunnel.TunnelName;
            }
            textBox_Name.Text    = tunnelHChuanEntity.NameHChuan;
            txtWidth.Text        = tunnelHChuanEntity.Width.ToString();
            textBox_X1.Text      = Convert.ToString(tunnelHChuanEntity.X1);
            textBox_Y1.Text      = Convert.ToString(tunnelHChuanEntity.Y1);
            textBox_Z1.Text      = Convert.ToString(tunnelHChuanEntity.Z1);
            textBox_X2.Text      = Convert.ToString(tunnelHChuanEntity.X2);
            textBox_Y2.Text      = Convert.ToString(tunnelHChuanEntity.Y2);
            textBox_Z2.Text      = Convert.ToString(tunnelHChuanEntity.Z2);
            textBox_Azimuth.Text = Convert.ToString(tunnelHChuanEntity.Azimuth);

            tunnelEntity.TunnelId = tunnelHChuanEntity.TunnelId1;
            //队别名称
            cboTeamName.Text = tunnelHChuanEntity.Team.TeamName;

            //开始日期
            dtpStartDate.Value = tunnelHChuanEntity.StartDate;
            //是否回采完毕
            if (tunnelHChuanEntity.IsFinish == 1)
            {
                rbtnHChuanY.Checked = true;
            }
            else
            {
                rbtnHChuanN.Checked = true;
            }
            //停工日期
            if (tunnelHChuanEntity.IsFinish == 1)
            {
                dtpStopDate.Value = tunnelHChuanEntity.StopDate;
            }
            //工作制式
            if (tunnelHChuanEntity.WorkStyle == rbtn38.Text)
            {
                rbtn38.Checked = true;
            }
            else
            {
                rbtn46.Checked = true;
            }
            //班次
            cboWorkTime.Text = tunnelHChuanEntity.WorkTime;
            //状态
            cmbTunnelState.Text = tunnelHChuanEntity.State;
        }
示例#3
0
        /// <summary>
        ///     删除按钮响应
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsBtnDel_Click(object sender, EventArgs e)
        {
            if (Alert.confirm(Const.DEL_CONFIRM_MSG))
            {
                var searchCount = _rowsCount;
                var bResult     = false;
                for (var i = 0; i < _rowsCount; i++)
                {
                    _tmpRowIndex = fpDayReportHChuan.Sheets[0].ActiveRowIndex;
                    //遍历“选择”是否选中
                    if (fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, 0].Value != null &&
                        (bool)fpDayReportHChuan.Sheets[0].Cells[_rowDetailStartIndex + i, 0].Value)
                    {
                        //主键
                        tunnelHChuanEntity.Id = Convert.ToInt32(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.ID]);
                        var tmp = 0;
                        //主运顺槽
                        if (int.TryParse(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID1].ToString(), out tmp))
                        {
                            tunnelHChuanEntity.TunnelId1 = tmp;
                            tmp = 0;
                        }
                        //辅运顺槽
                        if (int.TryParse(_ds.Tables[0].Rows[i][TunnelHChuanDbConstNames.TUNNEL_ID2].ToString(), out tmp))
                        {
                            tunnelHChuanEntity.TunnelId2 = tmp;
                            tmp = 0;
                        }

                        //重设巷道类型
                        var tunnel1 = Tunnel.Find(tunnelHChuanEntity.TunnelId1);
                        tunnel1.TunnelType = TunnelTypeEnum.OTHER;
                        tunnel1.Save();
                        var tunnel2 = Tunnel.Find(tunnelHChuanEntity.TunnelId2);
                        tunnel2.TunnelType = TunnelTypeEnum.OTHER;
                        tunnel2.Save();

                        //删除回采巷道信息
                        bResult = TunnelHChuanBLL.deleteTunnelHChuan(tunnelHChuanEntity);
                    }
                }
                if (bResult)
                {
                    //TODO:删除后事件
                    //将图层中对应的信息删除
                    DelHChuanjc(tunnelHChuanEntity.TunnelId1, tunnelHChuanEntity.TunnelId2);
                    //删除工作面中对应的回采信息
                    /////Mark
                }
                bindFpTunnelHChuanInfo();
                FarPointOperate.farPointFocusSetDel(fpDayReportHChuan, _tmpRowIndex);
            }
        }
示例#4
0
        public void UpdateTableContents(LibEntity.PreWarningResultTable preWarningResultTableEntity, int tunnelID)
        {
            if (preWarningResultTableEntity != null)
            {
                _tunnelID = tunnelID;
                //获取巷道实体信息
                var tunnelEnt = Tunnel.Find(_tunnelID);
                // 标题
                fpPreWarningResultTable.Sheets[0].Cells[0, 0].Text = tunnelEnt.TunnelName + "预警结果表";
                // 预警日期
                fpPreWarningResultTable.Sheets[0].Cells[3, 1].Text = preWarningResultTableEntity.PreWarningDate;
                // 预警时间
                fpPreWarningResultTable.Sheets[0].Cells[3, 3].Text = preWarningResultTableEntity.PreWarningTime;

                /** 预警结果 **/
                // 超限预警
                fpPreWarningResultTable.Sheets[0].Cells[7, 2].Text =
                    preWarningResultTableEntity.PreWarningResultArr[0].UltralimitPreWarning;
                // 超限预警-说明
                fpPreWarningResultTable.Sheets[0].Cells[7, 5].Text =
                    preWarningResultTableEntity.PreWarningResultArr[0].UltralimitPreWarningEX;
                // 突出预警
                fpPreWarningResultTable.Sheets[0].Cells[9, 2].Text =
                    preWarningResultTableEntity.PreWarningResultArr[0].OutburstPreWarning;
                // 突出预警-说明
                fpPreWarningResultTable.Sheets[0].Cells[9, 5].Text =
                    preWarningResultTableEntity.PreWarningResultArr[0].OutburstPreWarningEX;

                /** 预警依据 **/
                for (var i = 1; i < preWarningResultTableEntity.PreWarningResultArr.Length; i++)
                {
                    // 超限预警
                    fpPreWarningResultTable.Sheets[0].Cells[9 + i * 4, 2].Text =
                        preWarningResultTableEntity.PreWarningResultArr[i].UltralimitPreWarning;
                    // 超限预警-说明
                    fpPreWarningResultTable.Sheets[0].Cells[9 + i * 4, 5].Text =
                        preWarningResultTableEntity.PreWarningResultArr[i].UltralimitPreWarningEX;
                    var count = setCellHigh(preWarningResultTableEntity.PreWarningResultArr[i].UltralimitPreWarningEX);
                    fpPreWarningResultTable.Sheets[0].Rows[10 + i * 4].Height =
                        fpPreWarningResultTable.Sheets[0].Rows[9 + i * 4].Height * count;
                    // 突出预警
                    fpPreWarningResultTable.Sheets[0].Cells[11 + i * 4, 2].Text =
                        preWarningResultTableEntity.PreWarningResultArr[i].OutburstPreWarning;
                    // 突出预警-说明
                    fpPreWarningResultTable.Sheets[0].Cells[11 + i * 4, 5].Text =
                        preWarningResultTableEntity.PreWarningResultArr[i].OutburstPreWarningEX;
                    var count2 = setCellHigh(preWarningResultTableEntity.PreWarningResultArr[i].OutburstPreWarningEX);
                    fpPreWarningResultTable.Sheets[0].Rows[12 + i * 4].Height =
                        fpPreWarningResultTable.Sheets[0].Rows[11 + i * 4].Height * count2;
                }
            }
        }
示例#5
0
        private static void clearTunnelTypeOfHChuan(int tunnelHChuanID)
        {
            TunnelHChuan tunnelHChuanEntity =
                selectTunnelHChuan(tunnelHChuanID);

            if (tunnelHChuanEntity != null)
            {
                var tunnel1 = Tunnel.Find(tunnelHChuanEntity.TunnelId1);
                var tunnel2 = Tunnel.Find(tunnelHChuanEntity.TunnelId2);
                tunnel1.TunnelType = TunnelTypeEnum.OTHER;
                tunnel2.TunnelType = TunnelTypeEnum.OTHER;
                tunnel1.Save();
                tunnel2.Save();
            }
        }
示例#6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //去掉无用空行
            for (var i = 0; i < dgrdvWire.RowCount - 1; i++)
            {
                if (dgrdvWire.Rows[i].Cells[0].Value == null &&
                    dgrdvWire.Rows[i].Cells[1].Value == null &&
                    dgrdvWire.Rows[i].Cells[2].Value == null &&
                    dgrdvWire.Rows[i].Cells[3].Value == null &&
                    dgrdvWire.Rows[i].Cells[4].Value == null &&
                    dgrdvWire.Rows[i].Cells[5].Value == null &&
                    dgrdvWire.Rows[i].Cells[6].Value == null &&
                    dgrdvWire.Rows[i].Cells[7].Value == null)
                {
                    dgrdvWire.Rows.RemoveAt(i);
                }
            }
            //验证
            if (!check())
            {
                DialogResult = DialogResult.None;
                return;
            }
            var coordinates = new List <IPoint>();

            for (var i = 0; i < dgrdvWire.Rows.Count - 1; i++)
            {
                var    x   = Convert.ToDouble(dgrdvWire.Rows[i].Cells[1].Value);
                var    y   = Convert.ToDouble(dgrdvWire.Rows[i].Cells[2].Value);
                var    z   = Convert.ToDouble(dgrdvWire.Rows[i].Cells[3].Value);
                IPoint pnt = new PointClass();
                pnt.X = x;
                pnt.Y = y;
                pnt.Z = z;
                coordinates.Add(pnt);
            }
            var tunnel = Tunnel.Find(_tunnelEntity.TunnelId);

            Global.cons.DrawJJJZ(_tunnelEntity.TunnelId.ToString(), coordinates, Convert.ToDouble(tunnel.TunnelWid), 0,
                                 0, Global.searchlen, Global.sxjl, 1);
        }
        /// <summary>
        /// 以巷道为单位
        /// </summary>
        /// <returns></returns>
        public static List <PreWarningResultQuery> QueryHoldWarningResult()
        {
            List <PreWarningResultQuery> lastedResultEnts = new
                                                            List <PreWarningResultQuery>();

            // 一条巷道,有的记录有两条“突出和超限”,有的记录只有一条“”,我们把两条的合并成一条
            Dictionary <int, PreWarningResultQuery> container = new
                                                                Dictionary <int, PreWarningResultQuery>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT * FROM ");
            strSql.Append(PreWarningResultViewDbConstNames.VIEW_NAME);
            strSql.Append(" WHERE ");
            strSql.Append(PreWarningResultDBConstNames.WARNING_RESULT);
            strSql.Append(" < 2 ");
            strSql.Append(" AND " +
                          PreWarningResultDBConstNames.HANDLE_STATUS + " < 3"); // 3指 HANDLED
            strSql.Append(" AND WARNING_STATUS = 1");
            //strSql.Append(" AND " + PreWarningResultDBConstNames.TUNNEL_ID + " IN (SELECT TUNNEL_ID FROM " + PreWarningResultViewDbConstNames.VIEW_NAME + " WHERE WARNING_STATUS=1)");
            //strSql.Append(" ORDER BY ");
            //strSql.Append(PreWarningResultDBConstNames.TUNNEL_ID);
            ManageDataBase database = new
                                      ManageDataBase(DATABASE_TYPE.WarningManagementDB);

            database.Open();
            DataTable dt =
                database.ReturnDSNotOpenAndClose(strSql.ToString()).Tables[0];

            if (dt != null)
            {
                int rowCount = dt.Rows.Count;
                PreWarningResultQuery ent = null;
                for (int i = 0; i < rowCount; i++)
                {
                    //巷道名称
                    int tunelId = LibCommon.Const.INVALID_ID;
                    int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.TUNNEL_ID].ToString(),
                                 out tunelId);
                    if (container.ContainsKey(tunelId))
                    {
                        ent = container[tunelId];// 巷道已经存在字典中
                    }
                    else
                    {
                        ent = new PreWarningResultQuery();
                        container.Add(tunelId, ent);
                    }

                    ent.TunnelID = tunelId;

                    Tunnel entTunnel = Tunnel.Find(tunelId);
                    ent.TunelName =
                        entTunnel.WorkingFace.WorkingfaceTypeEnum ==
                        WorkingfaceTypeEnum.JJ ?
                        entTunnel.WorkingFace.WorkingFaceName :
                        entTunnel.WorkingFace.WorkingFaceName + " - " +
                        entTunnel.TunnelName;
                    //ent.TunelName = GetTunelNameByTunelID(tunelId);
                    ent.WorkingfaceId =
                        dt.Rows[i][WorkingFaceDbConstNames.WORKINGFACE_ID] !=
                        DBNull.Value ?
                        Convert.ToInt32(dt.Rows[i][WorkingFaceDbConstNames.WORKINGFACE_ID])
                        : 0;
                    ent.WorkingfaceName =
                        dt.Rows[i][WorkingFaceDbConstNames.WORKINGFACE_ID] !=
                        DBNull.Value ?
                        dt.Rows[i][WorkingFaceDbConstNames.WORKINGFACE_NAME].ToString()
                        : "";

                    //日期
                    ent.DateTime =
                        Convert.ToDateTime(dt.Rows[i][PreWarningResultDBConstNames.DATA_TIME]);
                    //班次
                    ent.Date_Shift =
                        dt.Rows[i][PreWarningResultDBConstNames.DATE_SHIFT].ToString();



                    int defultValue = (int)WarningResult.NULL;
                    //突出预警结果
                    if
                    ((WarningType)(dt.Rows[i][PreWarningResultDBConstNames.WARNING_TYPE])
                     == WarningType.OUTBURST)
                    {
                        WarningResultEnt outburstEnt = new
                                                       WarningResultEnt();
                        outburstEnt.ID =
                            dt.Rows[i][PreWarningResultDBConstNames.ID].ToString();

                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.WARNING_RESULT].ToString(),
                                     out defultValue);
                        outburstEnt.WarningResult = defultValue;

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.GAS].ToString(),
                                     out defultValue);
                        if (defultValue < outburstEnt.Gas)
                        {
                            outburstEnt.Gas
                                = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.COAL].ToString(),
                                     out defultValue);
                        if (defultValue < outburstEnt.Coal)
                        {
                            outburstEnt.Coal = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.GEOLOGY].ToString(),
                                     out defultValue);
                        if (defultValue < outburstEnt.Geology)
                        {
                            outburstEnt.Geology = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.VENTILATION].ToString(),
                                     out defultValue);
                        if (defultValue < outburstEnt.Ventilation)
                        {
                            outburstEnt.Ventilation = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.MANAGEMENT].ToString(),
                                     out defultValue);
                        if (defultValue < outburstEnt.Management)
                        {
                            outburstEnt.Management = defultValue;
                        }

                        // 处理状态
                        outburstEnt.HandleStatus =
                            Convert.ToInt32(dt.Rows[i][PreWarningResultDBConstNames.HANDLE_STATUS]);

                        ent.OutBrustWarningResult = outburstEnt;
                    }
                    //超限预警结果
                    if
                    ((WarningType)(dt.Rows[i][PreWarningResultDBConstNames.WARNING_TYPE])
                     == WarningType.OVER_LIMIT)
                    {
                        WarningResultEnt overlimitEnt = new
                                                        WarningResultEnt();
                        overlimitEnt.ID =
                            dt.Rows[i][PreWarningResultDBConstNames.ID].ToString();

                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.WARNING_RESULT].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.WarningResult)
                        {
                            overlimitEnt.WarningResult = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.GAS].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.Gas)
                        {
                            overlimitEnt.Gas = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.COAL].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.Coal)
                        {
                            overlimitEnt.Coal = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.GEOLOGY].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.Geology)
                        {
                            overlimitEnt.Geology = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.VENTILATION].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.Ventilation)
                        {
                            overlimitEnt.Ventilation = defultValue;
                        }

                        defultValue = (int)WarningResult.NULL;
                        int.TryParse(dt.Rows[i][PreWarningResultDBConstNames.MANAGEMENT].ToString(),
                                     out defultValue);
                        if (defultValue < overlimitEnt.Management)
                        {
                            overlimitEnt.Management = defultValue;
                        }

                        overlimitEnt.HandleStatus =
                            Convert.ToInt32(dt.Rows[i][PreWarningResultDBConstNames.HANDLE_STATUS].ToString());

                        ent.OverLimitWarningResult = overlimitEnt;
                    }
                    if (ent.OutBrustWarningResult == null &&
                        ent.OverLimitWarningResult == null)
                    {
                        continue;
                    }
                    //lastedResultEnts.Add(ent);
                }

                foreach (KeyValuePair <int, PreWarningResultQuery> kvp in
                         container)
                {
                    lastedResultEnts.Add(kvp.Value);
                }
            }
            database.Close();
            return(lastedResultEnts);
        }