Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xantari committed Jan 10, 2021
1 parent f3643c6 commit ce5cfd5
Show file tree
Hide file tree
Showing 13 changed files with 330 additions and 69 deletions.
1 change: 1 addition & 0 deletions PinCab.Configurator/DatabaseBrowser.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pincab.Configurator.exe -databasebrowser
242 changes: 213 additions & 29 deletions PinCab.Configurator/DatabaseBrowserForm.Designer.cs

Large diffs are not rendered by default.

110 changes: 75 additions & 35 deletions PinCab.Configurator/DatabaseBrowserForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ private void ConfigureGrid()
column.Resizable = DataGridViewTriState.True;
}
dataGridViewEntryList.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;

foreach (DataGridViewColumn column in dataGridViewChildEntries.Columns)
{
if (column.SortMode != DataGridViewColumnSortMode.NotSortable)
column.SortMode = DataGridViewColumnSortMode.Automatic;
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
column.Resizable = DataGridViewTriState.True;
}
dataGridViewChildEntries.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
//Speed tweak testing
//dataGridViewEntryList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
//dataGridViewEntryList.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
Expand Down Expand Up @@ -156,7 +165,7 @@ private void contextMenuStripGridActions_ItemClicked(object sender, ToolStripIte
int rowIndex = GetActiveRowIndex();
if (rowIndex == -1)
{
txtLog.Text = "Selected a row or cell first.";
txtLog.Text = "Select a row or cell first.";
return;
}
//if (e.ClickedItem == editToolStripMenuItem)
Expand All @@ -173,13 +182,6 @@ private void contextMenuStripGridActions_ItemClicked(object sender, ToolStripIte
// StopRunningRom();
}

//private void RefreshGrid()
//{
// LoadDatabaseGrid();
// if (!string.IsNullOrEmpty(txtRomSearch.Text))
// SearchByText();
//}

private int GetActiveRowIndex()
{
int rowIndex = -1;
Expand All @@ -198,6 +200,12 @@ private DatabaseBrowserEntry GetActiveRowEntry()
return data;
}

private DatabaseBrowserEntry GetChildActiveRowEntry()
{
var data = bindingSourceChildEntries.Current as DatabaseBrowserEntry;
return data;
}

private void backgroundWorkerProgressBar_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
toolStripProgressBar.Value = e.ProgressPercentage;
Expand All @@ -212,14 +220,6 @@ private void backgroundWorkerProgressBar_RunWorkerCompleted(object sender, RunWo
if (result.MessageType == ValidationMessageType.ToolMessage)
LogToolValidationResult(result.ToolName, result);
}
//if (result.FunctionExecuted == DatabaseManagerBackgroundProgressAction.DownloadDatabases.ToString())
//{
// //RefreshGrid();
//}
//else if (result.FunctionExecuted == DatabaseManagerBackgroundProgressAction.ProcessDatabase.ToString())
//{

//}
if (result.FunctionExecuted == DatabaseManagerBackgroundProgressAction.DownloadAndLoadDatabase.ToString())
{
if (result.Result != null)
Expand Down Expand Up @@ -276,25 +276,6 @@ private void UpdateToolstripStatus()
private void backgroundWorkerProgressBar_DoWork(object sender, DoWorkEventArgs e)
{
var arg = (DatabaseManagerBackgroundAction)e.Argument;
//if (arg.Action == DatabaseManagerBackgroundProgressAction.DownloadDatabases)
//{
// var result = _dbManager.RefreshAllDatabases();
// var toolResult = new ToolResult(result);
// toolResult.ToolName = DatabaseManager.ToolName;
// toolResult.MessageType = ValidationMessageType.ToolMessage;
// toolResult.FunctionExecuted = arg.Action.ToString();
// e.Result = toolResult;
//}
//else if (arg.Action == DatabaseManagerBackgroundProgressAction.ProcessDatabase)
//{
// var result = _dbManager.GetAllEntries();
// var toolResult = new ToolResult();
// toolResult.ToolName = DatabaseManager.ToolName;
// toolResult.MessageType = ValidationMessageType.ToolMessage;
// toolResult.FunctionExecuted = arg.Action.ToString();
// toolResult.Result = result;
// e.Result = toolResult;
//}
if (arg.Action == DatabaseManagerBackgroundProgressAction.DownloadAndLoadDatabase)
{
e.Result = DownloadAndLoadDatabase();
Expand Down Expand Up @@ -501,5 +482,64 @@ private void dataGridViewEntryList_RowContextMenuStripNeeded(object sender, Data
else
contextMenuStripGridActions.Items["IpdbInfoToolStripMenuItem"].Enabled = true;
}

private void dataGridViewChildEntries_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
dataGridViewEntryList.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);
}

private void dataGridViewChildEntries_RowContextMenuStripNeeded(object sender, DataGridViewRowContextMenuStripNeededEventArgs e)
{
var row = GetChildActiveRowEntry();
if (!row.IpdbId.HasValue)
contextMenuStripChildEntries.Items["toolStripMenuItemChildIpdb"].Enabled = false;
else
contextMenuStripChildEntries.Items["toolStripMenuItemChildIpdb"].Enabled = true;
}

private void toolStripMenuItemChildIpdb_Click(object sender, EventArgs e)
{
var row = GetChildActiveRowEntry();
if (row != null)
{
if (row.IpdbId.HasValue)
{
Process.Start($"https://www.ipdb.org/machine.cgi?id={row.IpdbId.Value}");
}
}
}

private void toolStripMenuItemChildUrl_Click(object sender, EventArgs e)
{
var row = GetChildActiveRowEntry();
if (row != null)
{
if (!string.IsNullOrEmpty(row.Url))
{
Process.Start(row.Url);
}
}
}

private void dataGridViewChildEntries_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1 || e.ColumnIndex == -1)
return;
var row = GetChildActiveRowEntry();
if (row != null)
{
if (!string.IsNullOrEmpty(row.Url))
{
Process.Start(row.Url);
}
}
}

private void dataGridViewEntryList_SelectionChanged(object sender, EventArgs e)
{
var entry = GetActiveRowEntry();
//Now bind the child grid
bindingSourceChildEntries.DataSource = entry.RelatedEntries.ToSortableBindingList();
}
}
}
27 changes: 27 additions & 0 deletions PinCab.Configurator/DatabaseBrowserForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,33 @@
<metadata name="vpinDatabaseSettingBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="contextMenuStripChildEntries.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>212, 56</value>
</metadata>
<metadata name="bindingSourceChildEntries.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="backgroundWorkerProgressBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>596, 17</value>
</metadata>
Expand Down
3 changes: 3 additions & 0 deletions PinCab.Configurator/Pincab.Configurator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Content Include="DatabaseBrowser.bat">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
2 changes: 2 additions & 0 deletions PinCab.Configurator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ static void Main(string[] args)
Application.Run(new GameManagerForm());
if (args.Contains("-rombrowser"))
Application.Run(new PinMameRomBrowserForm());
if (args.Contains("-databasebrowser"))
Application.Run(new DatabaseBrowserForm());
}
else
Application.Run(new MainForm());
Expand Down
Binary file added Screenshots/DatabaseBrowserScreenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/Wiki/DatabaseBrowserScreenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Wiki/SettingsPage1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Wiki/SettingsPage2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Wiki/SettingsPage3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/Wiki/SettingsPage4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Wiki here: https://github.com/xantari/PinCab.Configurator/wiki (Or click on Wiki
25. Manual settings output info for Pinball FX2/FX3 (so you can just type the values into the program to match your DMD position)
26. Pinball Y settings read/write/validation
27. P-Roc DMD Settings display
28. Database Manager that fetches data from the continously updated databases here: ![Pinball Databases](https://github.com/xantari/VirtualPinball.Databases "Pinball Databases")
29. Hooks into the continuously updated IPDB database here: ![IPDB Database](https://github.com/xantari/Ipdb.Database "IPDB Database")

# Instructions

Expand Down Expand Up @@ -84,6 +86,9 @@ Logging information is in the Log.txt file in the application root folder.
#### PinMAME ROM Setting Editor
![PinMAME ROM Setting Editor](https://github.com/xantari/PinCabScreenConfigurator/raw/master/Screenshots/PinMameRomEditorScreenshot.png "PinMAME ROM Setting Editor")

#### Database Browser
![Database Browser](https://github.com/xantari/PinCabScreenConfigurator/raw/master/Screenshots/DatabaseBrowserScreenshot.png "Database Browser")

# TODO
1. Add command line switch to actually run the FFMPeg commands to capture video and move the resulting videos to the correct location (depending on front end)
2. Create help HTML pages and hookup to the program
Expand All @@ -93,11 +98,7 @@ for things like Wheels / Backglass / Playfield / Launch Audio / Toppers / etc.
b. Option to right click a missing media cell and it will automatically popup a browser to search for that media
c. Hook into PuPmedia.php on VPinball.com to fetch media as well
d. Hook into PinballX's (GameEx) media library (if you have defined your GameEx credentials)
e. Convert the Pinball Game spreadsheet into JSON format and check into Git so that it can be used as a easy way to load tables into the front end. Automatically popup embedded programs Chromium based browser to fetch the table or media.
f. Maintain an install time of the table in a local database (extra fields in PinballY/PinballX XML, and already a field in PinUpPoppers Games table), so you can compare the last updated date/time stamp in the pinball game spreadsheet to see if updates to a table are available.
g. Add a pinball games database URL pointer to fetch updates on program load. Default it to Github so we can get PR's on updates to the games database.
4. Get a more robust dump of the IPDB database in JSON format with as much data from IPDB as possible.

e. Maintain an install time of the table in a local database (extra fields in PinballY/PinballX XML, and already a field in PinUpPoppers Games table), so you can compare the last updated date/time stamp in the pinball game database to see if updates to a table are available.

# Thank you!
Thanks go to [Soroush Falahati](https://github.com/falahati) for his excellent [WindowsDisplayApi](https://github.com/falahati/WindowsDisplayAPI) and [EDIDParser](https://github.com/falahati/EDIDParser) libraries!
Expand All @@ -106,6 +107,9 @@ Thanks go to [Soroush Falahati](https://github.com/falahati) for his excellent [

1. Unable to figure out how to read/write/validate Pinball FX2 / FX3 screen settings for Cabinet mode (need to ensure cabinet mode enabled first (must get code from Zen Studios)).
Settings data appears to be encrypted. Unsure how to read/write to it.
2. General optimizations / cleanup
3. Documentation
4. All PR's welcome!

# Notes
1. Compilation is done using Any CPU, with the Prefer 32-bit flag as it links itself to the 32-bit version of VPinMame for DMD preview

0 comments on commit ce5cfd5

Please sign in to comment.