|
@@ -76,6 +76,10 @@ namespace centralController
|
|
{
|
|
{
|
|
UpdateAllTerms();
|
|
UpdateAllTerms();
|
|
});
|
|
});
|
|
|
|
+ Task.Factory.StartNew(() =>
|
|
|
|
+ {
|
|
|
|
+ UpdateParkingSpaceView();
|
|
|
|
+ });
|
|
}));
|
|
}));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -266,6 +270,79 @@ namespace centralController
|
|
tm.pbNum.Visible = false;
|
|
tm.pbNum.Visible = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 更新立体停车位显示
|
|
|
|
+ /// </summary>
|
|
|
|
+ private void UpdateParkingSpaceView()
|
|
|
|
+ {
|
|
|
|
+ while (!closing)
|
|
|
|
+ {
|
|
|
|
+ List<ParkingSpaceStru> psList = Monitor.Monitor.parkingSpaceInfo;
|
|
|
|
+ TableLayoutPanel tlp = new TableLayoutPanel();
|
|
|
|
+ tlp.Name = "tlp_ParkingSpace";
|
|
|
|
+ tlp.ColumnCount = Monitor.Monitor.rows;
|
|
|
|
+ this.Invoke(new Action(() =>
|
|
|
|
+ {
|
|
|
|
+ //List<TableLayoutPanel> tlpList = new List<TableLayoutPanel>();
|
|
|
|
+ int blockSize = Monitor.Monitor.spacesInRow * Monitor.Monitor.floors * Monitor.Monitor.rows;
|
|
|
|
+ for (int i = 0; i < Monitor.Monitor.rows; i++)
|
|
|
|
+ {
|
|
|
|
+ TableLayoutPanel temp = new TableLayoutPanel();
|
|
|
|
+ temp.Name = "tlp_ParkingSpaceSection" + (i + 1).ToString();
|
|
|
|
+ temp.RowCount = Monitor.Monitor.spacesInRow;
|
|
|
|
+ temp.ColumnCount = Monitor.Monitor.floors;
|
|
|
|
+
|
|
|
|
+ for (int j = Math.Max(psList.Count, blockSize) - 1; j >= 0; j--)
|
|
|
|
+ {
|
|
|
|
+ Label lb = new Label();
|
|
|
|
+ lb.Anchor = (((((AnchorStyles.Top | AnchorStyles.Bottom)| AnchorStyles.Left)| AnchorStyles.Right)));
|
|
|
|
+ lb.AutoSize = true;
|
|
|
|
+ lb.Location = new Point(10, 10);
|
|
|
|
+ lb.Margin = new Padding(10);
|
|
|
|
+ lb.Name = "lb_parkingSpace"+j;
|
|
|
|
+ lb.TextAlign = ContentAlignment.MiddleCenter;
|
|
|
|
+ if (j > psList.Count - 1)
|
|
|
|
+ {
|
|
|
|
+ lb.Text = "";
|
|
|
|
+ temp.Controls.Add(lb);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if ((j / Monitor.Monitor.spacesInRow) % Monitor.Monitor.rows == i)
|
|
|
|
+ {
|
|
|
|
+ lb.Text = "车位" + psList[j].parkingSpace;
|
|
|
|
+ lb.BackColor = GetPSColor(psList[j].spaceStatus);
|
|
|
|
+ temp.Controls.Add(lb);
|
|
|
|
+ //int row = Monitor.Monitor.floors - 1 - j / (Monitor.Monitor.spacesInRow * Monitor.Monitor.rows);
|
|
|
|
+ //int column = (j % (Monitor.Monitor.spacesInRow * Monitor.Monitor.rows)) % Monitor.Monitor.spacesInRow;
|
|
|
|
+ //Control ctl = temp.GetControlFromPosition(column, row);
|
|
|
|
+
|
|
|
|
+ //ctl.Controls.Add();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tlp.Controls.Add(temp);
|
|
|
|
+ //tlpList.Add(temp);
|
|
|
|
+ }
|
|
|
|
+ ParkingSpaceMonitorPanel.Controls.Clear();
|
|
|
|
+ ParkingSpaceMonitorPanel.Controls.Add(tlp);
|
|
|
|
+ }));
|
|
|
|
+ Thread.Sleep(5000);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private Color GetPSColor(int status)
|
|
|
|
+ {
|
|
|
|
+ switch (status)
|
|
|
|
+ {
|
|
|
|
+ case 0:return Color.White;
|
|
|
|
+ case 1:return Color.Yellow;
|
|
|
|
+ case 2:return Color.SkyBlue;
|
|
|
|
+ case 3:return Color.Blue;
|
|
|
|
+ case 4:return Color.Red;
|
|
|
|
+ default:return Color.Violet;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
#region 测试
|
|
#region 测试
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -320,6 +397,20 @@ namespace centralController
|
|
int id = Monitor.Monitor.numMachineLinker.GetLicenseID(license);
|
|
int id = Monitor.Monitor.numMachineLinker.GetLicenseID(license);
|
|
textBox2.Text = "终端" + id.ToString();
|
|
textBox2.Text = "终端" + id.ToString();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// tableLayoutPanel测试
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="sender"></param>
|
|
|
|
+ /// <param name="e"></param>
|
|
|
|
+ private void button4_Click(object sender, EventArgs e)
|
|
|
|
+ {
|
|
|
|
+ Control c = tableLayoutPanel3.GetControlFromPosition(0, 0);
|
|
|
|
+ Console.WriteLine(tableLayoutPanel3.Controls.Count);
|
|
|
|
+ Control c1 = tableLayoutPanel3.GetControlFromPosition(0, 1);
|
|
|
|
+ Console.WriteLine(c1.Controls.Count);
|
|
|
|
+ Console.WriteLine("...");
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 系统
|
|
#region 系统
|
|
@@ -906,10 +997,12 @@ namespace centralController
|
|
{
|
|
{
|
|
Monitor.Monitor.UpdateParkingRecords(license, receiptNum, parkingFee, paymentStatus, true);
|
|
Monitor.Monitor.UpdateParkingRecords(license, receiptNum, parkingFee, paymentStatus, true);
|
|
Monitor.Monitor.UpdateParkingRecords(license, receiptNum, parkingFee, paymentStatus, false);
|
|
Monitor.Monitor.UpdateParkingRecords(license, receiptNum, parkingFee, paymentStatus, false);
|
|
|
|
+ Monitor.Monitor.UpdateTermFeeStatus(receiptNum);
|
|
Monitor.Monitor.SetNotification("支付信息已修改", TextColor.Warning);
|
|
Monitor.Monitor.SetNotification("支付信息已修改", TextColor.Warning);
|
|
Log.WriteLog(LogType.process, LogFile.INFO, "手动修改支付信息,号牌:" + license + ",凭证号:" + receiptNum + ",停车费用与支付状态改为:\n" + parkingFee + "与" + paymentStatus);
|
|
Log.WriteLog(LogType.process, LogFile.INFO, "手动修改支付信息,号牌:" + license + ",凭证号:" + receiptNum + ",停车费用与支付状态改为:\n" + parkingFee + "与" + paymentStatus);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|