Пример #1
0
 private void InitOutputs(Cabinet Cabinet)
 {
     if (Cabinet.Outputs.Contains(OutputNameRed))
     {
         _OutputRed = Cabinet.Outputs[OutputNameRed];
     }
     else
     {
         _OutputRed = null;
     }
     if (Cabinet.Outputs.Contains(OutputNameGreen))
     {
         _OutputGreen = Cabinet.Outputs[OutputNameGreen];
     }
     else
     {
         _OutputGreen = null;
     }
     if (Cabinet.Outputs.Contains(OutputNameBlue))
     {
         _OutputBlue = Cabinet.Outputs[OutputNameBlue];
     }
     else
     {
         _OutputBlue = null;
     }
 }
Пример #2
0
        public Form1(Cabinet cabinet)
        {
            InitializeComponent();

            _cabinet = cabinet;

            ResetForm();
        }
Пример #3
0
 /// <summary>
 /// Finishes the RGBLed toy.<br/>
 /// Resets the the toy and releases all references.
 /// </summary>
 public override void Finish()
 {
     Reset();
     _Cabinet = null;
     _OutputRed = null;
     _OutputGreen = null;
     _OutputBlue = null;
 }
 /// <summary>
 /// Initalizes the LedWizEquivalentOutput.
 /// </summary>
 /// <param name="Cabinet">The cabinet to which the LedWizEquivalentOutput belongs.</param>
 public void Init(Cabinet Cabinet)
 {
     if (Cabinet.Outputs.Contains(OutputName))
     {
         _Output = Cabinet.Outputs[OutputName];
     }
     else
     {
         _Output = null;
     }
 }
Пример #5
0
 private void InitOutputs(Cabinet Cabinet)
 {
     if (Cabinet.Outputs.Contains(OutputName))
     {
         Output = Cabinet.Outputs[OutputName];
     }
     else
     {
         Output = null;
     }
 }
        /// <summary>
        /// This method detects and configures LedWiz output controllers automatically.
       /// </summary>
        /// <param name="Cabinet">The cabinet object to which the automatically detected IOutputController objects are added if necessary.</param>
        public void AutoConfig(Cabinet Cabinet)
        {


            List<int> Preconfigured = new List<int>(Cabinet.OutputControllers.Where(OC => OC is LedWiz).Select(LW => ((LedWiz)LW).Number));
            List<int> Numbers = LedWiz.GetLedwizNumbers();
            foreach (int N in Numbers)
            {
                if (!Preconfigured.Contains(N))
                {
                    LedWiz LW = new LedWiz(N);
                    if (!Cabinet.OutputControllers.Contains(LW.Name))
                    {
                        
                        Cabinet.OutputControllers.Add(LW);
                        Log.Write("Detected and added LedWiz Nr. {0} with name {1}".Build(LW.Number, LW.Name));


                        if (!Cabinet.Toys.Any(T => T is LedWizEquivalent && ((LedWizEquivalent)T).LedWizNumber == LW.Number))
                        {
                            LedWizEquivalent LWE = new LedWizEquivalent();
                            LWE.LedWizNumber = LW.Number;
                            LWE.Name = "{0} Equivalent".Build(LW.Name);

                            for (int i = 1; i < 33; i++)
                            {
                                 LedWizEquivalentOutput LWEO = new LedWizEquivalentOutput() { OutputName = "{0}\\{0}.{1:00}".Build(LW.Name, i), LedWizEquivalentOutputNumber = i };
                                LWE.Outputs.Add(LWEO);
                            }

                            if (!Cabinet.Toys.Contains(LWE.Name))
                            {
                                Cabinet.Toys.Add(LWE);
                                Log.Write("Added LedwizEquivalent Nr. {0} with name {1} for Ledwiz Nr. {2}".Build(LWE.LedWizNumber,LWE.Name,LW.Number));
                            }

                        }
                    }
                }
            }





        }
Пример #7
0
        /// <summary>
        /// Initializes the PacLed64 object.<br />
        /// This method does also start the workerthread which does the actual update work when Update() is called.<br />
        /// This method should only be called once. Subsequent calls have no effect.
        /// </summary>
        /// <param name="Cabinet">The Cabinet object which is using the PacLed64 instance.</param>
        public override void Init(Cabinet Cabinet)
        {
            AddOutputs();   
            PacLed64Units[Id].Init(Cabinet);
            Log.Write("PacLed64 Id:{0} initialized and updater thread started.".Build(Id));

        }
Пример #8
0
 /// <summary>
 /// Initalizes the GenericAnalogToy.
 /// </summary>
  /// <param name="Cabinet"><see cref="Cabinet"/> object to which the <see cref="AnalogToy"/> belongs.</param>
 public override void Init(Cabinet Cabinet)
 {
     InitOutput(Cabinet);
 }
 /// <summary>
 /// Init initializes the ouput controller.<br />
 /// This method is called after the objects haven been instanciated.
 /// </summary>
 /// <param name="Cabinet">The Cabinet object which is using the NullOutputController instance.</param>
 public override  void Init(Cabinet Cabinet) {
 }
        /// <summary>
        /// This method detects and configures PacLed64 controllers automatically
       /// </summary>
        /// <param name="Cabinet">The cabinet object to which the automatically detected IOutputController objects are added if necessary.</param>
        public void AutoConfig(Cabinet Cabinet)
        {
            foreach (int Id in PacDriveSingleton.Instance.PacLed64GetIdList())
            {
                if (!Cabinet.OutputControllers.Any(oc => oc is PacLed64 && ((PacLed64)oc).Id == Id))
                {
                    PacLed64 PL = new PacLed64();
                    PL.Id = Id;
                   
                    if (!Cabinet.OutputControllers.Contains(PL.Name))
                    {
                        Cabinet.OutputControllers.Add(PL);

                        Log.Write("Detected and added PacLed64 Id {0} with name {1}".Build(PL.Id, PL.Name));


                        if (!!Cabinet.Toys.Any(T => T is LedWizEquivalent && (((LedWizEquivalent)T).LedWizNumber == ((PL.Id - 1) * 2) + 20 || ((LedWizEquivalent)T).LedWizNumber == ((PL.Id - 1) * 2) + 20+1)))
                        {
                            LedWizEquivalent LWE = new LedWizEquivalent();
                            LWE.LedWizNumber = (PL.Id - 1) * 2 + 20;
                            LWE.Name = "{0} Equivalent 1".Build(PL.Name);
                            for (int i = 1; i <= 32; i++)
                            {
                                

                                LedWizEquivalentOutput LWEO = new LedWizEquivalentOutput() { OutputName = "{0}\\{0}.{1:00}".Build(PL.Name,i), LedWizEquivalentOutputNumber = i };
                                LWE.Outputs.Add(LWEO);

                            }
                            if (!Cabinet.Toys.Contains(LWE.Name))
                            {
                                Cabinet.Toys.Add(LWE);
                            }

                            LWE = new LedWizEquivalent();
                            LWE.LedWizNumber = (PL.Id - 1) * 2 + 20 + 1;
                            LWE.Name = "{0} Equivalent 2".Build(PL.Name);
                            for (int i = 1; i <= 32; i++)
                            {
                                

                                LedWizEquivalentOutput LWEO = new LedWizEquivalentOutput() { OutputName = "{0}\\{0}.{1:00}".Build(PL.Name, i+32), LedWizEquivalentOutputNumber = i };
                                LWE.Outputs.Add(LWEO);


                            }
                            if (!Cabinet.Toys.Contains(LWE.Name))
                            {
                                Cabinet.Toys.Add(LWE);
                                Log.Write("Added LedwizEquivalent Nr. {0} with name {1} for PacLed64 with Id {2}".Build(LWE.LedWizNumber, LWE.Name, PL.Id));

                            }


                        }


                    }
                }


            }

        }
Пример #11
0
 /// <summary>
 /// Initializes the RGBLed toy.
 /// </summary>
 /// <param name="Cabinet"><see cref="Cabinet"/> object to which the <see cref="RGBLed"/> belongs.</param>
 public override void Init(Cabinet Cabinet)
 {
     _Cabinet = Cabinet;
     InitOutputs(Cabinet);
 }
Пример #12
0
        /// <summary>
        /// Initalizes the Motor toy.
        /// </summary>
        /// <param name="Cabinet"><see cref="Cabinet" /> object to which the <see cref="Motor" /> belongs.</param>
        public override void Init(Cabinet Cabinet)
        {
            AlarmHandler = Cabinet.Pinball.Alarms;

            base.Init(Cabinet);
        }
Пример #13
0
        /// <summary>
        /// Initializes the Artnet object.<br />
        /// Adds the output objects to the outputcollection of the ArtNet instance and starts the updater thread.
        /// </summary>
        /// <param name="Cabinet">The cabinet object which is using the ArtNet instance.</param>
        public override void Init(Cabinet  Cabinet)
        {
            AddOutputs();

   
            InitUpdaterThread();

            Log.Write("ArtNet node {0} (controlling universe {1}) initialized and updater thread started.".Build(Name,Universe));
        }
Пример #14
0
 /// <summary>
 /// Resets the toy and releases all references
 /// </summary>
 public override void Finish()
 {
     Reset();
     Output = null;
     Cabinet = null;
     base.Finish();
 }
Пример #15
0
 public void intialiser()
 {
     _cabinet = new Cabinet();
     _cabinet.modifier(TEST.MESSAGE_ENTREPRISE_VALIDE);
     _cabinet.enregistrer();
 }
Пример #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();
 }
Пример #17
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();
 }
Пример #18
0
        /// <summary>
        /// Initializes the LedWiz object.<br />
        /// This method does also start the workerthread which does the actual update work when Update() is called.<br />
        /// This method should only be called once. Subsequent calls have no effect.
        /// </summary>
        /// <param name="Cabinet">The Cabinet object which is using the LedWiz instance.</param>
        public override void Init(Cabinet Cabinet)
        {
            Log.Debug("Initializing LedWiz Nr. {0:00}".Build(Number));
            AddOutputs();
            LedWizUnits[Number].Init(Cabinet);
            Log.Write("LedWiz Nr. {0:00} initialized and updater thread initialized.".Build(Number));

        }
Пример #19
0
 /// <summary>
 /// Must initialize the IToy.
 /// Method must be overwritten.
 /// </summary>
 /// <param name="Cabinet"><see cref="Cabinet"/> object  to which the <see cref="IToy"/> belongs.</param>
 public abstract void Init(Cabinet Cabinet);
Пример #20
0
        /// <summary>
        /// Initializes the LedwizEquivalent toy.
        /// </summary>
        /// <param name="Cabinet"><see cref="Cabinet" /> object to which the <see cref="LedWizEquivalent"/> belongs.</param>
        public override void Init(Cabinet Cabinet)
        {

            Outputs.Init(Cabinet); 
        }