using FLY.Thick.Base.IService;

using FLY.Thick.FilmCasting.Common;
using FLY.Thick.FilmCasting.IService;
using FLY.Thick.FilmCasting.OBJ_INTERFACE;

namespace FLY.Thick.FilmCasting.Server.OBJProxy
{
    public class OBJProxy
    {
        public OBJProxy(int objsys_idx, TDGage gage)
        {
            var jsonDistOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.JSONDIST_ID,
                typeof(OBJComponents.IService.IJsonDistService), new OBJComponents.Server.JsonDist());


            var warnSystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.WARNING_OBJ_ID,
                typeof(OBJComponents.IService.IWarningSystem2Service), gage.warning);

            
            var ioDefineObjProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.IO_ID,
                typeof(IFlyAdIoDefineService), FlyADIODefine.Instance);

            var gageOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.TDGAGE_ID,
                typeof(ITDGageService), gage);

            var borderSearchOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BORDERSEARCH_ID, 
                typeof(IBorderSearchService), gage.borderSearch);

            var curveOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.CURVE_ID,
                 typeof(ICurveService), gage.curve);

            var getSampleOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.GET_SAMPLE_ID,
                typeof(IGetSampleService), gage.getSample);

            var initParamOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.INITPARAM_ID, 
                typeof(IInitParamService),gage.initParam);

            var scanCorrOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.SCANCORR_ID,
                typeof(IScanCorrService),gage.gmScanCorr);

            var flyAdOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.FLYAD_ID,
                typeof(IFlyADService), gage.flyAdService);

            var gageInfoOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.GAGEINFO_ID,
                typeof(IGageInfoService), gage.gmGageInfo);

            var fixOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.FIX_ID,
                typeof(IFixService), gage.gmFix);


            var profileOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.PROFILE_ID,
                typeof(IFilmCastingProfileService), gage.profile);

            var scanWarningOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.SCANWARNING_ID,
                typeof(IScanWarningService), gage.scanWarning);

            var boltMapOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BOLTMAP_ID,
                typeof(IBoltMapFilmCastingService), gage.boltmap);

            var bulkDbObjProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BULKDB_ID,
                typeof(IBulkDbService), gage.bulkDb);

            var rejectObjProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.REJECT_ID,
                typeof(IRejectService), gage.reject);


            FObjBase.FObjSys.Currents[objsys_idx].Start_Conn_Server(
                Misc.StringConverter.ToIPEndPoint(gage.sysParam.Addr));
        }
    }
}
