/// <summary>
        /// Update the display based on a mass update
        /// </summary>
        /// <param name="sender">The object sending you here</param>
        /// <param name="e">Event arguments</param>
        private void numCurrMass_Leave(object sender, EventArgs e)
        {
            //first, initial luminosity
            txtInitLumin.Text = Star.getMinLumin((double)numCurrMass.Value).ToString();

            //now we need to get an updated timeline
            this.currAgeChart.addMainLimit(Star.findMainLimit((double)numCurrMass.Value));
            this.currAgeChart.addSubLimit(Star.findSubLimit((double)numCurrMass.Value));
            this.currAgeChart.addGiantLimit(Star.findGiantLimit((double)numCurrMass.Value));

            //now we need to get what stage we are and push the details to the field.
            lblEndMain.Text       = "End of Main Sequence: " + this.currAgeChart.getMainLimit() + " GYr";
            lblEndSubGiant.Text   = "End of the Sub Giant Sequence: " + this.currAgeChart.getSubLimit() + " GYr";
            lblEndGiantPhase.Text = "End of the Giant Phase: " + this.currAgeChart.getGiantLimit() + " GYr";

            this.currAgeStatus   = this.currAgeChart.findCurrentAgeGroup((double)numAge.Value);
            lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus);

            //now we can get the current luminosity, figure out what the intial mass is.
            //and fill in the effective temperature if it's no longer in range.

            numInitMass.Value = numCurrMass.Value;
            txtCurrLumin.Text = Math.Round(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), 3).ToString();

            double temp;

            temp            = Star.getCurrentTemp(this.currAgeChart, Convert.ToDouble(txtCurrLumin.Text), (double)numAge.Value, (double)numCurrMass.Value, this.myDice);
            txtEffTemp.Text = Convert.ToString(temp);

            //set good ranges
            createAcceptRanges(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), temp);

            //display information for users benefits (formation zones, colors)
            this.color            = Star.setColor(this.myDice, temp);
            lblStellarColor.Text  = "Stellar Color: " + color;
            lblStellarRadius.Text = "Stellar Radius: " + Star.getRadius((double)numCurrMass.Value, temp, Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value),
                                                                        this.currAgeChart.findCurrentAgeGroup((double)numAge.Value)) + " AU";

            lblInnerFormation.Text = "Inner Formation Range: " + Star.innerRadius(Convert.ToDouble(txtInitLumin.Text), (double)numInitMass.Value) + " AU";
            lblOuterFormation.Text = "Outer Formation Range: " + Star.outerRadius((double)numInitMass.Value) + " AU";
            lblSnowLine.Text       = "Snow Line: " + Star.snowLine(Convert.ToDouble(txtInitLumin.Text)) + " AU";

            if ((double)numCurrMass.Value > .525)
            {
                chkFlareStar.Checked = false;
                chkFlareStar.Enabled = false;
            }
        }
        /// <summary>
        /// Update the display when you change the age of the star
        /// </summary>
        /// <param name="sender">The object sending you here</param>
        /// <param name="e">Event arguments</param>
        private void numAge_Leave(object sender, EventArgs e)
        {
            this.currAgeStatus   = this.currAgeChart.findCurrentAgeGroup((double)numAge.Value);
            lblCurrentStage.Text = "Current Status: " + StarAgeLine.descBranch(this.currAgeStatus);

            txtCurrLumin.Text = Math.Round(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), 3).ToString();

            double temp;

            temp            = Star.getCurrentTemp(this.currAgeChart, Convert.ToDouble(txtCurrLumin.Text), (double)numAge.Value, (double)numCurrMass.Value, this.myDice);
            txtEffTemp.Text = Convert.ToString(temp);

            createAcceptRanges(Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value), temp);

            lblStellarColor.Text  = "Stellar Color: " + Star.setColor(this.myDice, temp);
            lblStellarRadius.Text = Star.getRadius((double)numCurrMass.Value, temp, Star.getCurrLumin(this.currAgeChart, (double)numAge.Value, (double)numCurrMass.Value),
                                                   this.currAgeChart.findCurrentAgeGroup((double)numAge.Value)) + " AU";
        }
Exemple #3
0
        /// <summary>
        /// This function sets the inital luminosity of a Star object
        /// </summary>
        public virtual void setLumin()
        {
            int currAgeGroup = this.evoLine.findCurrentAgeGroup(this.starAge);

            this.initLumin = getMinLumin(); //this applies for most stars.

            this.currLumin = Star.getCurrLumin(this.evoLine, this.starAge, this.currMass);

            //set the maximum luminosity. Used for determining the formation zones if the star is in a few phases.
            if (currAgeGroup == StarAgeLine.RET_GIANTBRANCH)
            {
                this.maxLumin = this.currLumin;
            }

            if (currAgeGroup == StarAgeLine.RET_COLLASPEDSTAR)
            {
                this.maxLumin = Star.getMinLumin(this.currMass) * 10000;
            }
        }