Example #1
0
 /// <summary>
 /// Constructs a <see cref="Marquee"/> effect.
 /// </summary>
 /// <param name="Parent">The <see cref="IHueDevice"/> that the effect is being applied to.</param>
 /// <param name="Color">The <see cref="Color"/> of the effect.</param>
 /// <param name="Direction">The <see cref="Direction"/> of the effect.</param>
 /// <param name="LSS">The <see cref="LSS"/> param to apply.</param>
 public Marquee(IHueDevice Parent, Color Color, Direction Direction, LSS LSS)
 {
     this.Parent = Parent;
     this._Color = Color;
     this.Param1 = Direction;
     this.Param2 = LSS;
 }
Example #2
0
        public override async ETTask Run()
        {
            DBComponent dbComponent = Game.Scene.GetComponent <DBComponent>();

            try
            {
                int      s  = 0;
                string[] st = LSS.Split('|');
                Json = st[0];
                int.TryParse(st[1], out s);
                skip = s;
                int.TryParse(st[2], out s);
                limit = s;
                sort  = st[3];
                //Log.Debug("DBQueryLSSJsonTask Json: " + Json);
                //Log.Debug("DBQueryLSSJsonTask 从第几个拿skip: " + skip);
                //Log.Debug("DBQueryLSSJsonTask 获取多少个limit: "+limit);
                //Log.Debug("DBQueryLSSJsonTask Sort: "+ sort);
                // 执行查询数据库任务
                FilterDefinition <ComponentWithId> filterDefinition = new JsonFilterDefinition <ComponentWithId>(this.Json);
                IAsyncCursor <ComponentWithId>     cursor           = await dbComponent.GetCollection(this.CollectionName).Find(filterDefinition).Skip(skip).Limit(limit).Sort(sort).ToCursorAsync();

                List <ComponentWithId> components = await cursor.ToListAsync();

                this.Tcs.SetResult(components);
            }
            catch (Exception e)
            {
                this.Tcs.SetException(new Exception($"查询数据库异常! {CollectionName} {this.Json}", e));
            }
        }
Example #3
0
        public void GetScoreTestForLSS3()
        {
            Random R = new Random();

            double[,] Gamma = BinarySerializationHelper.DeserializeObject <double[, ]>(Resources.Sample3);
            int    np       = 8;
            double expected = Double.Parse(Resources.LSSAnswer3);
            double actual   = LSS.GetScore(Gamma, np);

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        /// <summary>輸出用於MessageBox之類臨時顯示的字串</summary>
        /// <returns></returns>
        public string ToScoreLine()
        {
            string output = "";

            output += Subject + "_" + SubjectState + "_" + RegionId + "_" + TopDown;
            output += "\t勾縫分數:\t" + GS.ToString("00.0");
            output += "\t平行分數:\t" + LPS.ToString("00.0");
            output += "\t筆直分數:\t" + LSS.ToString("00.0");
            output += "\t轉角分數:\t" + AS.ToString("00.0");
            output += "\t綜合分數:\t" + CompositeScore.ToString("00.0");
            output += "\t方林分數:\t" + FangLingScore.ToString("00.0");
            //output += "\t林的分數(修):\t" + scoreOfLinM.ToString("00.0");
            //output += "\t角Y方向離差:\t" + CornerResidualY.ToString();
            //output += "\t角X方向離差:\t" + CornerResidualX.ToString();
            return(output);
        }