59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AIParkingApplication
|
|
{
|
|
public partial class AIParkingApplicationForm : Form
|
|
{
|
|
//@"C:\CongRa_1.mp4"; @"C:\HS_test.mp4"; @"rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"
|
|
private ApiController apiController;
|
|
private IDoorControlAccess c3Device;
|
|
private LaneIn laneIn;
|
|
private LaneOut laneOut;
|
|
private StatusBar statusBar;
|
|
private Sidebar sidebar;
|
|
|
|
public AIParkingApplicationForm()
|
|
{
|
|
InitializeComponent();
|
|
string serverBaseAddress = "http://localhost:80/";
|
|
apiController = new ApiController(serverBaseAddress);
|
|
|
|
sidebar = new Sidebar(apiController);
|
|
sidebar.Location = new System.Drawing.Point(0, 0);
|
|
Controls.Add(sidebar);
|
|
|
|
c3Device = new C3DeviceController("192.168.1.200");
|
|
laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
|
|
laneIn.BorderStyle = BorderStyle.FixedSingle;
|
|
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, 0);
|
|
Controls.Add(laneIn);
|
|
|
|
laneOut = new LaneOut(2, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
|
|
laneOut.BorderStyle = BorderStyle.FixedSingle;
|
|
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, 0);
|
|
Controls.Add(laneOut);
|
|
|
|
statusBar = new StatusBar("192.168.1.122", "192.168.1.200", TimeSpan.FromSeconds(1));
|
|
statusBar.Location = new System.Drawing.Point(0, sidebar.Location.Y + sidebar.Height + 20);
|
|
statusBar.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
Controls.Add(statusBar);
|
|
|
|
StartLanes();
|
|
}
|
|
|
|
~AIParkingApplicationForm()
|
|
{
|
|
laneIn.Stop();
|
|
laneOut.Stop();
|
|
Application.Exit();
|
|
}
|
|
|
|
private void StartLanes()
|
|
{
|
|
laneIn.Start();
|
|
laneOut.Start();
|
|
}
|
|
}
|
|
}
|