} // First Routes public void AnalyzeRouteSecond(string request) { bool[] req = new bool[8]; req = hexToBinary(request); DataTable dt = new DataTable(); string item; int a = 73; int b = 65; for (int i = 0; i < 7; i = i + 2) { if (req[i]) { dt = LogORM.SelectRoute(a); Log.Insert(LogTypes.INFO, (DeviceID)a, StatusType.Reserved, request); for (int j = 0; j < dt.Rows.Count; j++) { item = dt.Rows[j]["LineName"].ToString().Trim(); var element = (LineUC)this.FindName(item); if (element != null && element.GetType() == typeof(LineUC)) { element.ColorizeLine(Brushes.Blue); } } } a--; } for (int i = 1; i < 8; i = i + 2) { if (req[i]) { dt = LogORM.SelectRoute(b); Log.Insert(LogTypes.INFO, (DeviceID)b, StatusType.Reserved, request); for (int j = 0; j < dt.Rows.Count; j++) { item = dt.Rows[j]["LineName"].ToString().Trim(); var element = (LineUC)this.FindName(item); if (element != null && element.GetType() == typeof(LineUC)) { element.ColorizeLine(Brushes.Blue); } } } b--; } }
} // conversion method public void ClearLines() { DataTable table = new DataTable(); table = LogORM.SelectRoute(74); string item; for (int i = 0; i < table.Rows.Count; i++) { item = table.Rows[i]["LineName"].ToString().Trim(); var element = (LineUC)this.FindName(item); if (element != null && element.GetType() == typeof(LineUC)) { element.ColorizeLine(Brushes.Black); } } }