LoginForm, AIParkingApplicationForm: Get configuration on web
This commit is contained in:
parent
ee56086eff
commit
2e44442289
|
@ -12,23 +12,25 @@ namespace AIParkingApplication
|
||||||
private LaneOut laneOut;
|
private LaneOut laneOut;
|
||||||
private StatusBar statusBar;
|
private StatusBar statusBar;
|
||||||
private Sidebar sidebar;
|
private Sidebar sidebar;
|
||||||
|
private Config configOnWeb;
|
||||||
|
|
||||||
public AIParkingApplicationForm(ApiController apiController)
|
public AIParkingApplicationForm(ApiController apiController, Config configOnWeb)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.apiController = apiController;
|
this.apiController = apiController;
|
||||||
|
this.configOnWeb = configOnWeb;
|
||||||
|
|
||||||
sidebar = new Sidebar(apiController);
|
sidebar = new Sidebar(apiController);
|
||||||
sidebar.Location = new System.Drawing.Point(0, 0);
|
sidebar.Location = new System.Drawing.Point(0, 0);
|
||||||
Controls.Add(sidebar);
|
Controls.Add(sidebar);
|
||||||
|
|
||||||
c3Device = new C3DeviceController("192.168.1.200");
|
c3Device = new C3DeviceController("192.168.1.200");
|
||||||
laneIn = new LaneIn(1, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, this.apiController, true, false, true);
|
laneIn = new LaneIn(1, this.configOnWeb.CameraData1.Stream_url, this.configOnWeb.CameraData2.Stream_url, c3Device, this.apiController, true, false, true);
|
||||||
laneIn.BorderStyle = BorderStyle.FixedSingle;
|
laneIn.BorderStyle = BorderStyle.FixedSingle;
|
||||||
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, 0);
|
laneIn.Location = new System.Drawing.Point(sidebar.Location.X + sidebar.Width + 20, 0);
|
||||||
Controls.Add(laneIn);
|
Controls.Add(laneIn);
|
||||||
|
|
||||||
laneOut = new LaneOut(2, @"C:\HS_test.mp4", @"C:\HS_test.mp4", c3Device, this.apiController, true, false, true);
|
laneOut = new LaneOut(2, this.configOnWeb.CameraData3.Stream_url, this.configOnWeb.CameraData4.Stream_url, c3Device, this.apiController, true, false, true);
|
||||||
laneOut.BorderStyle = BorderStyle.FixedSingle;
|
laneOut.BorderStyle = BorderStyle.FixedSingle;
|
||||||
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, 0);
|
laneOut.Location = new System.Drawing.Point(laneIn.Location.X + laneIn.Width + 20, 0);
|
||||||
Controls.Add(laneOut);
|
Controls.Add(laneOut);
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
public partial class LoginForm : Form
|
public partial class LoginForm : Form
|
||||||
{
|
{
|
||||||
private const string serverBaseAddress = "http://localhost:80/";
|
|
||||||
private ApiController apiController;
|
private ApiController apiController;
|
||||||
|
|
||||||
public LoginForm()
|
public LoginForm()
|
||||||
|
@ -44,7 +43,7 @@ namespace AIParkingApplication
|
||||||
var loginResult = await apiController.Login(new LoginModel { Username = username, Password = password });
|
var loginResult = await apiController.Login(new LoginModel { Username = username, Password = password });
|
||||||
if (loginResult.IsLoginSuccess)
|
if (loginResult.IsLoginSuccess)
|
||||||
{
|
{
|
||||||
new AIParkingApplicationForm(apiController).Show();
|
new AIParkingApplicationForm(apiController, loginResult.LoginData).Show();
|
||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user