示例#1
0
    private void exhibitionGuiAtStart(ExhibitionTest.testTypes exhibitionStationType)
    {
        if (exhibitionStationType == ExhibitionTest.testTypes.JUMP)
        {
            on_button_selector_start_jumps_simple_clicked(new object(), new EventArgs());
        }
        else if (exhibitionStationType == ExhibitionTest.testTypes.RUN)
        {
            on_button_selector_start_runs_simple_clicked(new object(), new EventArgs());
        }
        else if (exhibitionStationType == ExhibitionTest.testTypes.INERTIAL)
        {
            on_button_selector_start_encoder_inertial_clicked(new object(), new EventArgs());
        }
        else if (exhibitionStationType == ExhibitionTest.testTypes.FORCE_ROPE ||
                 exhibitionStationType == ExhibitionTest.testTypes.FORCE_SHOT)
        {
            on_button_selector_start_force_sensor_clicked(new object(), new EventArgs());
        }

        menuitem_open_session.Sensitive     = false;     //do not allow menu open to work (it could be really slow)
        frame_exhibition.Visible            = true;
        notebook_session_person.CurrentPage = 1;
        frame_persons.Sensitive             = true;
        frame_persons_top.Visible           = false;
        spin_exhibition_school.Value        = 0;  //need to assign an inital value (if not it shows blank value)
        spin_exhibition_group.Value         = 0;

        button_persons_up.SetSizeRequest(45, 10);
        button_persons_down.SetSizeRequest(45, 10);
    }
示例#2
0
 //read from the widgets
 //read testTypes and result
 private ExhibitionTest getExhibitionTestFromGui(ExhibitionTest.testTypes tt, double result)
 {
     return(new ExhibitionTest(Convert.ToInt32(spin_exhibition_school.Value),
                               Convert.ToInt32(spin_exhibition_group.Value),
                               currentPerson.UniqueID, tt, result));
 }
示例#3
0
    public void Read()
    {
        string contents = Util.ReadFile(UtilAll.GetConfigFileName(), false);

        if (contents != null && contents != "")
        {
            string line;
            using (StringReader reader = new StringReader(contents)) {
                do
                {
                    line = reader.ReadLine();

                    if (line == null)
                    {
                        break;
                    }
                    if (line == "" || line[0] == '#')
                    {
                        continue;
                    }

                    string [] parts = line.Split(new char[] { '=' });
                    if (parts.Length != 2)
                    {
                        continue;
                    }

                    if (parts[0] == "Compujump" && Util.StringToBool(parts[1]))
                    {
                        Compujump = true;
                    }
                    else if (parts[0] == "CompujumpServerURL" && parts[1] != "")
                    {
                        CompujumpServerURL = parts[1];
                    }
                    else if (parts[0] == "CompujumpStationID" && parts[1] != "" && Util.IsNumber(parts[1], false))
                    {
                        CompujumpStationID = Convert.ToInt32(parts[1]);
                    }
                    else if (parts[0] == "CompujumpAdminID" && parts[1] != "" && Util.IsNumber(parts[1], false))
                    {
                        CompujumpAdminID = Convert.ToInt32(parts[1]);
                    }
                    else if (parts[0] == "CompujumpAdminEmail" && parts[1] != "")
                    {
                        CompujumpAdminEmail = parts[1];
                    }
                    else if (parts[0] == "CompujumpStationMode" && Enum.IsDefined(typeof(Constants.Menuitem_modes), parts[1]))
                    {
                        CompujumpStationMode = (Constants.Menuitem_modes)
                                               Enum.Parse(typeof(Constants.Menuitem_modes), parts[1]);
                    }
                    else if (parts[0] == "SessionMode" && Enum.IsDefined(typeof(SessionModeEnum), parts[1]))
                    {
                        SessionMode = (SessionModeEnum)
                                      Enum.Parse(typeof(SessionModeEnum), parts[1]);
                    }
                    else if (parts[0] == "PlaySoundsFromFile" && Util.StringToBool(parts[1]))
                    {
                        PlaySoundsFromFile = true;
                    }
                    else if (parts[0] == "Exhibition" && Util.StringToBool(parts[1]))
                    {
                        Exhibition = true;
                    }
                    else if (parts[0] == "ExhibitionStationType" && Enum.IsDefined(typeof(ExhibitionTest.testTypes), parts[1]))
                    {
                        ExhibitionStationType = (ExhibitionTest.testTypes)
                                                Enum.Parse(typeof(ExhibitionTest.testTypes), parts[1]);
                    }

                    /*
                     * else if(parts[0] == "ExhibitionServerURL" && parts[1] != "")
                     *      ExhibitionServerURL = parts[1];
                     * else if(parts[0] == "ExhibitionStationID" && parts[1] != "" && Util.IsNumber(parts[1], false))
                     *      ExhibitionStationID = Convert.ToInt32(parts[1]);
                     */
                } while(true);
            }
        }
    }