예제 #1
0
        /// <summary>
        /// Po nacteni hlavniho okna se inicializuje hlavni manazer, ktery se postara
        /// o zbytek inicializace; take se inicializuje manazer kamery
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // pokud loading timer uz nebezi, zrus loading okno
            if (!loadingTimer.Enabled)
            {
                loadingWindow.Close();
            }

            // nacteni veskereho nastaveni z XML souboru
            CalibrationSettings.Instance().Load();
            CaptureSettings.Instance().Load();
            GraphicsSettings.Instance().Load();
            PhysicSettings.Instance().Load();


            CommonAttribService.mainWindow = this;

            // vytvoreni manazeru, ktery propoji funkcionalitu VSEM hlavnim modelum
            myManager          = new WindowManager();
            myManager.MyWindow = this;
            myManager.LoadDefaultValues();
            myManager.ManageMainWindow();

            CameraManager.Reinitialize();
        }
예제 #2
0
 /// <summary>
 /// Reset of al settings
 /// </summary>
 private void resetBut_Click(object sender, RoutedEventArgs e)
 {
     CalibrationSettings.Instance().Restart();
     CaptureSettings.Instance().Restart();
     GraphicsSettings.Instance().Restart();
     PhysicSettings.Instance().Restart();
 }
예제 #3
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     CalibrationSettings.Instance().Save();
     CaptureSettings.Instance().Save();
     GraphicsSettings.Instance().Save();
     PhysicSettings.Instance().Save();
 }
예제 #4
0
        /// <summary>
        /// Tries to generate particles. May return null if the generator is eiher empty
        /// or the random attempt failed
        /// </summary>
        /// <returns></returns>
        public Particle[] Generate(TableDepositor system, double counter)
        {
            GeneratorSettings settings = (settings_allowed) ? this.settings : this.baseSettings;

            generatingStep++;
            if (generatingStep > (PhysicSettings.Instance().DEFAULT_GENERATING_SPEED - settings.generatingSpeed))
            {
                // coefficient of regularity
                int coeff       = settings.Regular_generating ? 1 : (CommonAttribService.apiRandom.Next(5) + 1);
                int arrayLength = (int)((settings.generatingSpeed / coeff) * ((A_Rock)this).Intensity / 100);
                if (arrayLength <= 0)
                {
                    return(null);
                }
                Particle[] output = new Particle[arrayLength];



                for (int i = 0; i < output.Length; i++)
                {
                    output[i] = GenerateParticle(counter);
                    // start over
                    generatingStep = 0;
                }
                generatingNumber++;
                return(output);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
파일: Particle.cs 프로젝트: dodocloud/InTab
 public Particle()
 {
     settings                 = new ParticleSettings();
     baseSettings             = new ParticleSettings();
     this.vector_Velocity     = PhysicSettings.Instance().DEFAULT_TABLEOBJECT_VELOCITY;
     this.vector_Acceleration = new FVector(0, 0);
     settings.weigh           = PhysicSettings.Instance().DEFAULT_PARTICLE_WEIGH;
 }
예제 #6
0
파일: Graviton.cs 프로젝트: dodocloud/InTab
 public Graviton()
 {
     settings                = new GravitonSettings();
     baseSettings            = new GravitonSettings();
     this.shape              = new FCircle();
     ((FCircle)shape).Radius = PhysicSettings.Instance().DEFAULT_GRAVITON_RADIUS;
     settings.weigh          = PhysicSettings.Instance().DEFAULT_GRAVITON_WEIGH;
 }
예제 #7
0
 public Magneton()
 {
     settings                = new MagnetonSettings();
     baseSettings            = new MagnetonSettings();
     this.shape              = new FCircle();
     ((FCircle)shape).Radius = PhysicSettings.Instance().DEFAULT_MAGNETON_RADIUS;
     settings.force          = PhysicSettings.Instance().DEFAULT_MAGNETON_FORCE;
 }
예제 #8
0
 public BlackHole()
 {
     this.shape              = new FCircle();
     this.settings           = new BlackHoleSettings();
     this.baseSettings       = new BlackHoleSettings();
     settings.weigh          = PhysicSettings.Instance().DEFAULT_BLACKHOLE_WEIGH;
     settings.capacity       = PhysicSettings.Instance().DEFAULT_BLACKHOLE_CAPACITY;
     ((FCircle)shape).Radius = PhysicSettings.Instance().DEFAULT_BLACKHOLE_RADIUS;
 }
예제 #9
0
        /// <summary>
        /// Processes gravitons for one particle
        /// </summary>
        /// <param name="system"></param>
        /// <param name="part"></param>
        public static void ProcessGravitons(TableDepositor system, Particle part)
        {
            temp.X = 0;
            temp.Y = 0;

            foreach (Graviton ig in system.gravitons)
            {
                GravitonSettings settings = (ig.Settings_Allowed) ? ig.Settings : system.table.Settings.gravitonSettings;

                double length = (part.Position.X - ig.Position.X) * (part.Position.X - ig.Position.X) +
                                (part.Position.Y - ig.Position.Y) * (part.Position.Y - ig.Position.Y);

                //=================================================
                // GRAVITY:
                // g = CONST*M/(radius/11 + 14),
                //=================================================

                // fix treshold
                double acc         = (PhysicSettings.Instance().DEFAULT_GRAVITY_CONSTANT *ig.Settings.weigh) / (length / 114 + 14) * (((A_Rock)ig).Intensity / 100);
                double sqrt_length = Math.Sqrt(length);
                if (sqrt_length < 20)
                {
                    acc *= -Math.Log(sqrt_length - Math.Min(20, sqrt_length - 2));
                }

                // pulsar
                if (settings.Energy_pulsing)
                {
                    acc /= (1 + Math.Tan(settings.Energy_pulse_speed) / 10);
                }

                // calculate velocity
                if (PhysicsSettings.gravitationMode == GravitationMode.ADITIVE)
                {
                    temp.Add(acc * ((ig.Position.X - part.Position.X) / Math.Sqrt(length)),
                             acc * ((ig.Position.Y - part.Position.Y) / Math.Sqrt(length)));
                }
                else if (PhysicsSettings.gravitationMode == GravitationMode.AVERAGE)
                {
                    temp.Add(1 / (acc * ((ig.Position.X - part.Position.X) / Math.Sqrt(length))),
                             1 / (acc * ((ig.Position.Y - part.Position.Y) / Math.Sqrt(length))));
                }
                else if (PhysicsSettings.gravitationMode == GravitationMode.MULTIPLY)
                {
                    temp.Add(acc * ((ig.Position.X - part.Position.X) / Math.Log(length)),
                             acc * ((ig.Position.Y - part.Position.Y) / Math.Log(length)));
                }
            }

            if (PhysicsSettings.gravitationMode == GravitationMode.AVERAGE)
            {
                temp.Invert();
            }

            part.Vector_Acceleration.Add(temp);
        }
예제 #10
0
 /// <summary>
 /// Loads default settings
 /// </summary>
 private void loadDefButton_Click(object sender, RoutedEventArgs e)
 {
     GminPartSizeSlider.Value     = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZE;
     GmaxPartSizeSlider.Value     = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZE;
     BHweighSlider.Value          = PhysicSettings.Instance().DEFAULT_BLACKHOLE_WEIGH;
     GangleMaxSlider.Value        = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_MAX;
     GangleOffSlider.Value        = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_OFFSET;
     GgenerSpeedSlider.Value      = PhysicSettings.Instance().DEFAULT_GENERATING_SPEED;
     GmaxPartVelocitySlider.Value = PhysicSettings.Instance().DEFAULT_MAX_GENERATING_VELOCITY;
     GminPartVelocitySlider.Value = PhysicSettings.Instance().DEFAULT_MIN_GENERATING_VELOCITY;
     GravWeighSlider.Value        = PhysicSettings.Instance().DEFAULT_GRAVITON_WEIGH;
     MagForceSlider.Value         = PhysicSettings.Instance().DEFAULT_MAGNETON_FORCE;
     pulsarChck.IsChecked         = PhysicSettings.Instance().DEFAULT_ENERGY_GRAVITON_PULSING;
     baseSetChck.IsChecked        = false;
 }
예제 #11
0
        /// <summary>
        /// Processes magnetons for one particle
        /// </summary>
        public static void ProcessMagnetons(TableDepositor system, Particle part)
        {
            temp.X = 0;
            temp.Y = 0;

            foreach (Magneton ig in system.magnetons)
            {
                MagnetonSettings settings = (ig.Settings_Allowed) ? ig.Settings : system.table.Settings.magnetonSettings;

                // calculate distance between the particle and the stone
                double length = (part.Position.X - ig.Position.X) * (part.Position.X - ig.Position.X) +
                                (part.Position.Y - ig.Position.Y) * (part.Position.Y - ig.Position.Y);

                double acc = (PhysicSettings.Instance().DEFAULT_MAGNETON_CONSTANT *ig.Settings.force) / (length / 114 + 14) * (((A_Rock)ig).Intensity / 100);


                // pulsar
                if (settings.Energy_pulsing)
                {
                    acc /= (1 + Math.Tan(counter * settings.Energy_pulse_speed) / 10);
                }

                if (PhysicsSettings.magnetismMode == MagnetismMode.ADITIVE)
                {
                    temp.Add(-acc * ((ig.Position.X - part.Position.X) / Math.Sqrt(length)),
                             -acc * ((ig.Position.Y - part.Position.Y) / Math.Sqrt(length)));
                }
                else if (PhysicsSettings.magnetismMode == MagnetismMode.AVERAGE)
                {
                    temp.Add(1 / (-acc * ((ig.Position.X - part.Position.X) / Math.Sqrt(length))),
                             1 / (-acc * ((ig.Position.Y - part.Position.Y) / Math.Sqrt(length))));
                }
                else if (PhysicsSettings.magnetismMode == MagnetismMode.MULTIPLY)
                {
                    temp.Add(-acc * ((ig.Position.X - part.Position.X) / Math.Log(length)),
                             -acc * ((ig.Position.Y - part.Position.Y) / Math.Log(length)));
                }
            }

            if (PhysicsSettings.magnetismMode == MagnetismMode.AVERAGE)
            {
                temp.Invert();
            }
            part.Vector_Acceleration.Add(temp);
        }
예제 #12
0
        public TableSettings()
        {
            energy_loosing       = PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING;
            energy_loosing_speed = PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED;

            gravity_allowed = PhysicSettings.Instance().DEFAULT_TABLE_GRAVITY;
            gravity         = PhysicSettings.Instance().DEFAULT_TABLE_GRAVITY_VECTOR;
            interaction     = PhysicSettings.Instance().DEFAULT_INTERACTION_ALLOWED;

            blackHoleSettings          = new BlackHoleSettings();
            blackHoleSettings.capacity = PhysicSettings.Instance().DEFAULT_BLACKHOLE_CAPACITY;
            blackHoleSettings.weigh    = PhysicSettings.Instance().DEFAULT_BLACKHOLE_WEIGH;
            blackHoleSettings.enabled  = PhysicSettings.Instance().DEFAULT_BLACKHOLE_ENABLED;

            generatorSettings = new GeneratorSettings();
            generatorSettings.angle_maximum          = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_MAX;
            generatorSettings.angle_offset           = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_OFFSET;
            generatorSettings.generatingSpeed        = PhysicSettings.Instance().DEFAULT_GENERATING_SPEED;
            generatorSettings.particle_maximum_speed = PhysicSettings.Instance().DEFAULT_MAX_GENERATING_VELOCITY;
            generatorSettings.particle_minimum_speed = PhysicSettings.Instance().DEFAULT_MIN_GENERATING_VELOCITY;
            generatorSettings.Regular_generating     = PhysicSettings.Instance().DEFAULT_GENERATING_REGULAR;
            generatorSettings.enabled = PhysicSettings.Instance().DEFAULT_GENERATOR_ENABLED;

            gravitonSettings = new GravitonSettings();
            gravitonSettings.Energy_pulse_speed = PhysicSettings.Instance().DEFAULT_ENERGY_GRAVITON_PULSING_SPEED;
            gravitonSettings.Energy_pulsing     = PhysicSettings.Instance().DEFAULT_ENERGY_GRAVITON_PULSING;
            gravitonSettings.weigh   = PhysicSettings.Instance().DEFAULT_GRAVITON_WEIGH;
            gravitonSettings.enabled = PhysicSettings.Instance().DEFAULT_GRAVITON_ENABLED;

            magnetonSettings = new MagnetonSettings();
            magnetonSettings.Energy_pulse_speed = PhysicSettings.Instance().DEFAULT_ENERGY_MAGNETON_PULSING_SPEED;
            magnetonSettings.Energy_pulsing     = PhysicSettings.Instance().DEFAULT_ENERGY_MAGNETON_PULSING;
            magnetonSettings.force   = PhysicSettings.Instance().DEFAULT_MAGNETON_FORCE;
            magnetonSettings.enabled = PhysicSettings.Instance().DEFAULT_MAGNETON_ENABLED;

            particleSettings         = new ParticleSettings();
            particleSettings.weigh   = PhysicSettings.Instance().DEFAULT_PARTICLE_WEIGH;
            particleSettings.enabled = PhysicSettings.Instance().DEFAULT_PARTICLE_ENABLED;
            particleSettings.size    = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZE;
        }
예제 #13
0
        /// <summary>
        /// Draws a grid that determines gravity force
        /// </summary>
        /// <param name="objects"></param>
        private void DrawLines(TableDepositor objects)
        {
            DateTime pk        = DateTime.Now;
            int      row_pixel = (((int)(CommonAttribService.ACTUAL_TABLE_HEIGHT * ratioY)) / 20);
            int      col_pixel = row_pixel;

            for (int i = 0; i < ((int)(ratioY * CommonAttribService.ACTUAL_TABLE_HEIGHT)); i += row_pixel)
            {
                for (int j = 0; j < ((int)(ratioX * CommonAttribService.ACTUAL_TABLE_WIDTH)); j += col_pixel)
                {
                    int orig_col = j;
                    int orig_row = i;

                    // original position of the point
                    int orig_position_x = orig_col - ((int)(ratioX * CommonAttribService.ACTUAL_TABLE_WIDTH)) / 2;
                    int orig_position_y = orig_row - ((int)(ratioY * CommonAttribService.ACTUAL_TABLE_HEIGHT)) / 2;


                    double temp_position_x = orig_position_x;
                    double temp_position_y = orig_position_y;

                    double shift_x = 0;
                    double shift_y = 0;

                    foreach (Graviton gr in objects.gravitons)
                    {
                        // calc distance between the original point and the graviton
                        double length = Math.Sqrt((temp_position_x - gr.Position.X) * (temp_position_x - gr.Position.X) +
                                                  (temp_position_y - gr.Position.Y) * (temp_position_y - gr.Position.Y));


                        // calculate potential
                        double acc = (PhysicSettings.Instance().DEFAULT_GRAVITY_CONSTANT *gr.Settings.weigh) / ((length * length / 100 + 10));

                        // shift the grid point
                        shift_x += acc * (gr.Position.X - temp_position_x) / (0.1 * gr.Settings.weigh);
                        shift_y += acc * (gr.Position.Y - temp_position_y) / (0.1 * gr.Settings.weigh);

                        temp_position_x = orig_position_x + shift_x;
                        temp_position_y = orig_position_y + shift_y;
                    }

                    foreach (Magneton mg in objects.magnetons)
                    {
                        double length = Math.Sqrt((temp_position_x - mg.Position.X) * (temp_position_x - mg.Position.X) +
                                                  (temp_position_y - mg.Position.Y) * (temp_position_y - mg.Position.Y));

                        double acc = (PhysicSettings.Instance().DEFAULT_GRAVITY_CONSTANT *mg.Settings.force) / ((length * length / 100 + 10));

                        shift_x -= acc * (mg.Position.X - temp_position_x);
                        shift_y -= acc * (mg.Position.Y - temp_position_y);

                        temp_position_x = orig_position_x + shift_x;
                        temp_position_y = orig_position_y + shift_y;
                    }


                    foreach (BlackHole mg in objects.blackHoles)
                    {
                        double length = Math.Sqrt((temp_position_x - mg.Position.X) * (temp_position_x - mg.Position.X) +
                                                  (temp_position_y - mg.Position.Y) * (temp_position_y - mg.Position.Y));

                        double acc = (PhysicSettings.Instance().DEFAULT_GRAVITY_CONSTANT * 80) / ((length * length / 100 + 10));

                        shift_x += acc * (mg.Position.X - temp_position_x);
                        shift_y += acc * (mg.Position.Y - temp_position_y);

                        temp_position_x = orig_position_x + shift_x;
                        temp_position_y = orig_position_y + shift_y;
                    }


                    // shift the position of the grid point
                    int other_position_x = (int)(orig_col + shift_x);
                    int other_position_y = (int)(orig_row + shift_y);

                    int posX = (int)other_position_x;
                    int posY = (int)other_position_y;
                    DrawRectangle((int)posX, (int)posY, 1, 3, 0xFF333333);
                    DrawRectangle((int)posX, (int)posY, 3, 1, 0xFF333333);
                }
            }
        }
예제 #14
0
 /// <summary>
 /// Change particle energy
 /// </summary>
 /// <param name="part"></param>
 /// <param name="system"></param>
 private static void FixParticleEnergyLoosing(Particle part, TableDepositor system)
 {
     // if the value is -1, we will use global settings
     if (system.table.Settings.energy_loosing_speed != -1)
     {
         part.Vector_Velocity.Mult(1 - system.table.Settings.energy_loosing_speed / PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED_MAX,
                                   1 - system.table.Settings.energy_loosing_speed / PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED_MAX);
     }
     else
     {
         part.Vector_Velocity.Mult(1 - system.table.Settings.energy_loosing_speed / PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED_MAX,
                                   1 - system.table.Settings.energy_loosing_speed / PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED_MAX);
     }
 }
예제 #15
0
        /// <summary>
        /// Process black holes for one particle
        /// </summary>
        public static void ProcessBlackHoles(TableDepositor system, Particle part)
        {
            foreach (BlackHole blackH in system.blackHoles)
            {
                BlackHoleSettings settings = (blackH.Settings_Allowed) ? blackH.Settings : system.table.Settings.blackHoleSettings;

                // distance between the particle and the stone
                double length = Math.Sqrt((part.Position.X - blackH.Position.X) * (part.Position.X - blackH.Position.X) +
                                          (part.Position.Y - blackH.Position.Y) * (part.Position.Y - blackH.Position.Y));

                // if the distance is within the treshold, we will remove it
                if (length < blackH.Radius)
                {
                    if (PhysicsSettings.absorptionMode == AbsorptionMode.BLACKHOLE)
                    {
                        deletedParticles.Add(part);
                    }
                    else if (PhysicsSettings.absorptionMode == AbsorptionMode.RECYCLE)
                    {
                        // if the recycling is enabled, just find an appropriate generator and give it the deleted particle
                        if (system.generators.Count > 0)
                        {
                            system.generators.ElementAt(CommonAttribService.apiRandom.Next(system.generators.Count - 1)).generatingNumber--;
                            deletedParticles.Add(part);
                        }
                    }
                    else if (PhysicsSettings.absorptionMode == AbsorptionMode.SELECT)
                    {
                        if (CommonAttribService.apiRandom.Next(50) == 40)
                        {
                            deletedParticles.Add(part);
                        }
                    }
                    return;
                }

                // creepy gravity acceleration
                double acc    = (PhysicSettings.Instance().DEFAULT_GRAVITY_CONSTANT *settings.weigh) / (Math.Log(length * length) / 114 + 14) * (((A_Rock)blackH).Intensity / 100);
                double dist_x = (blackH.Position.X - part.Position.X);
                double dist_y = (blackH.Position.Y - part.Position.Y);
                double celk   = length * 1.5;

                // pulsar
                if (settings.Energy_pulsing)
                {
                    acc /= (1 + Math.Tan(counter * settings.Energy_pulse_speed) / (4 + 4 * Math.Log10(length)));
                }

                part.Vector_Acceleration.Add(0.5 * acc * ((dist_x) / length),
                                             0.5 * acc * ((dist_y) / length));

                // this is really creepy but it works
                if (dist_x > 0 && (-dist_y) > 0)
                {
                    dist_y *= length / 4;
                }
                else if (dist_x > 0 && (-dist_y) < 0)
                {
                    dist_x *= length / 4;
                }
                else if (dist_x < 0 && (-dist_y) > 0)
                {
                    dist_x *= length / 4;
                }
                else if (dist_x < 0 && (-dist_y) < 0)
                {
                    dist_y *= length / 4;
                }

                // add gravityy acceleration
                part.Vector_Acceleration.Add((-dist_y / celk) / 30, (dist_x / celk) / 30);
            }
        }
예제 #16
0
        protected A_Shape shape;                      // shape of the object


        public A_TableObject()
        {
            id            = id_counter++;
            this.position = PhysicSettings.Instance().DEFAULT_TABLEOBJECT_POINT;
        }
예제 #17
0
        public void SetHandlers()
        {
            // default settings of all checkboxes and sliders
            tableSetPanel.surfaceInterChck.IsChecked        = PhysicSettings.Instance().DEFAULT_INTERACTION_ALLOWED;
            tableSetPanel.gravityMovementChck.IsChecked     = PhysicSettings.Instance().DEFAULT_GRAVITON_ENABLED;
            tableSetPanel.magnetonMovementChck.IsChecked    = PhysicSettings.Instance().DEFAULT_MAGNETON_ENABLED;
            tableSetPanel.generationChck.IsChecked          = PhysicSettings.Instance().DEFAULT_GENERATOR_ENABLED;
            tableSetPanel.absorbChck.IsChecked              = PhysicSettings.Instance().DEFAULT_BLACKHOLE_ENABLED;
            tableSetPanel.tableGravityChck.IsChecked        = PhysicSettings.Instance().DEFAULT_TABLE_GRAVITY;
            tableSetPanel.gravitonLocalPulseChck.IsChecked  = PhysicSettings.Instance().DEFAULT_ENERGY_GRAVITON_PULSING;
            tableSetPanel.magnetonLocalPulseChck.IsChecked  = PhysicSettings.Instance().DEFAULT_ENERGY_MAGNETON_PULSING;
            tableSetPanel.particleEnergyLoseChck.IsChecked  = PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING;
            tableSetPanel.particleColorChangeChck.IsChecked = GraphicsSettings.Instance().DEFAULT_PARTICLE_COLOR_ALLOWED;
            tableSetPanel.generatorRegularGenChck.IsChecked = PhysicSettings.Instance().DEFAULT_GENERATING_REGULAR;
            tableSetPanel.particleSizeChck.IsChecked        = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZING_ENABLED;
            tableSetPanel.gridDispChck.IsChecked            = GraphicsSettings.Instance().DEFAULT_GRID_ENABLED;
            tableSetPanel.particleColorChangeChck.IsChecked = GraphicsSettings.Instance().DEFAULT_PARTICLE_COLOR_ALLOWED;
            tableSetPanel.rockDispChck.IsChecked            = GraphicsSettings.Instance().DEFAULT_OUTPUT_ROCK_DISPLAY;

            tableSetPanel.particleEnergyLoseSizeSlider.Value   = PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED;
            tableSetPanel.particleEnergyLoseSizeSlider.Maximum = PhysicSettings.Instance().DEFAULT_ENERGY_TABLE_LOOSING_SPEED_MAX;
            tableSetPanel.particleEnergyLoseSizeTb.Text        = tableSetPanel.particleEnergyLoseSizeSlider.Value.ToString();
            tableSetPanel.generatorGenFirstAngleSlider.Value   = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_OFFSET;
            tableSetPanel.generatorGenFirstAngleTb.Text        = tableSetPanel.generatorGenFirstAngleSlider.Value.ToString();
            tableSetPanel.generatorGenAngleSlider.Value        = PhysicSettings.Instance().DEFAULT_GENERATOR_ANGLE_MAX;
            tableSetPanel.generatorGenAngleTb.Text             = tableSetPanel.generatorGenAngleSlider.Value.ToString();
            tableSetPanel.generatorMinVelocSlider.Value        = PhysicSettings.Instance().DEFAULT_MIN_GENERATING_VELOCITY;
            tableSetPanel.generatorMinVelocTb.Text             = tableSetPanel.generatorMinVelocSlider.Value.ToString();
            tableSetPanel.generatorMaxVelocSlider.Value        = PhysicSettings.Instance().DEFAULT_MAX_GENERATING_VELOCITY;
            tableSetPanel.generatorMaxVelocTb.Text             = tableSetPanel.generatorMaxVelocSlider.Value.ToString();
            tableSetPanel.generatorSpeedSlider.Value           = PhysicSettings.Instance().DEFAULT_GENERATING_SPEED;
            tableSetPanel.generatorSpeedTb.Text        = tableSetPanel.generatorSpeedSlider.Value.ToString();
            tableSetPanel.generatorMinSizeSlider.Value = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZE;
            tableSetPanel.generatorMinSizeTb.Text      = tableSetPanel.generatorMinSizeSlider.Value.ToString();
            tableSetPanel.generatorMaxSizeSlider.Value = PhysicSettings.Instance().DEFAULT_PARTICLE_SIZE;
            tableSetPanel.generatorMaxSizeTb.Text      = tableSetPanel.generatorMaxSizeSlider.Value.ToString();
            tableSetPanel.tableSizeSlider.Value        = CommonAttribService.ACTUAL_TABLE_SIZE_MULTIPLIER;
            tableSetPanel.tableSizeTb.Text             = CommonAttribService.ACTUAL_TABLE_SIZE_MULTIPLIER.ToString("#");
            tableSetPanel.tableGravityXTbx.Text        = PhysicSettings.Instance().DEFAULT_TABLE_GRAVITY_VECTOR.X.ToString();
            tableSetPanel.tableGravityYTbx.Text        = PhysicSettings.Instance().DEFAULT_TABLE_GRAVITY_VECTOR.Y.ToString();

            tableSetPanel.pauseImage.MouseUp      += new System.Windows.Input.MouseButtonEventHandler(pauseImage_MouseUp);
            tableSetPanel.playImage.MouseUp       += new System.Windows.Input.MouseButtonEventHandler(playImage_MouseUp);
            tableSetPanel.stopImage.MouseUp       += new System.Windows.Input.MouseButtonEventHandler(stopImage_MouseUp);
            tableSetPanel.cameraImage.MouseUp     += new System.Windows.Input.MouseButtonEventHandler(cameraImage_MouseUp);
            tableSetPanel.recordImage.MouseUp     += new System.Windows.Input.MouseButtonEventHandler(recordImage_MouseUp);
            tableSetPanel.simulationImage.MouseUp += new System.Windows.Input.MouseButtonEventHandler(simulationImage_MouseUp);
            tableSetPanel.outputImage.MouseUp     += new System.Windows.Input.MouseButtonEventHandler(outputImage_MouseUp);
            tableSetPanel.generatorGenAngleSlider.ValueChanged      += new System.Windows.RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorGenFirstAngleSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorMaxVelocSlider.ValueChanged      += new System.Windows.RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorMinVelocSlider.ValueChanged      += new System.Windows.RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.particleEnergyLoseSizeSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorSpeedSlider.ValueChanged         += new RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorMinSizeSlider.ValueChanged       += new RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorMaxSizeSlider.ValueChanged       += new RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.tableSizeSlider.ValueChanged  += new RoutedPropertyChangedEventHandler <double>(sliderValueChanged);
            tableSetPanel.generatorRegularGenChck.Click += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.gravityMovementChck.Click     += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.magnetonMovementChck.Click    += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.particleColorChangeChck.Click += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.particleEnergyLoseChck.Click  += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.particleSizeChck.Click        += new RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.gravitonLocalPulseChck.Click  += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.magnetonLocalPulseChck.Click  += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.surfaceInterChck.Click        += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.tableGravityChck.Click        += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.generationChck.Click          += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.absorbChck.Click              += new System.Windows.RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.gridDispChck.Click            += new RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.blackHoleLocalPulseChck.Click += new RoutedEventHandler(CheckBoxCheckChanged);
            tableSetPanel.rockDispChck.Click            += new RoutedEventHandler(CheckBoxCheckChanged);

            tableSetPanel.gravityComboBox.SelectionChanged             += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.magnetonComboBox.SelectionChanged            += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.particleColorChangeComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.generationComboBox.SelectionChanged          += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.absorbComboBox.SelectionChanged             += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.particleSizeChangeComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(ComboBoxItem_changed);
            tableSetPanel.tableGravityXTbx.LostFocus   += new System.Windows.RoutedEventHandler(TextBox_FocusLost);
            tableSetPanel.tableGravityYTbx.LostFocus   += new System.Windows.RoutedEventHandler(TextBox_FocusLost);
            tableSetPanel.settingVisibilityBut.MouseUp += new System.Windows.Input.MouseButtonEventHandler(settingVisibilityBut_Click);
            tableSetPanel.particleColorChangeBut.Click += new RoutedEventHandler(particleColorChangeBut_Click);
        }
예제 #18
0
 public Generator()
 {
     settings = new GeneratorSettings();
     settings.generatingSpeed = PhysicSettings.Instance().DEFAULT_GENERATING_SPEED;
     baseSettings             = new GeneratorSettings();
 }