using FLY.FilmCasting.AutoDie.IService;
using FLY.FilmCasting.AutoDie.OBJ_INTERFACE;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace FLY.FilmCasting.AutoDie.Server.OBJProxy
{
    public class OBJProxy
    {
        public OBJProxy(int objsys_idx, TDGage gage)
        {
            TDGage mGage = gage;

            var mFeedbackOBJProxy = new FObjBase.Reflect.Reflect_Proxy( objsys_idx, OBJ_INTERFACE_ID.FEEDBACK_ID, typeof(IFeedbackHeatService), mGage.mfeedback);
            var mBufOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.HEATBUF_ID, typeof(IHeatBufService), mGage.mfeedback.mHeatBuf);
            var mCellOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.HEATCELL_ID, typeof(IHeatCellService), mGage.mfeedback.mHeatCell);
            var bulkDbOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BULKDB_ID, typeof(IBulkDbService), mGage.mHistoryDb);
            
            var warnSystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.WARNING_OBJ_ID,
                typeof(OBJComponents.IService.IWarningSystem2Service), mGage.mWarning);

            mFeedbackOBJProxy.CurrObjSys.Start_Conn_Server(
                new IPEndPoint(IPAddress.Any, gage.mSysParam.OBJ_Port),mFeedbackOBJProxy.ID);
        }
    }
}
