UploadMultiChronopic() private method

private UploadMultiChronopic ( MultiChronopic, myTest ) : int
myTest MultiChronopic,
return int
コード例 #1
0
ファイル: server.cs プロジェクト: dineshkummarc/chronojump
    //upload a test
    private static Constants.UploadCodes serverUploadTest(ChronojumpServer myServer, Constants.TestTypes type, string tableName, Event myTest)
    {
        Constants.UploadCodes uCode;

        if(myTest.Simulated == Constants.Simulated) {
            //Test is simulated, don't upload
            uCode = Constants.UploadCodes.SIMULATED;
        } else if(myTest.Simulated > 0) {
            //Test is already uploaded, don't upload
            uCode = Constants.UploadCodes.EXISTS;
        } else {
            int idAtServer = -1;
            switch (type) {
                case Constants.TestTypes.JUMP :
                    Jump jump = (Jump)myTest;
                    idAtServer = myServer.UploadJump(jump);
                    break;
                case Constants.TestTypes.JUMP_RJ :
                    JumpRj jumpRj = (JumpRj)myTest;
                    idAtServer = myServer.UploadJumpRj(jumpRj);
                    break;
                case Constants.TestTypes.RUN :
                    Run run = (Run)myTest;
                    idAtServer = myServer.UploadRun(run);
                    break;
                case Constants.TestTypes.RUN_I :
                    RunInterval runI = (RunInterval)myTest;
                    idAtServer = myServer.UploadRunI(runI);
                    break;
                case Constants.TestTypes.RT :
                    ReactionTime rt = (ReactionTime)myTest;
                    idAtServer = myServer.UploadRT(rt);
                    break;
                case Constants.TestTypes.PULSE :
                    Pulse pulse = (Pulse)myTest;
                    idAtServer = myServer.UploadPulse(pulse);
                    break;
                case Constants.TestTypes.MULTICHRONOPIC :
                    MultiChronopic mc = (MultiChronopic)myTest;
                    idAtServer = myServer.UploadMultiChronopic(mc);
                    break;
            }

            //update test (simulated) on client database
            myTest.Simulated = idAtServer;
            SqliteEvent.UpdateSimulated(true, tableName, myTest.UniqueID, idAtServer);

            uCode = Constants.UploadCodes.OK;
        }
        return uCode;
    }
コード例 #2
0
ファイル: server.cs プロジェクト: kleopatra999/chronojump
    //upload a test
    private static Constants.UploadCodes serverUploadTest(ChronojumpServer myServer, Constants.TestTypes type, string tableName, Event myTest)
    {
        Constants.UploadCodes uCode;

        if (myTest.Simulated == Constants.Simulated)
        {
            //Test is simulated, don't upload
            uCode = Constants.UploadCodes.SIMULATED;
        }
        else if (myTest.Simulated > 0)
        {
            //Test is already uploaded, don't upload
            uCode = Constants.UploadCodes.EXISTS;
        }
        else
        {
            int idAtServer = -1;
            switch (type)
            {
            case Constants.TestTypes.JUMP:
                Jump jump = (Jump)myTest;
                idAtServer = myServer.UploadJump(jump);
                break;

            case Constants.TestTypes.JUMP_RJ:
                JumpRj jumpRj = (JumpRj)myTest;
                idAtServer = myServer.UploadJumpRj(jumpRj);
                break;

            case Constants.TestTypes.RUN:
                Run run = (Run)myTest;
                idAtServer = myServer.UploadRun(run);
                break;

            case Constants.TestTypes.RUN_I:
                RunInterval runI = (RunInterval)myTest;
                idAtServer = myServer.UploadRunI(runI);
                break;

            case Constants.TestTypes.RT:
                ReactionTime rt = (ReactionTime)myTest;
                idAtServer = myServer.UploadRT(rt);
                break;

            case Constants.TestTypes.PULSE:
                Pulse pulse = (Pulse)myTest;
                idAtServer = myServer.UploadPulse(pulse);
                break;

            case Constants.TestTypes.MULTICHRONOPIC:
                MultiChronopic mc = (MultiChronopic)myTest;
                idAtServer = myServer.UploadMultiChronopic(mc);
                break;
            }


            //update test (simulated) on client database
            myTest.Simulated = idAtServer;
            SqliteEvent.UpdateSimulated(true, tableName, myTest.UniqueID, idAtServer);

            uCode = Constants.UploadCodes.OK;
        }
        return(uCode);
    }