You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
854 B
C#
30 lines
854 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using SlnMesnac.Common;
|
|
using SlnMesnac.Plc.Impl;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
namespace SlnMesnac.Plc
|
|
{
|
|
public static class PlcSetup
|
|
{
|
|
public static void AddPlcSetup(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<InovancePlc>();
|
|
services.AddSingleton<MelsecBinaryPlc>();
|
|
services.AddSingleton<OmronNJPlc>();
|
|
services.AddSingleton<SiemensPlc>();
|
|
services.AddSingleton<PlcPool>();
|
|
}
|
|
|
|
public static IApplicationBuilder UsePlcExtensions(this IApplicationBuilder app)
|
|
{
|
|
var plcPool = app.ApplicationServices.GetService<PlcPool>();
|
|
plcPool.Init();
|
|
return app;
|
|
}
|
|
}
|
|
}
|