static CodeCentralExampleInMemoryDataStoreProvider()
        {
            string providerKey = Guid.NewGuid().ToString();

            fConnectionString = String.Format("XpoProvider={0}", providerKey);
            fdataSet          = new DataSet();
            DataStoreBase.RegisterDataStoreProvider(providerKey, CreateProviderFromString);
        }
Exemplo n.º 2
0
        public override long GetAutoSolderDataTotalNum(string line)
        {
            IOperationBase IOb = new DataStoreBase();
            long           num = 0;

            IOb.ReadBaseProfile_totalNum(line, out num);

            return(num);
        }
Exemplo n.º 3
0
        public override long GetAutoSolderDataTimeToTimeNum(string line, DateTime dtStart, DateTime dtEnd)
        {
            IOperationBase IOb = new DataStoreBase();
            long           num = 0;

            IOb.ReadBaseProfile_TimeToTimeNum(line, dtStart.ToString(), dtEnd.ToString(), out num);

            return(num);
        }
 public new static void Register()
 {
     try {
         DataStoreBase.RegisterDataStoreProvider(XpoProviderTypeString, new  DataStoreCreationFromStringDelegate(CreateProviderFromString));
     } catch (ArgumentException e) {
         Tracing.Tracer.LogError(e);
         //Tracing.Tracer.LogText("A connection provider with the same name ( {0} ) has already been registered", XpoProviderTypeString);
     }
 }
 static CodeCentralExampleInMemoryDataStoreProvider()
 {
     try {
         dataSet = new DataSet();
         DataStoreBase.RegisterDataStoreProvider(XpoProviderTypeString, new DataStoreCreationFromStringDelegate(CreateProviderFromString));
     } catch {
         throw new Exception(string.Format("Cannot register the {0}", typeof(CodeCentralExampleInMemoryDataStoreProvider).Name));
     }
 }
Exemplo n.º 6
0
        public override DataTable GetAutoSolderData(string line, DateTime dtStart, DateTime dtEnd)
        {
            IOperationBase IOb = new DataStoreBase();
            DataTable      dt  = new DataTable();

            string tableName = line;

            IOb.ReadBaseProfile_dataTable(tableName, dtStart.ToString(), dtEnd.ToString(), out dt);

            return(dt);
        }
 public static void InitXpo(string connectionString, string login, string password)
 {
     RegisterEntities();
     InitSecurity();
     XpoDefault.RegisterBonusProviders();
     DataStoreBase.RegisterDataStoreProvider(WebApiDataStoreClient.XpoProviderTypeString, CreateWebApiDataStoreFromString);
     ObjectSpaceProvider = new SecuredObjectSpaceProvider(Security, connectionString, null);
     UpdateDataBase();
     LogIn(login, password);
     XpoDefault.Session = null;
 }
Exemplo n.º 8
0
        public override DataTable GetAutoSolderDataUsePage(string line, DateTime dtStart, DateTime dtEnd, string beginIndex, string num)
        {
            IOperationBase IOb = new DataStoreBase();
            DataTable      dt  = new DataTable();

            string tablename = line;



            IOb.ReadBaseProfile_dataTableUsePage(line, dtStart.ToString(), dtEnd.ToString(), out dt, beginIndex, num);

            return(dt);
        }
Exemplo n.º 9
0
        public override DateTime GetCurrentdateTime(string line)
        {
            DateTime       dtime = DateTime.Now;
            DataTable      dt    = new DataTable();
            IOperationBase IOb   = new DataStoreBase();

            IOb.ReadCurrentBaseprofileToDataTable(line, out dt);
            if (dt.Rows.Count > 0)
            {
                dtime = Convert.ToDateTime(dt.Rows[0]["TimePoint"]);
            }


            return(dtime);
        }
Exemplo n.º 10
0
 public static void Initialize()
 {
     // initialize
     if (StoreOnMemoryObjectPersistence.IsPersistentDataExisted("statuses"))
     {
         _store = new PersistentDataStore<long, TwitterStatus>
             (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"), new IdReverseComparer(),
             manageData: StoreOnMemoryObjectPersistence.GetPersistentData("statuses"));
     }
     else
     {
         _store = new PersistentDataStore<long, TwitterStatus>
             (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"), new IdReverseComparer());
     }
     App.OnApplicationFinalize += Shutdown;
 }
Exemplo n.º 11
0
 public static void Initialize()
 {
     // initialize store
     if (StoreOnMemoryObjectPersistence.IsPersistentDataExisted("users"))
     {
         _store = new PersistentDataStore<long, TwitterUser>
             (_ => _.Id, Path.Combine(App.DataStorePath, "users"), chunkNum: 16,
             manageData: StoreOnMemoryObjectPersistence.GetPersistentData("users"));
     }
     else
     {
         _store = new PersistentDataStore<long, TwitterUser>
             (_ => _.Id, Path.Combine(App.DataStorePath, "users"), chunkNum: 16);
     }
     LoadScreenNameResolverCache();
     App.OnApplicationFinalize += Shutdown;
 }
Exemplo n.º 12
0
 /// <inheritdoc />
 // ReSharper disable once TooManyDependencies
 protected SteamBotWorker(
     SteamBotOptions options,
     DataStoreBase dataStore,
     Coordinator coordinator,
     WorkerConfiguration configuration,
     Logger logger) :
     base(
         options,
         new LoggerWrapper(configuration.Alias ?? configuration.WorkerType + " [" + options.Username + "]", logger)
         )
 {
     DataStore           = dataStore;
     Coordinator         = coordinator;
     Configuration       = configuration;
     options.Coordinator = coordinator;
     Options             = options;
 }
Exemplo n.º 13
0
        public override List <DataTable> GetAutoSolderCurrentData(List <string> lineList)
        {
            IOperationBase   IOb       = new DataStoreBase();
            List <DataTable> listTable = new List <DataTable>();

            if (lineList == null)
            {
                return(null);
            }
            foreach (string tableName in lineList)
            {
                DataTable dt = new DataTable();
                IOb.ReadCurrentBaseprofileToDataTable(tableName, out dt);
                listTable.Add(dt);
            }
            return(listTable);
        }
Exemplo n.º 14
0
 public static void Initialize()
 {
     // initialize store
     if (StoreOnMemoryObjectPersistence.IsPersistentDataExisted("users"))
     {
         _store = new PersistentDataStore<long, TwitterUser>
             (_ => _.Id, Path.Combine(App.DataStorePath, "users"), ChunkCount,
             manageData: StoreOnMemoryObjectPersistence.GetPersistentData("users"));
     }
     else
     {
         _store = new PersistentDataStore<long, TwitterUser>
             (_ => _.Id, Path.Combine(App.DataStorePath, "users"), ChunkCount);
     }
     _dispatcher = new SingleThreadDispatcher<TwitterUser>(_store.Store);
     LoadScreenNameResolverCache();
     App.ApplicationFinalize += Shutdown;
 }
Exemplo n.º 15
0
        /// <summary>
        /// 现改为查询最近数据中一天内的数据
        /// </summary>
        /// <param name="line"></param>
        /// <returns></returns>
        public override DataSet GetAllDeviceDataChart(string line)
        {
            //查询最近一条数据的时间,再往前推一天,获取起止时间


            DateTime       dtEnd         = DateTime.Now;
            DateTime       dtStart       = dtEnd.AddDays(-1);
            string         dtEndString   = dtEnd.ToString();
            string         dtStartString = dtStart.ToString();
            IOperationBase IOb           = new DataStoreBase();
            DataTable      DtCurrent     = new DataTable();

            IOb.ReadCurrentBaseprofileToDataTable(line, out DtCurrent);

            if (DtCurrent != null)
            {
                dtEndString   = DtCurrent.Rows[0]["timepoint"].ToString();
                dtStartString = Convert.ToDateTime(dtEndString).AddDays(-1).ToString();
            }
            DataTable DtSolder = new DataTable();

            IOb.ReadBaseProfile_dataTableWithChart(line, dtStartString, dtEndString, out DtSolder);
            if (DtSolder == null)
            {
                DtSolder = new DataTable();
            }
            string pisMaxTResult = ExecuteScalar("select starttime from pisreflowdata where id = (select max(id) from pisreflowdata where proline='" + line + "')").ToString();

            if (pisMaxTResult != null)
            {
                dtEndString   = pisMaxTResult;
                dtStartString = Convert.ToDateTime(pisMaxTResult).AddDays(-1).ToString();
            }

            DataTable DtPis = ExecuteDataTable("select UNIX_TIMESTAMP(starttime + INTERVAL 8 HOUR) * 1000 AS x, Convert(cpk,decimal(9,3)) AS y from pisreflowdata where proline = @line and starttime >= @begintime and starttime <= @endtime", CommandType.Text, new MySqlParameter[] { new MySqlParameter(@"line", line), new MySqlParameter(@"begintime", dtStartString), new MySqlParameter(@"endtime", dtEndString) });

            DataSet Ds = new DataSet();

            DtSolder.TableName = "soldertable";
            DtPis.TableName    = "pistable";
            Ds.Tables.AddRange(new DataTable[] { DtSolder, DtPis });

            return(Ds);
        }
Exemplo n.º 16
0
        public override DataSet GetAllDeviceData(string line)
        {
            //因为两个数据库查询方法中的连接分开写的,分两次查出

            DataTable      DtSolder = new DataTable();
            IOperationBase IOb      = new DataStoreBase();

            IOb.ReadCurrentBaseprofileToDataTable(line, out DtSolder);

            if (DtSolder == null)
            {
                DtSolder = new DataTable();
            }
            //DbDataReader Dr = ExecuteReader("select * from pisreflowdata where id = (select max(id) where pisreflowdata)");
            //if (Dr.Read())
            //{
            //}
            //Dr.Close();

            //与pis页面类似 采用存储过程查询
            // DataTable DtPis = ExecuteDataTable("select * from pisreflowdata where id = (select max(id) from pisreflowdata where proline = '" + line + "')");
            DataTable DtPis = GetPISData(-1, new DateTime(), new DateTime());

            //取出当前所需结果
            DataRow[] rows        = DtPis.Select("proline = '" + line + "'");
            DataTable DtPisResult = new DataTable();

            DtPisResult = DtPis.Clone();
            foreach (DataRow row in rows)
            {
                DtPisResult.ImportRow(row);
            }

            DataSet Ds = new DataSet();

            DtSolder.TableName    = "soldertable";
            DtPisResult.TableName = "pistable";
            Ds.Tables.AddRange(new DataTable[] { DtSolder, DtPisResult });

            return(Ds);
        }
        private void ExcuteFun()
        {
            ILDO ini = new INI();

            ini.LDOPath = "D:\\AutosolderNet\\AutoSolderNetCon.ini";
            List <NetConfig> listNet = ini.ReadFun();

            if (listNet == null)
            {
                // PISTrace.WriteStrLine("listNet is null");
                LogClass.WriteLogFile("class-AutosolderServiceFun;Fun-ExcuteFun;  :listNet isNull 28行处");
                return;
            }
            Executelist = new List <ExecuteQueue>();
            for (int i = 0; i < listNet.Count; i++)
            {
                AutoSolderService.ExecuteQueue queue = new AutoSolderService.ExecuteQueue();
                int temp;
                try
                {
                    temp = int.Parse(listNet[i].Port);
                }
                catch (Exception ex)
                {
                    temp = 1234;
                    LogClass.WriteLogFile("Class-AutosolderServic;Fun-ExcuteFun; : 44行" + ex.Message);
                }

                queue.setupConection(listNet[i].Ip, temp);
                queue.ExecuteAddBaseProfile(listNet[i].Line);//10s
                Executelist.Add(queue);
                //事件
                IOperationBase Ids = new DataStoreBase();
                Ids.SettingEventScheduler("60", listNet[i].Line);
            }
        }
 public static void Register()
 {
     //var store = CreateProviderFromString;
     DataStoreBase.RegisterDataStoreProvider(XpoProviderTypeString, CreateProviderFromString);
 }
Exemplo n.º 19
0
 public static void Initialize()
 {
     // initialize
     if (StoreOnMemoryObjectPersistence.IsPersistentDataExisted("statuses"))
     {
         _store = new PersistentDataStore<long, TwitterStatus>
             (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"), ChunkCount, new IdReverseComparer(),
             StoreOnMemoryObjectPersistence.GetPersistentData("statuses"));
     }
     else
     {
         _store = new PersistentDataStore<long, TwitterStatus>
             (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"), ChunkCount, new IdReverseComparer());
     }
     _dispatcher = new SingleThreadDispatcher<TwitterStatus>(_store.Store);
     App.ApplicationFinalize += Shutdown;
 }
Exemplo n.º 20
0
 public static void Register()
 {
     DataStoreBase.RegisterDataStoreProvider(PostgreSqlConnectionProvider.XpoProviderTypeString,
                                             new DevExpress.Xpo.DB.Helpers.DataStoreCreationFromStringDelegate(CreateProviderFromString));
 }
Exemplo n.º 21
0
        /// <summary>
        /// 保存到数据库
        /// </summary>
        /// <param name="baseprofile"></param>
        private void SaveData(BaseProfile baseprofile, string tableName)
        {
            DataStoreBase dataStoreBase = new DataStoreBase();

            dataStoreBase.AddBaseProfile(baseprofile, tableName);
        }
 public new static void Register()
 {
     //HACK review this link https://supportcenter.devexpress.com/ticket/details/BC4261/data-access-library-connection-provider-registration-has-been-changed
     DataStoreBase.RegisterDataStoreProvider(XpoProviderTypeString, CreateProviderFromString);
     DataStoreBase.RegisterDataStoreProvider(XpoProviderTypeString, CreateProviderFromConnection);
 }
Exemplo n.º 23
0
 static void ConfigureXpoForDevEnvironment()
 {
     XpoDefault.RegisterBonusProviders();
     DataStoreBase.RegisterDataStoreProvider(WebApiDataStoreClient.XpoProviderTypeString, CreateWebApiDataStoreFromString);
 }
Exemplo n.º 24
0
        /// <summary>
        /// 保存到数据库
        /// </summary>
        /// <param name="baseprofile"></param>
        private void SaveData(BaseProfile baseprofile)
        {
            DataStoreBase dataStoreBase = new DataStoreBase();

            dataStoreBase.AddBaseProfile(baseprofile, "baseprofile");
        }
Exemplo n.º 25
0
 public static void Initialize()
 {
     // initialize
     if (StoreOnMemoryObjectPersistence.IsPersistentDataExisted("statuses"))
     {
         try
         {
             store = new PersistentDataStore<long, TwitterStatus>
                 (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"),
                 tocniops: StoreOnMemoryObjectPersistence.GetPersistentData("statuses"));
         }
         catch (Exception ex)
         {
             InformationHub.PublishInformation(new Information(InformationKind.Warning,
                 "STATUSSTORE_INIT_FAILED",
                 "ステータス データベースが破損しています。",
                 "読み込み時にエラーが発生したため、データベースを初期化しました。" + Environment.NewLine +
                 "送出された例外: " + ex.ToString()));
         }
     }
     if (store == null)
     {
         store = new PersistentDataStore<long, TwitterStatus>
             (_ => _.Id, Path.Combine(App.DataStorePath, "statuses"));
     }
     App.OnApplicationFinalize += Shutdown;
 }