|
@@ -295,6 +295,17 @@ namespace centralController
|
|
|
idPssMap.Add(psList[i].parkingSpace, psList[i]);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for (int i = 0; i < psList.Count; i++)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ idPssMap[psList[i].parkingSpace] = psList[i];
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
TableLayoutPanel tlp = new TableLayoutPanel();
|
|
|
tlp.Name = "tlp_ParkingSpace";
|
|
@@ -361,20 +372,29 @@ namespace centralController
|
|
|
foreach (Control segment in psCC)
|
|
|
{
|
|
|
Control.ControlCollection segmentCC = segment.Controls;
|
|
|
- foreach (Control space in segmentCC)
|
|
|
+ //Console.WriteLine("seg::"+segmentCC.Count);
|
|
|
+ foreach (Control spaces in segmentCC)
|
|
|
{
|
|
|
- if (space.GetType() == typeof(Label))
|
|
|
+ Control.ControlCollection spaceCC = spaces.Controls;
|
|
|
+ //Console.WriteLine("spaces::"+spaceCC.Count);
|
|
|
+ foreach (Control space in spaceCC)
|
|
|
{
|
|
|
- int index = -1;
|
|
|
- int.TryParse(space.Text.Substring(2), out index);
|
|
|
- if (idPssMap.ContainsKey(index))
|
|
|
- {
|
|
|
- space.BackColor = GetPSColor(idPssMap[index].spaceStatus);
|
|
|
- }
|
|
|
- else
|
|
|
+ if (space.GetType() == typeof(Label))
|
|
|
{
|
|
|
- needUpdate = true;
|
|
|
- break;
|
|
|
+ int index = -1;
|
|
|
+ bool result = int.TryParse(space.Text.Substring(2), out index);
|
|
|
+ //Console.WriteLine("text is :" + space.Text+", index:"+index);
|
|
|
+ if (idPssMap.ContainsKey(index))
|
|
|
+ {
|
|
|
+ Console.WriteLine("index:" + index+", status:"+ idPssMap[index].spaceStatus);
|
|
|
+ space.BackColor = GetPSColor(idPssMap[index].spaceStatus);
|
|
|
+ }
|
|
|
+ else if(result)
|
|
|
+ {
|
|
|
+ needUpdate = true;
|
|
|
+ //Console.WriteLine("need update:"+index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|