WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
Pinball.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.Reflection;
5 using System.Threading;
6 using DirectOutput.Cab;
7 using DirectOutput.FX;
12 using System.Linq;
13 using DirectOutput.Table;
14 
15 using System.Diagnostics;
16 
17 namespace DirectOutput
18 {
23  public class Pinball
24  {
25 
26  #region Properties
27 
28 
29 
30 
31 
32 
33  private Table.Table _Table = new Table.Table();
34 
41  public Table.Table Table
42  {
43  get { return _Table; }
44  set { _Table = value; }
45  }
46  private Cabinet _Cabinet = new Cabinet();
47 
54  public Cabinet Cabinet
55  {
56  get { return _Cabinet; }
57  set { _Cabinet = value; }
58  }
59 
60 
61 
62  private AlarmHandler _Alarms = new AlarmHandler();
63 
70  public AlarmHandler Alarms
71  {
72  get { return _Alarms; }
73  private set { _Alarms = value; }
74  }
75 
76  private GlobalConfig _GlobalConfig = new GlobalConfig();
77 
85  {
86  get { return _GlobalConfig; }
87  private set { _GlobalConfig = value; }
88  }
89 
90 
91 
92  #endregion
93 
94 
95  #region Init & Finish
96 
104  public void Setup(string GlobalConfigFilename = "", string TableFilename = "", string RomName = "")
105  {
106  bool GlobalConfigLoaded = true;
107  //Load the global config
108 
109 
110  try
111  {
112  if (!GlobalConfigFilename.IsNullOrWhiteSpace())
113  {
114  FileInfo GlobalConfigFile = new FileInfo(GlobalConfigFilename);
115 
116 
117  GlobalConfig = GlobalConfig.GetGlobalConfigFromConfigXmlFile(GlobalConfigFile.FullName);
118  if (GlobalConfig == null)
119  {
120  GlobalConfigLoaded = false;
121 
122  //set new global config object if it config could not be loaded from the file.
123  GlobalConfig = new GlobalConfig();
124  }
125  GlobalConfig.GlobalConfigFilename = GlobalConfigFile.FullName;
126  }
127  else
128  {
129  GlobalConfig = new GlobalConfig();
130  GlobalConfig.GlobalConfigFilename = GlobalConfigFilename;
131  }
132 
133  }
134  catch (Exception E)
135  {
136 
137  throw new Exception("DirectOutput framework could not initialize global config.\n Inner exception: {0}".Build(E.Message), E);
138  }
139 
141  {
143  {
144  try
145  {
146 
147  FileInfo LF = new FileInfo(GlobalConfig.GetLogFilename((!TableFilename.IsNullOrWhiteSpace() ? new FileInfo(TableFilename).FullName : ""), RomName));
148  if (LF.Exists)
149  {
150  LF.Delete();
151  }
152  }
153  catch { }
154  }
155  try
156  {
157 
158  Log.Filename = GlobalConfig.GetLogFilename((!TableFilename.IsNullOrWhiteSpace() ? new FileInfo(TableFilename).FullName : ""), RomName);
159  Log.Init();
160 
161  }
162  catch (Exception E)
163  {
164 
165  throw new Exception("DirectOutput framework could initialize the log file.\n Inner exception: {0}".Build(E.Message), E);
166  }
167  }
168 
169 
170  try
171  {
172  if (GlobalConfigLoaded)
173  {
174  Log.Write("Global config loaded from: {0}".Build(GlobalConfigFilename));
175  }
176  else
177  {
178  if (!GlobalConfigFilename.IsNullOrWhiteSpace())
179  {
180  Log.Write("Could not find or load theGlobalConfig file {0}".Build(GlobalConfigFilename));
181  }
182  else
183  {
184  Log.Write("No GlobalConfig file loaded. Using newly instanciated GlobalConfig object instead.");
185  }
186  }
187 
188 
189 
190  Log.Write("Loading Pinball parts");
191 
192 
193 
194  Log.Write("Loading cabinet");
195  //Load cabinet config
196  Cabinet = null;
197  FileInfo CCF = GlobalConfig.GetCabinetConfigFile();
198  if (CCF != null)
199  {
200  if (CCF.Exists)
201  {
202  Log.Write("Will load cabinet config file: {0}".Build(CCF.FullName));
203  try
204  {
206 
207  Log.Write("{0} output controller defnitions and {1} toy definitions loaded from cabinet config.".Build(Cabinet.OutputControllers.Count,Cabinet.Toys.Count));
208 
209 
210  Cabinet.CabinetConfigurationFilename = CCF.FullName;
212  {
213  Log.Write("Cabinet config file has AutoConfig feature enabled. Calling AutoConfig.");
214  try
215  {
217  }
218  catch (Exception E)
219  {
220  Log.Exception("A eception occured during cabinet auto configuration", E);
221  }
222  Log.Write("Autoconfig complete.");
223  }
224  Log.Write("Cabinet config loaded successfully from {0}".Build(CCF.FullName));
225  }
226  catch (Exception E)
227  {
228  Log.Exception("A exception occured when loading cabinet config file: {0}".Build(CCF.FullName), E);
229 
230 
231  }
232  }
233  else
234  {
235  Log.Warning("Cabinet config file {0} does not exist.".Build(CCF.FullName));
236  }
237  }
238  if (Cabinet == null)
239  {
240  Log.Write("No cabinet config file loaded. Will use AutoConfig.");
241  //default to a new cabinet object if the config cant be loaded
242  Cabinet = new Cabinet();
244  }
245 
246  Log.Write("Cabinet loaded");
247 
248  Log.Write("Loading table config");
249 
250  //Load table config
251 
252  Table = new DirectOutput.Table.Table();
253  Table.AddLedControlConfig = true;
254 
255  if (!TableFilename.IsNullOrWhiteSpace())
256  {
257  FileInfo TableFile = new FileInfo(TableFilename);
258  FileInfo TCF = GlobalConfig.GetTableConfigFile(TableFile.FullName);
259  if (TCF != null)
260  {
261  Log.Write("Will load table config from {0}".Build(TCF.FullName));
262  try
263  {
265  Table.TableConfigurationFilename = GlobalConfig.GetTableConfigFile(TableFile.FullName).FullName;
266  Log.Write("Table config loaded successfully from {0}".Build(TCF.FullName));
267  }
268  catch (Exception E)
269  {
270  Log.Exception("A exception occured when loading table config: {0}".Build(TCF.FullName), E);
271  }
273  {
274  Log.Write("Table config allows mix with ledcontrol configs.");
275  }
276  }
277  else
278  {
279  Log.Warning("No table config file found. Will try to load config from LedControl file(s).");
280  }
281  }
282  else
283  {
284  Log.Write("No TableFilename specified, will use empty tableconfig");
285  }
287  {
288  if (!RomName.IsNullOrWhiteSpace())
289  {
290  Log.Write("Will try to load configs from DirectOutput.ini or LedControl.ini file(s) for RomName {0}".Build(RomName));
291  //Load ledcontrol
292 
293  Dictionary<int, FileInfo> LedControlIniFiles = GlobalConfig.GetIniFilesDictionary(TableFilename);
294 
295 
297  if (LedControlIniFiles.Count > 0)
298  {
299  L.LoadLedControlFiles(LedControlIniFiles, false);
300  Log.Write("{0} directoutputconfig.ini or ledcontrol.ini files loaded.".Build(LedControlIniFiles.Count));
301  }
302  else
303  {
304  Log.Write("No directoutputconfig.ini or ledcontrol.ini files found.");
305  }
306 
307  if (!L.ContainsConfig(RomName))
308  {
309  Log.Write("No config for table found in LedControl data for RomName {0}.".Build(RomName));
310  }
311  else
312  {
313  Log.Write("Config for RomName {0} exists in LedControl data. Updating cabinet and config.".Build(RomName));
314 
317  C.EffectRGBMinDurationMs = GlobalConfig.LedControlMinimumRGBEffectDurationMs;
318  C.Setup(L, Table, Cabinet, RomName);
319  C = null;
320  // L.UpdateTableConfig(Table, RomName, Cabinet);
321 
322  //Check DOF Version
323  Version DOFVersion = typeof(Pinball).Assembly.GetName().Version;
324 
325  if(L.Any(LC=>LC.MinDOFVersion!=null && LC.MinDOFVersion.CompareTo(DOFVersion)>0)) {
326 
327  Version MaxVersion = null;
328  foreach (LedControlConfig LC in L)
329  {
330  if(LC.MinDOFVersion!=null && (MaxVersion==null || MaxVersion.CompareTo(LC.MinDOFVersion)>0)) {
331  MaxVersion = LC.MinDOFVersion;
332  }
333  }
334 
335 
336  Log.Warning("UPDATE DIRECT OUTPUT FRAMEWORK!");
337  if (MaxVersion != null)
338  {
339  Log.Warning("Current DOF version is {0}, but DOF version {1} or later is required by one or several config files.".Build(DOFVersion, MaxVersion));
340  }
341  try
342  {
343 
344  Process.Start(Path.Combine(Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().Location),"UpdateNotification.exe"));
345  }
346  catch (Exception E)
347  {
348  Log.Exception("A exception occured when displaying the update notification", E);
349  }
350  }
351 
352 
353 
354 
355  }
356  L = null;
357  }
358  else
359  {
360 
361  Log.Write("Cant load config from directoutput.ini or ledcontrol.ini file(s) since no RomName was supplied. No ledcontrol config will be loaded.");
362  }
363 
364  }
365  if (Table.TableName.IsNullOrWhiteSpace())
366  {
367  if (!TableFilename.IsNullOrWhiteSpace())
368  {
369  Table.TableName = Path.GetFileNameWithoutExtension(new FileInfo(TableFilename).FullName);
370  }
371  else if (!RomName.IsNullOrWhiteSpace())
372  {
373  Table.TableName = RomName;
374  }
375  }
376  if (!TableFilename.IsNullOrWhiteSpace())
377  {
378  Table.TableFilename = new FileInfo(TableFilename).FullName;
379  }
380  if (!RomName.IsNullOrWhiteSpace())
381  {
382  Table.RomName = RomName;
383  }
384  Log.Write("Table config loading finished");
385 
386 
387 
388  Log.Write("Pinball parts loaded");
389  }
390  catch (Exception E)
391  {
392  Log.Exception("DirectOutput framework has encountered a exception during setup.", E);
393  throw new Exception("DirectOutput framework has encountered a exception during setup.\n Inner exception: {0}".Build(E.Message), E);
394  }
395 
396 
397  }
398 
402  public void Init()
403  {
404 
405  try
406  {
407 
408  Log.Write("Starting processes");
409 
410 
411  CabinetOwner CO = new CabinetOwner();
412  CO.Alarms = this.Alarms;
413  CO.ConfigurationSettings.Add("LedControlMinimumEffectDurationMs",GlobalConfig.LedControlMinimumEffectDurationMs);
414  Cabinet.Init(CO);
415 
416  Table.Init(this);
417  Alarms.Init(this);
419  Cabinet.Update();
420 
421  //Add the thread initializing the framework to the threadinfo list
422  ThreadInfo TI = new ThreadInfo(Thread.CurrentThread);
423  TI.HeartBeatTimeOutMs = 10000;
424  TI.HostName = "External caller";
425  TI.HeartBeat();
426  //ThreadInfoList.Add(TI);
427 
428 
429 
430  InitMainThread();
431  Log.Write("Framework initialized.");
432  Log.Write("Have fun! :)");
433 
434 
435  }
436  catch (Exception E)
437  {
438  Log.Exception("DirectOutput framework has encountered a exception during initialization.", E);
439  throw new Exception("DirectOutput framework has encountered a exception during initialization.\n Inner exception: {0}".Build(E.Message), E);
440  }
441  }
442 
446  public void Finish()
447  {
448  try
449  {
450  Log.Write("Finishing framework");
451  FinishMainThread();
452 
453  Alarms.Finish();
454  Table.Finish();
455  Cabinet.Finish();
456 
457 
458  // WriteStatisticsToLog();
459 
460  //ThreadInfoList.ThreadTerminates();
461 
462  Log.Write("DirectOutput framework finished.");
463  Log.Write("Bye and thanks for using!");
464 
465  }
466  catch (Exception E)
467  {
468  Log.Exception("A exception occured while finishing the DirectOutput framework.", E);
469  throw new Exception("DirectOutput framework has encountered while finishing.\n Inner exception: {0}".Build(E.Message), E);
470  }
471  }
472 
473  #endregion
474 
475 
476 
477  #region MainThread
478  private void InitMainThread()
483  {
484 
485  if (!MainThreadIsActive)
486  {
487  KeepMainThreadAlive = true;
488  try
489  {
490  MainThread = new Thread(MainThreadDoIt);
491  MainThread.Name = "DirectOutput MainThread ";
492  MainThread.Start();
493 
494 
495  }
496  catch (Exception E)
497  {
498  Log.Exception("DirectOutput MainThread could not start.", E);
499  throw new Exception("DirectOutput MainThread could not start.", E);
500  }
501  }
502  }
503 
508  private void FinishMainThread()
509  {
510  if (MainThread != null)
511  {
512  try
513  {
514  KeepMainThreadAlive = false;
515  lock (MainThreadLocker)
516  {
517  Monitor.Pulse(MainThreadLocker);
518  }
519  if (!MainThread.Join(1000))
520  {
521  MainThread.Abort();
522  }
523  MainThread = null;
524  }
525  catch (Exception E)
526  {
527  Log.Exception("A error occured during termination of DirectOutput MainThread", E);
528  throw new Exception("A error occured during termination of DirectOutput MainThread", E);
529  }
530  }
531  }
532 
533 
537  public bool MainThreadIsActive
538  {
539  get
540  {
541  if (MainThread != null)
542  {
543  if (MainThread.IsAlive)
544  {
545  return true;
546  }
547  }
548  return false;
549  }
550  }
551 
555  public void MainThreadSignal()
556  {
557  lock (MainThreadLocker)
558  {
559  MainThreadDoWork = true;
560  Monitor.Pulse(MainThreadLocker);
561  }
562  }
563 
564 
565  private Thread MainThread { get; set; }
566  private object MainThreadLocker = new object();
567  private bool KeepMainThreadAlive = true;
568  private bool MainThreadDoWork = false;
569  //TODO: Maybe this should be a config option
570  const int MaxInputDataProcessingTimeMs = 10;
571 
572 
577  //TODO: Think about implement something which does really check on value changes on tableelements or triggered effects before setting update required.
578  private void MainThreadDoIt()
579  {
580 
581  //ThreadInfoList.HeartBeat("DirectOutput");
582  try
583  {
584  while (KeepMainThreadAlive)
585  {
586  bool UpdateRequired = false;
587  DateTime Start = DateTime.Now;
588 
589  //Consume the tableelement data delivered from the calling application
590  while (InputQueue.Count > 0 && (DateTime.Now - Start).Milliseconds <= MaxInputDataProcessingTimeMs && KeepMainThreadAlive)
591  {
593 
594  D = InputQueue.Dequeue();
595  try
596  {
597 
599  UpdateRequired |= true;
600 
601  }
602  catch (Exception E)
603  {
604  Log.Exception("A unhandled exception occured while processing data for table element {0} {1} with value {2}".Build(D.TableElementType, D.Number, D.Value), E);
605  //ThreadInfoList.RecordException(E);
606 
607  }
608  }
609 
610  if (KeepMainThreadAlive)
611  {
612  try
613  {
614  //Executed all alarms which have been scheduled for the current time
615  UpdateRequired |= Alarms.ExecuteAlarms(DateTime.Now.AddMilliseconds(1));
616  }
617  catch (Exception E)
618  {
619  Log.Exception("A unhandled exception occured while executing timer events.", E);
620  //ThreadInfoList.RecordException(E);
621  }
622  }
623 
624 
625  //Call update on output controllers if necessary
626  if (UpdateRequired && KeepMainThreadAlive)
627  {
628  try
629  {
630  Cabinet.Update();
631  }
632  catch (Exception E)
633  {
634  Log.Exception("A unhandled exception occured while updating the output controllers", E);
635  //ThreadInfoList.RecordException(E);
636  }
637  }
638 
639  if (KeepMainThreadAlive)
640  {
641  //ThreadInfoList.HeartBeat();
642  //Sleep until we get more input data and/or a timer expires.
643  DateTime NextAlarm = Alarms.GetNextAlarmTime();
644 
645  lock (MainThreadLocker)
646  {
647  while (InputQueue.Count == 0 && NextAlarm > DateTime.Now && !MainThreadDoWork && KeepMainThreadAlive)
648  {
649  int TimeOut = ((int)(NextAlarm - DateTime.Now).TotalMilliseconds).Limit(1, 50);
650 
651  Monitor.Wait(MainThreadLocker, TimeOut); // Lock is released while we’re waiting
652  //ThreadInfoList.HeartBeat();
653  }
654  }
655  MainThreadDoWork = false;
656  }
657 
658 
659  }
660  }
661  catch (Exception E)
662  {
663  Log.Exception("A unexpected exception occured in the DirectOutput MainThread", E);
664  //ThreadInfoList.RecordException(E);
665  }
666 
667  //ThreadInfoList.ThreadTerminates();
668  }
669  #endregion
670 
671 
672 
673 
674 
675 
676 
677 
678 
679  private InputQueue InputQueue = new InputQueue();
680 
688  public void ReceiveData(char TableElementTypeChar, int Number, int Value)
689  {
690  InputQueue.Enqueue(TableElementTypeChar, Number, Value);
692  //ThreadInfoList.HeartBeat("Data delivery");
693 
694  }
695 
696 
703  public void ReceiveData(string TableElementName, int Value)
704  {
705  //Log.Write("TableName:"+TableElementName);
706  //Log.Write("Update {0}: {1}".Build(TableElementName, Value));
707  InputQueue.Enqueue(TableElementName, Value);
709 
710  }
711 
712 
719  {
720  InputQueue.Enqueue(TableElementData);
722  //ThreadInfoList.HeartBeat("Data delivery");
723  }
724 
725 
726 
727 
728 
729 
730  #region ToString
731  public override string ToString()
738  {
739  string S = this.GetType().FullName + " {\n";
740  S += " GlobalConfig {\n";
741  S += " Global Config filename:" + GlobalConfig.GlobalConfigFilename + "\n";
742  S += " }\n";
743  S += " Table {\n";
744  S += " Tablename: " + Table.TableName + "\n";
745  S += " Tablefileename: " + Table.TableFilename + "\n";
746  S += " RomName: " + Table.RomName + "\n";
747  S += " Table config source: " + Table.ConfigurationSource + "\n";
748  S += " Table config fileename: " + Table.TableConfigurationFilename + "\n";
749  S += " Table Elements count: " + Table.TableElements.Count + "\n";
750  S += " Table Effects count: " + Table.Effects.Count + "\n";
751  S += " }\n";
752  S += " Cabinet {\n";
753  S += " Cabinet config filename: " + Cabinet.CabinetConfigurationFilename + "\n";
754  S += " Outputcontrollers count: " + Cabinet.OutputControllers.Count + "\n";
755  S += " Output toys count: " + Cabinet.Toys.Count + "\n";
756  S += " }\n";
757 
758  S += "}\n";
759  return S;
760 
761  }
762  #endregion
763 
764 
765  #region Constructor
766  public Pinball()
770  {
771 
772 
773 
774 
775  }
776 
777 
784  //public Pinball(string GlobalConfigFilename = "", string TableFilename = "", string RomName = "")
785  // : this()
786  //{
787  // Init(GlobalConfigFilename, TableFilename, RomName);
788  //}
789  #endregion
790 
791 
792  }
793 }
bool EnableLogging
Gets or sets a value indicating whether impotant events in the framework are logged to a file...
void HeartBeat()
HeartBeat has to be called regularely to update the LastHeartBeat property.
Definition: ThreadInfo.cs:99
The AlarmHandler classed is used to execute scheduled events (e.g. regular updates on a effect) in th...
Definition: AlarmHandler.cs:14
The Cabinet object describes the parts of a pinball cabinet (toys, outputcontrollers, outputs and more).
Definition: Cabinet.cs:17
TableElementTypeEnum TableElementType
The type of the table element.
void Setup(string GlobalConfigFilename="", string TableFilename="", string RomName="")
Configures the Pinball object. Loads the global config, table config and cabinet config ...
Definition: Pinball.cs:104
Simple queue of TableElementData objects. Used by the framework to separate data receiving and data ...
Definition: InputQueue.cs:12
void MainThreadSignal()
Signals the main thread to continue its work (if currently sleeping).
Definition: Pinball.cs:555
int LedControlMinimumRGBEffectDurationMs
Gets or sets the minimum duration in milliseconds for LedControl effects controlling RGB leds...
Definition: GlobalConfig.cs:73
void Finish()
Finishes the table and the contained objects (Effects, TableElements)
Definition: Table.cs:276
new int Count
Gets the of TableElementData objects in the queue..
Definition: InputQueue.cs:83
static Cabinet GetCabinetFromConfigXmlFile(string FileName)
Instanciates a Cabinet object from a cabinet configuration in a XML file.
Definition: Cabinet.cs:224
DateTime GetNextAlarmTime()
Gets the time when the next alarm (interval or single) is scheduled.
Definition: AlarmHandler.cs:22
FileInfo GetCabinetConfigFile()
FileInfo object for the file containing the configuration of the cabinet (outputs, toys and so on).
bool MainThreadIsActive
Indicates if the MainThread of DirectOutput is active
Definition: Pinball.cs:538
string RomName
Name of the table rom. Triggers RomNameChanged if value is changed.
Definition: Table.cs:110
void Init(Pinball Pinball)
Inits the object.
int Number
The number of the table element.
string GlobalConfigFilename
Gets or sets the global config filename.
string TableName
Name of the Table. Triggers TableNameChanged if value is changed.
Definition: Table.cs:82
static void Warning(string Message)
Writes a warning message to the log.
Definition: Log.cs:134
GlobalConfig GlobalConfig
Gets the global config for the Pinnball object.
Definition: Pinball.cs:85
void UpdateTableElement(TableElementData Data)
Updates the TableElements list with data received from Pinmame.
Definition: Table.cs:217
void TriggerStaticEffects()
Triggers the static effects for the table.
Definition: Table.cs:227
bool ContainsConfig(string RomName)
Determines whether a config for the spcified RomName exists in the configs.
DirectOutput.Cab.Toys.ToyList Toys
List of IToy objects describing the toys in the cabinet.
Definition: Cabinet.cs:107
void Enqueue(Char TableElementTypeChar, int Number, int Value)
Enqueues input data.
Definition: InputQueue.cs:23
void LoadLedControlFiles(IList< string > LedControlFilenames, bool ThrowExceptions=false)
Loads a list of ledcontrol.ini files.
void Update()
Calls the update method for toys and output controllers in the cabinet
Definition: Cabinet.cs:316
This object provides information on a thread.
Definition: ThreadInfo.cs:12
Pinball is the main object of the DirectOutput framework. It holds all objects required to process P...
Definition: Pinball.cs:23
static void Write(string Message)
Writes the specified message to the logfile.
Definition: Log.cs:99
static void Init()
Initializes the log using the file defnied in the Filename property.
Definition: Log.cs:40
TableConfigSourceEnum ConfigurationSource
Gets or sets the configuration source.
Definition: Table.cs:174
A simple logger used to record important events and exceptions.
Definition: Log.cs:14
new TableElementData Dequeue()
Dequeues the TableElementData object at the front of the queue.
Definition: InputQueue.cs:55
Cabinet Cabinet
Gets or sets the Cabinet object for the Pinball object.
Definition: Pinball.cs:55
void Init(Pinball Pinball)
Initializes the table and the contained objects(Effects, TableElements).
Definition: Table.cs:236
FileInfo GetTableConfigFile(string FullTableFilename)
Gets a FileInfo object for the table config file. The file is lookued up using the list of the prope...
int Value
The value of the table element.
int LedControlMinimumEffectDurationMs
Gets or sets the minimum duration in milliseconds for LedControl effects occupying one output (e...
Definition: GlobalConfig.cs:57
Out.OutputControllerList OutputControllers
List of IOutputController objects representing the output controllers in the cabinet.
Definition: Cabinet.cs:179
void ReceiveData(string TableElementName, int Value)
Receives data for named table elements. The received data is put in a queue and the internal thread o...
Definition: Pinball.cs:703
AlarmHandler Alarms
Gets the AlarmHandler object for the Pinball object.
Definition: Pinball.cs:71
void ReceiveData(TableElementData TableElementData)
Receives the table element data from the calling app. The received data is put in a queue and the in...
Definition: Pinball.cs:718
void Finish()
Finishes the Pinball object.
Definition: Pinball.cs:446
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
void Finish()
Finishes the cabinet
Definition: Cabinet.cs:327
int EffectMinDurationMs
The min duration for effects targeting a single output.
Definition: Configurator.cs:32
string GetLogFilename(string TableFilename="", string RomName="")
Gets the log filename based on the LogFilePattern with replaced placeholders.
string TableFilename
Gets or sets the filename of the table.
Definition: Table.cs:137
The DirectOutput.LedControl namespace contains the classes to read and understand the classical LedCo...
Definition: ColorConfig.cs:6
string TableConfigurationFilename
Gets or sets the table configuration filename.
Definition: Table.cs:146
TableElementList TableElements
Lists the TableElement objects for the Table. This list is automaticaly extend with new TableElement...
Definition: Table.cs:27
Data representing the state of a table emlement
void Init()
Initializes/starts the Pinball object
Definition: Pinball.cs:402
EffectList Effects
List of table specific effects.
Definition: Table.cs:187
void ReceiveData(char TableElementTypeChar, int Number, int Value)
Receives the table element data from the calling app (e.g. B2S.Server providing data through the plug...
Definition: Pinball.cs:688
PinballSupport.AlarmHandler Alarms
Definition: CabinetOwner.cs:20
int HeartBeatTimeOutMs
Gets or sets the heartbeat timeout in milliseconds.
Definition: ThreadInfo.cs:113
Dictionary< int, FileInfo > GetIniFilesDictionary(string TableFilename="")
Gets the a dictionary containing all ini files (file) and their number (key).
Ledcontrol configuration read from a ledcontrol.ini file.
void Finish()
Finishes the object. Clears all alarm lists.
List of LedControlConfig objects loaded from LedControl.ini files.
void Init(ICabinetOwner CabinetOwner)
Initializes the cabinet.
Definition: Cabinet.cs:302
void AutoConfig()
This method finds all classes implementing the IAutoConfigOutputController interface and uses the mem...
Definition: Cabinet.cs:22
string HostName
Gets or sets the name of the object hosting the thread.
Definition: ThreadInfo.cs:78
bool ClearLogOnSessionStart
Gets or sets a value indicating whether DOF clears the log file on session start. ...
Global configuration for the DirectOutput framework.
Definition: GlobalConfig.cs:18
The Table namespace contains all table specific classes like the Table class itself, TableElement and effect assigment classes.
Definition: Table.cs:14
static Table GetTableFromConfigXmlFile(string FileName)
Instanciates a Table object from a Table configuration in a XML file.
Definition: Table.cs:325
bool ExecuteAlarms(DateTime AlarmTime)
Executes all Alarmes which have expired until the specified AlarmTime..
Definition: AlarmHandler.cs:39
static string Filename
Gets or sets the filename for the log.
Definition: Log.cs:31
Configures the system based on data from ini files (either directoutputconfig.ini or ledcontrol...
Definition: Configurator.cs:27
Holds all table specific information and handles all TableElements
Definition: Table.cs:20
Dictionary< string, object > ConfigurationSettings
Definition: CabinetOwner.cs:15
bool AutoConfigEnabled
Gets or sets a value indicating whether auto config is enabled. If auto config is enabled...
Definition: Cabinet.cs:152
The namespace FX contains effect related classes. Effects can be assigned directly to a Table and wi...
string CabinetConfigurationFilename
Gets or sets the filename from which the cabiet configuration was loaded.
Definition: Cabinet.cs:98
Table()
Initializes a new instance of the Table class.
Definition: Table.cs:388
The namespace DirectOutput.General contains classes for general use.
override string ToString()
Returns a System.String that represents this instance.
Definition: Pinball.cs:737
Support classes used by the Pinball object.
Definition: AlarmHandler.cs:6
static void Exception(string Message, Exception E=null)
Writes a exception message to the log.
Definition: Log.cs:144
static GlobalConfig GetGlobalConfigFromConfigXmlFile(string GlobalConfigFileName)
Instanciates a GlobalConfig object from a global configuration in a XML file. If the global config f...
int Count
Number of items in the ExtList.
Definition: ExtList.cs:159
bool AddLedControlConfig
Gets or sets a value indicating whether configurations from ledcontrol files should be added to the t...
Definition: Table.cs:158
Pinball()
Initializes a new instance of the Pinball class.
Definition: Pinball.cs:769