Esempio n. 1
0
            public List <String> ListeDiametres()
            {
                int lgInt = 0;
                int lgNb  = 0;

                foreach (var Diam in Dic.Keys)
                {
                    int nb = 0;
                    foreach (var list in Dic[Diam].Values)
                    {
                        nb += list.Count;
                    }

                    lgInt = Math.Max(lgInt, Diam.ToString().Length);
                    lgNb  = Math.Max(lgNb, nb.ToString().Length);
                }

                String format = "Ø {0,-" + lgInt + "}  × {1,-" + lgNb + "}";

                foreach (var Diam in Dic.Keys)
                {
                    int nb = 0;
                    foreach (var list in Dic[Diam].Values)
                    {
                        nb += list.Count;
                    }

                    _DicIntitule.Add(String.Format(format, Diam, nb), Diam);
                }

                var lst = _DicIntitule.Keys.ToList();

                lst.Sort(new WindowsStringComparer());
                return(lst);
            }
        protected override void OnParametersSet()
        {
            int numBells;
            double x1Pos;
            double y1Pos;
            double x2Pos;
            double y2Pos;
            double tenorDiameter;

            // Set audio box coordinates
            numBells = TestSpec.Stage + (TestSpec.Stage % 2);

            x1Pos = (TestSpec.BaseGap * TestSpec.XScale) + Screen.XMargin;
            y1Pos = TestSpec.YScale + Screen.YMargin;

            x2Pos = (TestSpec.BaseGap * (numBells + 2) * TestSpec.XScale) + Screen.XMargin;
            y2Pos = (TestSpec.NumRows * TestSpec.YScale) + Screen.YMargin;

            // Adjust y coordinates
            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;
            y1Pos -= (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 4;
            y2Pos += (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 4;

            boundaryLeftPos = Convert.ToInt32(x1Pos).ToString() + "px";
            boundaryTopPos = Convert.ToInt32(y1Pos).ToString() + "px";

            boundaryWidth = Convert.ToInt32(x2Pos - x1Pos).ToString() + "px";
            boundaryHeight = Convert.ToInt32(y2Pos - y1Pos).ToString() + "px";

            // Set audio bar coordinates
            double x3Pos = x1Pos + 50;
            double x4Pos = x2Pos - 50;
            double y3Pos = (y1Pos + y2Pos) / 2;

            barLeftPos = Convert.ToInt32(x3Pos).ToString() + "px";

            // 3 is half the width of the audio bar
            barTopPos = Convert.ToInt32(y3Pos - 3).ToString() + "px";

            barWidth = Convert.ToInt32(x4Pos - x3Pos).ToString() + "px";

            // Set audio dot coordinates
            dotLeftStartPos = (x3Pos - 12).ToString() + "px";
            dotLeftEndPos = (x4Pos - 12).ToString() + "px";
            dotTopPos = (y3Pos - 12).ToString() + "px";

            durationStr = Screen.AnimationDuration.ToString() + "ms";

            msgLeftPos = x3Pos.ToString() + "px";
            msgTopPos = (y3Pos + 6).ToString() + "px";
        }
        protected override void OnParametersSet()
        {
            double xPos;
            double yPos;
            double tenorDiameter;

            xPos = ((TestSpec.BaseGap / (double)2) * TestSpec.XScale) + Screen.XMargin;
            yPos = (TestSpec.NumRows * TestSpec.YScale) + Screen.YMargin;

            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;

            yPos += (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 10 + 44;

            leftPosStr = Convert.ToInt32(xPos).ToString() + "px";
            topPosStr  = Convert.ToInt32(yPos).ToString() + "px";
        }
Esempio n. 4
0
        protected override void OnParametersSet()
        {
            int    numBells;
            double xPos;
            double yPos;
            double tenorDiameter;

            numBells = TestSpec.Stage + (TestSpec.Stage % 2);

            xPos = (TestSpec.BaseGap * (numBells + 2) * TestSpec.XScale) + Screen.XMargin - 75;
            yPos = (TestSpec.NumRows * TestSpec.YScale) + Screen.YMargin;

            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;

            yPos += (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 10;

            leftPosStr = Convert.ToInt32(xPos).ToString() + "px";
            topPosStr  = Convert.ToInt32(yPos).ToString() + "px";
        }
Esempio n. 5
0
        protected override void OnParametersSet()
        {
            // Calculations for bell
            double diameter;
            double diameterMin;
            double bellLeftPos;
            double bellTopPos;
            double paddingTop;

            borderWidthStr = TestSpec.BorderWidth.ToString() + "px";

            diameter = Diam.Diameter(Blow.BellActual) * TestSpec.DiameterScale;

            // Test to see if diameter is too small to fit bell number - if so set diameter to minimum value that
            // will fit the bell number
            diameterMin = ((TestSpec.FontSize / (double)2) + TestSpec.FontPaddingTop + TestSpec.BorderWidth) * 2;

            if (diameter < diameterMin)
            {
                diameter = diameterMin;
            }

            diameterStr = Convert.ToInt32(diameter).ToString() + "px";

            if (Blow.IsHandstroke)
            {
                bellLeftPos = (Blow.GapCumulativeRow * TestSpec.XScale) - (diameter / 2) +
                              Screen.XMargin;
            }
            else
            {
                bellLeftPos = (Blow.GapCumulativeRow * TestSpec.XScale) - (diameter / 2) +
                              (TestSpec.BaseGap * TestSpec.XScale) + Screen.XMargin;
            }

            bellLeftPosStr = Convert.ToInt32(bellLeftPos).ToString() + "px";

            bellTopPos = (Blow.RowNum * TestSpec.YScale) - (diameter / 2) +
                         Screen.YMargin;
            bellTopPosStr = Convert.ToInt32(bellTopPos).ToString() + "px";

            bellFontSizeStr = TestSpec.FontSize.ToString() + "px";

            // First set paddingTop to half the interior diameter
            paddingTop = (diameter - (TestSpec.BorderWidth * 2)) / 2;

            // Fonts seem to insert padding above of about 25% of font size, so subtract this
            paddingTop -= TestSpec.FontPaddingTop;

            // Now subtract half of the font size
            paddingTop -= TestSpec.FontSize / (double)2;

            paddingTopStr = Convert.ToInt32(paddingTop).ToString() + "px";

            // Calculations for gap label
            double tenorDiameter;
            double xPos;
            double yPos;
            double gapLabelLeftPos;
            double gapLabelTopPos;

            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;

            if (Blow.IsHandstroke)
            {
                xPos = (Blow.GapCumulativeRow * TestSpec.XScale) + Screen.XMargin;
            }
            else
            {
                xPos = ((Blow.GapCumulativeRow + TestSpec.BaseGap) * TestSpec.XScale) + Screen.XMargin;
            }

            gapLabelLeftPos = xPos - (tenorDiameter / 2) - 11;

            gapLabelLeftPosStr = Convert.ToInt32(gapLabelLeftPos).ToString() + "px";

            yPos = (Blow.RowNum * TestSpec.YScale) + Screen.YMargin;

            gapLabelTopPos    = yPos + (tenorDiameter / 2) + 1;
            gapLabelTopPosStr = Convert.ToInt32(gapLabelTopPos).ToString() + "px";

            gapLabelFontSizeStr = (TestSpec.FontSize - 2).ToString() + "px";

            if (Blow.IsHighlighted == true)
            {
                bgColor = "lightpink";
            }
            else
            {
                bgColor = "white";
            }

            gapStr = Blow.Gap.ToString();
        }
        protected override void OnParametersSet()
        {
            double diameter;
            double x1Pos;
            double x2Pos;
            double yPos;
            double xPos;
            double tenorDiameter;

            // Work out x coordinate of previous blow (i.e. zero gap)
            int zeroGap = Blow.GapCumulativeRow - Blow.Gap;

            if (Blow.IsHandstroke == true)
            {
                x1Pos = (zeroGap * TestSpec.XScale) + Screen.XMargin;
            }
            else
            {
                x1Pos = ((zeroGap + TestSpec.BaseGap) * TestSpec.XScale) + Screen.XMargin;
            }

            yPos = (Blow.RowNum * TestSpec.YScale) + Screen.YMargin;

            diameter = Diam.Diameter(Blow.BellActual) * TestSpec.DiameterScale;

            // Adjust x1Pos for gapMin, the diameter of the bell, and the width of the boundary box (which is 3px)
            x1Pos += (TestSpec.GapMin * TestSpec.XScale) - (diameter / 2) - 3;

            // Calculate x coordinate of right side of boundary box
            x2Pos = x1Pos + ((TestSpec.GapMax - TestSpec.GapMin) * TestSpec.XScale) +
                    diameter + 6;

            // Submit row
            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;

            if (TestSpec.ButtonsCentered == true)
            {
                xPos = x1Pos + ((x2Pos - x1Pos) / 2);

                // Controls are 293px wide. -78 will center the submit button on the current gap label
                xPos += -78;
            }
            else
            {
                xPos = x2Pos;

                // Controls are 293px wide. -224 will center the submit button on the current gap label
                xPos += -224;
            }

            // Make sure xPos isn't too close to left hand edge of screen
            if (xPos < 10)
            {
                xPos = 10;
            }

            // 44 is height of buttons in previous row (38) + margin of 6
            yPos += (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 10 + 44;

            leftPosStr = Convert.ToInt32(xPos).ToString() + "px";
            topPosStr  = Convert.ToInt32(yPos).ToString() + "px";
        }
Esempio n. 7
0
    public void setLarge()
    {
        diam = Diam.LARGE;

        selectionne("large", DIAM);
    }
Esempio n. 8
0
    public void setMedium()
    {
        diam = Diam.MEDIUM;

        selectionne("medium", DIAM);
    }
Esempio n. 9
0
    //Selection des diamètres
    public void setSmall()
    {
        diam = Diam.SMALL;

        selectionne("small", DIAM);
    }
        protected override void OnParametersSet()
        {
            double diameter;
            double x1Pos;
            double x2Pos;
            double yPos;
            double y1Pos;
            double y2Pos;
            double xPos;
            double boundaryLabelWidth;
            double boundaryLabelHeight;
            double altGapLeftPos;
            double altGapTopPos;
            double tenorDiameter;

            // Work out x coordinate of previous blow (i.e. zero gap)
            int zeroGap = Blow.GapCumulativeRow - Blow.Gap;

            if (Blow.IsHandstroke == true)
            {
                x1Pos = (zeroGap * TestSpec.XScale) + Screen.XMargin;
            }
            else
            {
                x1Pos = ((zeroGap + TestSpec.BaseGap) * TestSpec.XScale) + Screen.XMargin;
            }

            yPos = (Blow.RowNum * TestSpec.YScale) + Screen.YMargin;

            diameter = Diam.Diameter(Blow.BellActual) * TestSpec.DiameterScale;

            // Adjust x1Pos for gapMin, the diameter of the bell, and the width of the boundary box (which is 3px)
            x1Pos += (TestSpec.GapMin * TestSpec.XScale) - (diameter / 2) - 3;

            // Set y1Pos from the diameter of the bell, and the width of the boundary box (which is 3px)
            y1Pos = yPos - ((diameter / 2) + 3);

            // Calculate coordinates of bottom right corner of boundary box
            x2Pos = x1Pos + ((TestSpec.GapMax - TestSpec.GapMin) * TestSpec.XScale) +
                    diameter + 6;
            y2Pos = yPos + ((diameter / 2) + 3);

            // Boundary row
            boundaryRowLeftPosStr = Convert.ToInt32(x1Pos).ToString() + "px";
            boundaryRowTopPosStr  = Convert.ToInt32(y1Pos).ToString() + "px";

            // Calculate width and height of boundary box
            boundaryLabelWidth  = x2Pos - x1Pos;
            boundaryLabelHeight = y2Pos - y1Pos;

            boundaryLabelWidthStr  = Convert.ToInt32(boundaryLabelWidth).ToString() + "px";
            boundaryLabelHeightStr = Convert.ToInt32(boundaryLabelHeight).ToString() + "px";

            // Alt gap label
            altGapLeftPos = x2Pos + 10;
            altGapTopPos  = yPos - TestSpec.FontSize - 4;

            altGapLeftPosStr = Convert.ToInt32(altGapLeftPos).ToString() + "px";
            altGapTopPosStr  = Convert.ToInt32(altGapTopPos).ToString() + "px";

            altGapLabelStr         = Blow.AltGap.ToString() + "ms";
            altGapLabelFontSizeStr = (TestSpec.FontSize - 1).ToString() + "px";

            // Buttons
            tenorDiameter = Diam.Diameter("T") * TestSpec.DiameterScale;

            if (TestSpec.ButtonsCentered == true)
            {
                xPos = x1Pos + ((x2Pos - x1Pos) / 2);

                // Controls are 293px wide. When centering, adjust by half this amount
                xPos += -146;
            }
            else
            {
                xPos = x2Pos;

                // Controls are 293px wide. When aligning right, adjust by this amount
                xPos += -293;
            }

            // Make sure xPos isn't too close to left hand edge of screen
            if (xPos < 10)
            {
                xPos = 10;
            }

            yPos += (tenorDiameter / 2) + 1 + (TestSpec.FontSize - 2) + TestSpec.FontPaddingTop + 10;

            gapMinusLeftPosStr = Convert.ToInt32(xPos).ToString() + "px";
            gapMinusTopPosStr  = Convert.ToInt32(yPos).ToString() + "px";

            gapCurrLeftPosStr = Convert.ToInt32(xPos + 81).ToString() + "px";
            gapCurrTopPosStr  = Convert.ToInt32(yPos).ToString() + "px";

            gapPlusLeftPosStr = Convert.ToInt32(xPos + 81 + 56).ToString() + "px";
            gapPlusTopPosStr  = Convert.ToInt32(yPos).ToString() + "px";

            playLeftPosStr = Convert.ToInt32(xPos + 81 + 56 + 81).ToString() + "px";
            playTopPosStr  = Convert.ToInt32(yPos).ToString() + "px";
        }