You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

using Module.EMeter.ModbusTcp;
using Module.UpsEqm.ModBusTcp;
using Module.FireCtrl.ModBusTcp;
using Module.HMeter.ModBusTcp;
if (!HslCommunication.Authorization.SetAuthorizationCode("e3ef2dd5-2e1e-481d-99fe-452fe6bc00f0"))
{
}
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddCors();
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseSwagger();
app.UseSwaggerUI();
app.MapControllers();
app.UseCors(policy =>
policy.WithOrigins("http://127.0.0.1:8082","*")
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials());
new ElecMeterEqmManger().ElecMeterNetConnectThread();
Thread.Sleep(100);
new FireEqmManager().FireNetConnectThread();
//Thread.Sleep(100);
//new UpsEqmManger().UpsNetConnectThread();
Thread.Sleep(100);
new HumiMeterEqmManger().HumiNetConnectThread();
app.Run();