Ejemplo n.º 1
0
        private static StatisticsView CreateStatisticsView()
        {
            StatisticsView statisticsView = new StatisticsView();

            statisticsView.Presenter = new StatisticsPresenter(statisticsView);
            return(statisticsView);
        }
Ejemplo n.º 2
0
        internal void RefreshModel(StatisticsView view)
        {
            this.AdsbMessages      = view.AdsbMessages;
            this.AdsbRejected      = view.AdsbRejected;
            this.AdsbRejectedRatio = view.AdsbRejectedRatio;
            this.BadlyFormedBaseStationMessages      = view.BadlyFormedBaseStationMessages;
            this.BadlyFormedBaseStationMessagesRatio = view.BadlyFormedBaseStationMessagesRatio;
            this.BaseStationMessages          = view.BaseStationMessages;
            this.BytesReceived                = view.BytesReceived;
            this.ConnectedDuration            = String.Format("{0:00}:{1:00}:{2:00}", (long)view.ConnectedDuration.TotalHours, view.ConnectedDuration.Minutes, view.ConnectedDuration.Seconds);
            this.CurrentBufferSize            = view.CurrentBufferSize;
            this.ModeSLongFrame               = view.ModeSLongFrame;
            this.ModeSMessageCount            = view.ModeSMessageCount;
            this.ModeSNoAdsbPayload           = view.ModeSNoAdsbPayload;
            this.ModeSNoAdsbPayloadRatio      = view.ModeSNoAdsbPayloadRatio;
            this.ModeSPIBadParity             = view.ModeSPIBadParity;
            this.ModeSPIBadParityRatio        = view.ModeSPIBadParityRatio;
            this.ModeSShortFrame              = view.ModeSShortFrame;
            this.ModeSShortFrameUnusable      = view.ModeSShortFrameUnusable;
            this.ModeSShortFrameUnusableRatio = view.ModeSShortFrameUnusableRatio;
            this.ModeSWithPI                = view.ModeSWithPI;
            this.Name                       = view.Name;
            this.PositionsOutOfRange        = view.PositionsOutOfRange;
            this.PositionSpeedCheckExceeded = view.PositionSpeedCheckExceeded;
            this.PositionsReset             = view.PositionsReset;
            this.ReceiverBadChecksum        = view.ReceiverBadChecksum;
            this.ReceiverThroughput         = view.ReceiverThroughput;

            this.AdsbMessageTypeCount   = SetArray(view.AdsbMessageTypeCount, (idx, value) => new AdsbMessageTypeCountModel(idx, value));
            this.AdsbMessageFormatCount = SetArray(view.AdsbMessageFormatCount, (idx, value) => new AdsbMessageFormatCountModel((MessageFormat)idx, value));
            this.ModeSDFCount           = SetArray(view.ModeSDFCount, (idx, value) => new ModeSDFCountModel((DownlinkFormat)idx, value));
        }
Ejemplo n.º 3
0
    //private string                                m_FriendName = string.Empty;

    // =========================================================================================================================
    // === GuiScreen interface ============================================================================================
    protected override void OnViewInit()
    {
        base.OnViewInit();

        m_ScreenPivot  = GetPivot("Statistics_Screen");
        m_ScreenLayout = GetLayout("Statistics_Screen", "Statistics_Layout");

        PrepareButton(m_ScreenLayout, "03_SelectFriend_Button", null, OnSelectFriend);

        GUIBase_Button prevButton = PrepareButton(m_ScreenLayout, "Prev_Button", null, null);
        GUIBase_Button nextButton = PrepareButton(m_ScreenLayout, "Next_Button", null, null);

        prevButton.autoColorLabels = true;
        nextButton.autoColorLabels = true;

        GUIBase_List list = GetWidget(m_ScreenLayout, "Table").GetComponent <GUIBase_List>();

        m_StatisticsView = gameObject.AddComponent <StatisticsView>();
        m_StatisticsView.GUIView_Init(m_ScreenLayout, list, prevButton, nextButton);

        GUIBase_Widget header = GetWidget(m_ScreenLayout, "Header");

        m_SelectFriends = header.transform.GetChildComponent <GUIBase_Button>("03_SelectFriend_Button");
        m_SelectFriends.autoColorLabels = true;
        m_FriendNameLabel = header.transform.GetChildComponent <GUIBase_Label>("04_friend_name");
    }
Ejemplo n.º 4
0
        public void Check_StatisticsView_Loading_Should_Load()
        {
            var frm   = new Form1();
            var stFrm = new StatisticsView();

            frm.TestStatisticsFormLoading(ref stFrm);
            Assert.AreEqual(true, stFrm.Enabled);
            stFrm.Close();
        }
        public ActionResult ForGroup(int groupId)
        {
            var model = new StatisticsView
            {
                Group            = _groupProvider.GetById(groupId),
                UsersDict        = _userProvider.GetUsersByGroup(groupId).ToDictionary(x => x.VkUserId),
                StatisticsGroups = _statisticsProvider.GetStatisticsGroupsForTargetGroup(groupId)
            };

            return(View(model));
        }
Ejemplo n.º 6
0
        public void OverallInsights_ShouldShowGraphs()
        {
            // Arrange
            var frm = new StatisticsView();

            // Act
            frm.btnOverall_Click(this, null);

            //Assert
            Assert.AreEqual(14, frm.panel1.Controls.Count);
        }
Ejemplo n.º 7
0
        public ActionResult MyStatistics()
        {
            var userId     = User.Identity.GetUserId();
            var myArticles = db.Articles.Where(a => a.CreatedUserId == userId).ToList();
            var view       = new StatisticsView
            {
                ArticlesCount = myArticles.Count
            };

            return(PartialView("_MyStatistics", view));
        }
Ejemplo n.º 8
0
 public ActionResult BusinessStatistics(StatisticsView statis)
 {
     if (statis.FOperator == "business")
     {
         var yyslList = baseDAL.Get <yysj>().Where(
             c => c.skrq >= statis.FSDate &&
             c.skrq <= statis.FEDate
             ).ToList();
         return(Json(yyslList));
     }
     return(null);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Закончилось
        /// </summary>
        void WorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            IsCalculationStatistics = true;
            IsDelete             = true;
            IsProgressStatistics = (bool)e.Result;
            FileStatistics.Statistics.SortByLetter();

            for (int i = 0; i < FileStatistics.Statistics.StatsByLetter.Count; i++)
            {
                StatisticsView.Add(FileStatistics.Statistics.StatsByLetter[i]);
            }
        }
Ejemplo n.º 10
0
    /// <summary>
    /// This method adjusts the ui view, so that only the values, that correspond to the particular view, can be seen
    /// </summary>
    public bool SetView(StatisticsView.View view)
    {
        if (originalStats == null)
        {
            return(false);
        }

        float viewHours = StatisticsView.GetHours(view);

        // the date time of the last point of the original statstics converted to hours
        float lastTotalHours = visualizer.DateToHours(System.Convert.ToDateTime(originalStats.GetLastPoint().GetX()));
        // the date time of the first point of the original statstics converted to hours
        float firstTotalHours = visualizer.DateToHours(System.Convert.ToDateTime(originalStats.GetPoints()[0].GetX()));

        // If the current view includes points that the statistics cannot provide, ...
        if (lastTotalHours - viewHours < firstTotalHours && viewHours != -1)
        {
            // ... do not change the view.
            return(false);
        }

        // set xMax that correspond to the view
        int xMax = (int)viewHours;

        if (xMax < 0)
        {
            xMax = originalXMax;
        }
        visualizer.SetXMax(xMax);

        // set the amount of x ledger lines that correspond to the view
        int xLedgerLineAmount = StatisticsView.GetXLedgerLineAmount(view);

        if (xLedgerLineAmount < 0)
        {
            xLedgerLineAmount = originalXLedgerLines;
        }
        visualizer.SetXLedgerLineAmount(xLedgerLineAmount);

        // set the x unit that correspond to the view
        xUnit.Units unit = StatisticsView.GetUnit(view);
        if (unit == xUnit.Units.NUMBER)
        {
            unit = originalUnit;
        }
        visualizer.SetUnit(unit);

        // draw all circles and lines that correspond to the new statistics
        visualizer.Repaint();

        return(true);
    }
Ejemplo n.º 11
0
        private static AdminView CreateAdminView()
        {
            // Customer view
            CustomersDataView    customersDataView    = CreateCustomersDataView();
            CarsDataView         carsDataView         = CreateCarsDataView();
            OffersDataView       offersDataView       = CreateOffersDataView();
            ReservationsDataView reservationsDataView = CreateReservationsDataView();
            StatisticsView       statisticsView       = CreateStatisticsView();
            AdminView            adminView            = new AdminView(
                customersDataView,
                carsDataView,
                offersDataView,
                reservationsDataView,
                statisticsView);

            return(adminView);
        }
Ejemplo n.º 12
0
        public override void Initialize()
        {
            Textures = new Textures();
            Textures.Load();

            backgroundArea  = new BackgroundArea(this);
            GameArea        = new GameArea(this);
            StatisticsArea  = new StatisticsArea(this, GameArea);
            MainObject      = new MainObject(this, new Vector2f(500, 500));
            SliceOfLifeBase = new SliceOfLife1(this, MainObject);

            StatisticsView = new StatisticsView(this);

            backgroundArea.Initialize();
            GameArea.Initialize();
            StatisticsArea.Initialize();
            StatisticsView.Initialize();
            MainObject.Initialize();
            SliceOfLifeBase.Initialize();
        }
Ejemplo n.º 13
0
        public MainViewmodel()
        {
            TransactionsViewmodel = new TransActionsViewmodel(this);
            RelationsViewmodel    = new RelationsViewmodel(this, DialogCoordinator.Instance);
            MenuItems             = new List <MenuItem>();
            MenuItems.Add(new MenuItem()
            {
                Title = "Transacties",
                View  = new TransactionsView()
                {
                    DataContext = TransactionsViewmodel
                }
            });
            SelectedMenuItem = MenuItems.First();

            var statisticsView = new StatisticsView();

            StatisticsViewmodel        = new StatisticsViewmodel(this, statisticsView);
            statisticsView.DataContext = StatisticsViewmodel;
            MenuItems.Add(new MenuItem()
            {
                Title = "Statistieken",
                View  = statisticsView
            });

            MenuItems.Add(new MenuItem()
            {
                Title = "Relaties",
                View  = new RelationsEditingView()
            });
            MenuItems.Last().View.DataContext = RelationsViewmodel;

            MenuItems.Add(new MenuItem()
            {
                Title = "Categorieen",
                View  = new CategoriesView()
            });
            MenuItems.Last().View.DataContext = new CategoriesViewmodel(this);

            ShowAccountCommand = new RelayCommand(async(object obj) => await ShowAccountAsync());
        }
Ejemplo n.º 14
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
                if (_statsView != null)
                {
                    _statsView.Dispose();
                    _statsView = null;
                }
                if (_mnuProgress != null)
                {
                    _mnuProgress.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 15
0
        /// ------------------------------------------------------------------------------------
        public ProgressScreen(StatisticsViewModel statisticsModel)
        {
            Logger.WriteEvent("ProgressScreen constructor");

            InitializeComponent();
            _statsView = new StatisticsView(statisticsModel)
            {
                Dock = DockStyle.Fill
            };
            Controls.Add(_statsView);

            _mnuProgress = new ToolStripMenuItem
            {
                Text = LocalizationManager.GetString("ProgressView.ProgressMainMenuItemText",
                                                     "Pr&ogress", null, MainMenuItem)
            };

            var menu = new ToolStripMenuItem(null, ResourceImageCache.Copy, _statsView.HandleCopyToClipboardClick);

            menu.Text = LocalizationManager.GetString("ProgressView.CopyMenuItemText",
                                                      "&Copy", null, "Copy entire view to clipboard", null, menu);

            _mnuProgress.DropDown.Items.Add(menu);

            menu      = new ToolStripMenuItem(null, ResourceImageCache.Save, _statsView.HandleSaveButtonClicked);
            menu.Text = LocalizationManager.GetString("ProgressView.SaveMenuItemText",
                                                      "&Save...", null, "Save view to file", null, menu);

            _mnuProgress.DropDown.Items.Add(menu);

            menu      = new ToolStripMenuItem(null, ResourceImageCache.Print, _statsView.HandlePrintButtonClicked);
            menu.Text = LocalizationManager.GetString("ProgressView.PrintMenuItemText",
                                                      "&Print...", null, null, null, menu);

            _mnuProgress.DropDown.Items.Add(menu);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// button to access statistics
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void statisticsButton_Click(object sender, EventArgs e)
        {
            StatisticsView window = new StatisticsView();

            window.Show();
        }
Ejemplo n.º 17
0
 internal ViewModel(StatisticsView view)
 {
     RefreshModel(view);
 }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            var service = new CovidDbService(CovidDatabaseSettings.DatabaseSettings);

            StatisticsView statView   = new StatisticsView();
            CreateView     createView = new CreateView();
            //var service = new CitizenService(CovidDatabaseSettings.DatabaseSettings);
            //var citizens=service.GetCitizens();
            //int id=citizens.First().ID;
            //service.AddTest(new Test { Date = DateTime.Now, Res = "pos", Status = "Fine" },id);
            //citizens = service.GetCitizens();
            //foreach(var cit in citizens)
            //{

            //    Console.WriteLine($"Citizen:\n  Name: {cit.FirstName}, Muni: {cit.Muni}");
            //    Console.WriteLine("Tests:");
            //    foreach(var test in cit.Tests)
            //    {
            //        Console.WriteLine($"Test result: {test.Res}, Test date: {test.Date}");
            //    }
            //}

            bool finish = false;

            do
            {
                Console.Clear();
                Console.WriteLine("***** Velkommen til Covid19 tracking app ***** \n" +
                                  "\n Følgende muligheder er tilgængelige: \n - Exit \n - Vis antal aktive Covid19 patienter per kommune" +
                                  "\n - Se deataljeret statistik over smittede baseret på aldersgruppe og køn \n - Udregn mulige smittede ved nyeste smittetilfælde" +
                                  "\n - Tilføj nyt smittetilfælde, testcenter, testsag eller ny lokation" +
                                  "\n ");
                Console.WriteLine(" Indtast et af de følgende bogstaver for at åbne en mulighed: \n E = exit " +
                                  "\n A = Aktive pr. kommune \n S = Åben statistik \n U = Mulige nye smittede \n N = Tilføj data ");
                string input = Console.ReadLine();
                if (string.IsNullOrEmpty(input))
                {
                    continue;
                }

                switch (input[0])
                {
                case 'E':
                    finish = true;     // exit
                    break;

                case 'A':
                    //Calculate the number of active Covid19 cases - a person is infected 14 days after a positive
                    //test. Results should be shown per Municipality.
                    var totalInfected = service.GetAllCurrentlyInfected();
                    Console.WriteLine("Total antal smittede: {0}", totalInfected.Count);

                    // udskriv per municipality
                    Dictionary <int, int> muniDictionary = new Dictionary <int, int>();
                    foreach (var cit in totalInfected)
                    {
                        bool added = muniDictionary.TryAdd(cit.Muni, 1);
                        if (!added)
                        {
                            muniDictionary.TryGetValue(cit.Muni, out var currentCount);
                            muniDictionary[cit.Muni] = currentCount + 1;
                        }
                    }

                    Console.WriteLine("\n Kommune:             Antal smittede:");
                    foreach (KeyValuePair <int, int> kvp in muniDictionary)
                    {
                        Console.WriteLine(" {0}, {1} ", kvp.Key, kvp.Value);
                    }
                    Console.WriteLine("Tryk på en knap for at vælge en ny mulighed");
                    Console.ReadKey();
                    break;

                case 'S':
                    // åben stat menu
                    statView.OpenStatMenu();
                    break;

                case 'U':
                    //Given a new infected citizen, “calculate” which other citizen may be infected .
                    Console.WriteLine("Indtast id på smittet person.");
                    string citId = Console.ReadLine();
                    if (string.IsNullOrEmpty(citId))
                    {
                        continue;
                    }
                    var possibleInfectedList = service.GetPossibleInfected(int.Parse(citId));

                    Console.WriteLine("\n Muligt smittede borgere: ");

                    foreach (var cit in possibleInfectedList)
                    {
                        Console.WriteLine($"Test result: {cit.FirstName}, Test date: {cit.LastName}");
                    }
                    Console.WriteLine("Tryk på en knap for at vælge en ny mulighed");
                    Console.ReadKey();
                    break;

                case 'N':
                    //åben create menu
                    createView.OpenCreateMenu();
                    break;

                default:
                    break;
                }
            } while (!finish);
        }