Beispiel #1
0
 public void SetSource(Point SimPosition, double Value)
 {
     SinusWaveSource sws = new SinusWaveSource();
     sws.Frequency = Value;
     sws.X = SimPosition.X;
     sws.Y = SimPosition.Y;
     _loadedSettings.WaveSources.Add(sws);
     _waveEngineRef.AddWaveSoucre(sws);
 }
Beispiel #2
0
        private void DoMouseAction()
        {
            int x = _mouseX;
            int y = _mouseY;

            double value = 0;
            if (tsCbMouseValue.SelectedIndex != -1)
                value = Convert.ToDouble(tsCbMouseValue.Items[tsCbMouseValue.SelectedIndex]);

            if (tsCbMouseAction.SelectedIndex == 0)
            {
                Engine.Poke(x, y, value, 0);
                Engine.Poke(x+1, y, value, 0);
                Engine.Poke(x, y+1, value, 0);
                Engine.Poke(x+1, y+1, value, 0);
            }
            else if (tsCbMouseAction.SelectedIndex == 1)
                Engine.SetWall(x, y);
            else if (tsCbMouseAction.SelectedIndex == 2)
            {
                Engine.SetWall(x, y, false);
                Engine.SetWall(x+1, y, false);
                Engine.SetWall(x, y+1, false);
                Engine.SetWall(x+1, y+1, false);
            }
            else if (tsCbMouseAction.SelectedIndex == 3)
            {
                Engine.SetMass(x, y, value);
                Engine.SetMass(x+1, y, value);
                Engine.SetMass(x, y+1, value);
                Engine.SetMass(x+1, y+1, value);
                Engine.SetMass(x, y + 2, value);
                Engine.SetMass(x + 2, y + 2, value);
            }
            else if (tsCbMouseAction.SelectedIndex == 4)
            {
                Engine.SetMass(x, y, 0);
                Engine.SetMass(x+1, y, 0);
                Engine.SetMass(x, y+1, 0);
                Engine.SetMass(x+1, y+1, 0);
                Engine.SetMass(x, y + +2, 0);
                Engine.SetMass(x + 2, y + 2, 0);
            }
            else if (tsCbMouseAction.SelectedIndex == 5)
            {
                SinusWaveSource sws = new SinusWaveSource();
                sws.X = x;
                sws.Y = y;
                sws.Frequency = value / 10.0;

                Engine.AddWaveSoucre(sws);
            }
        }