Пример #1
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));
        }