Exemple #1
0
        public UserDisplay(Display display)
        {
            InitializeComponent();

            mainDisplay = display;
            cogSettings = new CognitiveLoadSettings(mainDisplay);
            inputSettings = new InputSettings(mainDisplay);

            ObjectSelect.SelectedIndex = mainDisplay.getObjectId();
            StationaryObjectsList.SelectedIndex = 0;
            AppearBehaviour.SelectedIndex = 0; //Implement setters for choices *ToDo
            CarActivation.SelectedIndex = 0;
            CarBehaviour.SelectedIndex = 0;

            SteeringWheelSenseSet.Value = mainDisplay.steeringSensitivity;
            SteeringWheelSensScroll.Value = (int)SteeringWheelSenseSet.Value;
            TransmissionEffSet.Value = (int)(mainDisplay.transmissionEfficiency * 100);
            TransmissionEffScroll.Value = (int)TransmissionEffSet.Value;
            BrakeForceSet.Value = (int)mainDisplay.brakeMax;
            BrakeForceScroll.Value = (int)BrakeForceSet.Value;
            SimStepSet.Value = (int)mainDisplay.msPerUpdate;
            SimStepScroll.Value = (int)SimStepSet.Value;
            RTriggerFactor.Value = (int)mainDisplay.rTriggerMax;

            saveData.InitialDirectory = mainDisplay.getFileName();
            initialized = true;
            this.BringToFront();
        }
Exemple #2
0
        private double wheelRadius = 0.45; // IN METERS, NEEDS TO BE PART OF CLASS

        #endregion Fields

        #region Constructors

        public Physics(Display display, UserDisplay readout)
        {
            dataReadout = readout;
            mainDisplay = display;

            inputChanged();

            carMass = 1347;
            transmissionEfficiency = display.transmissionEfficiency;
            oldRpm = 0;

            torqueCurve = car.torqueCurve;
            gearRatio = car.gearRatios;

            selectedGear = 1; // CAUSES STARTUP INPUT BUGS *ToDo
            neutral = true;
            soundInit = false;
            try
            {
                sound = SoundEffect.FromStream(TitleContainer.OpenStream("engineIdleLoopAmp1.wav"));
                soundInstance = sound.CreateInstance();
                soundInstance.IsLooped = true;

                soundInstance.Volume = 0.5F;
                soundInstance.Play();
                soundInit = true;
            }
            catch (Exception err)
            {

            }
        }
        public InputSettings(Display display)
        {
            axisName[0] = "X";
            axisName[1] = "Y";
            axisName[2] = "Z";
            axisName[3] = "Rx";
            axisName[4] = "Ry";
            axisName[5] = "Rz";

            InitializeComponent();
            mainDisplay = display;
            pollingReadouts = new Label[2];
            pollingReadouts[0] = Joystick1Info;
            pollingReadouts[1] = Joystick2Info;
            InputSelect.SelectedIndex = mainDisplay.getInputSource();

            this.Show();
        }
        public CognitiveLoadSettings(Display mainDisplay)
        {
            InitializeComponent();
            main = mainDisplay;

            int i = 0;
            foreach(bool b in mainDisplay.cogLoad)
            {
                if(mainDisplay.cogLoad[i])
                {
                    OptionsList.SetItemCheckState(i, CheckState.Checked);
                }
                else
                {
                    OptionsList.SetItemCheckState(i, CheckState.Unchecked);
                }
                i++;
            }
            initialized = true;
        }