Esempio n. 1
0
 public ImageRecognizer(IFileRepository fileRepository, ImageLoader imageLoader, InputCreator inputCreator, PredictionHandler predictionHandler)
 {
     _fileRepository    = fileRepository;
     _imageLoader       = imageLoader;
     _inputCreator      = inputCreator;
     _predictionHandler = predictionHandler;
 }
Esempio n. 2
0
        protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
        {
            var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);

            layoutManager.Add("PlantCode", InputCreator.DFMemo("厂家标识"));
            layoutManager.Add("CustomTaxRate", new DFValueLabel(mDFInfo.Fields["CustomTaxRate"]));
            var config = new AutoLayoutConfig();

            if (IsNewDialog)
            {
                config.Add("Goods_Name");
            }
            else
            {
                config.Add("Goods_ID");
            }
            config.Add("Goods_Code");
            config.Add("Name");
            config.Add("ProductionDate");
            config.Add("InStoreDate");
            config.Add("InStorePrice");
            config.Add("PlantCode");
            config.Add("Remark");
            config.Add("CustomTaxRate");
            pageLayoutSection.SetRequired("Goods_ID", "Name");
            pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);

            layoutManager.Config = config;
            titlePanel.Controls.Add(layoutManager.CreateLayout());
        }
Esempio n. 3
0
        protected override void BuildBody(Control container)
        {
            var mainInfo      = container.EAdd(new TitlePanel("基本信息"));
            var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);

            layoutManager.Add("ProductPlan_ID", InputCreator.DFChoiceBox(B3ButcheryDataSource.计划号, "ProductPlan_Name"));
            var config = new AutoLayoutConfig();

            config.Add("AccountingUnit_ID");
            config.Add("Department_ID");
            config.Add("Employee_ID");
            config.Add("Store_ID");
            config.Add("InStoreType_ID");
            config.Add("InStoreDate");
            config.Add("CheckEmployee_ID");
            config.Add("CheckDate");
            config.Add("ProductPlan_ID");
            layoutManager.Config = config;
            var section = mPageLayoutManager.AddSection("BaseProperties", "基本属性");

            section.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
            mainInfo.Controls.Add(layoutManager.CreateLayout());
            mainInfo.SetPageLayoutSetting(mPageLayoutManager, section.Name);
            CreateDetailPanel(container.EAdd(new TitlePanel("明细信息")));
        }
Esempio n. 4
0
        protected override void BuildBody(Control container)
        {
            var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);
            var planNumberBox = layoutManager.Add("PlanNumber_ID", InputCreator.DFChoiceBox(B3ButcheryDataSource.计划号, "PlanNumber_Name"));

            planNumberBox.OnBeforeDrop = "this.argument2=__DFContainer.getControl('Date').value";
            var config = new AutoLayoutConfig();

            config.Add("Date");
            config.Add("AccountingUnit_ID");
            config.Add("Department_ID");
            config.Add("PlanNumber_ID");
            config.Add("Remark");
            layoutManager.Config = config;
            container.Controls.Add(layoutManager.CreateLayout());

            var vPanel = container.EAdd(new VLayoutPanel());

            if (CanSave)
            {
                vPanel.Add(new TSButton("载入明细", delegate
                {
                    LoadDetail();
                }), new VLayoutOption(HorizontalAlign.Left));
            }
            CreateInputDetailPanel(vPanel);
            CreateOutputDetailPanel(vPanel);
        }
Esempio n. 5
0
        protected override void BuildBody(Control container)
        {
            var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);

            layoutManager.Add("Time", new DFDateInput());
            var planNumberBox = InputCreator.DFChoiceBox(B3ButcheryDataSource.计划号, "PlanNumber_Name", true);

            layoutManager.Add("PlanNumber_ID", planNumberBox);
            var config = new AutoLayoutConfig();

            config.Add("Time");
            config.Add("PlanNumber_ID");
            config.Add("AccountingUnit_ID");
            config.Add("Department_ID");
            config.Add("ProductionUnit_ID");

            config.Add("Employee_ID");
            config.Add("ProductLinks_ID");
            config.Add("FrozenStore_ID");
            AddProductLinkTemplate(layoutManager, config);
            layoutManager.Config = config;
            container.Controls.Add(layoutManager.CreateLayout());

            var vPanel = container.EAdd(new VLayoutPanel());

            CreateOutputDetailPanel(vPanel);
        }
Esempio n. 6
0
        protected override void BuildBody(Control container)
        {
            var layoutManager = new LayoutManager("main", mDFInfo, mDFContainer);

            layoutManager.Add("ChargePerson_ID", InputCreator.DFChoiceBox("授权员工", "ChargePerson_Name", true));
            var config = new AutoLayoutConfig();

            config.Add("Name");
            config.Add("ProductLine_ID");
            config.Add("ChargePerson_ID");
            layoutManager.Config = config;
            container.Controls.Add(layoutManager.CreateLayout());
            var vPanel = container.EAdd(new VLayoutPanel());

            CreateInputDetailPanel(vPanel);
            CreateOutputDetailPanel(vPanel);
        }
        public Bootstrapper()
        {
            _fileRepository       = new FileRepository();
            _logger               = CreateLogger();
            _dataProcessingParams = new DataProcessingParams();

            _httpDownloader = new HttpDownloader();
            _webCrawlerMain = new WebCrawlerMain(
                httpDownloader: _httpDownloader,
                measurementPointUtility: new MeasurementPointConfigUtility(
                    timeConverter: new TimeConverter(),
                    fileRepository: _fileRepository),
                stringEditUtility: new StringEditUtility());

            _modelRule0             = new ModelRule(0);
            _modelRule1             = new ModelRule(1);
            _modelRule2             = new ModelRule(2);
            _modelRule3             = new ModelRule(3);
            _modelRule4             = new ModelRule(4);
            _modelRule5             = new ModelRule(5);
            _modelRule6             = new ModelRule(6);
            _modelRule7             = new ModelRule(7);
            _modelRule8             = new ModelRule(8);
            _modelRule9             = new ModelRule(9);
            _modelRuleNoMatch       = new ModelRuleNoMatch();
            _bitmapProcessingParams = new BitmapProcessingParams();
            _inputCreator           = new InputCreator();

            _imageLoader = new ImageLoader(
                fileRepository: _fileRepository,
                bitmapProcessingParams: _bitmapProcessingParams,
                bitmapProcessor: new BitmapProcessor(
                    crop: new Crop(
                        rect: new Rectangle()),
                    grayscale: new Grayscale(0, 0, 0),
                    contrastStretch: new ContrastStretch(),
                    resizeBilinear: new ResizeBilinear(1, 1),
                    bitmapProcessingParams: _bitmapProcessingParams));

            _imageRecognitionMain = new ImageRecognitionMain(
                fileRepository: _fileRepository,
                bitmapProcessingParams: _bitmapProcessingParams,
                machine: new Machine(
                    inputCreator: _inputCreator,
                    outputCreator: new OutputCreator(),
                    learning: new Learning(),
                    imageLoader: _imageLoader),
                imageRecognizer: new ImageRecognizer(
                    fileRepository: _fileRepository,
                    imageLoader: _imageLoader,
                    inputCreator: _inputCreator,
                    predictionHandler: new PredictionHandler(
                        fileRepository: _fileRepository,
                        firstDigitModelMatcher: new FirstDigitModelMatcher(
                            modelRules: GetFirstModelRules()),
                        secondDigitModelMatcher: new SecondDigitModelMatcher(
                            modelRules: GetSecondModelRules()),
                        logger: _logger)),
                logger: _logger);

            _dataProcessor = GetDataProcessor();

            _inputValidator = new InputValidator();
            _csvUtility     = new CsvUtility(_fileRepository);
            _contextLoader  = new ProcessingContextLoader(
                folderChooser: new FolderChooser(
                    fileRepository: _fileRepository,
                    folderInfo: new FolderInfo(),
                    inputValidator: _inputValidator),
                configLoader: new LocatioSettingsLoader(
                    fileRepository: _fileRepository),
                configChooser: new ConfigChooser(
                    fileRepository: _fileRepository,
                    inputValidator: _inputValidator),
                csvUtility: _csvUtility);

            UIMain = new UIMain(GetTasks(), _inputValidator, new ProcessingContext());
        }
Esempio n. 8
0
 /// <summary>
 /// 注册表单输入创建处理
 /// </summary>
 /// <param name="handler"></param>
 public static void Register(Handler handler)
 {
     InputCreator.Register(handler);
 }