private void InitializeData()
        {
            IModuleService    moduleService    = IocContainerFactory.GetUnityContainer().Resolve <IModuleService>();
            IDataPointService dataPointService = IocContainerFactory.GetUnityContainer().Resolve <IDataPointService>();
            IModbusService    modbusService    = IocContainerFactory.GetUnityContainer().Resolve <IModbusService>();

            GetAllModuleRequest  getAllModuleRequest  = new GetAllModuleRequest();
            GetAllModuleResponse getAllModuleResponse = moduleService.GetAllModules(getAllModuleRequest);

            foreach (var moduleView in getAllModuleResponse.ModuleViews)
            {
                GetDataPointByModuleRequest getDataPointByModuleRequest = new GetDataPointByModuleRequest();
                getDataPointByModuleRequest.ModuleId = moduleView.ModuleId;

                GetDataPointByModuleResponse getDataPointByModuleResponse =
                    dataPointService.GetDataPointInfoByModule(getDataPointByModuleRequest);

                if (getDataPointByModuleResponse.ResponseSucceed)
                {
                    foreach (var dataPointInfoView in getDataPointByModuleResponse.DataPointInfoViews)
                    {
                        DataPointViewModel dataPointViewModel = dataPointInfoView.ConvertToDataPointViewModel();

                        dataPointViewModel.ModuleNumber      = moduleView.Number;
                        dataPointViewModel.ModuleName        = moduleView.Name;
                        dataPointViewModel.ModuleDescription = moduleView.Description;

                        this.DataPoints.Add(dataPointViewModel);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public DataPointInformationView()
        {
            InitializeComponent();

            this.dgDataPiontInformation.ColumnWidth = DataGridLength.SizeToCells;

            //非Ioc,要写这写代码,很是繁琐。
            //IUnitOfWork unitOfWork = new NHUnitOfWork();
            //IDataPointRepository dataPointRepository = new DataPointRepository(unitOfWork);
            //dataPointService = new DataPointService(dataPointRepository);

            this.dataPointService = IocContainerFactory.GetUnityContainer().Resolve <IDataPointService>();
        }
 public KMeansService(IDataPointService dataPointService)
 {
     _dataPointService = dataPointService;
 }
Ejemplo n.º 4
0
 public RandomForestService(IDataPointService dataPointService)
 {
     _dataPointService = dataPointService;
 }
Ejemplo n.º 5
0
 public DataPointController(IDataPointService dataPointService)
 {
     this.dataPointService = dataPointService;
 }
Ejemplo n.º 6
0
 public DataPointController()
 {
     dataPointService = new DataPointService(MvcApplication.DocumentStore);
 }
 public SupportVectorMachineService(IDataPointService dataPointService)
 {
     _dataPointService = dataPointService;
 }