Inheritance: MonoBehaviour
Esempio n. 1
0
        public bool LoadConfig()
        {
            OpenConfigDialog OCD = new OpenConfigDialog(Settings);

            if (OCD.ShowDialog() == DialogResult.OK)
            {
                if (Pinball != null)
                {
                    Pinball.Finish();
                }


                Pinball = new Pinball();
                Pinball.Init(OCD.GlobalConfigFilename, OCD.TableFilename, OCD.RomName);

                DisplayTableElements();


                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public static void Open(Pinball Pinball, Form Owner=null)
        {


            foreach (Form F in Application.OpenForms)
            {
                if (F.GetType() == typeof(MainMenu))
                {
                    F.BringToFront();
                    F.Focus();
                    return;
                }
            }

            MainMenu M = new MainMenu(Pinball);

            if (Owner == null)
            {
                M.Show();
            }
            else
            {
                M.StartPosition = FormStartPosition.CenterParent;
                M.Show(Owner);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes the Plugin.<br/>
        /// The IPlugin interface requires the implementation of this method.<br/>
        /// </summary>
        /// <param name="HostingApplicationName">Name of the hosting application.</param>
        /// <param name="TableFilename">The table filename.<br>If no table filename is available, it is best to provide a path and name of a non existing dummy file, since the plugins might use this path to identify the directories where the store logs, load configs from and so on.</br></param>
        /// <param name="GameName">Name of the game.<br/>If the game is a SS pinball table it is highly recommanded to provide the name of the game rom, otherwise any other name which identifiey to game uniquely will be fine as well.</param>
        public void PluginInit(string HostingApplicationName, string TableFilename, string GameName)
        {
            string HostAppFilename = HostingApplicationName.Replace(".", "");

            foreach (char C in Path.GetInvalidFileNameChars())
            {
                HostAppFilename = HostAppFilename.Replace("" + C, "");
            }
            foreach (char C in Path.GetInvalidPathChars())
            {
                HostAppFilename = HostAppFilename.Replace("" + C, "");
            }
            HostAppFilename = "GlobalConfig_{0}".Build(HostAppFilename);

            //Check config dir for global config file
            FileInfo F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", HostAppFilename + ".xml"));

            if (!F.Exists)
            {
                //Check if a shortcut to the config dir exists
                FileInfo LnkFile = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", HostAppFilename + ".lnk"));
                if (LnkFile.Exists)
                {
                    string ConfigDirPath = ResolveShortcut(LnkFile);
                    if (Directory.Exists(ConfigDirPath))
                    {
                        F = new FileInfo(Path.Combine(ConfigDirPath, HostAppFilename + ".xml"));
                    }
                }
            }

            Pinball = new Pinball();
            Pinball.Init(F.FullName, TableFilename, GameName);
        }
Esempio n. 4
0
        public static void Open(Pinball Pinball, Form Owner=null)
        {


            foreach (Form F in Application.OpenForms)
            {
                if (F.GetType() == typeof(MainMenu))
                {
                    F.BringToFront();
                    F.Focus();
                    return;
                }
            }

            MainMenu M = new MainMenu(Pinball);

            if (Owner == null)
            {
                M.Show();
            }
            else
            {
                M.StartPosition = FormStartPosition.CenterParent;
                M.Show(Owner);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes the table and the contained objects(Effects, TableElements).
        /// </summary>
        /// <param name="Pinball">The Pinball object containing the Table.</param>
        public void Init(Pinball Pinball)
        {
            this.Pinball = Pinball;
            Effects.Init(this);

            TableElements.InitAssignedEffects(this);
            AssignedStaticEffects.Init(this);
        }
Esempio n. 6
0
 public void Finish()
 {
     TerminateLedWizUpdaterThread();
     ShutdownLighting();
     this.Pinball            = null;
     UpdateTimeStatistics    = null;
     PWMUpdateTimeStatistics = null;
 }
Esempio n. 7
0
        /// <summary>
        /// Initializes the cabinet.
        /// </summary>
        /// <param name="Pinball">The Pinball object using the Cabinet instance.</param>
        public void Init(Pinball Pinball)
        {
            Log.Write("Initializing cabinet");
            this.Pinball = Pinball;
            OutputControllers.Init(this);
            Toys.Init(this);

            Log.Write("Cabinet initialized");
        }
Esempio n. 8
0
 private void ResolveName(Pinball Pinball)
 {
     if (!LampToyName.IsNullOrWhiteSpace() && Pinball.Cabinet.Toys.Contains(LampToyName))
     {
         if (Pinball.Cabinet.Toys[LampToyName] is ILampToy)
         {
             _LampToy = (ILampToy)Pinball.Cabinet.Toys[LampToyName];
         }
     }
 }
        private void MoveLaunchPointToBallButton()
        {
            if (GUILayout.Button("Move Launch Point To Ball"))
            {
                Pinball ball = FindObjectOfType <Pinball>();

                if (ball != null)
                {
                    targetPM.LaunchPoint = ball.transform.position;
                }
            }
        }
    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        PinballLauncher launcher = animator.gameObject.GetComponent<PinballLauncher>();

        if (!launcher.gameManager.pinballInMap && Random.value > 0.5f)
        {
            pinball = launcher.SpawnPinball();
            pinball.GetComponent<Rigidbody>().isKinematic = true;
            launcher.gameManager.pinballInMap = true;
        }

        if(pinball != null)
        {
            if (!startHeldDown && !Input.GetButtonDown(launcher.inputAxis))
            {
                waitTime += Time.deltaTime;
                if (waitTime >= waitMaxTime)
                {
                    pinball.GetComponent<Rigidbody>().isKinematic = false;
                    pinball.gameObject.GetComponent<Rigidbody>().AddForce
                        (new Vector3(0, 0, Random.value * launcher.launchStrength), ForceMode.VelocityChange);
                    animator.SetBool("IsLaunched", true);
                }
            }
            else if(!startHeldDown && Input.GetButtonDown(launcher.inputAxis))
            {
                startHeldDown = true;
            }

            else if(startHeldDown && Input.GetButton(launcher.inputAxis))
            {
                holdDownTimer += Time.deltaTime;
                holdDownTimer = Mathf.Clamp(holdDownTimer, 0f, holdDownMaxTime);
            }
            else if(startHeldDown && Input.GetButtonUp(launcher.inputAxis))
            {
                startHeldDown = false;
                float chargeLevel = Mathf.Clamp(holdDownTimer, 0f, holdDownMaxTime) / holdDownMaxTime;
                Mathf.Clamp(chargeLevel, 0.2f,1f);
                pinball.GetComponent<Rigidbody>().isKinematic = false;
                pinball.gameObject.GetComponent<Rigidbody>().AddForce
                    (new Vector3(0 , 0, chargeLevel * launcher.launchStrength), ForceMode.VelocityChange);
                //

                //launcher.gameManager.pinballInMap = true;
                animator.SetBool("IsLaunched",true);
            }
        }

        if (launcher.currentHealth <= 0)
            animator.SetBool("IsCaptured", true);
    }
Esempio n. 11
0
 /// <summary>
 /// Inits the object.<br/>
 /// </summary>
 public void Init(Pinball Pinball)
 {
     AlarmStatistics = new TimeSpanStatisticsItem()
     {
         Name = "Alarm calls", GroupName = "Pinball - Alarm calls"
     };
     Pinball.TimeSpanStatistics.Add(AlarmStatistics);
     IntervalAlarmStatistics = new TimeSpanStatisticsItem()
     {
         Name = "Interval Alarm calls", GroupName = "Pinball - Alarm calls"
     };
     Pinball.TimeSpanStatistics.Add(IntervalAlarmStatistics);
 }
Esempio n. 12
0
        /// <summary>
        /// Initializes the <see cref="ILampToy"/>.
        /// </summary>
        public override void Init(Pinball Pinball)
        {
            ResolveName(Pinball);

            Timer = Pinball.UpdateTimer;
            Timer.RegisterIntervalAlarm(20, UpdateDimmer);

            if (LampToy != null)
            {
                TargetBrightness = LampToy.Brightness;
                Timer            = Pinball.UpdateTimer;
                Timer.RegisterIntervalAlarm(20, UpdateDimmer);
            }
        }
Esempio n. 13
0
        private MainMenu(Pinball Pinball)
        {


            this.Pinball = Pinball;
            InitializeComponent();
            
            Version V = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            DateTime BuildDate = new DateTime(2000, 1, 1).AddDays(V.Build).AddSeconds(V.Revision * 2);

            Version.Text = "Version {0} as of {1}".Build(V.ToString(), BuildDate.ToString("yyyy.MM.dd HH:mm"));

            TableName.Text = (Pinball.Table.TableName.IsNullOrWhiteSpace() ? "<No table name set>" : Pinball.Table.TableName);
            TableFilename.Text = (Pinball.Table.TableFilename.IsNullOrWhiteSpace() ? "<No table file name set>" : Pinball.Table.TableFilename);
            TableRomname.Text = (Pinball.Table.RomName.IsNullOrWhiteSpace() ? "<No rom name set>" : Pinball.Table.RomName);


            GlobalConfigFilename.Text = (Pinball.GlobalConfig.GlobalConfigFilename.IsNullOrWhiteSpace() ? "<no global config file set>" : (Pinball.GlobalConfig.GetGlobalConfigFile().Exists ? Pinball.GlobalConfig.GlobalConfigFilename : "<no global config file found>"));


            switch (Pinball.Table.ConfigurationSource)
            {
                case DirectOutput.Table.TableConfigSourceEnum.TableConfigurationFile:
                    TableConfigFilename.Text = Pinball.Table.TableConfigurationFilename;
                    break;
                case DirectOutput.Table.TableConfigSourceEnum.IniFile:
                    TableConfigFilename.Text = "Table config parsed from LedControl file.";
                    break;
                default:
                    TableConfigFilename.Text = "<no config file loaded>";
                    break;
            }


            if (Pinball.Cabinet.CabinetConfigurationFilename.IsNullOrWhiteSpace())
            {
                CabinetConfigFilename.Text = "<no config file loaded>";
            }
            else
            {
                CabinetConfigFilename.Text = Pinball.Cabinet.CabinetConfigurationFilename;
            }

        }
Esempio n. 14
0
        private MainMenu(Pinball Pinball)
        {


            this.Pinball = Pinball;
            InitializeComponent();
            
            Version V = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            DateTime BuildDate = new DateTime(2000, 1, 1).AddDays(V.Build).AddSeconds(V.Revision * 2);

            Version.Text = "Version {0} as of {1}".Build(V.ToString(), BuildDate.ToString("yyyy.MM.dd HH:mm"));

            TableName.Text = (Pinball.Table.TableName.IsNullOrWhiteSpace() ? "<No table name set>" : Pinball.Table.TableName);
            TableFilename.Text = (Pinball.Table.TableFilename.IsNullOrWhiteSpace() ? "<No table file name set>" : Pinball.Table.TableFilename);
            TableRomname.Text = (Pinball.Table.RomName.IsNullOrWhiteSpace() ? "<No rom name set>" : Pinball.Table.RomName);
            DOFPath.Text = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).Directory.FullName;

            GlobalConfigFilename.Text = (Pinball.GlobalConfig.GlobalConfigFilename.IsNullOrWhiteSpace() ? "<no global config file set>" : (Pinball.GlobalConfig.GetGlobalConfigFile().Exists ? Pinball.GlobalConfig.GlobalConfigFilename : "<no global config file found>"));


            switch (Pinball.Table.ConfigurationSource)
            {
                case DirectOutput.Table.TableConfigSourceEnum.TableConfigurationFile:
                    TableConfigFilename.Text = Pinball.Table.TableConfigurationFilename;
                    break;
                case DirectOutput.Table.TableConfigSourceEnum.IniFile:
                    TableConfigFilename.Text = "Table config parsed from LedControl file(s).";
                    break;
                default:
                    TableConfigFilename.Text = "<no config file loaded>";
                    break;
            }


            if (Pinball.Cabinet.CabinetConfigurationFilename.IsNullOrWhiteSpace())
            {
                CabinetConfigFilename.Text = "<no config file loaded>";
            }
            else
            {
                CabinetConfigFilename.Text = Pinball.Cabinet.CabinetConfigurationFilename;
            }

        }
Esempio n. 15
0
 public void Init(Cabinet Cabinet)
 {
     this.Pinball = Cabinet.Pinball;
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} update calls".Build(Number)))
     {
         UpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "LedWiz {0:00} update calls".Build(Number), GroupName = "OutputControllers - LedWiz"
         };
         Pinball.TimeSpanStatistics.Add(UpdateTimeStatistics);
     }
     else
     {
         UpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} update calls".Build(Number)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} PWM updates".Build(Number)))
     {
         PWMUpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "LedWiz {0:00} PWM updates".Build(Number), GroupName = "OutputControllers - LedWiz"
         };
         Pinball.TimeSpanStatistics.Add(PWMUpdateTimeStatistics);
     }
     else
     {
         PWMUpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} PWM updates".Build(Number)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} OnOff updates".Build(Number)))
     {
         OnOffUpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "LedWiz {0:00} OnOff updates".Build(Number), GroupName = "OutputControllers - LedWiz"
         };
         Pinball.TimeSpanStatistics.Add(OnOffUpdateTimeStatistics);
     }
     else
     {
         OnOffUpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} OnOff updates".Build(Number)];
     }
     StartLedWizUpdaterThread();
 }
Esempio n. 16
0
 public void Init(Cabinet Cabinet)
 {
     this.Pinball = Cabinet.Pinball;
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} update calls".Build(Id)))
     {
         UpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "PacLed64 {0:0} update calls".Build(Id), GroupName = "OutputControllers - PacLed64"
         };
         Pinball.TimeSpanStatistics.Add(UpdateTimeStatistics);
     }
     else
     {
         UpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} update calls".Build(Id)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} PWM updates".Build(Id)))
     {
         PWMUpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "PacLed64 {0:0} PWM updates".Build(Id), GroupName = "OutputControllers - PacLed64"
         };
         Pinball.TimeSpanStatistics.Add(PWMUpdateTimeStatistics);
     }
     else
     {
         PWMUpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} PWM updates".Build(Id)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} OnOff updates".Build(Id)))
     {
         OnOffUpdateTimeStatistics = new TimeSpanStatisticsItem()
         {
             Name = "PacLed64 {0:0} OnOff updates".Build(Id), GroupName = "OutputControllers - PacLed64"
         };
         Pinball.TimeSpanStatistics.Add(OnOffUpdateTimeStatistics);
     }
     else
     {
         OnOffUpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} OnOff updates".Build(Id)];
     }
     StartPacLed64UpdaterThread();
 }
Esempio n. 17
0
        /// <summary>
        /// Initializes the Plugin.<br/>
        /// The IHyperpinPlugin interface requires the implementation of this method.<br/>
        /// DirectOutput likes to receive a global config filename, a table file name and a romname when it is initialized. <br/>
        /// The global config file for the HyperPinPlugin is called GlobalConfig_Hyperpin.xml and should reside in the config subdirectory of the directory containing the DirectOutput.dll or there can be a shortcut named config pointing to the directory containg the config file.<br/>
        /// For the tablename the name of a file named Hyperpin.tmp located in the config dir of DirectOutput is supplied to DirectOutput. This file does/must not exist.<br/>
        /// For the RomName the value Hyperpin is provided to DOF to allow for configuratiojn through LedControl files.
        /// </summary>
        public void PluginInit()
        {
            //Check config dir for global config file
            FileInfo F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_Hyperpin.xml"));

            if (!F.Exists)
            {
                //Check if a shortcut to the config dir exists
                FileInfo LnkFile = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_Hyperpin.lnk"));
                if (LnkFile.Exists)
                {
                    string ConfigDirPath = ResolveShortcut(LnkFile);
                    if (Directory.Exists(ConfigDirPath))
                    {
                        F = new FileInfo(Path.Combine(ConfigDirPath, "GlobalConfig_Hyperpin.xml"));
                    }
                }
            }

            Pinball.Init(F.FullName, Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "Hyperpin.tmp"), "Hyperpin");
        }
Esempio n. 18
0
        /// <summary>
        /// Initializes the Plugin.<br/>
        /// The IDirectPlugin interface requires the implementation of this method.<br/>
        /// </summary>
        /// <param name="TableFilename">The table filename.</param>
        /// <param name="RomName">Name of the rom.</param>
        public void PluginInit(string TableFilename, string RomName)
        {
            //Check config dir for global config file
            FileInfo F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.xml"));

            if (!F.Exists)
            {
                //Check if a shortcut to the config dir exists
                FileInfo LnkFile = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.lnk"));
                if (LnkFile.Exists)
                {
                    string ConfigDirPath = ResolveShortcut(LnkFile);
                    if (Directory.Exists(ConfigDirPath))
                    {
                        F = new FileInfo(Path.Combine(ConfigDirPath, "GlobalConfig_B2SServer.xml"));
                    }
                }
                if (!F.Exists)
                {
                    //Check table dir for global config file
                    F = new FileInfo("GlobalConfig_B2SServer.xml");
                    if (!F.Exists)
                    {
                        //Check dll dir for global config file
                        F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "GlobalConfig_B2SServer.xml"));
                        if (!F.Exists)
                        {
                            //if global config file does not exist, set filename to config directory.
                            F = new FileInfo(Path.Combine(new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName, "config", "GlobalConfig_B2SServer.xml"));
                        }
                    }
                }
            }

            Pinball.Setup(F.FullName, TableFilename, RomName);
            Pinball.Init();

            // PluginShowFrontend();
        }
Esempio n. 19
0
        /// <summary>
        /// Initializes the table and the contained objects(Effects, TableElements).
        /// </summary>
        /// <param name="Pinball">The Pinball object containing the Table.</param>
        public void Init(Pinball Pinball)
        {
            this.Pinball = Pinball;

            FileInfo ShapeDefinitionFile = Pinball.GlobalConfig.GetShapeDefinitionFile();

            if (ShapeDefinitionFile != null && ShapeDefinitionFile.Exists)
            {
                Log.Write("Loading shape definition file: {0}".Build(ShapeDefinitionFile.FullName));
                try
                {
                    ShapeDefinitions = ShapeDefinitions.GetShapeDefinitionsFromShapeDefinitionsXmlFile(ShapeDefinitionFile);
                }
                catch (Exception E)
                {
                    Log.Exception("Loading shape definition file {0} failed.".Build(ShapeDefinitionFile.FullName), E);
                }
                ShapeDefinitions.BitmapFilePattern = new General.FilePattern(ShapeDefinitionFile.FullName.Substring(0, ShapeDefinitionFile.FullName.Length - ShapeDefinitionFile.Extension.Length) + ".png");
            }
            else
            {
                if (ShapeDefinitionFile == null)
                {
                    Log.Warning("Could not determin name of shape definition file");
                }
                else
                {
                    Log.Warning("Shape definition file {0} does not exist");
                }
                ShapeDefinitions = new ShapeDefinitions();
            }

            Effects.Init(this);

            TableElements.InitAssignedEffects(this);
            AssignedStaticEffects.Init(this);
        }
Esempio n. 20
0
     /// <summary>
     /// Initializes the cabinet.
     /// </summary>
     /// <param name="Pinball">The Pinball object using the Cabinet instance.</param>
     public void Init(Pinball Pinball)
     {
         Log.Write("Initializing cabinet");
         this.Pinball = Pinball;
         OutputControllers.Init(this);
         Toys.Init(this);
 
         Log.Write("Cabinet initialized");
     }
Esempio n. 21
0
 /// <summary>
 /// Inits the object.<br/>
 /// </summary>
 public void Init(Pinball Pinball)
 {
     AlarmStatistics = new TimeSpanStatisticsItem() { Name = "Alarm calls", GroupName = "Pinball - Alarm calls" };
     Pinball.TimeSpanStatistics.Add(AlarmStatistics);
     IntervalAlarmStatistics = new TimeSpanStatisticsItem() { Name = "Interval Alarm calls", GroupName = "Pinball - Alarm calls" };
     Pinball.TimeSpanStatistics.Add(IntervalAlarmStatistics);
 }
Esempio n. 22
0
        static void Main(string[] args)
        {
            StreamWriter writer;
            bool go = true;

            while (go)
            {
                Console.Out.WriteLine("Type 0 if you want random runs, or 1 if you want specific angles");
                int num = Int32.Parse(Console.In.ReadLine());

                switch (num)
                {

                    case (0):

                        try
                        {
                            Console.Out.WriteLine("This code runs 100 times, so whatever input you give, 100 times that will be run\nsuggested is 1000,000\n\ta text file called out.txt in the home directory of this project will contain the data about these runs with max angles");
                            int runs = Int32.Parse(Console.In.ReadLine());

                            writer = new StreamWriter("out.txt");
                            Pinball pin = new Pinball();

                            writer.WriteLine("100 * " + runs + " runs. \nthe maximum angles from 100 different sets is shown below.");

                            Random gen = new Random();
                            //double angle = .4626753;
                            for (int k = 0; k < 100; k++)
                            {
                                double maxAngle = 0;
                                int count = 0;

                                for (int i = 0; i < runs; i++)
                                {
                                    double angle = gen.NextDouble() * 359 + 1;

                                    int max = pin.run(angle);

                                    if (max > count)
                                    {
                                        count = max;
                                        maxAngle = angle;
                                    }

                                }

                                Console.Out.WriteLine(k + ".");
                                if (maxAngle != 0)
                                    writer.WriteLine("Angle " + maxAngle + " hit " + count + " times");
                            }

                            writer.Flush();

                            writer.Close();
                            Console.Out.WriteLine("Tada!");
                        }

                        catch (IOException exe)
                        {
                            Console.Out.WriteLine("someting wong");
                        }

                        break;

                    case (1):
                        Console.Out.WriteLine("enter an angle in degrees\n\tmax angle is 94.5372630745615 degrees");
                        double notradians = double.Parse(Console.In.ReadLine());
                        Pinball pin2 = new Pinball();
                        Console.Out.WriteLine(pin2.run(notradians));
                        List<String> result = pin2.getList();

                        foreach (String v2 in result)
                        {
                            Console.Out.WriteLine(v2);
                        }

                        break;
                }

                Console.Out.WriteLine("try again? type yes or no");
                String go2 = Console.In.ReadLine();
                if (String.Compare(go2, "yes", true) == 0)
                {
                    go = true;
                }

                else
                    go = false;
            }
        }
Esempio n. 23
0
 /// <summary>
 /// This method is called, when the hosting application sends new data to DirectOutput.<br />
 /// The IPlugin interface requires the implementation of this method.<br/>
 /// </summary>
 /// <param name="TableElementTypeChar">Char identifying the type of the table element. For a list of valid char, check to docu on the TableElementTypeEnum in DirectOutput.</param>
 /// <param name="Number">The received Number.</param>
 /// <param name="Value">The received value.</param>
 public void DataReceive(char TableElementTypeChar, int Number, int Value)
 {
     Pinball.ReceiveData(TableElementTypeChar, Number, Value);
 }
Esempio n. 24
0
 public void Init(Cabinet Cabinet)
 {
     this.Pinball = Cabinet.Pinball;
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} update calls".Build(Number)))
     {
         UpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "LedWiz {0:00} update calls".Build(Number), GroupName = "OutputControllers - LedWiz" };
         Pinball.TimeSpanStatistics.Add(UpdateTimeStatistics);
     }
     else
     {
         UpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} update calls".Build(Number)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} PWM updates".Build(Number)))
     {
         PWMUpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "LedWiz {0:00} PWM updates".Build(Number), GroupName = "OutputControllers - LedWiz" };
         Pinball.TimeSpanStatistics.Add(PWMUpdateTimeStatistics);
     }
     else
     {
         PWMUpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} PWM updates".Build(Number)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("LedWiz {0:00} OnOff updates".Build(Number)))
     {
         OnOffUpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "LedWiz {0:00} OnOff updates".Build(Number), GroupName = "OutputControllers - LedWiz" };
         Pinball.TimeSpanStatistics.Add(OnOffUpdateTimeStatistics);
     }
     else
     {
         OnOffUpdateTimeStatistics = Pinball.TimeSpanStatistics["LedWiz {0:00} OnOff updates".Build(Number)];
     }   
     StartLedWizUpdaterThread();
 }
Esempio n. 25
0
 /// <summary>
 /// Inits the object.<br/>
 /// </summary>
 public void Init(Pinball Pinball)
 {
 }
Esempio n. 26
0
 public void Init(Cabinet Cabinet)
 {
     this.Pinball = Cabinet.Pinball;
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} update calls".Build(Id)))
     {
         UpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "PacLed64 {0:0} update calls".Build(Id), GroupName = "OutputControllers - PacLed64" };
         Pinball.TimeSpanStatistics.Add(UpdateTimeStatistics);
     }
     else
     {
         UpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} update calls".Build(Id)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} PWM updates".Build(Id)))
     {
         PWMUpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "PacLed64 {0:0} PWM updates".Build(Id), GroupName = "OutputControllers - PacLed64" };
         Pinball.TimeSpanStatistics.Add(PWMUpdateTimeStatistics);
     }
     else
     {
         PWMUpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} PWM updates".Build(Id)];
     }
     if (!Pinball.TimeSpanStatistics.Contains("PacLed64 {0:0} OnOff updates".Build(Id)))
     {
         OnOffUpdateTimeStatistics = new TimeSpanStatisticsItem() { Name = "PacLed64 {0:0} OnOff updates".Build(Id), GroupName = "OutputControllers - PacLed64" };
         Pinball.TimeSpanStatistics.Add(OnOffUpdateTimeStatistics);
     }
     else
     {
         OnOffUpdateTimeStatistics = Pinball.TimeSpanStatistics["PacLed64 {0:0} OnOff updates".Build(Id)];
     }
     StartPacLed64UpdaterThread();
 }
Esempio n. 27
0
            public void Finish()
            {

                TerminatePacLed64UpdaterThread();
                ShutdownLighting();
                this.Pinball = null;
                UpdateTimeStatistics = null;
                PWMUpdateTimeStatistics = null;
            }
Esempio n. 28
0
 public SystemMonitor(Pinball Pinball)
 {
     this.Pinball = Pinball;
     InitializeComponent();
     RefreshData();
 }
Esempio n. 29
0
 /// <summary>
 /// This method is called, when Hyperpin sends new data to DirectOutput.<br/>
 /// HyperPin does only send a IDNumber and a value. These values are fed to DirectOutput as updates on EMTable elements (TableElementType character E).<br/>
 /// The IHyperpinPlugin interface requires the implementation of this method.
 /// </summary>
 /// <param name="Number">The received IdNumber.</param>
 /// <param name="Value">The received value.</param>
 public void DataReceive(int Number, int Value)
 {
     Pinball.ReceiveData('E', Number, Value);
 }
Esempio n. 30
0
 public TableInfo(Pinball Pinball)
 {
     InitializeComponent();
     this.Pinball = Pinball;
 }
Esempio n. 31
0
 public ScriptInfo(Pinball Pinball)
 {
     InitializeComponent();
     this.Pinball = Pinball;
 }
Esempio n. 32
0
 public SystemMonitor(Pinball Pinball)
 {
     this.Pinball = Pinball;
     InitializeComponent();
     RefreshData();
 }
Esempio n. 33
0
 /// <summary>
 /// Finishes the plugin.<br />
 /// This is the last method called, before a plugin is discared. This method is also called, after a undhandled exception has occured in a plugin.<br/>
 /// The IHyperpinPlugin interface requires the implementation of this method.<br/>
 /// </summary>
 public void PluginFinish()
 {
     Pinball.Finish();
 }
Esempio n. 34
0
 public ScriptInfo(Pinball Pinball)
 {
     InitializeComponent();
     this.Pinball = Pinball;
 }
Esempio n. 35
0
 public TableInfo(Pinball Pinball)
 {
     InitializeComponent();
     this.Pinball = Pinball;
 }
Esempio n. 36
0
        /// <summary>
        /// Initializes the table and the contained objects(Effects, TableElements).
        /// </summary>
        /// <param name="Pinball">The Pinball object containing the Table.</param>
        public void Init(Pinball Pinball)
        {
            this.Pinball = Pinball;
            Effects.Init(this);

            TableElements.InitAssignedEffects(this);
            AssignedStaticEffects.Init(this);
        }