OBJProxy.cs 1.87 KB
using FLY.OBJComponents.IService;
using FLY.OBJComponents.Server.OBJProxy;
using FLY.Weight.IService;
using FLY.Weight.Server.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace FLY.Weight.Server.OBJProxy
{
    public class OBJProxy
    {

        public OBJProxy(int objsys_idx, TDGage gage)
        {
            TDGage mGage = gage;
            var weightSystemOBJProxy = new WeightSystem_OBJProxy(objsys_idx, gage.mData);
            
            var mFlowListOBJProxy = new FObjBase.Reflect.Reflect_Proxy( objsys_idx, OBJ_INTERFACE.OBJ_INTERFACE.WEIGHTS_OBJ_FLOW_ID, typeof(IBulkDbFlowService), gage.mHistoryDb.FlowBuffer);

            for (int i = 0; i < gage.mData.Items.Count(); i++)
            {
                var mMixBufferOBJProxy = new FObjBase.Reflect.Reflect_Proxy(
                        objsys_idx,
                        OBJ_INTERFACE.OBJ_INTERFACE.WEIGHTS_OBJ_MIX_ID(OBJ_INTERFACE.OBJ_INTERFACE.WEIGHTS_OBJ_MIX_BASE_ID, i),
                        typeof(IBulkDbMixService),
                        gage.mHistoryDb.MixBuffers[i]);

                var mRollMixBufferOBJProxy = new FObjBase.Reflect.Reflect_Proxy(
                    objsys_idx,
                    OBJ_INTERFACE.OBJ_INTERFACE.WEIGHTS_OBJ_ROLLMIX_ID(OBJ_INTERFACE.OBJ_INTERFACE.WEIGHTS_OBJ_MIX_BASE_ID, i),
                    typeof(IBulkDbMixService),
                    gage.mHistoryDb.RollMixBuffers[i]);
            }

            var mWarnSystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(
                objsys_idx,
                OBJ_INTERFACE.OBJ_INTERFACE.WARNING_OBJ_ID,
                typeof(IWarningSystem2Service),
                gage.mWarning);

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