public BarUsingApplication(Canvas canvas)
        {
            circleBar = new CircleBar(canvas, 0.09, Color.FromArgb(255, 0, 100, 0), 4, 0, 15, 50);
            valueBarUsingApplication = new MyLabel(canvas, "-", 74, 40, 22,
                                                   canvas.Width / 2 - 33, canvas.Height / 2 - 5, Color.FromArgb(255, 0, 100, 0), Color.FromArgb(0, 0, 0, 0));

            MyLabel title = new MyLabel(canvas, "Aktywna aplikacja", 140, 30, 14, 0, 0, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));

            dailyUseOfApplication_db = new DailyUseOfApplication_db();
        }
Пример #2
0
        public TimeUsingApplication(Canvas canvas)
        {
            MyLabel title  = new MyLabel(canvas, "Czas użycia", 100, 30, 14, 0, 0, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));
            MyLabel label1 = new MyLabel(canvas, "Całkowity", 80, 30, 12, 0, 100, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));
            MyLabel label2 = new MyLabel(canvas, "Aplikacji", 80, 30, 12, 0, 50, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));

            timeOfAplication = new MyLabel(canvas, "0 h 0 min", 110, 35, 18, 70, 65, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));
            totalTime        = new MyLabel(canvas, "0 h 0 min", 110, 35, 18, 70, 110, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));
            MyRectangle line = new MyRectangle(canvas, 170, 1, Color.FromArgb(255, 47, 79, 79), 10, 100);

            dailyUseOfApplication_db = new DailyUseOfApplication_db();
        }
        private void UpdateChart()
        {
            AllData_db allData_db = new AllData_db();
            DailyUseOfApplication_db dailyUseOfApplication_db = new DailyUseOfApplication_db();
            List <int> activityID = new List <int>();

            int[]    timeActivity = new int[7];
            DateTime dateTime     = DateTime.Now;

            activityID.Add(viewActivityID);

            for (int i = 0; i < 7; i++)
            {
                if (i < 6)
                {
                    timeActivity[i] = allData_db.GetTimeForNumberActivity(activityID, dateTime.AddDays(-(7 - (i + 1))).ToShortDateString());
                }
                else
                {
                    timeActivity[i] = dailyUseOfApplication_db.GetTimeForNumberActivity(activityID);
                }
            }

            double maxValue = ActionOnNumbers.DivisionD((timeActivity.Max() > 2) ? timeActivity.Max() : 3, 60);

            for (int i = 0; i < 4; i++)
            {
                scaleLabel[i].SetContent((((maxValue / 3.0) * 3) - ((maxValue / 3.0) * i)).ToString("0.0") + " h");
            }

            if (timeActivity.Max() > 0)
            {
                double scale = maxValue / Convert.ToDouble(scaleLabel[0].GetContent().Replace(" h", ""));
                for (int i = 0; i < 7; i++)
                {
                    charts[i].Resize((int)(timeActivity[i] * (120 * scale) / timeActivity.Max()), 16);
                    charts[i].Position(y: 200 - timeActivity[i] * (120 * scale / timeActivity.Max()));
                    charts[i].ToolTip(ActionOnTime.GetTime(timeActivity[i]));
                }
            }
            else
            {
                for (int i = 0; i < 7; i++)
                {
                    charts[i].Resize(0, 16);
                    charts[i].ToolTip(ActionOnTime.GetTime(timeActivity[i]));
                }
            }
            SetVisibleScale();
        }
Пример #4
0
        public SpendingTime(Canvas canvas)
        {
            barsGraph         = new MyRectangle[4];
            mylabels          = new MyLabel[4];
            namesBarsGraph    = new string[4];
            namesBarsGraph[0] = "Wył. komputer";
            namesBarsGraph[1] = "Brak Aktyw.";
            namesBarsGraph[2] = "Programowanie";
            namesBarsGraph[3] = "Pozostałe";

            MyLabel title = new MyLabel(canvas, "Dzienna aktywność", 140, 30, 14, 0, 0, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));

            CreateSegmentSpendingTime(canvas, Color.FromArgb(255, 230, 230, 250), 0, 25, 70, 2, 131);
            CreateSegmentSpendingTime(canvas, Color.FromArgb(255, 72, 61, 139), 1, 65, 70, 102, 131);
            CreateSegmentSpendingTime(canvas, Color.FromArgb(255, 34, 139, 34), 2, 105, 70, 2, 146);
            CreateSegmentSpendingTime(canvas, Color.FromArgb(255, 218, 165, 32), 3, 145, 70, 102, 146);

            dailyUseOfApplication_db = new DailyUseOfApplication_db();
            Update();
        }
        public BiggestResultsOfDay(Canvas canvas)
        {
            this.canvas = canvas;
            labels      = new MyLabel[4];
            labelLegend = new MyLabel[4];
            nameColor   = new Color[4];
            MyLabel title = new MyLabel(canvas, "Największe użycie", 140, 30, 14, 0, 0, Color.FromArgb(255, 47, 79, 79), Color.FromArgb(0, 0, 0, 0));

            circleBar = new CircleBar(canvas, 0.04, Color.FromArgb(255, 255, 255, 255), 10, -8, -8, 40, false);

            nameColor[0] = Color.FromArgb(255, 46, 139, 87);
            nameColor[1] = Color.FromArgb(255, 255, 69, 0);
            nameColor[2] = Color.FromArgb(255, 255, 165, 0);
            nameColor[3] = Color.FromArgb(255, 75, 0, 130);

            CreateSegmentRecordDay(2, 131, 0);
            CreateSegmentRecordDay(102, 131, 1);
            CreateSegmentRecordDay(2, 146, 2);
            CreateSegmentRecordDay(102, 146, 3);

            dailyUseOfApplication_db = new DailyUseOfApplication_db();
        }
Пример #6
0
 public Counter()
 {
     dateLastRestet           = new DateTime();
     dateLastRestet           = DateTime.Now;
     dailyUseOfApplication_db = new DailyUseOfApplication_db();
 }