Commit 169033ef authored by 潘栩锋's avatar 潘栩锋 🚴

IBCSystemClient 没有继承INotifyPropertyChanged, 导致界面不会更新 IBC服务器连接断开

parent c7392bef
...@@ -57,7 +57,7 @@ namespace FLY.IBC.UI.Client.UIModule ...@@ -57,7 +57,7 @@ namespace FLY.IBC.UI.Client.UIModule
reason_list_index--; reason_list_index--;
if (reason_list_index < 0) if (reason_list_index < 0)
reason_list_index = mWindow.Record.Count(); reason_list_index = mWindow.Record.Count();
updateError(); updateError01();
}; };
mWindow.Record.CollectionChanged += Record_CollectionChanged; mWindow.Record.CollectionChanged += Record_CollectionChanged;
...@@ -81,25 +81,28 @@ namespace FLY.IBC.UI.Client.UIModule ...@@ -81,25 +81,28 @@ namespace FLY.IBC.UI.Client.UIModule
{ {
if (e.PropertyName == "IsConnected") if (e.PropertyName == "IsConnected")
{ {
updateError(); updateError01();
} }
}; };
updateError(); updateError01();
} }
private void Record_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) private void Record_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
reason_list_index = mWindow.Record.Count() - 1;
updateError01();
}
void updateError01()
{ {
FObjBase.PollModule.Current.Poll_JustOnce( FObjBase.PollModule.Current.Poll_JustOnce(
new FObjBase.PollModule.PollHandler(delegate () new FObjBase.PollModule.PollHandler(delegate ()
{ {
reason_list_index = mWindow.Record.Count() - 1;
updateError(); updateError();
}), this, MARKNO_UPDATEERROR); }), this, MARKNO_UPDATEERROR);
} }
void updateError() void updateError()
{ {
if (!iBCSystemClient.IsConnected) if (!iBCSystemClient.IsConnected)
......
...@@ -15,7 +15,7 @@ using System.Threading.Tasks; ...@@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace FLY.IBC.Client namespace FLY.IBC.Client
{ {
public class IBCSystemClient : FObj, IIBCSystemService public class IBCSystemClient : FObj, IIBCSystemService,INotifyPropertyChanged
{ {
public BufferServiceClient<Db_Width> CtrlList; public BufferServiceClient<Db_Width> CtrlList;
#region IIBCSystemService #region IIBCSystemService
...@@ -32,8 +32,23 @@ namespace FLY.IBC.Client ...@@ -32,8 +32,23 @@ namespace FLY.IBC.Client
public IPLCProxySystemService PLCos { get; private set; } public IPLCProxySystemService PLCos { get; private set; }
#endregion #endregion
//private bool isConnected;
public bool IsConnected { get; set; } = false; public bool IsConnected
{
get;set;
}
//{
// get {
// return isConnected;
// }
// set {
// if (isConnected != value)
// {
// isConnected = value;
// this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsConnected"));
// }
// }
//}
IFConn mConn; IFConn mConn;
UInt32 mServerID; UInt32 mServerID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment