コード例 #1
0
        void clockRadio_CheckedChanged(object sender, EventArgs e)
        {
            ClockFace oldClockFace = currentClockFace;

            if (clock10Radio.Selected)
            {
                currentClockFace = ClockFace.Clock10;
                rdaPanel.Visible = true;
                rdaReductionGroup.SelectedButton = mildRDAReductionButton;
            }
            else if (clock11Radio.Selected)
            {
                currentClockFace = ClockFace.Clock11;
                rdaPanel.Visible = false;
            }
            else if (clock12Radio.Selected)
            {
                currentClockFace = ClockFace.Clock12;
                rdaPanel.Visible = false;
            }
            if (allowClockChangeEventFire && oldClockFace != currentClockFace)
            {
                if (CurrentStageChanged != null)
                {
                    CurrentStageChanged.Invoke(this, EventArgs.Empty);
                }
            }
        }
コード例 #2
0
        void rdaGroup_SelectedButtonChanged(object sender, EventArgs e)
        {
            RdaReduction oldReduction = currentReduction;

            if (mildRDAReductionButton.Selected)
            {
                currentReduction = RdaReduction.Mild;
            }
            else if (moderateRDAReductionButton.Selected)
            {
                currentReduction = RdaReduction.Moderate;
            }
            else if (severeRDAReductionButton.Selected)
            {
                currentReduction = RdaReduction.Severe;
            }
            if (allowRdaReductionEventFire && oldReduction != currentReduction)
            {
                if (CurrentStageChanged != null)
                {
                    CurrentStageChanged.Invoke(this, EventArgs.Empty);
                }
            }
        }
コード例 #3
0
        void stageGroup_SelectedButtonChanged(object sender, EventArgs e)
        {
            PiperStage oldStage = currentStage;

            if (stageIButton.Selected)
            {
                currentStage     = PiperStage.I;
                rdaGroup.Enabled = false;
            }
            else if (stageIIButton.Selected)
            {
                currentStage     = PiperStage.II;
                rdaGroup.Enabled = false;
            }
            else if (stageIIIaButton.Selected)
            {
                currentStage     = PiperStage.IIIa;
                rdaGroup.Enabled = false;
            }
            else if (stageIIIbButton.Selected)
            {
                currentStage     = PiperStage.IIIb;
                rdaGroup.Enabled = false;
            }
            else if (stageIVaButton.Selected)
            {
                allowRdaReductionEventFire = false;
                currentStage               = PiperStage.IVa;
                rdaGroup.Enabled           = true;
                rdaGroup.SelectedButton    = mildRDAReductionButton;
                allowRdaReductionEventFire = true;
            }
            else if (stageIVbButton.Selected)
            {
                allowRdaReductionEventFire = false;
                currentStage               = PiperStage.IVb;
                rdaGroup.Enabled           = true;
                rdaGroup.SelectedButton    = mildRDAReductionButton;
                allowRdaReductionEventFire = true;
            }
            else if (stageVaButton.Selected)
            {
                currentStage     = PiperStage.Va;
                rdaGroup.Enabled = false;
            }
            else if (stageVbButton.Selected)
            {
                currentStage     = PiperStage.Vb;
                rdaGroup.Enabled = false;
            }
            else
            {
                currentStage = PiperStage.Unknown;
            }
            if (currentStage != oldStage && allowStageChangeEventFire)
            {
                if (CurrentStageChanged != null)
                {
                    CurrentStageChanged.Invoke(this, EventArgs.Empty);
                }
            }
        }
コード例 #4
0
        private PiperStage computeDopplerStage()
        {
            stageMap[PiperStage.I]    = 0;
            stageMap[PiperStage.II]   = 0;
            stageMap[PiperStage.IIIa] = 0;
            stageMap[PiperStage.IIIb] = 0;
            stageMap[PiperStage.IVa]  = 0;
            stageMap[PiperStage.IVb]  = 0;
            stageMap[PiperStage.Va]   = 0;
            stageMap[PiperStage.Vb]   = 0;

            switch (rotatoryCombo.SelectedIndex)
            {
            case 0:     //None
                stageMap[PiperStage.I]    += 2;
                stageMap[PiperStage.II]   += 2;
                stageMap[PiperStage.IIIa] += 2;
                stageMap[PiperStage.IIIb] += 2;
                break;

            case 1:     //Mild
                stageMap[PiperStage.I]    += 1;
                stageMap[PiperStage.II]   += 1;
                stageMap[PiperStage.IIIa] += 1;
                stageMap[PiperStage.IIIb] += 1;
                stageMap[PiperStage.IVa]  += 1;
                stageMap[PiperStage.IVb]  += 1;
                break;

            case 2:     //Moderate
                stageMap[PiperStage.IVa] += 2;
                stageMap[PiperStage.IVb] += 2;
                stageMap[PiperStage.Va]  += 1;
                stageMap[PiperStage.Vb]  += 1;
                break;

            case 3:     //Coarse Rough
                stageMap[PiperStage.Va] += 10;
                break;

            case 4:     //Coarse Eburnated
                stageMap[PiperStage.Vb] += 10;
                break;
            }

            switch (translatoryCombo.SelectedIndex)
            {
            case 0:     //None
                stageMap[PiperStage.I]  += 2;
                stageMap[PiperStage.II] += 1;
                break;

            case 1:     //Mild
                stageMap[PiperStage.I]    += 1;
                stageMap[PiperStage.II]   += 2;
                stageMap[PiperStage.IIIa] += 1;
                stageMap[PiperStage.IIIb] += 1;
                stageMap[PiperStage.IVa]  += 1;
                stageMap[PiperStage.IVb]  += 1;
                break;

            case 2:     //Moderate
                stageMap[PiperStage.IIIa] += 2;
                stageMap[PiperStage.IIIb] += 2;
                stageMap[PiperStage.IVa]  += 2;
                stageMap[PiperStage.IVb]  += 2;
                break;

            case 3:     //Coarse Rough
                stageMap[PiperStage.Va] += 10;
                break;

            case 4:     //Coarse Eburnated
                stageMap[PiperStage.Vb] += 10;
                break;
            }

            switch (clickCombo.SelectedIndex)
            {
            case 0:     //None
                stageMap[PiperStage.I]    += 2;
                stageMap[PiperStage.II]   += 1;
                stageMap[PiperStage.IIIb] += 2;
                stageMap[PiperStage.IVb]  += 2;
                stageMap[PiperStage.Va]   += 2;
                stageMap[PiperStage.Vb]   += 2;
                break;

            case 1:     //Reciprocal
                stageMap[PiperStage.II]   += 2;
                stageMap[PiperStage.IIIa] += 2;
                stageMap[PiperStage.IVa]  += 2;
                break;

            case 2:     //Surface
                stageMap[PiperStage.Va] += 1;
                stageMap[PiperStage.Vb] += 1;
                break;
            }

            //Find the largest number
            int largest = 0;

            foreach (int value in stageMap.Values)
            {
                if (value > largest)
                {
                    largest = value;
                }
            }

            //Find all matching stages and return them
            PiperStage stages = PiperStage.Unknown;

            foreach (PiperStage stage in stageMap.Keys)
            {
                if (stageMap[stage] == largest)
                {
                    stages |= stage;
                }
            }

            allowStageChangeEventFire  = false;
            allowRdaReductionEventFire = false;

            //Update UI
            bool activatedLowest = false;

            processButton(stageIButton, PiperStage.I, stages, ref activatedLowest);
            processButton(stageIIButton, PiperStage.II, stages, ref activatedLowest);
            processButton(stageIIIaButton, PiperStage.IIIa, stages, ref activatedLowest);
            processButton(stageIIIbButton, PiperStage.IIIb, stages, ref activatedLowest);
            processButton(stageIVaButton, PiperStage.IVa, stages, ref activatedLowest);
            processButton(stageIVbButton, PiperStage.IVb, stages, ref activatedLowest);
            processButton(stageVaButton, PiperStage.Va, stages, ref activatedLowest);
            processButton(stageVbButton, PiperStage.Vb, stages, ref activatedLowest);

            //Override the settings with any custom overrides
            //If rotatory crepitus is Moderate and we do not have coarse rough or coarse ebrunated
            if (rotatoryCombo.SelectedIndex == 2 && translatoryCombo.SelectedIndex != 3 && translatoryCombo.SelectedIndex != 4)
            {
                //Force stage IVa if reciprocal click
                if (clickCombo.SelectedIndex == 1)
                {
                    stageGroup.SelectedButton = stageIVaButton;
                }
                //Force stage IVb for others ignoring value under translatory
                else
                {
                    stageGroup.SelectedButton = stageIVbButton;
                    stageIVbButton.Enabled    = true;
                }
            }

            allowStageChangeEventFire  = true;
            allowRdaReductionEventFire = true;

            if (CurrentStageChanged != null)
            {
                CurrentStageChanged.Invoke(this, EventArgs.Empty);
            }

            return(stages);
        }
コード例 #5
0
        void stageButton_CheckedChanged(object sender, EventArgs e)
        {
            PiperStage oldStage = currentStage;

            if (stageIButton.Selected)
            {
                currentStage           = PiperStage.I;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else if (stageIIButton.Selected)
            {
                currentStage           = PiperStage.II;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else if (stageIIIaButton.Selected)
            {
                currentStage           = PiperStage.IIIa;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else if (stageIIIbButton.Selected)
            {
                currentStage           = PiperStage.IIIb;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else if (stageIVaButton.Selected)
            {
                allowRdaReductionEventFire = false;
                currentStage     = PiperStage.IVa;
                rdaPanel.Visible = clock10Radio.Selected;
                rdaReductionGroup.SelectedButton = mildRDAReductionButton;
                clockFacePanel.Visible           = true;
                allowRdaReductionEventFire       = true;
            }
            else if (stageIVbButton.Selected)
            {
                allowRdaReductionEventFire = false;
                currentStage               = PiperStage.IVb;
                rdaPanel.Visible           = false;
                clockFacePanel.Visible     = false;
                allowRdaReductionEventFire = true;
            }
            else if (stageVaButton.Selected)
            {
                currentStage           = PiperStage.Va;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else if (stageVbButton.Selected)
            {
                currentStage           = PiperStage.Vb;
                rdaPanel.Visible       = false;
                clockFacePanel.Visible = false;
            }
            else
            {
                currentStage = PiperStage.Unknown;
            }
            if (currentStage != oldStage && allowStageChangeEventFire)
            {
                if (CurrentStageChanged != null)
                {
                    CurrentStageChanged.Invoke(this, EventArgs.Empty);
                }
            }
        }
コード例 #6
0
        private void computeDiscSpaceStage()
        {
            stageMap[PiperStage.I]    = 0;
            stageMap[PiperStage.II]   = 0;
            stageMap[PiperStage.IIIa] = 0;
            stageMap[PiperStage.IIIb] = 0;
            stageMap[PiperStage.IVa]  = 0;
            stageMap[PiperStage.IVb]  = 0;
            stageMap[PiperStage.Va]   = 0;
            stageMap[PiperStage.Vb]   = 0;

            clockFaceMap[ClockFace.Clock10] = 0;
            clockFaceMap[ClockFace.Clock11] = 0;
            clockFaceMap[ClockFace.Clock12] = 0;

            switch (verticalSpaceCombo.SelectedIndex)
            {
            case 0:     //Normal
                stageMap[PiperStage.I]    += 1;
                stageMap[PiperStage.II]   += 1;
                stageMap[PiperStage.IIIa] += 1;
                stageMap[PiperStage.IIIb] += 1;
                //stageMap[PiperStage.IVa] += 1;
                clockFaceMap[ClockFace.Clock11] += 1;
                break;

            case 1:     //Increased
                stageMap[PiperStage.IVa]        += 1;
                clockFaceMap[ClockFace.Clock11] += 1;
                clockFaceMap[ClockFace.Clock12] += 2;
                break;

            case 2:     //Decreased
                stageMap[PiperStage.IVa]        += 1;
                stageMap[PiperStage.IVb]        += 1;
                clockFaceMap[ClockFace.Clock11] += 1;
                clockFaceMap[ClockFace.Clock10] += 2;
                break;

            case 3:     //Bone on Bone
                stageMap[PiperStage.Va] += 10;
                stageMap[PiperStage.Vb] += 10;
                break;
            }

            switch (horizontalSpaceCombo.SelectedIndex)
            {
            case 0:     //Normal
                stageMap[PiperStage.I]    += 1;
                stageMap[PiperStage.II]   += 1;
                stageMap[PiperStage.IIIa] += 1;
                stageMap[PiperStage.IIIb] += 1;
                stageMap[PiperStage.IVa]  += 1;
                stageMap[PiperStage.IVb]  += 1;
                stageMap[PiperStage.Va]   += 1;
                stageMap[PiperStage.Vb]   += 1;
                break;

            case 1:     //Posterior Shift
                stageMap[PiperStage.IVa]        += 2;
                clockFaceMap[ClockFace.Clock11] += 2;
                break;
            }

            switch (condyleShapeCombo.SelectedIndex)
            {
            case 0:     //Normal
                stageMap[PiperStage.I]    += 1;
                stageMap[PiperStage.II]   += 1;
                stageMap[PiperStage.IIIa] += 1;
                stageMap[PiperStage.IIIb] += 1;
                stageMap[PiperStage.IVa]  += 1;
                stageMap[PiperStage.IVb]  += 1;
                stageMap[PiperStage.Va]   += 1;
                break;

            case 1:     //Osteophyte
                stageMap[PiperStage.Vb] += 10;
                break;
            }

            //Find the largest piper stage number
            int largest = 0;

            foreach (int value in stageMap.Values)
            {
                if (value > largest)
                {
                    largest = value;
                }
            }

            //Find all matching stages and return them
            PiperStage stages = PiperStage.Unknown;

            foreach (PiperStage stage in stageMap.Keys)
            {
                if (stageMap[stage] == largest)
                {
                    stages |= stage;
                }
            }

            //Find the largest clock face number
            largest = 0;
            foreach (int value in clockFaceMap.Values)
            {
                if (value > largest)
                {
                    largest = value;
                }
            }

            ClockFace clockFaces = ClockFace.Unknown;

            foreach (ClockFace clockFace in clockFaceMap.Keys)
            {
                if (clockFaceMap[clockFace] == largest)
                {
                    clockFaces |= clockFace;
                }
            }

            allowStageChangeEventFire  = false;
            allowRdaReductionEventFire = false;
            allowClockChangeEventFire  = false;

            //Update UI
            bool activatedLowest = false;

            processStageButton(stageIButton, (int)PiperStage.I, (int)stages, ref activatedLowest);
            processStageButton(stageIIButton, (int)PiperStage.II, (int)stages, ref activatedLowest);
            processStageButton(stageIIIaButton, (int)PiperStage.IIIa, (int)stages, ref activatedLowest);
            processStageButton(stageIIIbButton, (int)PiperStage.IIIb, (int)stages, ref activatedLowest);
            processStageButton(stageIVaButton, (int)PiperStage.IVa, (int)stages, ref activatedLowest);
            processStageButton(stageIVbButton, (int)PiperStage.IVb, (int)stages, ref activatedLowest);
            processStageButton(stageVaButton, (int)PiperStage.Va, (int)stages, ref activatedLowest);
            processStageButton(stageVbButton, (int)PiperStage.Vb, (int)stages, ref activatedLowest);

            activatedLowest = false;
            processClockButton(clock12Radio, (int)ClockFace.Clock12, (int)clockFaces, ref activatedLowest);
            processClockButton(clock11Radio, (int)ClockFace.Clock11, (int)clockFaces, ref activatedLowest);
            processClockButton(clock10Radio, (int)ClockFace.Clock10, (int)clockFaces, ref activatedLowest);

            allowStageChangeEventFire  = true;
            allowRdaReductionEventFire = true;
            allowClockChangeEventFire  = true;

            if (CurrentStageChanged != null)
            {
                CurrentStageChanged.Invoke(this, EventArgs.Empty);
            }
        }