예제 #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));
        }
예제 #2
0
        public ActionResult MultipleExperimentsCalculated(int ExperimentalId)
        {
            List <UpDownGroup> list_udg         = dbDrive.GetUpDownGroups(ExperimentalId);
            UpDownExperiment   upDownExperiment = dbDrive.GetUpDownExperiment(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];
            int      n      = 0;

            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_Initialstimulus, 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;
                n        += up.n;
            }
            var mtr = LiftingPublic.SelectState(dbDrive.GetUpDownExperiment(ExperimentalId)).MultigroupTestResult(nj, Gj, Hj, muj, sigmaj);

            string[] value = { mtr.μ0_final.ToString(), mtr.σ0_final.ToString(), mtr.Sigma_mu.ToString(), mtr.Sigma_sigma.ToString(), mtr.prec01.ToString(), mtr.prec999.ToString(), mtr.rpse01.ToString(), mtr.rpse999.ToString(), n.ToString() };
            return(Json(value));
        }
예제 #3
0
        public ActionResult RevocationData(int udg_id, int ExperimentalId)
        {
            List <UpDownDataTable> list_udt         = dbDrive.GetUpDownDataTables(udg_id);
            UpDownExperiment       upDownExperiment = dbDrive.GetUpDownExperiment(ExperimentalId);
            var lr    = LiftingPublic.SelectState(upDownExperiment);
            var xAndV = LiftingPublic.GetXArrayAndVArray(list_udt, upDownExperiment);

            if (list_udt.Count == 1)
            {
                string[] value = { "false", list_udt.Count.ToString(), list_udt[list_udt.Count - 1].dtup_Initialstimulus.ToString(), lr.StepsNumber(xAndV.xArray, xAndV.vArray).ToString() };
                return(Json(value));
            }

            UpDownDataTable        upDownDataTable = list_udt[list_udt.Count - 1];
            var                    isTure          = dbDrive.Delete(upDownDataTable);
            List <UpDownDataTable> list_udtDelete  = dbDrive.GetUpDownDataTables(udg_id);
            var                    xAndVDelete     = LiftingPublic.GetXArrayAndVArray(list_udtDelete, upDownExperiment);

            string[] valueDelete = { isTure.ToString(), (list_udt.Count - 1).ToString(), list_udtDelete[list_udtDelete.Count - 1].dtup_Initialstimulus.ToString(), lr.StepsNumber(xAndVDelete.xArray, xAndVDelete.vArray).ToString() };
            return(Json(valueDelete));
        }
예제 #4
0
        public ActionResult InsertData(string response, int udg_id, int ExperimentalId)
        {
            List <UpDownDataTable> list_udt         = dbDrive.GetUpDownDataTables(udg_id);
            UpDownGroup            upDownGroup      = dbDrive.GetDownGroup(udg_id);
            UpDownExperiment       upDownExperiment = dbDrive.GetUpDownExperiment(ExperimentalId);
            var lr = LiftingPublic.SelectState(upDownExperiment);

            list_udt[list_udt.Count - 1].dtup_response = int.Parse(response);
            var             xAndV           = LiftingPublic.GetXArrayAndVArray(list_udt, upDownExperiment);
            var             up              = lr.GetReturn(xAndV.xArray, xAndV.vArray, upDownExperiment.udt_Initialstimulus, upDownGroup.dudt_Stepd, out double z, upDownExperiment.udt_Instrumentresolution, out double z1);
            UpDownDataTable upDownDataTable = new UpDownDataTable();

            upDownDataTable.dtup_DataTableId      = udg_id;
            upDownDataTable.dtup_Initialstimulus  = z1;
            upDownDataTable.dtup_response         = 0;
            upDownDataTable.dtup_Standardstimulus = z;
            bool isTure = dbDrive.Insert(upDownDataTable);
            List <UpDownGroup>     list_udg       = dbDrive.GetUpDownGroups(upDownExperiment.id);
            List <UpDownDataTable> list_udtInsert = dbDrive.GetUpDownDataTables(udg_id);
            var xAndVInsert = LiftingPublic.GetXArrayAndVArray(list_udtInsert, upDownExperiment);

            string[] value = { isTure.ToString(), LiftingPublic.CurrentSetNumber(list_udg, udg_id).ToString(), (list_udtInsert.Count).ToString(), lr.StepsNumber(xAndVInsert.xArray, xAndVInsert.vArray).ToString(), z1.ToString() };
            return(Json(value));
        }