AIParkingApplicationForm - Add 2 Test Button: btnStopLaneIn, btnStartLaneIn

This commit is contained in:
DucDangAnh 2020-06-29 15:21:28 +07:00
parent 20b3ce8360
commit 0d5e76b2af
2 changed files with 44 additions and 5 deletions

View File

@ -28,13 +28,37 @@
/// </summary>
private void InitializeComponent()
{
this.btnStopLaneIn = new System.Windows.Forms.Button();
this.btnStartLaneIn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnStopLaneIn
//
this.btnStopLaneIn.Location = new System.Drawing.Point(840, 205);
this.btnStopLaneIn.Name = "btnStopLaneIn";
this.btnStopLaneIn.Size = new System.Drawing.Size(75, 23);
this.btnStopLaneIn.TabIndex = 0;
this.btnStopLaneIn.Text = "Stop";
this.btnStopLaneIn.UseVisualStyleBackColor = true;
this.btnStopLaneIn.Click += new System.EventHandler(this.btnStopLaneIn_Click);
//
// btnStartLaneIn
//
this.btnStartLaneIn.Location = new System.Drawing.Point(840, 246);
this.btnStartLaneIn.Name = "btnStartLaneIn";
this.btnStartLaneIn.Size = new System.Drawing.Size(75, 23);
this.btnStartLaneIn.TabIndex = 0;
this.btnStartLaneIn.Text = "Start";
this.btnStartLaneIn.UseVisualStyleBackColor = true;
this.btnStartLaneIn.Click += new System.EventHandler(this.btnStartLaneIn_Click);
//
// AIParkingApplicationForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1350, 729);
this.Controls.Add(this.btnStartLaneIn);
this.Controls.Add(this.btnStopLaneIn);
this.MinimumSize = new System.Drawing.Size(1366, 768);
this.Name = "AIParkingApplicationForm";
this.Text = "AIParking Application";
@ -43,6 +67,9 @@
}
#endregion
private System.Windows.Forms.Button btnStopLaneIn;
private System.Windows.Forms.Button btnStartLaneIn;
}
}

View File

@ -5,16 +5,18 @@ 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 C3DeviceController c3Device;
private LaneIn laneIn;
public AIParkingApplicationForm()
{
InitializeComponent();
string serverBaseAddress = "http://localhost:80/";
ApiController apiController = new ApiController(serverBaseAddress);
C3DeviceController c3Device = new C3DeviceController("192.168.1.200");
LaneIn laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
//LaneIn laneOut = new LaneIn();
apiController = new ApiController(serverBaseAddress);
c3Device = new C3DeviceController("192.168.1.200");
laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, apiController, true, false, true);
Controls.Add(laneIn);
laneIn.Start();
//laneOut.Location = new System.Drawing.Point(550, 0);
//Controls.Add(laneOut);
@ -23,5 +25,15 @@ namespace AIParkingApplication
//Controls.Add(laneIn1);
//laneIn1.Start();
}
private void btnStopLaneIn_Click(object sender, System.EventArgs e)
{
laneIn.Stop();
}
private void btnStartLaneIn_Click(object sender, System.EventArgs e)
{
laneIn.Start();
}
}
}