public IEnumerable <DB_AGIN_Baccarat_Check_RstItem> ChkPattern(dynamic config)
        {
            List <DB_AGIN_Baccarat_Check_RstItem> items = new DB_AGIN_Baccarat_Check(this, config).Search();

            foreach (DB_AGIN_Baccarat_Check_RstItem item in items)
            {
                if (0 != AlertPattern.Count(x =>
                                            x.CellsFreq.Count == item.CellsFreq.Count &&
                                            x.NFreq * x.CellsFreq.Count + x.CellsSub.Count == item.NFreq * item.CellsFreq.Count + item.CellsSub.Count))
                {
                    item.Notify = false;
                }
            }
            AlertPattern = items;
            return(items.Where(x => x.Notify));
        }
Exemple #2
0
        public void Analysis1_AGIN()
        {
            List <DB_AGIN_Baccarat> agins = new List <DB_AGIN_Baccarat>();
            SQLiteCommand           cmd   = ConnHelper.ConnDb.CreateCommand();

            try
            {
                #region SQLiteCommand: Initialize
                #region cmd.CommandText = string.Format(@"")
                cmd.CommandText = string.Format(@"
SELECT ASUM.* FROM AGIN_SUMMARY ASUM WHERE ASUM.Id > 8281 ORDER BY ASUM.Id ASC");
                #endregion
                cmd.CommandType    = CommandType.Text;
                cmd.CommandTimeout = CONFIG_CONN_TIMEOUT;
                #endregion
                #region SQLiteCommand: Parameters
                #endregion
                #region SQLiteCommand: Connection
                DataSet ds = ConnHelper.ExecCmd(cmd);
                #endregion
                #region For: Retrieve
                DataTable     dt   = ds.Tables[0];
                List <string> cols = ToCols(dt);
                foreach (DataRow dr in dt.Rows)
                {
                    agins.Add(DB_AGIN_Baccarat.ExtractDB(dr, cols));
                }
                #endregion
                #region For: Clean
                dt.Clear();
                ds.Clear();
                dt.Dispose();
                ds.Dispose();
                #endregion
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("{0}{1}", ex.Message, ex.StackTrace), ex);
            }
            finally
            {
                cmd.Dispose();
            }
            int idx = 1;
            List <List <object> > lst_vals = new List <List <object> >();
            string cmd_text = string.Format(@"INSERT INTO AGIN_RESULT1 (SubId, LatestOrder, FreqN, FreqL, FreqLSub, FreqColors) VALUES (?, ?, ?, ?, ?, ?)");
            foreach (DB_AGIN_Baccarat agin in agins)
            {
                agin.DataAnalysis.UpdCoordinate();
                int order = 0;
                while (agin.DataAnalysis.LatestOrder > order++)
                {
                    DB_AGIN_Baccarat_Check baccarat_check = new DB_AGIN_Baccarat_Check(agin, 10, 1, new KeyValuePair <int, int>[10] {
                        new KeyValuePair <int, int>(1, 1),
                        new KeyValuePair <int, int>(2, 6),
                        new KeyValuePair <int, int>(3, 9),
                        new KeyValuePair <int, int>(4, 12),
                        new KeyValuePair <int, int>(5, 15),
                        new KeyValuePair <int, int>(6, 18),
                        new KeyValuePair <int, int>(7, 21),
                        new KeyValuePair <int, int>(8, 24),
                        new KeyValuePair <int, int>(9, 27),
                        new KeyValuePair <int, int>(10, 30)
                    });
                    baccarat_check.Search(order).ForEach(x => {
                        lst_vals.Add(new List <object>()
                        {
                            agin.Id, order, x.NFreq, x.CellsFreq.Count, x.CellsSub.Count, x.ColorsFreq
                        });
                    });
                }
                System.Threading.Thread.Sleep(0);
                System.Windows.Forms.Application.DoEvents();
                Console.Clear();
                Console.WriteLine(string.Format("Information\t:: {0:P}", (double)idx++ / agins.Count));
            }
            ConnHelper.ExecNonQueryCmdOptimizeMany(lst_vals, cmd_text);
        }