Exemplo n.º 1
0
        /// <summary>
        /// 交换机电源箱信息刷新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void switchRefresh_Click(object sender, EventArgs e)
        {
            try
            {
                var node = treeViewSwitch.SelectedNode;
                if (node == null)
                {
                    XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (_thrSwitchRefresh != null && _thrSwitchRefresh.IsAlive == true)
                {
                    return;
                }
                selectMacNow = node.Name;
                ChargeMrg.sendD(16, node.Name);
                _thrSwitchRefresh = new Thread(SwitchRefreshRefreshThrFun)
                {
                    IsBackground = true
                };
                _thrSwitchRefresh.Start(node.Name);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 分站树选择函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewSubstation_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                //结束刷新进程
                if (_thrSubstationRefresh != null && _thrSubstationRefresh.IsAlive == true)
                {
                    _thrSubstationRefresh.Abort();
                }

                var node = treeViewSubstation.SelectedNode;
                if (node == null)
                {
                    //XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                //刷新放电按钮状态
                //var point = node.Name.PadLeft(3, '0') + "0000";
                //var tempControls = ChargeMrg.QueryJCSDKZbyInf(10, point);
                //if (tempControls.Count > 0)
                //{
                //    //XtraMessageBox.Show("该设备正处于放电状态。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //    //return;
                //    substationExecuteDischarge.Text = "取消放电";
                //    substationExecuteDischarge.ForeColor = Color.Red;
                //}
                //else
                //{
                //    substationExecuteDischarge.Text = "执行放电";
                //    substationExecuteDischarge.ForeColor = Color.Green;
                //}

                //var gsa = ControlInterfaceFuction.GetSubstationPowerBoxInfo(node.Name);
                //SubstationInfoRefresh(gsa);
                selectFzhNow = node.Name;

                ChargeMrg.sendD(0, node.Name);
                _thrSubstationRefresh = new Thread(SubstationRefreshRefreshThrFun)
                {
                    IsBackground = true
                };
                _thrSubstationRefresh.Start(node.Name);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 交换机树选择函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeViewSwitch_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                //结束刷新进程
                if (_thrSwitchRefresh != null && _thrSwitchRefresh.IsAlive == true)
                {
                    _thrSwitchRefresh.Abort();
                }

                var node = treeViewSwitch.SelectedNode;
                if (node == null)
                {
                    return;
                }

                //刷新放电按钮状态
                //var point = node.Name;
                //var tempControls = ChargeMrg.QueryJCSDKZbyInf(10, point);
                //if (tempControls.Count > 0)
                //{
                //    switchExecuteDischarge.Text = "取消放电";
                //    switchExecuteDischarge.ForeColor = Color.Red;
                //}
                //else
                //{
                //    switchExecuteDischarge.Text = "执行放电";
                //    switchExecuteDischarge.ForeColor = Color.Green;
                //}

                //var gsp = ControlInterfaceFuction.GetSwitchPowerBoxInfo(node.Name);
                //SwitchInfoRefresh(gsp);
                selectMacNow = node.Name;

                ChargeMrg.sendD(16, node.Name);
                _thrSwitchRefresh = new Thread(SwitchRefreshRefreshThrFun)
                {
                    IsBackground = true
                };
                _thrSwitchRefresh.Start(node.Name);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 分站电源箱信息刷新
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void substationRefresh_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    var node = treeViewSwitch.SelectedNode;
            //    if (node == null)
            //    {
            //        XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //        return;
            //    }

            //    var point = node.Name;
            //    var tempControls = ChargeMrg.QueryJCSDKZbyInf(10, point);
            //    if (tempControls.Count == 0)
            //    {
            //        XtraMessageBox.Show("该设备未处于放电状态。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //        return;
            //    }

            //    for (var i = 0; i < tempControls.Count; i++)
            //    {
            //        tempControls[i].InfoState = InfoState.Delete;
            //        OperateLogHelper.InsertOperateLog(4,
            //            "取消放电:主控【" + tempControls[i].ZkPoint + "】-【" + tempControls[i].Bkpoint + "】-【" +
            //            DateTime.Now + "】", "");
            //    }
            //    //ChargeMrg.DelJC_JCSDKZCache(tempControls.ToList());

            //    XtraMessageBox.Show("操作成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //}
            //catch (Exception exc)
            //{
            //    XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //}

            try
            {
                var node = treeViewSubstation.SelectedNode;
                if (node == null)
                {
                    XtraMessageBox.Show("请先选择需操作的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (_thrSubstationRefresh != null && _thrSubstationRefresh.IsAlive == true)
                {
                    return;
                }
                selectFzhNow = node.Name;
                ChargeMrg.sendD(0, node.Name);
                _thrSubstationRefresh = new Thread(SubstationRefreshRefreshThrFun)
                {
                    IsBackground = true
                };
                _thrSubstationRefresh.Start(node.Name);
            }
            catch (Exception exc)
            {
                XtraMessageBox.Show(exc.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }