public PD(string PDName,string IP, int Port, tblPDConfig tblpdconfig) { this.IP = IP; this.Port = Port; //bits = new System.Collections.BitArray(data); this.tblPDConfig = tblpdconfig; initValue(); //try //{ // RTUDevice = new ModbusTCP.Master(IP, (ushort)Port); //} //catch { ;} new Thread(ConnectTask).Start(); tmr = new System.Threading.Timer(new System.Threading.TimerCallback(timerBack)); tmr.Change(0, 5000); new Thread(ReadingTask).Start(); this.PDName = PDName; }
string GetPDStatusDescription(int Side, tblPDConfig tbl) { if (Side == 0) // primary site { if (tbl.R0 + tbl.S0 + tbl.T0 == 3) return "斷電"; else return "欠相"; } else { if (tbl.R1 + tbl.S1 + tbl.T1 == 3) return "斷電"; else return "欠相"; } }