Esempio n. 1
0
        void DrawNeedle(SKCanvas canvas, float value)
        {
            float angle = -135f + (value / (100 - 0)) * 270f;

            canvas.Save();
            canvas.RotateDegrees(angle);
            float needleWidth = 6f;
            float needleHeight = 76f;
            float x = 0f, y = 0f;

            SKPaint paint = new SKPaint
            {
                IsAntialias = true,
                Color       = NeedleColor.ToSKColor()
            };

            SKPath needleRightPath = new SKPath();

            needleRightPath.MoveTo(x, y);
            needleRightPath.LineTo(x + needleWidth, y);
            needleRightPath.LineTo(x, y - needleHeight);
            needleRightPath.LineTo(x, y);
            needleRightPath.LineTo(x + needleWidth, y);


            SKPath needleLeftPath = new SKPath();

            needleLeftPath.MoveTo(x, y);
            needleLeftPath.LineTo(x - needleWidth, y);
            needleLeftPath.LineTo(x, y - needleHeight);
            needleLeftPath.LineTo(x, y);
            needleLeftPath.LineTo(x - needleWidth, y);


            canvas.DrawPath(needleRightPath, paint);
            canvas.DrawPath(needleLeftPath, paint);
            canvas.Restore();
        }
Esempio n. 2
0
        private SQLiteParameter[] GetSqlParameters()
        {
            List <SQLiteParameter> SqlParmColl = new List <SQLiteParameter>();

            try
            {
                SqlParmColl.Add(CommonDB.AddSqlParm("@ID", ID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DisplayID", DisplayID, DbType.Int64));
                SqlParmColl.Add(CommonDB.AddSqlParm("@oIndex", oIndex, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DlgType", DlgType, DbType.Byte));
                SqlParmColl.Add(CommonDB.AddSqlParm("@DlgIndex", DlgIndex, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Left", Left, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Right", Right, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Top", Top, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Bottom", Bottom, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ViewUnit", ViewUnit, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ViewLim", ViewLim, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@ViewLable", ViewLable, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@NeedleColor", NeedleColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@MeterValue", MeterValue, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Font", Font, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@FontColor", FontColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@LimFont", LimFont, DbType.String));
                SqlParmColl.Add(CommonDB.AddSqlParm("@LimFontColor", LimFontColor.ToArgb(), DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@MeterValueID", MeterValueID, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@LastRev", LastRev, DbType.Boolean));
                SqlParmColl.Add(CommonDB.AddSqlParm("@Layer", Layer, DbType.Int32));
                SqlParmColl.Add(CommonDB.AddSqlParm("@CompiledExp", CompiledExp, DbType.Binary));
                SqlParmColl.Add(CommonDB.AddSqlParm("@validexpression", validexpression, DbType.Boolean));
                return(SqlParmColl.ToArray());
            }
            catch (SQLiteException Exc)
            {
                throw Exc;
            }
        }