using FLY.Thick.Base.IService;
using FLY.Thick.FilmCasting.Common;
using FLY.Thick.FilmCasting.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebSocketSharp.Server;
using IInitParamService = FLY.Thick.FilmCasting.IService.IInitParamService;

namespace FLY.Thick.FilmCasting.Server.WsProxy
{
    public class WsProxys
    {
        public WsProxys(WebSocketServer wss, TDGage gage)
        {
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/WarningSystem", (wsproxy) => wsproxy.Init(typeof(OBJComponents.IService.IWarningSystem2Service), gage.warning));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/ThkGauge", (wsproxy) => wsproxy.Init(typeof(IThkGaugeService), gage));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/BorderSearch", (wsproxy) => wsproxy.Init(typeof(IBorderSearchService), gage.borderSearch));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/Curve", (wsproxy) => wsproxy.Init(typeof(ICurveService), gage.curve));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/Getsample", (wsproxy) => wsproxy.Init(typeof(IGetSampleService), gage.getSample));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/InitParam", (wsproxy) => wsproxy.Init(typeof(IInitParamService), gage.initParam));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/ScanCorr", (wsproxy) => wsproxy.Init(typeof(IScanCorrService), gage.gmScanCorr));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/FlyAd", (wsproxy) => wsproxy.Init(typeof(IFlyADService), gage.flyAdService));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/Fix", (wsproxy) => wsproxy.Init(typeof(IFixService), gage.gmFix));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/FilmCastingProfile", (wsproxy) => wsproxy.Init(typeof(IFilmCastingProfileService), gage.profile));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/ScanWarning", (wsproxy) => wsproxy.Init(typeof(IScanWarningService), gage.scanWarning));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/BoltMapFilmCasting", (wsproxy) => wsproxy.Init(typeof(IBoltMapFilmCastingService), gage.boltmap));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/BulkDb", (wsproxy) => wsproxy.Init(typeof(IBulkDbService), gage.bulkDb));
            wss.AddWebSocketService<WSCF.Reflect_Proxy>("/api/Reject", (wsproxy) => wsproxy.Init(typeof(IRejectService), gage.reject));
        }
    }
}
