コード例 #1
0
ファイル: Generator.cs プロジェクト: filthmancer/greatgrand
    public Face GenerateNewFace(GrandData targ)
    {
        GameObject _base = (GameObject)Instantiate(Base.GetObject(targ.Info.Gender, targ.Info.Base.Index));

        Face final = _base.GetComponent <Face>();

        final.FaceChildren.Left_Eye   = Instantiate(Eye.GetObject(targ.Info.Gender, targ.Info.Eye.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Right_Eye  = Instantiate(Eye.GetObject(targ.Info.Gender, targ.Info.Eye.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Left_Ear   = Instantiate(Ear.GetObject(targ.Info.Gender, targ.Info.Ear.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Right_Ear  = Instantiate(Ear.GetObject(targ.Info.Gender, targ.Info.Ear.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Left_Brow  = Instantiate(Brow.GetObject(targ.Info.Gender, targ.Info.Brow.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Right_Brow = Instantiate(Brow.GetObject(targ.Info.Gender, targ.Info.Brow.Index)).GetComponent <Face_Obj>();

        final.FaceChildren.Hair = Instantiate(Hair.GetObject(targ.Info.Gender, targ.Info.Hair.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Nose = Instantiate(Nose.GetObject(targ.Info.Gender, targ.Info.Nose.Index)).GetComponent <Face_Obj>();
        final.FaceChildren.Jaw  = Instantiate(Jaw.GetObject(targ.Info.Gender, targ.Info.Jaw.Index)).GetComponent <Face_Obj>();

        if (targ.Info.Glasses != null)
        {
            final.Glasses_Left  = Instantiate(Glasses.GetObject(true, targ.Info.Glasses.Index)).GetComponent <Face_Obj>();
            final.Glasses_Right = Instantiate(Glasses.GetObject(true, targ.Info.Glasses.Index)).GetComponent <Face_Obj>();
        }

        final.Create(targ.Info);

        _base.transform.SetParent(GameManager.GetWorldObjects().transform);
        _base.transform.localPosition = Vector3.zero;

        _base.name = targ.Info.Name;
        targ.Faces.Add(final);
        return(final);
    }
コード例 #2
0
        public Commands(MediaElement mediaElement, Body body, Ear ear,
                        Dictionary <Storyboard, int> facesPauseTime, Dictionary <ETinBotFaces, Storyboard> faces,
                        Dictionary <ETinBotToggle, int> toggles)
        {
            MediaElement   = mediaElement;
            FacesPauseTime = facesPauseTime;
            Faces          = faces;
            _body          = body;
            Ear            = ear;
            Toggles        = toggles;

            var voice = SpeechSynthesizer.AllVoices.FirstOrDefault(v => v.DisplayName.Contains("Daniel"));

            Synth.Voice = voice;

            SetupStandByBehaviors();

            ActionRequestArrived += (s, a) => ProcessActionsQueue();

            Ear.ActionRequested += (sender, action) =>
            {
                ExecuteOnMainThread(() => ActionsQueue.Add(action)).Wait();
                ProcessActionsQueue();
            };
        }
コード例 #3
0
ファイル: Brain.cs プロジェクト: PlumpMath/DesignPatterns-270
 private void CreateBodyParts()
 {
     Ear  = new Ear(this);
     Eye  = new Eye(this);
     Face = new Face(this);
     Hand = new Hand(this);
     Leg  = new Leg(this);
 }
コード例 #4
0
        /// <summary>
        /// Add a ear movement
        /// </summary>
        /// <param name="ear">The ear to move</param>
        /// <param name="steps">the steps from -17 to +17</param>
        /// <param name="waitDurationTimeframeMultiple">duration to wait before executing the command</param>
        public void MoveEarRelative(Ear ear, byte steps, byte waitDurationTimeframeMultiple = 0)
        {
            byte[] chrono = new byte[] {
                waitDurationTimeframeMultiple, (byte)OpCode.Avance, (byte)ear, steps,
            };

            _choreography.AddRange(chrono);
        }
コード例 #5
0
        /// <summary>
        /// Set ear direction for taichi
        /// </summary>
        /// <param name="ear">The ear to move</param>
        /// <param name="forward">true if forward</param>
        /// <param name="waitDurationTimeframeMultiple">duration to wait before executing the command</param>
        public void SetEarDirection(Ear ear, bool forward, byte waitDurationTimeframeMultiple = 0)
        {
            byte[] chrono = new byte[] {
                waitDurationTimeframeMultiple, (byte)OpCode.SetMotorDirection, (byte)(forward ? 0 : 1),
            };

            _choreography.AddRange(chrono);
        }
コード例 #6
0
ファイル: Teddy.cs プロジェクト: VyacheslavTretyak/TeddyBear
 private void Start()
 {
     animator = GetComponent <Animator>();
     ears     = GetComponentInChildren <Ear>();
     eyes     = GetComponentInChildren <Eye>();
     bow      = GetComponentInChildren <Bow>();
     SetColor(startColor);
 }
コード例 #7
0
ファイル: Ears.cs プロジェクト: Ellerbach/Nabaztag.Net
        public int DetectEarPosition(Ear ear)
        {
            string earCommand = "?";

            byte[] command = Encoding.ASCII.GetBytes(earCommand);
            var    earFile = ear == Ear.Left ? Left : Right;

            return(Position(earFile, command));
        }
コード例 #8
0
ファイル: HumanFeatures.cs プロジェクト: theducvu/LD44
 public HumanFeatures(Mouth nmouth, Eyes neyes, Hair nhair, Ear near, Nose nnose)
 {
     mouth = nmouth;
     eyes  = neyes;
     hair  = nhair;
     ear   = near;
     nose  = nnose;
     code  = ((int)mouth).ToString() + ((int)eyes).ToString() + ((int)hair).ToString() + ((int)ear).ToString() + ((int)nose).ToString();
     // return this;
 }
コード例 #9
0
ファイル: HumanCreator.cs プロジェクト: JohanGl/Experiment
        private IEnumerable<Ear> GetEars()
        {
            var result = new Ear[2];

            result[0] = new Ear();
            result[1] = new Ear();

            result[1].AppearanceRating = result[0].AppearanceRating;

            return result;
        }
コード例 #10
0
ファイル: Generator.cs プロジェクト: filthmancer/greatgrand
    public void RandomiseFaceData(GrandData final)
    {
        final.Info.C_Hair = HairGrad.Evaluate(Random.value);        //RandomHair();
        final.Info.C_Skin = SkinGrad.Evaluate(Random.value);        //RandomSkin();
        final.Info.C_Eye  = RandomEye();

        RandomiseOffsetColours(final);

        final.Info.Base = Base.Randomise(final.Info.Gender, Simple2x2.zero, Simple2x2.zero, Simple2x2.zero);

        final.Info.Eye = Eye.Randomise(final.Info.Gender, new Simple2x2(0.0F, -0.5F, 0.0F, 0.9F),
                                       Simple2x2.zero,
                                       new Simple2x2(-0.2F, -0.2F, 0.1F, 0.1F));
        //	new Vector3(0,0.05F), 0.0F, new Vector3(0.1F, 0.1F));

        final.Info.Ear = Ear.Randomise(final.Info.Gender, new Simple2x2(0.0F, -1.5F, 0.0F, 1.5F),
                                       new Simple2x2(-4.0F, 0.0F, 4.0F, 0.0F),
                                       new Simple2x2(-0.3F, -0.3F, 0.05F, 0.25F));
        //new Vector3(0,0.3F), 4.0F,  new Vector3(0.3F, 0.3F));

        final.Info.Brow = Brow.Randomise(final.Info.Gender, new Simple2x2(0.0F, -0.1F, 0.0F, 0.15F),
                                         new Simple2x2(-5.0F, 0.0F, 7.0F, 0.0F),
                                         new Simple2x2(-0.2F, -0.15F, 0.35F, 0.35F));
        //new Vector3(0,0.1F), 6.0F,  new Vector3(0.3F, 0.2F));

        final.Info.Hair = Hair.Randomise(final.Info.Gender, Simple2x2.zero,
                                         Simple2x2.zero,
                                         new Simple2x2(0.0F, -0.1F, 0.0F, 0.1F));
        //Vector3.zero, 0.0F,  new Vector3(0.0F, 0.1F));

        final.Info.Jaw = Jaw.Randomise(final.Info.Gender, Simple2x2.zero,
                                       Simple2x2.zero,
                                       new Simple2x2(-0.15F, -0.15F, 0.13F, 0.2F));
        //Vector3.zero, 0.0F, new Vector3(0.35F, 0.25F));

        final.Info.Nose = Nose.Randomise(final.Info.Gender, new Simple2x2(0.0F, -0.7F, 0.0F, 0.7F),
                                         Simple2x2.zero,
                                         new Simple2x2(-0.2F, -0.15F, 0.2F, 0.35F));
        //new Vector3(0,0.1F), 0.0F,  new Vector3(0.1F, 0.3F));

        final.Info.Glasses = Random.value > (float)final.Age.Current / 100 ? null :
                             Glasses.Randomise(true, Simple2x2.zero,
                                               Simple2x2.zero,
                                               new Simple2x2(0.0F, 0.0F, 0.34F, 0.35F));
        if (final.Info.Glasses != null)
        {
            final.Info.Glasses._Scale   += (final.Info.Eye._Scale - Vector3.one);
            final.Info.Glasses._Position = final.Info.Eye._Position;
        }

        SetPupilInfo(final);
    }
コード例 #11
0
        /// <summary>
        /// Add a ear movement
        /// </summary>
        /// <param name="ear">The ear to move</param>
        /// <param name="steps">the steps from -17 to +17</param>
        /// <param name="waitDurationTimeframeMultiple">duration to wait before executing the command</param>
        public void MoveEarAbsolute(Ear ear, int steps, byte waitDurationTimeframeMultiple = 0)
        {
            if ((steps < -17) || (steps > 17))
            {
                throw new ArgumentException($"Ears can only be moved from -17 to +17");
            }

            byte[] chrono = new byte[] {
                waitDurationTimeframeMultiple, (byte)OpCode.SetMotor, (byte)ear, (byte)(steps > 0 ? 0 : 1), (byte)(steps > 0 ? steps : -steps),
            };

            _choreography.AddRange(chrono);
        }
コード例 #12
0
        private void InitializeDevice(Ear ear, DeviceCommunicationType deviceConnectionType)
        {
            SwitchCommInterface(ear, deviceConnectionType);

            //Create the Module and Initialize here
            // Need memory map or json file to create and initialize all modules
            _deviceModules = new Dictionary <string, IModule>
            {
                { ModuleName.MDA_MODULE, new MDAModule(_communicator) },

                { ModuleName.WDRC_MODULE, new WDRCModule(_communicator) }
            };
        }
コード例 #13
0
ファイル: Generator.cs プロジェクト: filthmancer/greatgrand
    public void CheckEditorInfo(GrandData fin)
    {
        fin.Info.Base = Base.GetCurrent();
        fin.Info.Eye  = Eye.GetCurrent();
        fin.Info.Ear  = Ear.GetCurrent();
        fin.Info.Brow = Brow.GetCurrent();
        fin.Info.Hair = Hair.GetCurrent();
        fin.Info.Jaw  = Jaw.GetCurrent();
        fin.Info.Nose = Nose.GetCurrent();

        fin.Info.C_Hair = HairCurrent;
        fin.Info.C_Skin = SkinCurrent;
        fin.Info.C_Eye  = EyeCurrent;
    }
コード例 #14
0
        private void SetupStandByBehaviors()
        {
            PhoneState.OnStandByOn += async(sender, args) =>
            {
                Ear.StartListen();
                await _body.DeAttachServos();
            };

            PhoneState.OnStandByOff += async(sender, args) =>
            {
                Ear.StopListen();
                await _body.AttachServos();
            };
        }
コード例 #15
0
ファイル: UC4_Scan.cs プロジェクト: pete7513/ST4HAAAP
        public bool CreateTechnicalSpec(Patient patient, StaffLogin ScanTechID, Ear earSide)
        {
            TecnicalSpec techSpec = new TecnicalSpec();

            techSpec.PatientFK = patient.PatientId;
            //techSpec.Patient = patient;
            techSpec.StaffLoginFK = ScanTechID.StaffID;
            //techSpec.StaffLogin = ScanTechID;
            techSpec.Printed    = false;
            techSpec.EarSide    = earSide;
            techSpec.CreateDate = DateTime.Now;

            return(clinicDB.SaveTechnicalSpec(techSpec));
        }
コード例 #16
0
        private void CreateAdrocomObject(Ear ear, AdrocomMode mode)
        {
            HAL = new SignaKlara3HAL();

            HAL.SetEar((int)ear);

            HearingAid = new Device
            {
                Ear = (int)ear,

                HAL = (BaseHAL)HAL
            };

            HAL.CommSession.Programmer = mode == AdrocomMode.Wired ? HAL.CommSession.ProgrammerList.FindByName("HI-PRO") : HAL.CommSession.ProgrammerList.FindByName("BLECom");
        }
コード例 #17
0
        public RawEarScan StartScanning(Ear earside)
        {
            earscan = new RawEarScan();

            byte[] bytes = System.IO.File.ReadAllBytes(MODEL_PATH);

            earscan.Scan     = new byte[bytes.Length];
            earscan.Scan     = bytes;
            earscan.EarSide  = earside;
            earscan.ScanDate = timeStamp.getDate();

            Thread.Sleep(3000);

            return(earscan);
        }
コード例 #18
0
        public bool SwitchCommInterface(Ear ear, DeviceCommunicationType deviceConnectionType)
        {
            bool isCommSwitched = false;

            try
            {
                if (DeviceCommType != deviceConnectionType || _communicator == null)
                {
                    //Diconnect Current Communication
                    _communicator?.Disconnect();

                    switch (deviceConnectionType)
                    {
                    case DeviceCommunicationType.Simulation:
                    {
                        _communicator = new SimulatedCommunication(ear);
                        break;
                    }

                    case DeviceCommunicationType.Wired:
                    {
                        _communicator = new WiredCommunication(ear);
                        break;
                    }

                    case DeviceCommunicationType.WiredCTK:
                    {
                        _communicator = new WiredCTKCommunication(ear);
                        break;
                    }

                    case DeviceCommunicationType.Wireless:
                    {
                        _communicator = new WirelessCommunication(ear);
                        break;
                    }
                    }
                    DeviceCommType = deviceConnectionType;
                    isCommSwitched = true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                isCommSwitched = false;
            }
            return(isCommSwitched);
        }
コード例 #19
0
        public bool CreateTechnicalSpec(Patient patient, StaffLogin ScanTechID, Ear earSide)
        {
            TecnicalSpec techSpec = new TecnicalSpec();

            techSpec.CPR        = patient.CPR;
            techSpec.Patient    = patient;
            techSpec.StaffID    = ScanTechID.StaffID;
            techSpec.StaffLogin = ScanTechID;
            techSpec.Printed    = false;
            techSpec.EarSide    = earSide;
            techSpec.CreateDate = DateTime.Now;

            //null values
            techSpec.EarPrints  = new List <RawEarPrint>();
            techSpec.RawEarScan = new RawEarScan();
            techSpec.ScanID     = 0;

            return(clinicDB.SaveTechnicalSpec(techSpec));
        }
コード例 #20
0
ファイル: Ears.cs プロジェクト: Ellerbach/Nabaztag.Net
        public void MoveRelative(Ear ear, EarDirection direction, byte steps, bool blocking = false)
        {
            string earCommand = $"{(direction == EarDirection.Forward ? '+' : '-')}{(char)steps}{(blocking ? "" : ".")}";

            byte[] command = Encoding.ASCII.GetBytes(earCommand);
            var    earFile = ear == Ear.Left ? Left : Right;

            if (blocking)
            {
                Write(earFile, command);
            }
            else
            {
                new Thread(() =>
                {
                    Write(earFile, command);
                }).Start();
            }
        }
コード例 #21
0
        private void ListenLoop()
        {
            Connection = Ear.Accept();

            byte[] messageSizeBytes = new byte[sizeof(int)];
            Connection.Receive(messageSizeBytes);
            int messageSize = BitConverter.ToInt32(messageSizeBytes, 0);

            byte[] messageBytes = new byte[messageSize];
            Connection.Receive(messageBytes);

            RecieveEventArgs args = new RecieveEventArgs(Connection.RemoteEndPoint, messageBytes);

            Recieved?.Invoke(Connection, args);

            Connection.Shutdown(SocketShutdown.Both);
            Connection.Close();

            ListenLoop();
        }
コード例 #22
0
ファイル: CommandService.cs プロジェクト: nopap/choreography
        private byte[] _moveEar(Ear ear, int steps)
        {
            if (steps < -17 || steps > 17)
            {
                throw new Exception("Invalid steps provided");
            }
            //if (!steps) throw new Error('No steps provided');
            int stepsPos = steps;
            int dir      = 0;

            if (steps < 0)
            {
                dir      = 1;
                stepsPos = -steps;
            }

            var choreography = new byte[] {
                0, (byte)MTL_OPCODE_HANDLDERS.setmotordir, (byte)ear, (byte)dir,
                0, (byte)MTL_OPCODE_HANDLDERS.avance, (byte)ear, (byte)stepsPos
            };

            return(choreography);
        }
コード例 #23
0
        private void OnSelectedItemViewModelChanged(Ear <NodeItemViewModel> ear, NodeItemViewModel oldValue, NodeItemViewModel newValue)
        {
            if (newValue != null)
            {
                switch (newValue)
                {
                case CommitNodeItemViewModel commitNodeViewModel:
                    var commitViewModel = new CommitViewModel(ViewModel.Repository, commitNodeViewModel.Commit);
                    commitViewModel.Listen(x => x.SelectedFileContent).Then(() => ViewModel.SelectedFileContent = commitViewModel.SelectedFileContent);
                    commitView.ViewModel     = commitViewModel;
                    selectedItemView.Content = commitView;
                    break;

                case ChangesNodeItemViewModel changesNodeViewModel:
                    var changesViewModel = new ChangesViewModel(ViewModel.Repository, changesNodeViewModel.Status);
                    changesViewModel.Listen(x => x.SelectedFileContent).Then(() => ViewModel.SelectedFileContent = changesViewModel.SelectedFileContent);
                    changesView.ViewModel    = changesViewModel;
                    selectedItemView.Content = changesView;
                    break;
                }

                if (rightColumn.Width == new GridLength(0))
                {
                    var settings = Properties.Settings.Default;
                    splitterColumn.Width = new GridLength(5);
                    rightColumn.Width    = new GridLength(settings.RightSidebarWidth);
                }
            }
            else
            {
                if (rightColumn.Width != new GridLength(0))
                {
                    splitterColumn.Width = new GridLength(0);
                    rightColumn.Width    = new GridLength(0);
                }
            }
        }
コード例 #24
0
ファイル: Commands.cs プロジェクト: marcodiniz/TinBot
        public Commands(MediaElement mediaElement, Body body, Ear ear,
            Dictionary<Storyboard, int> facesPauseTime, Dictionary<ETinBotFaces, Storyboard> faces,
            Dictionary<ETinBotToggle, int> toggles)
        {
            MediaElement = mediaElement;
            FacesPauseTime = facesPauseTime;
            Faces = faces;
            _body = body;
            Ear = ear;
            Toggles = toggles;

            var voice = SpeechSynthesizer.AllVoices.FirstOrDefault(v => v.DisplayName.Contains("Daniel"));
            Synth.Voice = voice;

            SetupStandByBehaviors();

            ActionRequestArrived += (s, a) => ProcessActionsQueue();

            Ear.ActionRequested += (sender, action) =>
            {
                ExecuteOnMainThread(() => ActionsQueue.Add(action)).Wait();
                ProcessActionsQueue();
            };
        }
コード例 #25
0
        public void UC4GetPatientInformationCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            HentisRunning      = false;
            Loading.Spin       = false;
            Loading.Visibility = Visibility.Collapsed;

            PatientInformationTB.Visibility = Visibility.Visible;

            patientAndHA = (Patient)e.Result;

            if (patientAndHA != null)
            {
                if (Convert.ToInt32(HACastIDTB.Text) == patientAndHA.EarCasts[0].EarCastID)
                {
                    PatientInformationTB.Text = "CPR: " + patientAndHA.CPR + "\r\nNavn: " + patientAndHA.Name + " " +
                                                patientAndHA.Lastname + "\r\nAlder: " + patientAndHA.Age +
                                                "\r\nØreside: " + patientAndHA.EarCasts[0].EarSide;
                    ScanB.IsEnabled     = true;
                    HentInfoB.IsEnabled = false;
                    earside             = patientAndHA.EarCasts[0].EarSide;
                }
                else if (Convert.ToInt32(HACastIDTB.Text) == patientAndHA.EarCasts[2].EarCastID)
                {
                    PatientInformationTB.Text = "PCPR: " + patientAndHA.CPR + "\r\nNavn: " + patientAndHA.Name + " " +
                                                patientAndHA.Lastname + "\r\nAlder: " + patientAndHA.Age +
                                                "\r\nØreside: " + patientAndHA.EarCasts[1].EarSide;
                    ScanB.IsEnabled     = true;
                    HentInfoB.IsEnabled = false;
                    earside             = patientAndHA.EarCasts[1].EarSide;
                }
            }
            else
            {
                PatientInformationTB.Text = "Det indtastede\r\nhøreafstøbningsID findes\r\nikke i databasen";
            }
        }
コード例 #26
0
 public WiredCTKCommunication(Ear ear)
 {
     _ctkWrapper = new CTKComWrapper();
 }
コード例 #27
0
ファイル: Pathology.cs プロジェクト: jlaswell/Virtual_Lab
        /// <summary>
        /// This function assigns the pathology threshold values
        /// </summary>
        /// <param name="pathCase">Which Pathology to use</param>
        private void AssignThresholds(int pathCase)
        {
            int[, ,] normHearing = RandomNormalHearing();
            int[, ,] normHearingNew = RandomNormalHearingNew();

            /*
            int count = 0;
            while (count++ < 10000000)
            {
                normHearingNew = RandomNormalHearingNew();
                //TestNormalHearing(normHearing);
                TestNormalHearing(normHearingNew);
            }
            */

            Random rand = new Random(); // General random variable

            int rand_badEar = new int();

            rand_badEar = GoodBadEar();
            System.Diagnostics.Debug.WriteLine("Ear Random Number" + rand_badEar);
            //int count = 0;
            //while (count++ < 10000000)
            //{
            switch (pathCase)
            {
                #region Unilateral_Ostosclerosis (Completed)
                case (int)Pathology_Cases.Unilateral_Otosclerosis:

                    // James Golike
                    // 2/06/2012

                    // Bad ear pre-randomized prior to switch block
                    badEar = (Ear)rand_badEar;
                    goodEar = (Ear)Math.Abs(rand_badEar - 1);

                    // normal hearing
                    for (int i = 0; i < 6; i++) // good ear
                    {
                        AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                        BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                        // good ear is ear 0
                        // bad ear is ear 1
                        AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                        BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                    }

                    for (int i = 3; i < 6; i++)
                    {
                        BC_Thresh[i, (int)badEar] = rand.Next(25, 66);
                        // Code from Bilateral Ostosclerosis. Same Pathology but excluded to one ear.
                        // BC_Thresh[i, (int)goodEar] = BC_Thresh[i, (int)badEar] - rand.Next(0, 10);
                    }

                    /*AC_Thresh[0, (int)goodEar] = 10;
                    AC_Thresh[0, (int)badEar] = 20;
                    BC_Thresh[0, (int)goodEar] = 10;
                    BC_Thresh[0, (int)badEar] = 15;
                    BC_Mask[0, (int)badEar] = 20;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 10;
                    AC_Thresh[1, (int)badEar] = 20;
                    BC_Thresh[1, (int)goodEar] = 10;
                    BC_Thresh[1, (int)badEar] = 10;
                    BC_Mask[1, (int)badEar] = 20;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 15;
                    AC_Thresh[2, (int)badEar] = 20;
                    BC_Thresh[2, (int)goodEar] = 15;
                    BC_Thresh[2, (int)badEar] = 10;
                    BC_Mask[2, (int)badEar] = 20;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 15;
                    AC_Thresh[3, (int)badEar] = 50;
                    BC_Thresh[3, (int)goodEar] = 15;
                    BC_Thresh[3, (int)badEar] = 15;
                    BC_Mask[3, (int)badEar] = 20;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 20;
                    AC_Thresh[4, (int)badEar] = 50;
                    BC_Thresh[4, (int)goodEar] = 20;
                    BC_Thresh[4, (int)badEar] = 25;
                    BC_Mask[4, (int)badEar] = 30;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 25;
                    AC_Thresh[5, (int)badEar] = 25;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    //BC_Thresh[5, (int) badEar] = ??;*/

                    break;
                #endregion
                #region Sudden_Onset (Not Done)
                case (int)Pathology_Cases.Sudden_Onset:
                    if (rand_badEar == 0)
                    {
                        goodEar = Ear.left;
                        badEar = Ear.right;
                    }
                    else
                    {
                        goodEar = Ear.right;
                        badEar = Ear.left;
                    }
                    // 250
                    AC_Thresh[0, (int)goodEar] = 70;
                    AC_Thresh[0, (int)badEar] = 20;
                    BC_Thresh[0, (int)goodEar] = 25;
                    BC_Thresh[0, (int)badEar] = 20;
                    BC_Mask[0, (int)goodEar] = 70;
                    AC_Mask[0, (int)goodEar] = 70;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 80;
                    AC_Thresh[1, (int)badEar] = 20;
                    BC_Thresh[1, (int)goodEar] = 20;
                    BC_Thresh[1, (int)badEar] = 20;
                    BC_Mask[1, (int)goodEar] = 80;
                    AC_Mask[1, (int)goodEar] = 80;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 90;
                    AC_Thresh[2, (int)badEar] = 25;
                    BC_Thresh[2, (int)goodEar] = 25;
                    BC_Thresh[2, (int)badEar] = 25;
                    BC_Mask[2, (int)Ear.left] = 90;
                    AC_Mask[2, (int)goodEar] = 90;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 90;
                    AC_Thresh[3, (int)badEar] = 30;
                    BC_Thresh[3, (int)goodEar] = 30;
                    BC_Thresh[3, (int)badEar] = 25;
                    BC_Mask[3, (int)Ear.left] = 90;
                    AC_Mask[3, (int)Ear.left] = 90;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 95;
                    AC_Thresh[4, (int)badEar] = 30;
                    BC_Thresh[4, (int)goodEar] = 30;
                    BC_Thresh[4, (int)badEar] = 25;
                    BC_Mask[4, (int)goodEar] = 95;
                    AC_Mask[4, (int)goodEar] = 95;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 105;
                    AC_Thresh[5, (int)badEar] = 50;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    BC_Thresh[5, (int)badEar] = 0;
                    AC_Mask[0, (int)goodEar] = 70;
                    break;
                #endregion
                #region Acoustic_Tumor (Completed)
                case (int)Pathology_Cases.Acoustic_Tumor:
                    {

                         // Matt Hunold
                        // 9/27/2011 hjkl

                        //int randMin, randMax, minBC = 25, maxAC = -10;

                        // Bad ear pre-randomized prior to switch block
                        badEar = (Ear)rand_badEar;
                        goodEar = (Ear)Math.Abs(rand_badEar - 1);

                        // Assign normal hearing values to appropriate array locations
                        // and determine the maximum AC and minimum BC values for the bad ear
                        // this disease has normal hearing up to and including 1k

                        for (int i = 0; i < 6; i++) // good ear
                        {
                            AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                            BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                            // good ear is ear 0
                            // bad ear is ear 1
                            AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                            BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                        }

                        for (int i = 3; i < 6; i++)
                        {
                            AC_Thresh[i, (int)badEar] = AC_Thresh[i - 1, (int)badEar] + rand.Next(3, 5) * 5;
                            BC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]) - (rand.Next(0, 2)  * ((AC_Thresh[i, (int)badEar] - BC_Thresh[i, (int)badEar]) >= 15 ? 5 : 0));
                            AC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]);

                        }

                    /*
                    if (rand_badEar == 0)
                    {
                        goodEar = Ear.left;
                        badEar = Ear.right;
                    }
                    else
                    {
                        goodEar = Ear.right;
                        badEar = Ear.left;
                    }
                    // 250
                    AC_Thresh[0, (int)goodEar] = 15;
                    AC_Thresh[0, (int)badEar] = 5;
                    BC_Thresh[0, (int)goodEar] = 10;
                    BC_Thresh[0, (int)badEar] = 10;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 15;
                    AC_Thresh[1, (int)badEar] = 10;
                    BC_Thresh[1, (int)goodEar] = 15;
                    BC_Thresh[1, (int)badEar] = 10;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 20;
                    AC_Thresh[2, (int)badEar] = 10;
                    BC_Thresh[2, (int)goodEar] = 20;
                    BC_Thresh[2, (int)badEar] = 10;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 25;
                    AC_Thresh[3, (int)badEar] = 15;
                    BC_Thresh[3, (int)goodEar] = 20;
                    BC_Thresh[3, (int)badEar] = 15;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 50;
                    AC_Thresh[4, (int)badEar] = 15;
                    BC_Thresh[4, (int)goodEar] = 15;
                    BC_Thresh[4, (int)badEar] = 15;
                    BC_Mask[4, (int)goodEar] = 50;
                    BC_Mask[4, (int)badEar] = 15;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 60;
                    AC_Thresh[5, (int)badEar] = 15;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    //BC_Thresh[5, (int) badEar] = ??;
                    */
                    }
                    break;
                #endregion
                #region Progressive_Loss(Not Done)
                case (int)Pathology_Cases.Progressive_Loss:
                    goodEar = Ear.neither;
                    badEar = Ear.both;
                    // 250
                    AC_Thresh[0, (int)Ear.left] = 10;
                    AC_Thresh[0, (int)Ear.right] = 5;
                    BC_Thresh[0, (int)Ear.left] = 5;
                    BC_Thresh[0, (int)Ear.right] = 5;
                    // 500
                    AC_Thresh[1, (int)Ear.left] = 10;
                    AC_Thresh[1, (int)Ear.right] = 10;
                    BC_Thresh[1, (int)Ear.left] = 5;
                    BC_Thresh[1, (int)Ear.right] = 10;
                    // 1000
                    AC_Thresh[2, (int)Ear.left] = 20;
                    AC_Thresh[2, (int)Ear.right] = 20;
                    BC_Thresh[2, (int)Ear.left] = 20;
                    BC_Thresh[2, (int)Ear.right] = 20;
                    // 2000
                    AC_Thresh[3, (int)Ear.left] = 40;
                    AC_Thresh[3, (int)Ear.right] = 35;
                    BC_Thresh[3, (int)Ear.left] = 40;
                    BC_Thresh[3, (int)Ear.right] = 35;
                    // 4000
                    AC_Thresh[4, (int)Ear.left] = 60;
                    AC_Thresh[4, (int)Ear.right] = 65;
                    // Set the BC_Masked value to the threshold value to prevent
                    // the program from expecting air masking
                    BC_Thresh[4, (int)Ear.left] = BC_Mask[4, (int)Ear.left] = 65;
                    BC_Thresh[4, (int)Ear.right] = BC_Mask[4, (int)Ear.right] = 65;
                    // 8000
                    AC_Thresh[5, (int)Ear.left] = 80;
                    AC_Thresh[5, (int)Ear.right] = 75;
                    //BC_Thresh[5, (int)Ear.left] = ??;
                    //BC_Thresh[5, (int)Ear.right] = ??;
                    break;
                #endregion
                #region Ossicular_Discontinuity (Completed)
                case (int)Pathology_Cases.Ossicular_Discontinuity:
                    {
                        // Matt Hunold
                        // 9/27/2011 hjkl

                        //int randMin, randMax, minBC = 25, maxAC = -10;

                        // Bad ear pre-randomized prior to switch block
                        badEar = (Ear)rand_badEar;
                        goodEar = (Ear)Math.Abs(rand_badEar - 1);

                        // Assign normal hearing values to appropriate array locations
                        // and determine the maximum AC and minimum BC values for the bad ear
                        // this disease has normal hearing up to and including 1k

                        for (int i = 0; i < 6; i++) // good ear
                        {
                            AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                            BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                            // good ear is ear 0
                            // bad ear is ear 1
                            AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                            BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                            BC_Mask[i, (int)badEar] = BC_Thresh[i, (int)badEar];
                            //* ((AC_Thresh[i, (int)badEar] - 40 >= BC_Thresh[i, (int)goodEar] ? 5 : 0));
                            //BC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]) - (rand.Next(0, 2) * ((AC_Thresh[i, (int)badEar] - BC_Thresh[i, (int)badEar]) >= 15 ? 5 : 0));

                        }

                        int[] AC_min = new int [6];

                        for (int i = 0; i < 6; i++)
                        {
                            AC_min[i] = Math.Max(30, BC_Thresh[i, (int)badEar] + 15);
                            AC_Thresh[i, (int)badEar] = AC_min[i] + rand.Next(0, (60 - AC_min[i] + 1));
                            AC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]);
                        }

                        /*
                        if (rand_badEar == 0)
                        {
                            goodEar = Ear.left;
                            badEar = Ear.right;
                        }
                        else
                        {
                            goodEar = Ear.right;
                            badEar = Ear.left;
                        }
                        // 250
                        AC_Thresh[0, (int)goodEar] = 50;
                        AC_Thresh[0, (int)badEar] = 0;
                        BC_Thresh[0, (int)goodEar] = 0;
                        BC_Thresh[0, (int)badEar] = 0;
                        // 500
                        AC_Thresh[1, (int)goodEar] = 50;
                        AC_Thresh[1, (int)badEar] = 0;
                        BC_Thresh[1, (int)goodEar] = 0;
                        BC_Thresh[1, (int)badEar] = 0;
                        // 1000
                        AC_Thresh[2, (int)goodEar] = 50;
                        AC_Thresh[2, (int)badEar] = 5;
                        BC_Thresh[2, (int)goodEar] = 5;
                        BC_Thresh[2, (int)badEar] = 5;
                        BC_Mask[2, (int)goodEar] = 5;
                        // 2000
                        AC_Thresh[3, (int)goodEar] = 40;
                        AC_Thresh[3, (int)badEar] = 5;
                        BC_Thresh[3, (int)goodEar] = 5;
                        BC_Thresh[3, (int)badEar] = 5;
                        BC_Mask[3, (int)goodEar] = 5;
                        // 4000
                        AC_Thresh[4, (int)goodEar] = 40;
                        AC_Thresh[4, (int)badEar] = 5;
                        BC_Thresh[4, (int)goodEar] = 5;
                        BC_Thresh[4, (int)badEar] = 5;
                        BC_Mask[4, (int)goodEar] = 5;
                        // 8000
                        AC_Thresh[5, (int)goodEar] = 40;
                        AC_Thresh[5, (int)badEar] = 0;
                        //BC_Thresh[5, (int) goodEar] = ??;
                        BC_Thresh[5, (int)badEar] = 5;
                        */
                    }
                    break;
                #endregion
                #region Unilateral_Otitis_Media (flat loss) (Not Done)
                case (int)Pathology_Cases.Unilateral_Otitis_Media:
                    // Matt Hunold
                    // 2/28/2012 hjkl

                    //int randMin, randMax, minBC = 25, maxAC = -10;

                    // Bad ear pre-randomized prior to switch block
                    badEar = (Ear)rand_badEar;
                    goodEar = (Ear)Math.Abs(rand_badEar - 1);

                    // Assign normal hearing values to appropriate array locations
                    // and determine the maximum AC and minimum BC values for the bad ear

                    for (int i = 0; i < 6; i++) // good ear
                    {
                        AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                        BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                        // good ear is ear 0
                        // bad ear is ear 1
                        BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                    }

                    for (int i = 0; i < 6; i++)
                    {
                        AC_Thresh[i, (int)badEar] = BC_Thresh[i, (int)badEar] + 15;
                    }
                    /*// 250
                    AC_Thresh[0, (int)goodEar] = 10;
                    AC_Thresh[0, (int)badEar] = 40;
                    BC_Thresh[0, (int)goodEar] = 10;
                    BC_Thresh[0, (int)badEar] = 10;
                    BC_Mask[0, (int)goodEar] = 10;
                    BC_Mask[0, (int)badEar] = 10;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 15;
                    AC_Thresh[1, (int)badEar] = 40;
                    BC_Thresh[1, (int)goodEar] = 15;
                    BC_Thresh[1, (int)badEar] = 15;
                    BC_Mask[1, (int)goodEar] = 15;
                    BC_Mask[1, (int)badEar] = 15;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 15;
                    AC_Thresh[2, (int)badEar] = 15;
                    BC_Thresh[2, (int)goodEar] = 15;
                    BC_Thresh[2, (int)badEar] = 15;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 15;
                    AC_Thresh[3, (int)badEar] = 15;
                    BC_Thresh[3, (int)goodEar] = 15;
                    BC_Thresh[3, (int)badEar] = 15;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 15;
                    AC_Thresh[4, (int)badEar] = 15;
                    BC_Thresh[4, (int)goodEar] = 15;
                    BC_Thresh[4, (int)badEar] = 15;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 10;
                    AC_Thresh[5, (int)badEar] = 10;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    BC_Thresh[5, (int)badEar] = 5; */
                    break;
                #endregion
                #region Presbyacusis (Completed)
                case (int)Pathology_Cases.Presbyacusis:
                    {
                        // Matt Harris
                        // 9/27/2011

                        // Bad ear pre-randomized prior to switch block
                        // For Presbyacusis, this is simply just for randomization purposes
                        // There is "true" good or bad ear in presbyacusis, they are both bad
                        badEar = (Ear)rand_badEar;
                        goodEar = (Ear)Math.Abs(rand_badEar - 1);

                        int[] BCDiffs, AC0Diffs, AC1Diffs;
                        int randMin, randMax, randFloor, randCeiling;
                        double a, b, c, y3, y4, divide;

                        BCDiffs = new int[4];
                        AC0Diffs = new int[4];
                        AC1Diffs = new int[4];

                        // Find the differences for 1000, 2000, 4000, 8000 Hz
                        for (int i = 2; i < 6; i++)
                        {
                            BCDiffs[i - 2] = normHearing[i, 0, 1] - normHearing[i, 0, 0];
                            AC0Diffs[i - 2] = normHearing[i, 1, 0] - normHearing[i, 0, 0];
                            AC1Diffs[i - 2] = normHearing[i, 1, 1] - normHearing[i, 0, 1];
                        }

                        // y_0 and y_1 are the original values (for bone and air, both ears)
                        for (int i = 0; i < 2; i++)
                        {
                            for (int j = 0; j < 2; j++)
                            {
                                BC_Thresh[i, j] = normHearing[i, 0, j];
                                AC_Thresh[i, j] = normHearing[i, 1, j];
                            }
                        }

                        // y_2 is the greater of y_1 and y_2 + 5 to 15 dB
                        BC_Thresh[2, 0] = Math.Max(BC_Thresh[0, 0], BC_Thresh[1, 0]) + rand.Next(1, 4) * 5;

                        // y_5 minimum is y_2 + 15 and maximum is 80 dB
                        randMin = Math.Max((BC_Thresh[2, 0] + 15) / 5, 9);
                        randMax = 16;
                        BC_Thresh[5, 0] = rand.Next(randMin, randMax + 1) * 5;

                        // Solve for the coefficients
                        a = 0.1 * BC_Thresh[0, 0] - BC_Thresh[2, 0] / 6 + BC_Thresh[5, 0] / 15;
                        b = BC_Thresh[2, 0] * 5 / 6 - 0.7 * BC_Thresh[0, 0] - BC_Thresh[5, 0] * 2 / 15;
                        c = BC_Thresh[0, 0];

                        // Compute y3 and y4 from coefficients
                        y3 = a * 9 + b * 3 + c;
                        y4 = a * 16 + b * 4 + c;

                        // Randomly round up or down for y3 and y4
                        divide = y3 / 5;
                        randFloor = rand.Next(0, 2);
                        randCeiling = Math.Abs(randFloor - 1);
                        BC_Thresh[3, 0] = (randFloor * (int)Math.Floor(divide) + randCeiling * (int)Math.Ceiling(divide)) * 5;

                        divide = y4 / 5;
                        randFloor = rand.Next(0, 2);
                        randCeiling = Math.Abs(randFloor - 1);
                        BC_Thresh[4, 0] = (randFloor * (int)Math.Floor(divide) + randCeiling * (int)Math.Ceiling(divide)) * 5;

                        // Adjust remaining AC and BC values using differences determined
                        for (int i = 2; i < 6; i++)
                        {
                            BC_Thresh[i, 1] = BC_Thresh[i, 0] + BCDiffs[i - 2];
                            AC_Thresh[i, 0] = BC_Thresh[i, 0] + AC0Diffs[i - 2];
                            AC_Thresh[i, 1] = BC_Thresh[i, 1] + AC1Diffs[i - 2];
                        }

                        /*if (rand_badEar == 0)
                    {
                        goodEar = Ear.left;
                        badEar = Ear.right;
                    }
                    else
                    {
                        goodEar = Ear.right;
                        badEar = Ear.left;
                    }
                    // 250
                    AC_Thresh[0, (int)goodEar] = 20;
                    AC_Thresh[0, (int)badEar] = 15;
                    BC_Thresh[0, (int)goodEar] = 20;
                    BC_Thresh[0, (int)badEar] = 15;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 15;
                    AC_Thresh[1, (int)badEar] = 15;
                    BC_Thresh[1, (int)goodEar] = 15;
                    BC_Thresh[1, (int)badEar] = 15;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 25;
                    AC_Thresh[2, (int)badEar] = 20;
                    BC_Thresh[2, (int)goodEar] = 25;
                    BC_Thresh[2, (int)badEar] = 20;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 30;
                    AC_Thresh[3, (int)badEar] = 30;
                    BC_Thresh[3, (int)goodEar] = 30;
                    BC_Thresh[3, (int)badEar] = 30;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 45;
                    AC_Thresh[4, (int)badEar] = 45;
                    BC_Thresh[4, (int)goodEar] = 45;
                    BC_Thresh[4, (int)badEar] = 45;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 60;
                    AC_Thresh[5, (int)badEar] = 60;
                    BC_Thresh[5, (int)goodEar] = 60;
                    BC_Thresh[5, (int)badEar] = 60;
                     */
                    }
                    break;
                #endregion
                #region Noise_Induced_Trauma (Needs Editing)
                case (int)Pathology_Cases.Noise_Induced_Trauma :

                    // Matt Hunold
                    // 2/28/2012 hjkl

                    //int randMin, randMax, minBC = 25, maxAC = -10;

                    // Bad ear pre-randomized prior to switch block
                    badEar = (Ear)rand_badEar;
                    goodEar = (Ear)Math.Abs(rand_badEar - 1);

                    // Assign normal hearing values to appropriate array locations
                    // and determine the maximum AC and minimum BC values for the bad ear

                    for (int i = 0; i < 6; i++) // good ear
                    {
                        AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                        BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                        // good ear is ear 0
                        // bad ear is ear 1
                        AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                        BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];
                    }

                    // 4000 Hz
                    AC_Thresh[4, (int)badEar] = AC_Thresh[3, (int)badEar] + rand.Next(30, 51);
                    AC_Thresh[4, (int)goodEar] = AC_Thresh[3, (int)goodEar] + rand.Next(20, 51);
                    BC_Thresh[4, (int)badEar] = AC_Thresh[4, (int)badEar] - rand.Next(0,10); // not (0,11) due to style choice: BC and AC are close together most often
                    BC_Thresh[4, (int)goodEar] = AC_Thresh[4, (int)goodEar] - rand.Next(0, 10);
                    // 8000 Hz
                    traumaDiff = AC_Thresh[4, (int)badEar] - AC_Thresh[4, (int)goodEar];
                    AC_Thresh[5, (int)badEar] = AC_Thresh[4, (int)badEar] + rand.Next(0, 11);
                    AC_Thresh[5, (int)goodEar] = AC_Thresh[5, (int)badEar] - traumaDiff;

                /* case (int)Pathology_Cases.Noise_Induced_Trauma:
                    if (rand_badEar == 0)
                    {
                        goodEar = Ear.left;
                        badEar = Ear.right;
                    }
                    else
                    {
                        goodEar = Ear.right;
                        badEar = Ear.left;
                    }
                    // 250
                    AC_Thresh[0, (int)goodEar] = 20;
                    AC_Thresh[0, (int)badEar] = 15;
                    BC_Thresh[0, (int)goodEar] = 15;
                    BC_Thresh[0, (int)badEar] = 10;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 15;
                    AC_Thresh[1, (int)badEar] = 10;
                    BC_Thresh[1, (int)goodEar] = 15;
                    BC_Thresh[1, (int)badEar] = 10;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 10;
                    AC_Thresh[2, (int)badEar] = 10;
                    BC_Thresh[2, (int)goodEar] = 5;
                    BC_Thresh[2, (int)badEar] = 5;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 15;
                    AC_Thresh[3, (int)badEar] = 15;
                    BC_Thresh[3, (int)goodEar] = 15;
                    BC_Thresh[3, (int)badEar] = 10;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 50;
                    AC_Thresh[4, (int)badEar] = 75;
                    BC_Thresh[4, (int)goodEar] = 50;
                    BC_Thresh[4, (int)badEar] = 55;
                    BC_Mask[4, (int)badEar] = 75;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 45;
                    AC_Thresh[5, (int)badEar] = 60;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    //BC_Thresh[5, (int) badEar] = 60;
                    break;*/
                    break;
                #endregion
                #region Bilateral_Otitis_Media (flat loss) (Needs Editing)
                case (int)Pathology_Cases.Bilateral_Otitis_Media:
                    // Matt Hunold
                    // 2/28/2012 hjkl

                    //int randMin, randMax, minBC = 25, maxAC = -10;

                    // Bad ear pre-randomized prior to switch block
                    badEar = (Ear)rand_badEar;
                    goodEar = (Ear)Math.Abs(rand_badEar - 1);

                    // Assign normal hearing values to appropriate array locations
                    // and determine the maximum AC and minimum BC values for the bad ear

                    for (int i = 0; i < 6; i++) // good ear
                    {
                        BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                        // good ear is ear 0
                        // bad ear is ear 1
                        BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                    }

                    for (int i = 0; i < 6; i++)
                    {
                        AC_Thresh[i, (int)badEar] = BC_Thresh[i, (int)badEar] + 15;
                        AC_Thresh[i, (int)goodEar] = BC_Thresh[i, (int)goodEar] + 15;
                    }
                    break;
                #endregion
                #region Bilateral_Otosclerosis (Completed)
                case (int)Pathology_Cases.Bilateral_Otosclerosis:

                    // James Golike
                    // 2/06/2012

                    // Bad ear pre-randomized prior to switch block
                    badEar = (Ear)rand_badEar;
                    goodEar = (Ear)Math.Abs(rand_badEar - 1);

                    // normal hearing
                    for (int i = 0; i < 6; i++) // good ear
                    {
                        AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                        BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                        // good ear is ear 0
                        // bad ear is ear 1
                        AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                        BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                    }

                    for (int i = 3; i < 6; i++)
                    {
                        BC_Thresh[i, (int)badEar] = rand.Next(25, 66);
                        BC_Thresh[i, (int)goodEar] = BC_Thresh[i, (int)badEar] - rand.Next(0, 10);
                    }

                /* // 250
                    AC_Thresh[0, (int)Ear.left] = 55;
                    AC_Thresh[0, (int)Ear.right] = 50;
                    BC_Thresh[0, (int)Ear.left] = 0;
                    BC_Thresh[0, (int)Ear.right] = 0;
                    BC_Mask[0, (int)Ear.left] = 10;
                    BC_Mask[0, (int)Ear.right] = 10;
                    // 500
                    AC_Thresh[1, (int)Ear.left] = 60;
                    AC_Thresh[1, (int)Ear.right] = 60;
                    BC_Thresh[1, (int)Ear.left] = 5;
                    BC_Thresh[1, (int)Ear.right] = 5;
                    BC_Mask[1, (int)Ear.left] = 15;
                    BC_Mask[1, (int)Ear.right] = 15;
                    // 1000
                    AC_Thresh[2, (int)Ear.left] = 55;
                    AC_Thresh[2, (int)Ear.right] = 55;
                    BC_Thresh[2, (int)Ear.left] = 10;
                    BC_Thresh[2, (int)Ear.right] = 10;
                    BC_Mask[2, (int)Ear.left] = 15;
                    BC_Mask[2, (int)Ear.right] = 15;
                    // 2000
                    AC_Thresh[3, (int)Ear.left] = 50;
                    AC_Thresh[3, (int)Ear.right] = 45;
                    BC_Thresh[3, (int)Ear.left] = 20;
                    BC_Thresh[3, (int)Ear.right] = 20;
                    BC_Mask[3, (int)Ear.left] = 20;
                    BC_Mask[3, (int)Ear.right] = 20;
                    // 4000
                    AC_Thresh[4, (int)Ear.left] = 30;
                    AC_Thresh[4, (int)Ear.right] = 30;
                    BC_Thresh[4, (int)Ear.left] = 5;
                    BC_Thresh[4, (int)Ear.right] = 5;
                    BC_Mask[4, (int)Ear.left] = 10;
                    BC_Mask[4, (int)Ear.right] = 10;
                    // 8000
                    AC_Thresh[5, (int)Ear.left] = 50;
                    AC_Thresh[5, (int)Ear.right] = 50;
                    //BC_Thresh[5, (int)Ear.left] = ??;
                    //BC_Thresh[5, (int)Ear.right] = 60; */
                    break;
                #endregion
                #region Menieres_Disease (Completed)
                case (int)Pathology_Cases.Menieres_Disease:
                    {
                        // Matt Harris
                        // 9/26/2007
                        int MenieresDiseaseOffset;
                        int randMin, randMax, maxACOffset = 85, maxOffsetTest, minBC = 25, maxAC = -10;

                        // Bad ear pre-randomized prior to switch block
                        badEar = (Ear)rand_badEar;
                        goodEar = (Ear)Math.Abs(rand_badEar - 1);

                        // Assign normal hearing values to appropriate array locations
                        // and determine the maximum AC and minimum BC values for the bad ear
                        for (int i = 0; i < 6; i++)
                        {
                            AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                            BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];

                            AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                            BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                            maxOffsetTest = BC_Thresh[i, (int)goodEar] + 55 - AC_Thresh[i, (int)badEar];
                            if (maxOffsetTest < maxACOffset)
                                maxACOffset = maxOffsetTest;

                            if (BC_Thresh[i, (int)badEar] < minBC)
                                minBC = BC_Thresh[i, (int)badEar];

                        }

                        // Determine the randomization range
                        randMin = (30 - minBC) / 5;
                        randMax = maxACOffset / 5;

                        // Randomize the offset range and offset the bad ear
                        MenieresDiseaseOffset = rand.Next(randMin, randMax + 1) * 5;
                        for (int i = 0; i < 6; i++)
                        {
                            AC_Thresh[i, (int)badEar] += MenieresDiseaseOffset;
                            BC_Mask[i, (int)badEar] = BC_Thresh[i, (int)badEar] + MenieresDiseaseOffset;
                        }
                        /*
                        // 250
                        AC_Thresh[0, (int)goodEar] = 50;
                        AC_Thresh[0, (int)badEar] = 5;
                        BC_Thresh[0, (int)goodEar] = 5;
                        BC_Thresh[0, (int)badEar] = 5;
                        BC_Mask[0, (int)Ear.left] = 50;
                        // 500
                        AC_Thresh[1, (int)goodEar] = 45;
                        AC_Thresh[1, (int)badEar] = 0;
                        BC_Thresh[1, (int)goodEar] = 0;
                        BC_Thresh[1, (int)badEar] = 0;
                        BC_Mask[1, (int)Ear.left] = 45;
                        // 1000
                        AC_Thresh[2, (int)goodEar] = 40;
                        AC_Thresh[2, (int)badEar] = 5;
                        BC_Thresh[2, (int)goodEar] = 5;
                        BC_Thresh[2, (int)badEar] = 5;
                        BC_Mask[2, (int)Ear.left] = 40;
                        // 2000
                        AC_Thresh[3, (int)goodEar] = 35;
                        AC_Thresh[3, (int)badEar] = 10;
                        BC_Thresh[3, (int)goodEar] = 10;
                        BC_Thresh[3, (int)badEar] = 10;
                        BC_Mask[3, (int)goodEar] = 35;
                        // 4000
                        AC_Thresh[4, (int)goodEar] = 40;
                        AC_Thresh[4, (int)badEar] = 5;
                        BC_Thresh[4, (int)goodEar] = 5;
                        BC_Thresh[4, (int)badEar] = 5;
                        BC_Mask[4, (int)goodEar] = 40;
                        // 8000
                        AC_Thresh[5, (int)goodEar] = 45;
                        AC_Thresh[5, (int)badEar] = 10;
                        //BC_Thresh[5, (int) goodEar] = ??;
                        //BC_Thresh[5, (int) badEar] = 60;
                         */
                    }
                    break;
                #endregion
                #region Microtia (Completed)
                case (int)Pathology_Cases.Microtia:
                    {

                        // Matt Hunold
                        // 9/27/2011 hjkl

                        int randMin, randMax, minBC = 25, maxAC = -10;

                        // Bad ear pre-randomized prior to switch block
                        badEar = (Ear)rand_badEar;
                        goodEar = (Ear)Math.Abs(rand_badEar - 1);

                        // Assign normal hearing values to appropriate array locations
                        // and determine the maximum AC and minimum BC values for the bad ear MOAR STUFF
                        // this disease has normal hearing up to and including 1k

                        for (int i = 0; i < 6; i++) // good ear
                        {
                            AC_Thresh[i, (int)goodEar] = normHearing[i, 1, 0];
                            BC_Thresh[i, (int)goodEar] = normHearing[i, 0, 0];
                            // good ear is ear 0
                            // bad ear is ear 1
                            AC_Thresh[i, (int)badEar] = normHearing[i, 1, 1];
                            BC_Thresh[i, (int)badEar] = normHearing[i, 0, 1];

                            BC_Mask[i, (int)badEar] = BC_Thresh[i, (int)badEar];
                            //* ((AC_Thresh[i, (int)badEar] - 40 >= BC_Thresh[i, (int)goodEar] ? 5 : 0));
                            //BC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]) - (rand.Next(0, 2) * ((AC_Thresh[i, (int)badEar] - BC_Thresh[i, (int)badEar]) >= 15 ? 5 : 0));

                        }

                        int[] AC_min = new int[6];

                        for (int i = 0; i < 6; i++)
                        {
                            AC_min[i] = Math.Max(30, BC_Thresh[i, (int)badEar] + 15);
                            AC_Thresh[i, (int)badEar] = AC_min[i] + rand.Next(0, (60 - AC_min[i] + 1));
                            if ((AC_Thresh[i, (int)badEar]) > 60)
                            {
                                AC_Thresh[i, (int)badEar] = 60;
                            }
                            AC_Mask[i, (int)badEar] = (AC_Thresh[i, (int)badEar]);
                        }

                    /*
                    if (rand_badEar == 0)
                    {
                        goodEar = Ear.left;
                        badEar = Ear.right;
                    }
                    else
                    {
                        goodEar = Ear.right;
                        badEar = Ear.left;
                    }
                    // 250
                    AC_Thresh[0, (int)goodEar] = 65;
                    AC_Thresh[0, (int)badEar] = 5;
                    AC_Mask[0, (int)goodEar] = 65;
                    BC_Thresh[0, (int)goodEar] = 10;
                    BC_Thresh[0, (int)badEar] = 5;
                    BC_Mask[0, (int)goodEar] = 10;
                    // 500
                    AC_Thresh[1, (int)goodEar] = 60;
                    AC_Thresh[1, (int)badEar] = 0;
                    AC_Mask[1, (int)goodEar] = 60;
                    BC_Thresh[1, (int)goodEar] = 5;
                    BC_Thresh[1, (int)badEar] = 0;
                    BC_Mask[1, (int)goodEar] = 5;
                    // 1000
                    AC_Thresh[2, (int)goodEar] = 60;
                    AC_Thresh[2, (int)badEar] = 0;
                    AC_Mask[2, (int)goodEar] = 60;
                    BC_Thresh[2, (int)goodEar] = 5;
                    BC_Thresh[2, (int)badEar] = 0;
                    BC_Mask[2, (int)goodEar] = 5;
                    // 2000
                    AC_Thresh[3, (int)goodEar] = 55;
                    AC_Thresh[3, (int)badEar] = 0;
                    BC_Thresh[3, (int)goodEar] = 5;
                    BC_Thresh[3, (int)badEar] = 0;
                    BC_Mask[3, (int)goodEar] = 5;
                    // 4000
                    AC_Thresh[4, (int)goodEar] = 55;
                    AC_Thresh[4, (int)badEar] = 5;
                    BC_Thresh[4, (int)goodEar] = 5;
                    BC_Thresh[4, (int)badEar] = 5;
                    BC_Mask[4, (int)goodEar] = 5;
                    // 8000
                    AC_Thresh[5, (int)goodEar] = 65;
                    AC_Thresh[5, (int)badEar] = 10;
                    //BC_Thresh[5, (int) goodEar] = ??;
                    //BC_Thresh[5, (int) badEar] = 60;*/
                    break;
                   }
                #endregion
            }

                //TestNIT(AC_Thresh[5, 0], AC_Thresh[5, 1]);
                //normHearingNew = RandomNormalHearingNew();
                //TestNormalHearing(normHearing);
                //TestNormalHearing(normHearingNew);
            //}

            #region Word Intelligibility and Speach Recognition Test (Needs Implementation)
            //Who made this and when was it made. Is it still relevant? -AW 10/26/11

            /*
            // Make WI_Value a multiple of 4 because of the score being out of 25
            WI_Value[0] /= 4;
            WI_Value[1] /= 4;
            WI_Value[0] *= 4;
            WI_Value[1] *= 4;

            // bad ear is both for bilateral
            if (pathCase >= (int)Pathology_Cases.Bilateral_Otitis_Media)
                badEar = (int)Ear.both;

            // check to ensure that AC >= BC
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    if (AC_Thresh[i,j] < BC_Thresh[i,j]) BC_Thresh[i,j] = AC_Thresh[i,j];
                }
            }

            // Assign SRT Threshold and WI Level
            SRT_Thresh = new int[2];
            SRT_Thresh[0] = (AC_Thresh_Val(500, (int)Ear.left) + AC_Thresh_Val(1000, (int)Ear.left) + AC_Thresh_Val(2000, (int)Ear.left))/3;
            SRT_Thresh[1] = (AC_Thresh_Val(500, (int)Ear.right) + AC_Thresh_Val(1000, (int)Ear.right) + AC_Thresh_Val(2000, (int)Ear.right))/3;
            if(SRT_Thresh[0] % 5 < 3) SRT_Thresh[0] = 5*(SRT_Thresh[0] / 5);
            else SRT_Thresh[0] = 5*(SRT_Thresh[0] / 5 + 1);
            if(SRT_Thresh[1] % 5 < 3) SRT_Thresh[1] = 5*(SRT_Thresh[1] / 5);
            else SRT_Thresh[1] = 5*(SRT_Thresh[1] / 5 + 1);
            WI_Level = new int[2];
            WI_Level[0] = SRT_Thresh[0] + 30;
            WI_Level[1] = SRT_Thresh[1] + 30;

            //Temp
            SRT_Masking = new int[2];
            WI_Masking = new int[2];
            SRT_Masking[0] = 0;
            SRT_Masking[1] = 0;
            WI_Masking[0] = 0;
            WI_Masking[1] = 0;
            // End Temp*/
            #endregion
        }
コード例 #28
0
ファイル: Pathology.cs プロジェクト: jlaswell/Virtual_Lab
        /// <summary>
        /// This just returns the BC threshold requested
        /// </summary>
        /// <param name="frequency">frequency</param>
        /// <param name="ear"> what ear do you want</param>
        /// <returns>BC Threshold at specified frequency for specified ear</returns>
        public int BC_Thresh_Val(int frequency, Ear ear)
        {
            if (ear != Ear.left && ear != Ear.right) return -200;

            int freqToPass;
            switch (frequency)
            {
                case 250:
                    freqToPass = 0;
                    break;
                case 500:
                    freqToPass = 1;
                    break;
                case 1000:
                    freqToPass = 2;
                    break;
                case 2000:
                    freqToPass = 3;
                    break;
                case 4000:
                    freqToPass = 4;
                    break;
                case 8000:
                    freqToPass = 5;
                    break;
                default:
                    return -200;
            }
            return BC_Thresh[freqToPass,(int)ear];
        }
コード例 #29
0
 private void EarOnValueChanged(Ear <bool> ear, bool oldvalue, bool newvalue)
 {
     CanExecuteChanged?.Invoke(this, EventArgs.Empty);
 }
コード例 #30
0
ファイル: Brain.cs プロジェクト: olko/MySpace
 private void CreateBodyParts()
 {
     Ear = new Ear(this);
     Eye = new Eye(this);
     Face = new Face(this);
     Hand = new Hand(this);
     Leg = new Leg(this);
 }
コード例 #31
0
ファイル: Ears.cs プロジェクト: Ellerbach/Nabaztag.Net
 public bool IsMoving(Ear ear) => _isEarMoving[ear == Ear.Left ? Left : Right];
コード例 #32
0
ファイル: Virtual_Lab.cs プロジェクト: jlaswell/Virtual_Lab
        /// <summary>
        /// Default Constructor
        /// </summary>
        public VirtualLabToplevel()
        {
            //
            // Required	for	Windows	Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after	InitializeComponent	call
            //
            resultsHidePath.Visible	= false;
            testEar = Ear.neither;
        }
コード例 #33
0
 private void OnSelectedFileChanged(Ear <string> ear, string oldValue, string newValue)
 {
     SelectedFileChanged?.Invoke(ViewModel.SelectedFileContent);
 }
コード例 #34
0
ファイル: UC4_Scan.cs プロジェクト: pete7513/ST4HAAAP
 public RawEarScan StartScanning(Ear Earside)
 {
     return(scanner.StartScanning(Earside));
 }
コード例 #35
0
 public WiredCommunication(Ear ear)
 {
     // Configure Adrocom for Wired Communication
     ComWrapper = new AdrocomWrapper(ear, AdrocomMode.Wired);
 }
コード例 #36
0
 public bool RunFeedbackMeasurement(Ear ear)
 {
     throw new NotImplementedException();
 }
コード例 #37
0
ファイル: Pathology.cs プロジェクト: jlaswell/Virtual_Lab
 /// <summary>
 /// Obtains the minimum value of the BC Thresholds for the given ear
 /// </summary>
 /// <param name="ear">which ear is being tested</param>
 /// <returns>miminum BC Threshold value</returns>
 public int GetMinimumBC(Ear ear)
 {
     int min = int.MaxValue;
     for(int i = 250; i < 8000; i*=2)
     {
         int val = BC_Thresh_Val(i, ear);
         if(val < min) min = val;
     }
     return min;
 }