Ejemplo n.º 1
0
 /// <summary>
 /// Generate random values with a normal distribution
 /// </summary>
 public Population(Random rand, int pointCount, double mean = .5, double stdDev = .5)
 {
     values = DataGen.RandomNormal(rand, pointCount, mean, stdDev);
     Recalculate();
 }
        public void MODCRStudyTeamOnlyCreationThroughCommitteeReviewToDeferred()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            EntityClonerUtil.CloneEntity("STUDY00000024", targetStudy, true);

            var CRSmartForm        = new InitialModCrSmartForm();
            var StudySF            = new InitialStudySmartForm();
            var workspace          = new IRBWorkspace();
            var irbSubmissionsPage = new IRBSubmissions();
            var actionsNav         = new ActionsNav();

            // Log in as the PI and go to the IRB/Active tab and select an Approved study, Create Modification/CR ,
            // select “Modification and Continuing” and “Other parts of the study”.  Make changes to one or more views of the study.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            actionsNav.ImgCreateModCr.Click();

            // Fill in just required info
            CRSmartForm.ChooseModCRPurpose(SubmissionPurpose.ModAndCR);
            CRSmartForm.ChooseModificationScope(Scope.StudyTeamMemberInformation);
            CRSmartForm.BtnContinue.Click();
            CRSmartForm.SpecifyEnrollmentTotals("2", "2", "1");
            CRSmartForm.ChooseResearchMilestone(InitialModCrSmartForm.MileStones.StudyPermanentlyClosedToEnrollment, InitialModCrSmartForm.MileStones.AllSubjectCompletedStudyRelatedInterventions,
                                                InitialModCrSmartForm.MileStones.CollectionOfPrivateInfoComplete, InitialModCrSmartForm.MileStones.AnalysisOfPrivateInfoComplete);
            CRSmartForm.RdoFinancialInterestNo.Click();
            CRSmartForm.BtnContinue.Click();

            // Modification Page
            CRSmartForm.TxtSummarizeModifications.Value = "These are the new modifications!  :/ :) :P";
            CRSmartForm.BtnContinue.Click();

            // Add a study team member, save, exit
            //StudySF.StudyTeamMembersPage.AddStudyTeamMember("Czerch (comm2)", false, false, AddStudyTeamMemberPopup.Roles.CoInvestigator);
            // test to see if "" selects first value...
            StudySF.StudyTeamMembersPage.AddStudyTeamMember(false, false, "", AddStudyTeamMemberPopup.Roles.CoInvestigator);
            StudySF.LnkSave.Click();
            StudySF.LnkExit.Click();

            //As the PI, Submit.
            workspace.Submit(Users.Pi.UserName, Users.Pi.Password);
            Assert.IsTrue(new Link(By.LinkText("Submitted")).Exists, "'Submitted' activity not found for:  " + targetStudy);
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review", "State expected not in 'Pre-Review'.  State currently: " + workspace.GetStudyState());
            var CRName = Web.PortalDriver.Title;

            //Log in as the assigned coordinator and Submit Pre-Review
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitPreReviewForCR();
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review Completed", "State expected not in 'Pre-Review Completed'.  State currently:  " + workspace.GetStudyState());

            // Log in as an IRB coordinator and Assign Coordinator
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.AssignCoordinator("Orlando Max (irbc)");

            //As the assigned coordinator, Assign Meeting.
            workspace.AssignMeetingByFirstMeeting();
            Assert.IsTrue(workspace.GetStudyState() == "Committee Review");

            //As the assigned coordinator, Submit Committee Review (approved determination).
            // need determination, risk level
            workspace.SubmitCommitteeReview(SubmitCommitteeReviewPopup.Determinations.Deferred, "2", "0", "0", "0", "0", "", true);
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned IRB Coordinator, Finalize Documents.
            workspace.FinalizeDocuments();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Deferred", "State expected not in 'Deferred'.  State currently:  " + workspace.GetStudyState());
        }
Ejemplo n.º 3
0
 public void ExecuteRecipe(Plot plt)
 {
     double[,] imageData = DataGen.SampleImageData();
     plt.AddHeatmap(imageData);
 }
Ejemplo n.º 4
0
        public MultiAxisLock()
        {
            InitializeComponent();

            Random rand = new Random();

            double[] data1 = DataGen.RandomWalk(rand, 100, mult: 1);
            double[] data2 = DataGen.RandomWalk(rand, 100, mult: 10);
            double[] data3 = DataGen.RandomWalk(rand, 100, mult: 100);
            double   avg1  = data1.Sum() / data1.Length;
            double   avg2  = data2.Sum() / data2.Length;
            double   avg3  = data3.Sum() / data3.Length;

            // Add signals specifying the vertical axis index for each
            var plt1 = formsPlot1.Plot.AddSignal(data1);

            plt1.YAxisIndex = 0;
            plt1.LineWidth  = 3;
            plt1.Color      = Color.Magenta;

            var plt2 = formsPlot1.Plot.AddSignal(data2);

            plt2.YAxisIndex = 1;
            plt2.LineWidth  = 3;
            plt2.Color      = Color.Green;

            var plt3 = formsPlot1.Plot.AddSignal(data3);

            plt3.YAxisIndex = 2;
            plt3.LineWidth  = 3;
            plt3.Color      = Color.Navy;

            // Add draggable horizontal lines specifying the vertical axis index for each
            var hline1 = formsPlot1.Plot.AddHorizontalLine(avg1);

            hline1.DragEnabled = true;
            hline1.Color       = plt1.Color;
            hline1.LineStyle   = LineStyle.Dash;
            hline1.YAxisIndex  = 0;

            var hline2 = formsPlot1.Plot.AddHorizontalLine(avg2);

            hline2.DragEnabled = true;
            hline2.Color       = plt2.Color;
            hline2.LineStyle   = LineStyle.Dash;
            hline2.YAxisIndex  = 1;

            var hline3 = formsPlot1.Plot.AddHorizontalLine(avg3);

            hline3.DragEnabled = true;
            hline3.Color       = plt3.Color;
            hline3.LineStyle   = LineStyle.Dash;
            hline3.YAxisIndex  = 2;

            // The horizontal axis is shared by these signal plots (XAxisIndex defaults to 0)
            formsPlot1.Plot.XAxis.Label("Horizontal Axis");

            // Customize the primary (left) and secondary (right) axes
            formsPlot1.Plot.YAxis.Color(Color.Magenta);
            formsPlot1.Plot.YAxis.Label("Primary Axis");
            formsPlot1.Plot.YAxis2.Color(Color.Green);
            formsPlot1.Plot.YAxis2.Label("Secondary Axis");

            // the secondary (right) axis ticks are hidden by default so enable them
            formsPlot1.Plot.YAxis2.Ticks(true);

            // Create an additional vertical axis and customize it
            YAxis3 = formsPlot1.Plot.AddAxis(Renderable.Edge.Left, 2);
            YAxis3.Color(Color.Navy);
            YAxis3.Label("Tertiary Axis");

            // adjust axis limits to fit the data once before locking them based on initial check state
            formsPlot1.Plot.AxisAuto();
            SetLocks();

            formsPlot1.Refresh();
        }
Ejemplo n.º 5
0
            public void Render(Plot plt)
            {
                // create some sample data to represent test scores.
                Random rand = new Random(0);

                // Each class (A, B, C) is a series.
                // Each semester (fall, spring, summer A, summer B) is a group.

                double[] scoresAfall = DataGen.RandomNormal(rand, 35, 85, 5);
                double[] scoresBfall = DataGen.RandomNormal(rand, 42, 87, 5);
                double[] scoresCfall = DataGen.RandomNormal(rand, 23, 82, 5);

                double[] scoresAspring = DataGen.RandomNormal(rand, 35, 84, 3);
                double[] scoresBspring = DataGen.RandomNormal(rand, 42, 88, 3);
                double[] scoresCspring = DataGen.RandomNormal(rand, 23, 84, 3);

                double[] scoresAsumA = DataGen.RandomNormal(rand, 35, 80, 5);
                double[] scoresBsumA = DataGen.RandomNormal(rand, 42, 90, 5);
                double[] scoresCsumA = DataGen.RandomNormal(rand, 23, 85, 5);

                double[] scoresAsumB = DataGen.RandomNormal(rand, 35, 91, 2);
                double[] scoresBsumB = DataGen.RandomNormal(rand, 42, 93, 2);
                double[] scoresCsumB = DataGen.RandomNormal(rand, 23, 90, 2);

                // Collect multiple populations into a PopulationSeries.
                // All populations in a series will be styled the same and appear once in the legend.

                var popsA = new Statistics.Population[] {
                    new Statistics.Population(scoresAfall),
                    new Statistics.Population(scoresAspring),
                    new Statistics.Population(scoresAsumA),
                    new Statistics.Population(scoresAsumB)
                };

                var popsB = new Statistics.Population[] {
                    new Statistics.Population(scoresBfall),
                    new Statistics.Population(scoresBspring),
                    new Statistics.Population(scoresBsumA),
                    new Statistics.Population(scoresBsumB)
                };

                var popsC = new Statistics.Population[] {
                    new Statistics.Population(scoresCfall),
                    new Statistics.Population(scoresCspring),
                    new Statistics.Population(scoresCsumA),
                    new Statistics.Population(scoresCsumB)
                };

                var seriesA   = new Statistics.PopulationSeries(popsA, "Class A");
                var seriesB   = new Statistics.PopulationSeries(popsB, "Class B");
                var seriesC   = new Statistics.PopulationSeries(popsC, "Class C");
                var allSeries = new Statistics.PopulationSeries[] { seriesA, seriesB, seriesC };

                // create a MultiSeries from multiple population series and plot it
                var multiSeries = new Statistics.PopulationMultiSeries(allSeries);

                plt.PlotPopulations(multiSeries);

                // improve the style of the plot
                plt.Title($"Test Scores by Class");
                plt.YLabel("Score");
                plt.XTicks(new string[] { "Fall", "Spring", "Summer A", "Summer B" });
                plt.Legend();
                plt.Grid(lineStyle: LineStyle.Dot, enableVertical: false);
            }
Ejemplo n.º 6
0
 public void ExecuteRecipe(Plot plt)
 {
     // OHLCs are open, high, low, and closing prices for a time range.
     OHLC[] prices = DataGen.RandomStockPrices(null, 60);
     plt.AddCandlesticks(prices);
 }
Ejemplo n.º 7
0
        public Form1()
        {
            InitializeComponent();

            // Prepare separate Y axes
            formsPlot1.Plot.YAxis.Color(Color.Magenta);
            var yAxis1 = formsPlot1.Plot.YAxis;
            var yAxis2 = formsPlot1.Plot.AddAxis(ScottPlot.Renderable.Edge.Left, 2, "", Color.Navy);
            var yAxis3 = formsPlot1.Plot.AddAxis(ScottPlot.Renderable.Edge.Left, 3, "", Color.Green);

            // Create data and add it to the plot
            Random rand = new(0);

            double[] data1 = DataGen.RandomWalk(rand, 100, mult: 1);
            double[] data2 = DataGen.RandomWalk(rand, 100, mult: 10);
            double[] data3 = DataGen.RandomWalk(rand, 100, mult: 100);
            double   avg1  = data1.Sum() / data1.Length;
            double   avg2  = data2.Sum() / data2.Length;
            double   avg3  = data3.Sum() / data3.Length;

            var plt1 = formsPlot1.Plot.AddSignal(data1);

            plt1.YAxisIndex = 0;
            plt1.LineWidth  = 3;
            plt1.Color      = Color.Magenta;

            var plt2 = formsPlot1.Plot.AddSignal(data2);

            plt2.YAxisIndex = 3;
            plt2.LineWidth  = 3;
            plt2.Color      = Color.Green;

            var plt3 = formsPlot1.Plot.AddSignal(data3);

            plt3.YAxisIndex = 2;
            plt3.LineWidth  = 3;
            plt3.Color      = Color.Navy;

            // Add draggable horizontal lines specifying the vertical axis index for each
            var hline1 = formsPlot1.Plot.AddHorizontalLine(avg1);

            hline1.DragEnabled             = true;
            hline1.Color                   = plt1.Color;
            hline1.LineStyle               = LineStyle.Dash;
            hline1.YAxisIndex              = 0;
            hline1.PositionLabelBackground = plt1.Color;
            hline1.PositionFormatter       = (double position) => position.ToString("N0");
            hline1.PositionLabel           = true;
            hline1.PositionLabelAxis       = yAxis1;

            var hline2 = formsPlot1.Plot.AddHorizontalLine(avg3);

            hline2.DragEnabled             = true;
            hline2.Color                   = plt3.Color;
            hline2.LineStyle               = LineStyle.Dash;
            hline2.YAxisIndex              = 2;
            hline2.PositionLabelBackground = plt3.Color;
            hline2.PositionFormatter       = (double position) => position.ToString("N0");
            hline2.PositionLabel           = true;
            hline2.PositionLabelAxis       = yAxis2;

            var hline3 = formsPlot1.Plot.AddHorizontalLine(avg2);

            hline3.DragEnabled             = true;
            hline3.Color                   = plt2.Color;
            hline3.LineStyle               = LineStyle.Dash;
            hline3.YAxisIndex              = 3;
            hline3.PositionLabelBackground = plt2.Color;
            hline3.PositionFormatter       = (double position) => position.ToString("N0");
            hline3.PositionLabel           = true;
            hline3.PositionLabelAxis       = yAxis3;

            // update the plot
            formsPlot1.Plot.AxisAuto();
            formsPlot1.Refresh();
        }
Ejemplo n.º 8
0
 public LinkedPlots()
 {
     InitializeComponent();
     formsPlot1.Plot.AddSignal(DataGen.Sin(51));
     formsPlot2.Plot.AddSignal(DataGen.Cos(51));
 }
Ejemplo n.º 9
0
 private void FormSandbox_Load(object sender, EventArgs e)
 {
     formsPlot1.plt.PlotSignal(DataGen.Sin(51));
     formsPlot1.plt.PlotSignal(DataGen.Cos(51));
     formsPlot1.Render();
 }
Ejemplo n.º 10
0
 public void Render(Plot plt)
 {
     plt.PlotSignal(DataGen.Sin(51));
     plt.Ticks(xTickRotation: -45); // TODO: rotations other than 0-90 look bad!
 }
Ejemplo n.º 11
0
 public Person_Tests()
 {
     this.local = DataGen.Person().ToArray();
 }
Ejemplo n.º 12
0
 public VisualizerViewModel(NaiveBaysModel baysModel)
 {
     _baysModel = baysModel;
     _plot.plt.PlotSignal(DataGen.RandomWalk(new Random(), 1000));
     _plot.Render();
 }
        public void MODCRStudyTeamOnlyCreationThroughNonCommitteeReviewWithModificationsRequiredToApproved()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            EntityClonerUtil.CloneEntity("STUDY00000024", targetStudy, true);

            var CRSmartForm        = new InitialModCrSmartForm();
            var StudySF            = new InitialStudySmartForm();
            var workspace          = new IRBWorkspace();
            var irbSubmissionsPage = new IRBSubmissions();
            var actionsNav         = new ActionsNav();

            // Log in as the PI and go to the IRB/Active tab and select an Approved study, Create Modification/CR ,
            // select “Modification and Continuing” and “Other parts of the study”.  Make changes to one or more views of the study.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            actionsNav.ImgCreateModCr.Click();

            // Fill in just required info
            CRSmartForm.ChooseModCRPurpose(SubmissionPurpose.ModAndCR);
            CRSmartForm.ChooseModificationScope(Scope.StudyTeamMemberInformation);
            CRSmartForm.BtnContinue.Click();
            CRSmartForm.SpecifyEnrollmentTotals("2", "2", "1");
            CRSmartForm.ChooseResearchMilestone(InitialModCrSmartForm.MileStones.StudyPermanentlyClosedToEnrollment, InitialModCrSmartForm.MileStones.AllSubjectCompletedStudyRelatedInterventions,
                                                InitialModCrSmartForm.MileStones.CollectionOfPrivateInfoComplete, InitialModCrSmartForm.MileStones.AnalysisOfPrivateInfoComplete);
            CRSmartForm.RdoFinancialInterestNo.Click();
            CRSmartForm.BtnContinue.Click();

            // Modification Page
            CRSmartForm.TxtSummarizeModifications.Value = "These are the new modifications!  :/ :) :P";
            CRSmartForm.BtnContinue.Click();

            // Add a study team member, save, exit
            StudySF.StudyTeamMembersPage.AddStudyTeamMember(false, false, "", AddStudyTeamMemberPopup.Roles.CoInvestigator);
            StudySF.LnkSave.Click();
            StudySF.LnkExit.Click();

            //As the PI, Submit the Mod.
            workspace.Submit(Users.Pi.UserName, Users.Pi.Password);
            Assert.IsTrue(new Link(By.LinkText("Submitted")).Exists, "'Submitted' activity not found for:  " + targetStudy);
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review", "State expected not in 'Pre-Review'.  State currently: " + workspace.GetStudyState());
            var CRName = Web.PortalDriver.Title;

            //Log in as the assigned coordinator and Submit Pre-Review
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitPreReviewForCR();

            // As the assigned IRBC, Assign Designated Reviewer.
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.AssignDesignatedReviewer("Harry Smith (comm4)");
            Assert.IsTrue(workspace.GetStudyState() == "Non-Committee Review", "State expected not in 'Non-Committee Review'.  State currently:  " + workspace.GetStudyState());

            // Log in as the Designated Reviewer and Submit Designated Review approved.
            Store.LoginAsUser(Users.Comm4);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitDesignatedReviewForStudy(SubmitDesignatedReview.StudyDeterminations.ModificationsRequiredToSecureApproved, "These are modifications required:  :/", true);
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned IRB Coordinator, Finalize Documents.
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.FinalizeDocuments();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Modifications Required", "State expected not in 'Modifications Required'.  State currently:  " + workspace.GetStudyState());

            // Log in as the PI and Submit Response.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitResponse(Users.Pi.UserName, Users.Pi.Password, "This is my response!  :P");
            Assert.IsTrue(workspace.GetStudyState() == "Modifications Submitted", "State expected not in 'Modifications Submitted'.  State currently:  " + workspace.GetStudyState());

            // Log in as the assigned IRB Coordinator, Review Required Modifications (Yes to the question “Were the modifications completed as required?” “yes” response)
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.ReviewRequiredModifications();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Approved", "State expected not in 'Approved'.  State currently:  " + workspace.GetStudyState());
        }
Ejemplo n.º 14
0
        public void ExecuteRecipe(Plot plt)
        {
            // Each class (A, B, C) is a series.
            // Each semester (fall, spring, summer A, summer B) is a group.

            // create sample data to represent test scores for each class in each semester
            Random rand = new Random(0);

            double[] scoresAfall   = DataGen.RandomNormal(rand, 35, 85, 5);
            double[] scoresBfall   = DataGen.RandomNormal(rand, 42, 87, 5);
            double[] scoresCfall   = DataGen.RandomNormal(rand, 23, 82, 5);
            double[] scoresAspring = DataGen.RandomNormal(rand, 35, 84, 3);
            double[] scoresBspring = DataGen.RandomNormal(rand, 42, 88, 3);
            double[] scoresCspring = DataGen.RandomNormal(rand, 23, 84, 3);
            double[] scoresAsumA   = DataGen.RandomNormal(rand, 35, 80, 5);
            double[] scoresBsumA   = DataGen.RandomNormal(rand, 42, 90, 5);
            double[] scoresCsumA   = DataGen.RandomNormal(rand, 23, 85, 5);
            double[] scoresAsumB   = DataGen.RandomNormal(rand, 35, 91, 2);
            double[] scoresBsumB   = DataGen.RandomNormal(rand, 42, 93, 2);
            double[] scoresCsumB   = DataGen.RandomNormal(rand, 23, 90, 2);

            // Collect multiple populations into a PopulationSeries.
            // All populations in a series will be styled the same and appear once in the legend.
            var popsA = new Statistics.Population[] {
                new Statistics.Population(scoresAfall),
                new Statistics.Population(scoresAspring),
                new Statistics.Population(scoresAsumA),
                new Statistics.Population(scoresAsumB)
            };

            var popsB = new Statistics.Population[] {
                new Statistics.Population(scoresBfall),
                new Statistics.Population(scoresBspring),
                new Statistics.Population(scoresBsumA),
                new Statistics.Population(scoresBsumB)
            };

            var popsC = new Statistics.Population[] {
                new Statistics.Population(scoresCfall),
                new Statistics.Population(scoresCspring),
                new Statistics.Population(scoresCsumA),
                new Statistics.Population(scoresCsumB)
            };

            // create a population series for each array of populations and give it a label
            var seriesA   = new Statistics.PopulationSeries(popsA, "Class A");
            var seriesB   = new Statistics.PopulationSeries(popsB, "Class B");
            var seriesC   = new Statistics.PopulationSeries(popsC, "Class C");
            var allSeries = new Statistics.PopulationSeries[] { seriesA, seriesB, seriesC };

            // create a MultiSeries from multiple population series and plot it
            var multiSeries = new Statistics.PopulationMultiSeries(allSeries);

            plt.AddPopulations(multiSeries);

            // improve the style of the plot
            string[] groupNames = new string[] { "Fall", "Spring", "Summer A", "Summer B" };
            plt.XTicks(groupNames);
            plt.XAxis.Grid(false);
            plt.Legend();
        }
Ejemplo n.º 15
0
 public MouseTracker()
 {
     InitializeComponent();
     formsPlot1.Plot.AddSignal(DataGen.RandomWalk(null, 100));
     Crosshair = formsPlot1.Plot.AddCrosshair(0, 0);
 }
Ejemplo n.º 16
0
 private void AddSine(object sender, EventArgs e)
 {
     formsPlot1.plt.PlotSignal(DataGen.Sin(51, phase: rand.NextDouble() * 1000));
     formsPlot1.plt.AxisAuto();
     formsPlot1.Render();
 }
Ejemplo n.º 17
0
        public void ContinuingReviewThroughNonCommitteeReviewThroughModsRequiredToApproved()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            EntityClonerUtil.CloneEntity("STUDY00000024", targetStudy, true);

            var CRSmartForm        = new InitialModCrSmartForm();
            var workspace          = new IRBWorkspace();
            var irbSubmissionsPage = new IRBSubmissions();
            var actionsNav         = new ActionsNav();

            //Log in as the PI to an Approved study and select Create Modification/CR. Select “Continuing Review”  and on the Continuing Review/Study Closure Information select the top 4 Research milestones.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            actionsNav.ImgCreateModCr.Click();

            // Fill in just required info
            CRSmartForm.ChooseModCRPurpose(SubmissionPurpose.ContinuingReview);
            CRSmartForm.BtnContinue.Click();

            CRSmartForm.SpecifyEnrollmentTotals("2", "2", "1");
            CRSmartForm.ChooseResearchMilestone(InitialModCrSmartForm.MileStones.StudyPermanentlyClosedToEnrollment, InitialModCrSmartForm.MileStones.AllSubjectCompletedStudyRelatedInterventions,
                                                InitialModCrSmartForm.MileStones.CollectionOfPrivateInfoComplete, InitialModCrSmartForm.MileStones.AnalysisOfPrivateInfoComplete);
            CRSmartForm.RdoFinancialInterestNo.Click();
            CRSmartForm.BtnContinue.Click();
            CRSmartForm.BtnFinish.Click();

            //As the PI, Submit the Continuing Review.
            workspace.Submit(Users.Pi.UserName, Users.Pi.Password);
            Assert.IsTrue(new Link(By.LinkText("Submitted")).Exists, "'Submitted' activity not found for:  " + targetStudy);
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review", "State expected not in 'Pre-Review'.  State currently: " + workspace.GetStudyState());
            var CRName = Web.PortalDriver.Title;

            // Log in as an IRB coordinator and Assign Coordinator
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.AssignCoordinator("Orlando Max (irbc)");

            //Log in as the assigned coordinator and Submit Pre-Review
            workspace.SubmitPreReviewForCR();
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review Completed", "State expected not in 'Pre-Review Completed'.  State currently:  " + workspace.GetStudyState());

            // As the assigned IRBC, Assign Designated Reviewer.
            workspace.AssignDesignatedReviewer("Harry Smith (comm4)");
            Assert.IsTrue(workspace.GetStudyState() == "Non-Committee Review", "State expected not in 'Non-Committee Review'.  State currently:  " + workspace.GetStudyState());

            // Log in as the Designated Reviewer and Submit Designated Review (human research not engaged determination).
            Store.LoginAsUser(Users.Comm4);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitDesignatedReviewForStudy(SubmitDesignatedReview.StudyDeterminations.ModificationsRequiredToSecureApproved, "These are comments for the modification!  :/ ", true);
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned IRB Coordinator, Finalize Documents.
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.FinalizeDocuments();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Modifications Required", "State expected not in 'Modifications Required'.  State currently:  " + workspace.GetStudyState());

            // Log in as the PI and Submit Response.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitResponse(Users.Pi.UserName, Users.Pi.Password, "This is my response!  :P");
            Assert.IsTrue(workspace.GetStudyState() == "Modifications Submitted", "State expected not in 'Modifications Submitted'.  State currently:  " + workspace.GetStudyState());

            // Log in as the assigned IRB Coordinator, Review Required Modifications (Yes to the question “Were the modifications completed as required?” “yes” response)
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.ReviewRequiredModifications();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Approved", "State expected not in 'Approved'.  State currently:  " + workspace.GetStudyState());
        }
Ejemplo n.º 18
0
 public Channel(int code)
 {
     Code   = code;
     Random = new Random();
     Data   = DataGen.RandomWalk(Random, 500);
 }
Ejemplo n.º 19
0
        public void ContinuingReviewThroughCommitteeReviewToDeferred()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            EntityClonerUtil.CloneEntity("STUDY00000024", targetStudy, true);

            var CRSmartForm        = new InitialModCrSmartForm();
            var workspace          = new IRBWorkspace();
            var irbSubmissionsPage = new IRBSubmissions();
            var actionsNav         = new ActionsNav();

            //Log in as the PI to an Approved study and select Create Modification/CR. Select “Continuing Review”  and on the Continuing Review/Study Closure Information select the top 4 Research milestones.
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            actionsNav.ImgCreateModCr.Click();

            // Fill in just required info
            CRSmartForm.ChooseModCRPurpose(SubmissionPurpose.ContinuingReview);
            CRSmartForm.BtnContinue.Click();

            CRSmartForm.SpecifyEnrollmentTotals("2", "2", "1");
            CRSmartForm.ChooseResearchMilestone(InitialModCrSmartForm.MileStones.StudyPermanentlyClosedToEnrollment, InitialModCrSmartForm.MileStones.AllSubjectCompletedStudyRelatedInterventions,
                                                InitialModCrSmartForm.MileStones.CollectionOfPrivateInfoComplete, InitialModCrSmartForm.MileStones.AnalysisOfPrivateInfoComplete);
            CRSmartForm.RdoFinancialInterestNo.Click();
            CRSmartForm.BtnContinue.Click();
            CRSmartForm.BtnFinish.Click();

            //As the PI, Submit the Continuing Review.
            workspace.Submit(Users.Pi.UserName, Users.Pi.Password);
            Assert.IsTrue(new Link(By.LinkText("Submitted")).Exists, "'Submitted' activity not found for:  " + targetStudy);
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review", "State expected not in 'Pre-Review'.  State currently: " + workspace.GetStudyState());
            var CRName = Web.PortalDriver.Title;

            //Log in as the assigned coordinator and Submit Pre-Review
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.SubmitPreReviewForCR();

            // Log in as an IRB coordinator and Assign Coordinator
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(CRName);
            workspace.AssignCoordinator("Orlando Max (irbc)");

            //As the assigned coordinator, Assign Meeting.
            workspace.AssignMeetingByFirstMeeting();
            Assert.IsTrue(workspace.GetStudyState() == "Committee Review");

            //As the assigned coordinator, Submit Committee Review (approved determination).
            // need determination, risk level
            workspace.SubmitCommitteeReview(SubmitCommitteeReviewPopup.Determinations.Deferred, "2", "0", "0", "0", "0", "", true);
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned IRB Coordinator, Finalize Documents.
            workspace.FinalizeDocuments();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            //As the assigned coordinator, Prepare Letter.
            workspace.PrepareLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Post-Review", "State expected not in 'Post-Review'.  State currently:  " + workspace.GetStudyState());

            // As the assigned coordinator, Send Letter.
            workspace.SendLetter();
            Assert.IsTrue(workspace.GetStudyState() == "Deferred", "State expected not in 'Deferred'.  State currently:  " + workspace.GetStudyState());
        }
Ejemplo n.º 20
0
 public void Render(Plot plt)
 {
     double[,] imageData = DataGen.SampleImageData();
     plt.PlotHeatmap(imageData);
 }
Ejemplo n.º 21
0
        public MainWindow()
        {
            const string versionText   = "Blinklicht Fibonacci";
            const string versionNummer = "V2.0";

            const int anzByteDigInput     = 1;
            const int anzByteDigOutput    = 1;
            const int anzByteAnalogInput  = 0;
            const int anzByteAnalogOutput = 0;


            VersionInfoLokal = versionText + " " + versionNummer;

            Datenstruktur     = new Datenstruktur(anzByteDigInput, anzByteDigOutput, anzByteAnalogInput, anzByteAnalogOutput);
            ConfigPlc         = new ConfigPlc.Plc("./ConfigPlc");
            BeschriftungenPlc = new BeschriftungenPlc();

            var viewModel = new ViewModel.ViewModel(this);

            InitializeComponent();
            DataContext = viewModel;

            DatenRangieren = new DatenRangieren(viewModel);
            PlcDaemon      = new PlcDaemon(Datenstruktur, DatenRangieren.Rangieren);
            DatenRangieren.ReferenzUebergeben(PlcDaemon.Plc);

            DisplayPlc = new DisplayPlc.DisplayPlc(Datenstruktur, ConfigPlc, BeschriftungenPlc);

            TestAutomat = new TestAutomat.TestAutomat(Datenstruktur, DisplayPlc.EventBeschriftungAktualisieren, BeschriftungenPlc, PlcDaemon.Plc);
            TestAutomat.SetTestConfig("./ConfigTests/");
            TestAutomat.TabItemFuellen(TabItemAutomatischerSoftwareTest, DisplayPlc);

            Closing += (_, e) =>
            {
                e.Cancel = true;
                Schliessen();
            };

            var zeitachse = DataGen.Consecutive(5000);

            WpfPlot.Plot.XAxis.Label("Zeit [ms]");
            WpfPlot.Plot.YLabel("Leuchtmelder");
            WpfPlot.Plot.AddScatter(zeitachse, WertLeuchtMelder, Color.Magenta, 1, 1, MarkerShape.none, LineStyle.Solid, "LED");

            // create a timer to modify the data
            var updateDataTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(10)
            };

            updateDataTimer.Tick += UpdateData;
            updateDataTimer.Start();

            // create a timer to update the GUI
            var renderTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(10)
            };

            renderTimer.Tick += Render;
            renderTimer.Start();

            Datenstruktur.BetriebsartProjekt = BetriebsartProjekt.Simulation;
        }
Ejemplo n.º 22
0
 public void ExecuteRecipe(Plot plt)
 {
     OHLC[] prices = DataGen.RandomStockPrices(null, 60);
     plt.AddOHLCs(prices);
 }
Ejemplo n.º 23
0
        public void AddRelatedGrant()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            CloneEntity("STUDY00000017", targetStudy);

            var ActionsNav             = new ActivitiesNav();
            var AddRelatedGrantPopup   = new AddRelatedGrant("STUDY-" + targetStudy, "Add Related Grant");
            var ClickIRBGrantInfoPopup = new AddClickIRBGrantInfo();
            var Inbox = new Inbox();

            //var SelectPersonsPage = new ChooserPopup("Persons", true);

            Store.LoginAsUser(Users.Irbd);
            ActionsNav.LnkSubmissions.Click();
            Inbox.LnkAdvanced.Click();
            Wait.Until(h => Inbox.QueryField1.Displayed);
            Inbox.QueryField1.SelectByInnerText("Name");
            Wait.Until(h => Inbox.QueryCriteria1.Enabled);
            Inbox.QueryCriteria1.Text = targetStudy;
            Wait.Until(d => Inbox.BtnGo.Enabled);
            Inbox.BtnGo.Click();
            Wait.Until(d => Inbox.BtnGo.Enabled);

            var studyForReview = new CCElement(By.LinkText(targetStudy));

            studyForReview.Click();

            ActionsNav.LnkAddRelatedGrant.Click();
            AddRelatedGrantPopup.SwitchTo();
            AddRelatedGrantPopup.BtnAdd.Click();
            ClickIRBGrantInfoPopup.SwitchTo();
            ClickIRBGrantInfoPopup.TxtGrantId.Value    = "Grant-" + DataGen.String(4);
            ClickIRBGrantInfoPopup.TxtGrantTitle.Value = "Grant Title Automation Test" + DataGen.String(4);
            ClickIRBGrantInfoPopup.BtnOk.Click();
            ClickIRBGrantInfoPopup.SwitchBackToParent();
            AddRelatedGrantPopup.BtnOk.Click();
            AddRelatedGrantPopup.SwitchBackToParent();

            Wait.Until(h => new CCElement(By.LinkText("Related Grants Updated")).Exists);
            Assert.IsTrue(new CCElement(By.LinkText("Related Grants Updated")).Exists, "'Related Grants Updated' activity not found for:  " + targetStudy);
        }
Ejemplo n.º 24
0
 public static void PlotHeatmapImage(Plot plt, Colormap cmap)
 {
     double[,] intensities = DataGen.SampleImageData();
     plt.Clear();
     plt.PlotHeatmap(intensities, cmap);
 }
Ejemplo n.º 25
0
        public void test()
        {
            string targetStudy = "AutoTest-" + DataGen.String(5);

            EntityClonerUtil.CloneEntity("STUDY00000024", targetStudy, true);
        }
Ejemplo n.º 26
0
 public DataFactory()
 {
     ohlcs = DataGen.RandomStockPrices(rand, 20000, sequential: true);
 }
Ejemplo n.º 27
0
        public void ExecuteRecipe(Plot plt)
        {
            (double[] xs, double[] ys) = DataGen.RandomWalk2D(new Random(0), 5_000);

            plt.AddSignalXY(xs, ys);
        }
Ejemplo n.º 28
0
            public void Render(Plot plt)
            {
                Random rand = new Random(0);

                plt.PlotErrorBars(
                    xs: DataGen.Random(rand, 10, 10),
                    ys: DataGen.Random(rand, 10, 10),
                    xPositiveError: DataGen.Random(rand, 10),
                    xNegativeError: DataGen.Random(rand, 10),
                    yPositiveError: DataGen.Random(rand, 10),
                    yNegativeError: DataGen.Random(rand, 10),
                    label: "error bars"
                    );

                var func = new Func <double, double?>((x) => Math.Sin(x) * Math.Sin(10 * x) + 3);

                plt.PlotFunction(func, label: "function", lineWidth: 2);

                var func2 = new Func <double, double?>((x) => Math.Sin(x) * Math.Sin(10 * x) + 5);

                plt.PlotFunction(func2, label: null); // null labels will not appear in legend

                plt.PlotHLine(7.75, label: "horizontal line", lineStyle: LineStyle.Dot);
                plt.PlotVLine(7.75, label: "vertical line", lineStyle: LineStyle.Dash);

                plt.PlotHSpan(1.5, 2.5, label: "horizontal span");
                plt.PlotVSpan(1.5, 2.5, label: "vertical span");

                plt.PlotOHLC(new OHLC[] {
                    new OHLC(5, 6, 4, 5.5, 1),
                    new OHLC(6, 7.5, 3.5, 4.75, 1.5),
                    new OHLC(5.5, 6, 3, 4.5, 2)
                });

                plt.PlotCandlestick(new OHLC[] {
                    new OHLC(5, 6, 4, 5.5, 3),
                    new OHLC(6, 7.5, 3.5, 4.75, 3.5),
                    new OHLC(5.5, 6, 3, 4.5, 4)
                });

                plt.PlotScatter(
                    xs: new double[] { 5, 5.5, 6, 7, 7, 6 },
                    ys: new double[] { 7, 8, 7, 9, 7, 8 },
                    lineStyle: LineStyle.Dash,
                    lineWidth: 2,
                    markerShape: MarkerShape.openCircle,
                    markerSize: 10,
                    label: "Scatter Plot"
                    );

                plt.PlotSignal(
                    ys: DataGen.RandomNormal(rand, 10),
                    sampleRate: 5,
                    xOffset: 3,
                    yOffset: 8,
                    label: "Signal Plot"
                    );

                plt.PlotText("ScottPlot", 6, 6, rotation: 25, fontSize: 14, bold: true);

                plt.PlotPoint(1, 9, label: "point");
                plt.PlotArrow(8, 8, 8.5, 8.5, label: "arrow");

                plt.SetAxisLimits(0, 13, -1, 11);
                plt.Legend();
                plt.Grid(false);
            }
        //private static ScottPlot.Plot plt = new ScottPlot.Plot(600,400);
        public static double[] loads(ExcelBuilding building, string month, float dischargeThreshold = 40000f)
        {
            //ScottPlot.Plot plt = new Plot();
            double[] loadValues = null;
            double[] xs;
            switch (month)
            {
            case "January":
                loadValues = building.JanuaryLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "February":
                loadValues = building.FebruaryLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "March":
                loadValues = building.MarchLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "April":
                loadValues = building.AprilLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "May":
                loadValues = building.MayLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "June":
                loadValues = building.JuneLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "July":
                loadValues = building.JulyLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "August":
                loadValues = building.AugustLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "September":
                loadValues = building.SeptemberLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "October":
                loadValues = building.OctoberLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "November":
                loadValues = building.NovemberLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;

            case "December":
                loadValues = building.DecemberLoads.ToArray();
                xs         = DataGen.Range(loadValues.Count());
                //plt.PlotScatter(xs, loadValues);
                break;
            }

            return(loadValues);
        }