Ejemplo n.º 1
0
        //导出excel
        public ActionResult GropingExcel(int udg_id, int ExperimentalId, int grop)
        {
            var strFullName = "";

            try
            {
                UpDownExperiment   upDownExperiment = dbDrive.GetUpDownExperiment(ExperimentalId);
                List <UpDownView>  upDownViews      = dbDrive.GetUpDownViews(udg_id);
                List <UpDownView>  upDownViews1     = dbDrive.GetUpDownViews_UDEID(ExperimentalId);
                List <UpDownGroup> list_udg         = dbDrive.GetUpDownGroups(ExperimentalId);
                var      lr     = LiftingPublic.SelectState(upDownExperiment);
                int[]    nj     = new int[list_udg.Count];
                double[] Gj     = new double[list_udg.Count];
                double[] Hj     = new double[list_udg.Count];
                double[] muj    = new double[list_udg.Count];
                double[] sigmaj = new double[list_udg.Count];
                for (int i = 0; i < list_udg.Count; i++)
                {
                    List <UpDownDataTable> upDownDataTables = dbDrive.GetUpDownDataTables(list_udg[i].Id);
                    var xAndV = LiftingPublic.GetXArrayAndVArray(upDownDataTables, upDownExperiment);
                    var up    = lr.GetReturn(xAndV.xArray, xAndV.vArray, upDownDataTables[0].dtup_Standardstimulus, list_udg[i].dudt_Stepd, out double z, upDownExperiment.udt_Instrumentresolution, out double z1);
                    nj[i]     = up.n;
                    Gj[i]     = up.G;
                    Hj[i]     = up.H;
                    muj[i]    = up.μ0_final;
                    sigmaj[i] = up.σ0_final;
                }
                strFullName = FreeSpire.UpDownFreeSpireExcel(upDownExperiment, upDownViews, grop, upDownViews1, nj, Gj, Hj, muj, sigmaj, lr, list_udg);
            }
            catch (Exception ex) { }
            return(Json(strFullName, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        private static QueryModel GetQueryModel(IDbDrive dbDrive, UpDownExperiment ude, LiftingAlgorithm lr)
        {
            QueryModel query = new QueryModel();

            query.id = ude.id;
            query.InitialStimulus      = ude.udt_Initialstimulus;
            query.StepLength           = ude.udt_Stepd;
            query.Groping              = ude.udt_Groupingstate;
            query.PublishStatusMethods = DistributionState(lr);
            query.pow = ude.udt_Power;
            List <UpDownGroup> upDownGroups = dbDrive.GetUpDownGroups(ude.id);

            query.udg_id      = upDownGroups[0].Id;
            query.GroupNumber = upDownGroups.Count;
            List <UpDownView> upDownViews = dbDrive.GetUpDownViews_UDEID(ude.id);

            query.TotalNumberSaples = upDownViews.Count;
            query.FilpResponse      = ude.udt_Flipresponse;
            query.DateTime          = ude.udt_Creationtime.ToString();
            query.projectname       = ude.udt_ProdectName;
            return(query);
        }