示例#1
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));
        }
示例#2
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));
        }
示例#3
0
        public ActionResult UpdateUPparSeting()
        {
            var sr     = new StreamReader(Request.InputStream);
            var stream = sr.ReadToEnd();
            JavaScriptSerializer js = new JavaScriptSerializer();
            UpDownExperiment     upDownExperiment = ude;

            upDownExperiment.udt_Distribution = js.Deserialize <UpDownExperiment>(stream).udt_Distribution;
            var isTure = dbDrive.Update(upDownExperiment);

            double[] xArray = new double[udv.Count];
            int[]    vArray = new int[udv.Count];
            for (int i = 0; i < udv.Count; i++)
            {
                xArray[i] = udv[i].dtup_Standardstimulus;
                vArray[i] = LiftingPublic.Filp(udv[i].dtup_response, upDownExperiment.udt_Flipresponse);
            }
            var lr = LiftingPublic.SelectState(upDownExperiment);
            var up = lr.GetReturn(xArray, vArray, upDownExperiment.udt_Initialstimulus, upDownExperiment.udt_Stepd, out double z, upDownExperiment.udt_Instrumentresolution, out double z1);

            double[] prec  = lr.GetPrec(up.μ0_final, up.σ0_final);
            var      group = upDownExperiment.udt_Groupingstate == 0 ? "不分组" : "多组试验";

            double[] rpse = lr.ResponsePointStandardError(up.Sigma_mu, up.Sigma_sigma);
            string[] str  = { isTure.ToString(), up.μ0_final.ToString(), up.σ0_final.ToString(), up.Sigma_mu.ToString(), up.Sigma_sigma.ToString(), up.A.ToString(), up.M.ToString(), up.B.ToString(), up.b.ToString(), prec[1].ToString(), prec[0].ToString(), rpse[0].ToString(), rpse[1].ToString(), up.p.ToString(), up.G.ToString(), up.n.ToString(), up.H.ToString(), "升降法:" + lr.DistributionNameAndMethodStandardName() + "/" + group };//[0]表示修改状态,[1]代表修改后的试验参数
            return(Json(str));
        }
示例#4
0
        public ActionResult UpDownMethod(int udg_id)
        {
            UpDownMethodModel  upDM             = new UpDownMethodModel();
            UpDownGroup        upDownGroup      = dbDrive.GetDownGroup(udg_id);
            UpDownExperiment   upDownExperiment = dbDrive.GetUpDownExperiment(upDownGroup.dudt_ExperimentId);
            List <UpDownGroup> upDownGroups     = dbDrive.GetUpDownGroups(upDownExperiment.id);
            var lr = LiftingPublic.SelectState(upDownExperiment);

            upDM.id                    = udg_id;
            upDM.ExperimentalId        = upDownGroup.dudt_ExperimentId;
            upDM.ExperimentalLabelName = lr.DistributionNameAndMethodStandardName();
            upDM.ProductName           = upDownExperiment.udt_ProdectName;
            upDM.Groupingstate         = upDownExperiment.udt_Groupingstate == 0 ? "不分组" : "多组试验";
            upDM.IsLastGroup           = upDownGroups[0].Id == udg_id ? true : false;
            int count = 0;

            for (int i = 0; i < upDownGroups.Count; i++)
            {
                count++;
                if (upDownGroups[i].Id == udg_id)
                {
                    break;
                }
            }
            upDM.GroupNumber = count;
            return(View(upDM));
        }
示例#5
0
        //设置升降法初始参数
        public ActionResult ParameterSettingData()
        {
            var sr     = new StreamReader(Request.InputStream);
            var stream = sr.ReadToEnd();
            JavaScriptSerializer js         = new JavaScriptSerializer();
            UpDownExperiment     experiment = js.Deserialize <UpDownExperiment>(stream);

            experiment.udt_Creationtime     = DateTime.Now;
            experiment.udt_RecordEmployeeId = LangleyPublic.adminId;
            dbDrive.Insert(experiment);
            UpDownGroup upDownGroup = new UpDownGroup();

            upDownGroup.dudt_ExperimentId = experiment.id;
            upDownGroup.dudt_Stepd        = experiment.udt_Stepd;
            dbDrive.Insert(upDownGroup);
            UpDownDataTable upDownDataTable = new UpDownDataTable();

            upDownDataTable.dtup_DataTableId      = upDownGroup.Id;
            upDownDataTable.dtup_Standardstimulus = LiftingPublic.SelectState(experiment).GetStandardStimulus(experiment.udt_Initialstimulus);
            upDownDataTable.dtup_Initialstimulus  = experiment.udt_Initialstimulus;
            upDownDataTable.dtup_response         = 0;
            var isTure = dbDrive.Insert(upDownDataTable);

            string[] str = { isTure.ToString(), upDownGroup.Id.ToString(), experiment.udt_ProdectName };
            return(Json(str));//需要传输本次实验的ID
        }
示例#6
0
        public ActionResult Fchs_ResponsePointIntervalEstimation(int ExperimentalId, double Fchs_StimulusQuantity, double cjl_zxsp, int textNumber, double favg, double fsigma, double fsigmaavg, double fsigmasigma)
        {
            UpDownExperiment upDownExperiment = dbDrive.GetUpDownExperiment(ExperimentalId);
            var vfr = LiftingPublic.SelectState(upDownExperiment).VarianceFunctionResponsePointIntervalEstimated(cjl_zxsp, textNumber, Fchs_StimulusQuantity, favg, fsigma, fsigmaavg, fsigmasigma);

            string[] value = { "(" + vfr[1].ToString("f6") + "," + vfr[0].ToString("f6") + ")", "(" + vfr[3].ToString("f6") + "," + vfr[2].ToString("f6") + ")", "(" + vfr[5].ToString("f6") + "," + vfr[4].ToString("f6") + ")", "(" + vfr[7].ToString("f6") + "," + vfr[6].ToString("f6") + ")" };
            return(Json(value));
        }
示例#7
0
        public ActionResult Likelihood(double BatchConfidenceLevel, double yMin, double yMax, int Y_Axis, int intervalTypeSelection, double favg, double fsigma, int ExperimentalId, int udg_id)
        {
            UpDownExperiment       ude      = dbDrive.GetUpDownExperiment(ExperimentalId);
            List <UpDownDataTable> list_udt = dbDrive.GetUpDownDataTables(udg_id);
            var lr = LiftingPublic.SelectState(ude);

            double[] xArray = new double[list_udt.Count];
            int[]    vArray = new int[list_udt.Count];
            for (int i = 0; i < list_udt.Count; i++)
            {
                xArray[i] = list_udt[i].dtup_Initialstimulus;
                vArray[i] = LiftingPublic.Filp(list_udt[i].dtup_response, ude.udt_Flipresponse);
            }
            var srd = lr.QuasiLikelihoodRatioMethod(yMax, yMin, Y_Axis, BatchConfidenceLevel, favg, fsigma, xArray, vArray, intervalTypeSelection);

            LangleyPublic.sideReturnData = srd;
            LangleyPublic.aArray.Clear();
            LangleyPublic.bArray.Clear();
            LangleyPublic.cArray.Clear();
            double ceiling = srd.responsePoints.Min();
            double lower   = srd.responsePoints.Max();

            for (int i = 0; i < srd.responseProbability.Length; i++)
            {
                LangleyPublic.aArray.Add("[" + srd.responsePoints[i] + "," + srd.responseProbability[i] + "]");
                if (double.IsInfinity(srd.Y_Ceilings[i]))
                {
                    LangleyPublic.bArray.Add("[" + lower + "," + srd.responseProbability[i] + "]");
                }
                else
                {
                    LangleyPublic.bArray.Add("[" + srd.Y_Ceilings[i] + "," + srd.responseProbability[i] + "]");
                }
                if (double.IsInfinity(srd.Y_LowerLimits[i]))
                {
                    LangleyPublic.cArray.Add("[" + ceiling + "," + srd.responseProbability[i] + "]");
                }
                else
                {
                    LangleyPublic.cArray.Add("[" + srd.Y_LowerLimits[i] + "," + srd.responseProbability[i] + "]");
                }
            }
            if (intervalTypeSelection == 0)
            {
                LangleyPublic.incredibleIntervalType = "拟然比区间计算-单侧置信区间";
            }
            else
            {
                LangleyPublic.incredibleIntervalType = "拟然比区间计算-双侧置信区间";
            }
            LangleyPublic.incredibleLevelName = BatchConfidenceLevel.ToString();
            return(Json(true));
        }
示例#8
0
        [HttpPost]//计算当前组数据
        public ActionResult CalculateCurrentData(int udg_id)
        {
            List <UpDownView> list_udv         = dbDrive.GetUpDownViews(udg_id);
            UpDownExperiment  upDownExperiment = dbDrive.GetUpDownExperiment(list_udv[0].dudt_ExperimentId);
            var lr = LiftingPublic.SelectState(upDownExperiment);
            var up = LiftingPublic.Upanddown(list_udv, upDownExperiment, lr);

            double[] prec  = lr.GetPrec(up.μ0_final, up.σ0_final);
            double[] rpse  = lr.ResponsePointStandardError(up.Sigma_mu, up.Sigma_sigma);
            string[] value = { up.μ0_final.ToString(), up.σ0_final.ToString(), up.Sigma_mu.ToString(), up.Sigma_sigma.ToString(), up.A.ToString(), up.M.ToString(), up.B.ToString(), up.b.ToString(), prec[0].ToString(), prec[1].ToString(), rpse[0].ToString(), rpse[1].ToString(), up.p.ToString(), up.G.ToString(), up.n.ToString(), up.H.ToString() };
            return(Json(value));
        }
示例#9
0
        //新增多组实验页面
        public ActionResult Manyexperiments(string ExperimentalId, string average, string standardDeviation)
        {
            int Experimentalid = Int32.Parse(ExperimentalId);
            ManyexperimentsModel manyexperimentsModel = new ManyexperimentsModel();
            List <UpDownGroup>   list_udg             = dbDrive.GetUpDownGroups(Experimentalid);
            UpDownExperiment     upDownExperiment     = dbDrive.GetUpDownExperiment(Experimentalid);

            manyexperimentsModel.previousSetNumber = list_udg[list_udg.Count - 1].dudt_Stepd;
            manyexperimentsModel.currentSetNumber  = list_udg.Count + 1;
            manyexperimentsModel.ProductName       = upDownExperiment.udt_ProdectName;
            manyexperimentsModel.stimulusQuantity  = average;
            manyexperimentsModel.stepLength        = standardDeviation;
            manyexperimentsModel.distribution      = LiftingPublic.SelectState(upDownExperiment).DistributionNameAndMethodStandardName();
            return(View(manyexperimentsModel));
        }
示例#10
0
        public ActionResult ResponsePointIntervalEstimation(int ExperimentalId, int udg_id, double Srb_ProbabilityResponse, double Srb_Confidencelevel, double fq, double favg, double fsigma)
        {
            List <UpDownView> list_udv         = dbDrive.GetUpDownViews(udg_id);
            UpDownExperiment  upDownExperiment = dbDrive.GetUpDownExperiment(ExperimentalId);

            double[] xArray = new double[list_udv.Count];
            int[]    vArray = new int[list_udv.Count];
            for (int i = 0; i < list_udv.Count; i++)
            {
                xArray[i] = list_udv[i].dtup_Initialstimulus;
                vArray[i] = LiftingPublic.Filp(list_udv[i].dtup_response, upDownExperiment.udt_Flipresponse);
            }
            var ies = LiftingPublic.SelectState(upDownExperiment).ResponsePointIntervalEstimated(Srb_ProbabilityResponse, Srb_Confidencelevel, xArray, vArray, fq, favg, fsigma);

            string[] str = { "(" + ies[0].Confidence.Down.ToString("f6") + "," + ies[0].Confidence.Up.ToString("f6") + ")", "(" + ies[0].Mu.Down.ToString("f6") + "," + ies[0].Mu.Up.ToString("f6") + ")", "(" + ies[0].Sigma.Down.ToString("f6") + "," + ies[0].Sigma.Up.ToString("f6") + ")", "(" + ies[1].Confidence.Down.ToString("f6") + "," + ies[1].Confidence.Up.ToString("f6") + ")", "(" + ies[1].Mu.Down.ToString("f6") + "," + ies[1].Mu.Up.ToString("f6") + ")", "(" + ies[1].Sigma.Down.ToString("f6") + "," + ies[1].Sigma.Up.ToString("f6") + ")" };
            return(Json(str));
        }
示例#11
0
        public ActionResult Variancefunction(double BatchConfidenceLevel, double yMin, double yMax, int Y_Axis, int intervalTypeSelection, double favg, double fsigma, int ExperimentalId, int textNumber, double fsigmaavg, double fsigmasigma)
        {
            UpDownExperiment ude = dbDrive.GetUpDownExperiment(ExperimentalId);
            var lr  = LiftingPublic.SelectState(ude);
            var srd = lr.VarianceFunctionMethod(yMax, yMin, Y_Axis, BatchConfidenceLevel, favg, fsigma, intervalTypeSelection, textNumber, fsigmaavg, fsigmasigma);

            LangleyPublic.sideReturnData = srd;
            LangleyPublic.aArray.Clear();
            LangleyPublic.bArray.Clear();
            LangleyPublic.cArray.Clear();
            double ceiling = srd.responsePoints.Min();
            double lower   = srd.responsePoints.Max();

            for (int i = 0; i < srd.responseProbability.Length; i++)
            {
                LangleyPublic.aArray.Add("[" + srd.responsePoints[i] + "," + srd.responseProbability[i] + "]");
                if (double.IsInfinity(srd.Y_Ceilings[i]))
                {
                    LangleyPublic.bArray.Add("[" + lower + "," + srd.responseProbability[i] + "]");
                }
                else
                {
                    LangleyPublic.bArray.Add("[" + srd.Y_Ceilings[i] + "," + srd.responseProbability[i] + "]");
                }
                if (double.IsInfinity(srd.Y_LowerLimits[i]))
                {
                    LangleyPublic.cArray.Add("[" + ceiling + "," + srd.responseProbability[i] + "]");
                }
                else
                {
                    LangleyPublic.cArray.Add("[" + srd.Y_LowerLimits[i] + "," + srd.responseProbability[i] + "]");
                }
            }
            if (intervalTypeSelection == 0)
            {
                LangleyPublic.incredibleIntervalType = "GJB377单侧区间估计方法";
            }
            else
            {
                LangleyPublic.incredibleIntervalType = "GJB377双侧区间估计方法";
            }
            LangleyPublic.incredibleLevelName = BatchConfidenceLevel.ToString();
            return(Json(true));
        }
示例#12
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));
        }
示例#13
0
        public ActionResult ManyexperimentsSetings(int ExperimentalId)
        {
            var sr     = new StreamReader(Request.InputStream);
            var stream = sr.ReadToEnd();
            JavaScriptSerializer js              = new JavaScriptSerializer();
            ManyexperimentsModel mm              = js.Deserialize <ManyexperimentsModel>(stream);
            UpDownGroup          upDownGroup     = new UpDownGroup();
            UpDownDataTable      upDownDataTable = new UpDownDataTable();

            upDownGroup.dudt_ExperimentId = ExperimentalId;
            upDownGroup.dudt_Stepd        = double.Parse(mm.stepLength);
            dbDrive.Insert(upDownGroup);
            upDownDataTable.dtup_DataTableId      = upDownGroup.Id;
            upDownDataTable.dtup_Initialstimulus  = double.Parse(mm.stimulusQuantity);
            upDownDataTable.dtup_Standardstimulus = LiftingPublic.SelectState(dbDrive.GetUpDownExperiment(ExperimentalId)).GetStandardStimulus(upDownDataTable.dtup_Initialstimulus);
            upDownDataTable.dtup_response         = 0;
            bool isTure = dbDrive.Insert(upDownDataTable);

            string[] value = { isTure.ToString(), upDownGroup.Id.ToString() };
            return(Json(value));
        }
示例#14
0
        public ActionResult ComprehensiveList(int ude_id)
        {
            List <ComprehensiveResultsModel> list_crm = new List <ComprehensiveResultsModel>();
            List <UpDownGroup> list_udg         = dbDrive.GetUpDownGroups(ude_id);
            UpDownExperiment   upDownExperiment = dbDrive.GetUpDownExperiment(ude_id);
            var lr = LiftingPublic.SelectState(upDownExperiment);

            for (int i = 0; i < list_udg.Count; i++)
            {
                ComprehensiveResultsModel comprehensiveResultsModel = new ComprehensiveResultsModel();
                List <UpDownView>         list_udv = dbDrive.GetUpDownViews(list_udg[i].Id);
                var      up   = LiftingPublic.Upanddown(list_udv, upDownExperiment, lr);
                double[] prec = lr.GetPrec(up.μ0_final, up.σ0_final);
                comprehensiveResultsModel.setNumber         = i + 1;
                comprehensiveResultsModel.stimulusQuantity  = list_udv[0].dtup_Initialstimulus;
                comprehensiveResultsModel.stepLength        = list_udv[0].dudt_Stepd;
                comprehensiveResultsModel.sampleNumber      = list_udv.Count();
                comprehensiveResultsModel.average           = up.μ0_final;
                comprehensiveResultsModel.standardDeviation = up.σ0_final;
                comprehensiveResultsModel.msde             = up.Sigma_mu;
                comprehensiveResultsModel.sdsde            = up.Sigma_sigma;
                comprehensiveResultsModel.temptationNumber = up.n;
                comprehensiveResultsModel.G             = up.G;
                comprehensiveResultsModel.H             = up.H;
                comprehensiveResultsModel.A             = up.A;
                comprehensiveResultsModel.B             = up.B;
                comprehensiveResultsModel.M             = up.M;
                comprehensiveResultsModel.b             = up.b;
                comprehensiveResultsModel.p             = up.p;
                comprehensiveResultsModel.percentage01  = prec[1];
                comprehensiveResultsModel.percentage999 = prec[0];
                list_crm.Add(comprehensiveResultsModel);
            }
            list_crm.Reverse();
            return(Json(new { code = "", msg = "", count = list_crm.Count(), data = list_crm }, JsonRequestBehavior.AllowGet));
        }
示例#15
0
        //单组试验结果数据
        public ActionResult GetAllsingleunitList(int udg_id)
        {
            List <UpDownView> list_udv         = dbDrive.GetUpDownViews(udg_id);
            UpDownExperiment  upDownExperiment = dbDrive.GetUpDownExperiment(list_udv[0].dudt_ExperimentId);
            var lr = LiftingPublic.SelectState(upDownExperiment);
            var up = LiftingPublic.Upanddown(list_udv, upDownExperiment, lr);
            List <SingleExperimentTable> singleExperimentTables = new List <SingleExperimentTable>();

            for (int w = 0; w < up.result_i.Length; w++)
            {
                SingleExperimentTable singleExperimentTable = new SingleExperimentTable();
                singleExperimentTable.i     = up.result_i[w];
                singleExperimentTable.i2    = up.result_i[w] * up.result_i[w];
                singleExperimentTable.i2mi1 = up.result_i[w] * up.result_i[w] * up.mi[w];
                singleExperimentTable.i2vi  = up.result_i[w] * up.result_i[w] * up.vi[w];
                singleExperimentTable.imi1  = up.result_i[w] * up.mi[w];
                singleExperimentTable.ivi   = up.result_i[w] * up.vi[w];
                singleExperimentTable.mi    = up.mi[w];
                singleExperimentTable.vi    = up.vi[w];
                singleExperimentTables.Add(singleExperimentTable);
            }
            //code--信息状态,默认为0,msg--返回信息,count--数据条数,data--数据
            return(Json(new { code = "", msg = "", count = up.result_i.Length, data = singleExperimentTables }, JsonRequestBehavior.AllowGet));
        }
示例#16
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));
        }
示例#17
0
        public ActionResult StimulusQuantity(int ExperimentalId, string average, string standardDeviation, double StimulusQuantityValue)
        {
            var rpc = LiftingPublic.SelectState(dbDrive.GetUpDownExperiment(ExperimentalId)).ResponseProbabilityCalculation(StimulusQuantityValue, double.Parse(average), double.Parse(standardDeviation));

            return(Json(rpc));
        }
示例#18
0
        public ActionResult ResponsePoint(int ExperimentalId, string average, string standardDeviation, double ResponsePointValue)
        {
            var rpc = LiftingPublic.SelectState(dbDrive.GetUpDownExperiment(ExperimentalId)).ResponsePointCalculation(ResponsePointValue, double.Parse(standardDeviation), double.Parse(average));

            return(Json(rpc));
        }