private autoDataDisplayWin()
        {
            InitializeComponent();

            peakhelper       = PeakHelper.GetInstance();
            datastoremanager = DataStoreManager.GetInstance();
        }
Пример #2
0
        public DataQuerier(string datastoreName, RUNNINGMODE runningMode)
        {
            log = Log.Logger.ForContext <DataQuerier>();

            this.dsFrame      = DataStoreManager.GetInstance().GetDataStore(datastoreName);
            this.msgGenerator = new MessageGenerator(runningMode);
        }
Пример #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHostingEnvironment env, ILoggerFactory loggerFactory, ILogger <Startup> _log)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseCors(builder =>
            {
                builder.AllowAnyMethod()
                .AllowAnyHeader()
                .AllowAnyOrigin();
            });

            app.UseHttpsRedirection();
            app.UseSession();
            app.UseMvcWithDefaultRoute();

            loggerFactory.AddSerilog();

            Serilog.ILogger log = Log.Logger.ForContext <Startup>().Here();

            DataStoreManager.initInstance(Configuration);
            DataStoreManager.GetInstance().LoadDataStores();
            log.Information("KG Data is initialized and loaded.");
        }
Пример #4
0
 public ManualExperimentWin()
 {
     InitializeComponent();
     peakHelperer     = PeakHelper.GetInstance();
     dataStoreManager = DataStoreManager.GetInstance();
     config           = ConfigManager.GetInstance();
 }
Пример #5
0
        public NLUProcessor(string datastoreName)
        {
            DataStoreFrame dsFrame = DataStoreManager.GetInstance().GetDataStore(datastoreName);

            if (dsFrame != null)
            {
                this.nluDF = DataStoreManager.GetInstance().GetDataStore(datastoreName).GetNLU();
            }
        }
Пример #6
0
 public PouringState()
 {
     InitializeComponent();
     adamHelper       = AdamHelper.GetInstance();
     dataStoreManager = DataStoreManager.GetInstance();
     warningManager   = WarningManager.GetInstance();
     config           = ConfigManager.GetInstance();
     //timer1.Enabled = false;
 }
Пример #7
0
        public GraphExecutor(string datastoreName)
        {
            log = Log.Logger.ForContext <GraphExecutor>();

            DataStoreFrame dsFrame = DataStoreManager.GetInstance().GetDataStore(datastoreName);

            if (dsFrame != null)
            {
                this.kgDF = dsFrame.GetKG();
            }
        }
Пример #8
0
        public async Task <ActionResult <ResponseResult> > ReloadData([FromForm] ReloadForm form)
        {
            string dsName = form.DatastoreName;

            (bool success, string message) = DataStoreManager.GetInstance().LoadDataStore(dsName);
            ResponseResult msg = new ResponseResult();

            if (success)
            {
                ContextAccessor.GetInstance().CleanContext(); // Clean all contexts and restart from clean env for a new datastore
            }
            msg.success         = success;
            msg.responseMessage = message;

            return(Ok(msg));
        }
Пример #9
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, ILogger <Startup> _log)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseCors(builder =>
            {
                builder.AllowAnyMethod()
                .AllowAnyHeader()
                .AllowAnyOrigin();
            });

            app.UseHttpsRedirection();
            app.UseSession();
            app.UseMvcWithDefaultRoute();

            loggerFactory.AddSerilog();

            Serilog.ILogger log = Log.Logger.ForContext <Startup>().Here();

            DataStoreManager.initInstance(Configuration);
            DataStoreManager.GetInstance().LoadDataStores();
            log.Information("KG and NLU Data is initialized and loaded.");

            ContextAccessor.initInstance(Configuration);
            log.Information("Context Data is initialized.");

            //启用中间件服务生成Swagger作为JSON终结点
            app.UseSwagger();
            //启用中间件服务对swagger-ui,指定Swagger JSON终结点
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/smartkg/swagger.json", "SmartKG V1");
            });
        }