//private void timer1_Tick(object sender, EventArgs e) //{ // timer1.Enabled = false; // show(); // timer1.Enabled = true; //} private void fthread() { dt = Model.RealInterfaceFuction.GetRealMac(); MethodInvoker In1 = new MethodInvoker(() => show()); this.BeginInvoke(In1); while (_isRun) { try { //DataTable dt = Model.RealInterfaceFuction.GetRealMac(); dt = Model.RealInterfaceFuction.GetRealMac(); //MethodInvoker In1 = new MethodInvoker(() => show()); //this.BeginInvoke(In1); for (int i = 0; i < dt.Rows.Count; i++) { NetDeviceSettingInfo tempNetInfo = _NetworkModuleService.GetNetworkModuletParameters(new NetworkModuletParametersGetRequest() { Mac = dt.Rows[i]["mac"].ToString() }).Data; if (tempNetInfo == null) { dt.Rows[i]["Switch1000State"] = "-"; dt.Rows[i]["Switch100State"] = "-"; dt.Rows[i]["Switch100RJ45State"] = "-"; continue; } string switch1000StateString = ""; if (tempNetInfo.NetSetting != null && tempNetInfo.NetSetting.Switch1000JkState != null) { for (int j = 0; j < tempNetInfo.NetSetting.Switch1000JkState.Length; j++) { switch1000StateString += "千兆光口" + (j + 1).ToString() + ":" + (tempNetInfo.NetSetting.Switch1000JkState[j] == 0 ? "断开" : "正常") + "\r\n"; } } dt.Rows[i]["Switch1000State"] = switch1000StateString == "" ? "-" : switch1000StateString; string switch100StateString = ""; if (tempNetInfo.NetSetting != null && tempNetInfo.NetSetting.Switch100JkState != null) { for (int j = 0; j < tempNetInfo.NetSetting.Switch100JkState.Length; j++) { switch100StateString += "百兆光口" + (j + 1).ToString() + ":" + (tempNetInfo.NetSetting.Switch100JkState[j] == 0 ? "断开" : "正常") + "\r\n"; } } dt.Rows[i]["Switch100State"] = switch100StateString == "" ? "-" : switch100StateString; string switch100RJ45State = ""; if (tempNetInfo.NetSetting != null && tempNetInfo.NetSetting.Switch100RJ45State != null) { for (int j = 0; j < tempNetInfo.NetSetting.Switch100RJ45State.Length; j++) { switch100RJ45State += "百兆电口" + (j + 1).ToString() + ":" + (tempNetInfo.NetSetting.Switch100RJ45State[j] == 0 ? "断开" : "正常") + "\r\n"; } } dt.Rows[i]["Switch100RJ45State"] = switch100RJ45State == "" ? "-" : switch100RJ45State; } In1 = new MethodInvoker(() => show()); this.BeginInvoke(In1); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(ex); } Thread.Sleep(15000); } }
public BasicResponse <NetDeviceSettingInfo> GetNetworkModuletParameters(NetworkModuletParametersGetRequest networkModuleCacheRequest) { return(_NetworkModuleService.GetNetworkModuletParameters(networkModuleCacheRequest)); }