Exemple #1
0
 /// <summary>
 /// 显示上传到数据中心结果日志的显示
 /// </summary>
 /// <param name="server"></param>
 /// <param name="communication"></param>
 /// <param name="device"></param>
 /// <param name="uploadresult"></param>
 public static void ShowMonitorUploadListView(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION communication, Scada.Model.IO_DEVICE device, string uploadresult)
 {
     if (mediator.IOMonitorForm.IsHandleCreated)
     {
         mediator.IOMonitorForm.ShowMonitorUploadListView(server, communication, device, uploadresult);
     }
 }
Exemple #2
0
 public static void AppendSendCommand(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION communication, Scada.Model.IO_DEVICE device, Scada.Model.IO_PARA para, Scada.Model.IO_COMMANDS command)
 {
     if (mediator == null)
     {
         return;
     }
     mediator.IOMonitorForm.InsertMonitorCommandListView(server, communication, device, para, command);
     Scada.Logger.Logger.GetInstance().Info(command.GetCommandString());
 }
Exemple #3
0
 /// <summary>
 /// 显示更新报警界面的数据
 /// </summary>
 /// <param name="server"></param>
 /// <param name="comm"></param>
 /// <param name="device"></param>
 public static void MonitorIODataAlarmShowView(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION comm, Scada.Model.IO_DEVICE device, IO_PARAALARM alarm, string uploadresult)
 {
     if (mediator.IOMonitorForm.IsHandleCreated)
     {
         mediator.IOMonitorForm.BeginInvoke(new EventHandler(delegate
         {
             mediator.IOMonitorForm.InsertMonitorAlarmListView(server, comm, device, alarm, uploadresult);
         }));
     }
 }
Exemple #4
0
        /// <summary>
        /// 显示最近产生的报警
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>

        #region 加载IO属性
        public static void SetIOPara(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION comm, Scada.Model.IO_DEVICE device, Scada.Model.IO_PARA para)
        {
            if (mediator.IOMonitorForm.IsHandleCreated)
            {
                mediator.IOMonitorForm.BeginInvoke(new EventHandler(delegate
                {
                    mediator.IOPropertiesForm.SetPara(server, comm, device, para);
                }));
            }
        }
Exemple #5
0
        public void ReloadSimulator(string IO_SERVER_ID)
        {
            Task.Run(() => {
                if (IOCenterManager.SimulatorManager.SimulatorForm != null)
                {
                    IOCenterManager.SimulatorManager.ColseSimulator();
                }
                Scada.Business.IO_DEVICE deviceBll      = new Scada.Business.IO_DEVICE();
                Scada.Business.IO_COMMUNICATION commBll = new Scada.Business.IO_COMMUNICATION();
                Scada.Business.IO_SERVER serverBll      = new Scada.Business.IO_SERVER();
                lock (Servers)
                {
                    Scada.Model.IO_SERVER deleteServer = Servers.Find(x => x.SERVER_ID == IO_SERVER_ID);
                    if (deleteServer != null)
                    {
                        Servers.Remove(deleteServer);//删除这个采集站信息
                    }

                    Scada.Model.IO_SERVER newsServer = serverBll.GetModel(IO_SERVER_ID);
                    if (newsServer != null)
                    {
                        Servers.Add(newsServer);
                    }
                    else
                    {
                        return;
                    }
                }
                lock (Communications)
                {
                    for (int i = Communications.Count - 1; i >= 0; i--)
                    {
                        if (Communications[i].IO_SERVER_ID == IO_SERVER_ID)
                        {
                            //首先删除设备
                            for (int d = Communications[i].Devices.Count - 1; d >= 0; d--)
                            {
                                Devices.Remove(Communications[i].Devices[d]);
                            }
                            Communications.RemoveAt(i);
                        }
                    }

                    List <Scada.Model.IO_COMMUNICATION> newsCommunications = commBll.GetModelList(" IO_SERVER_ID='" + IO_SERVER_ID + "' ");
                    Communications.AddRange(newsCommunications);
                    List <Scada.Model.IO_DEVICE> newsDevices = deviceBll.GetModelList("  IO_SERVER_ID='" + IO_SERVER_ID + "'");
                    Devices.AddRange(newsDevices);

                    for (int i = 0; i < newsCommunications.Count; i++)
                    {
                        newsCommunications[i].Devices = newsDevices.FindAll(x => x.IO_COMM_ID == newsCommunications[i].IO_COMM_ID && x.IO_SERVER_ID == newsCommunications[i].IO_SERVER_ID);
                    }
                }
            });
        }
Exemple #6
0
 /// <summary>
 /// 设置采集点的采集值
 /// </summary>
 /// <returns></returns>
 public void SetIOValue(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION comm, Scada.Model.IO_DEVICE device)
 {
     try
     {
         ChangedBinds(server, comm, device.Copy());
     }
     catch (Exception ex)
     {
         MonitorFormManager.DisplyException(ex);
     }
 }
Exemple #7
0
        public IO_SERVER Copy()
        {
            IO_SERVER server = new IO_SERVER()
            {
                SERVER_CREATEDATE = this.SERVER_CREATEDATE,
                SERVER_ID         = this.SERVER_ID,
                SERVER_IP         = this.SERVER_IP,
                SERVER_NAME       = this.SERVER_NAME,
                SERVER_REMARK     = this.SERVER_REMARK,
                SERVER_STATUS     = this.SERVER_STATUS
            };

            return(server);
        }
Exemple #8
0
        public static void  MonitorIODataShowView(Scada.Model.IO_SERVER server, Scada.Model.IO_COMMUNICATION comm, Scada.Model.IO_DEVICE device)
        {
            if (mediator.IOMonitorForm.IsHandleCreated)
            {
                mediator.IOMonitorForm.BeginInvoke(new EventHandler(delegate
                {
                    mediator.IOMonitorForm.SetIOValue(server, comm, device);


                    //清空接收的数据
                    device.ClearCollectDatas();
                }));
            }
        }
Exemple #9
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Scada.Model.IO_SERVER model)
 {
     return(dal.Update(model));
 }
Exemple #10
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Scada.Model.IO_SERVER model)
 {
     return(dal.Add(model));
 }