Skip to content

Commit cd5b374

Browse files
authored
Merge pull request #44 from tomaz82/auto-author
Auto author and auto rom id / type
2 parents 3a045bf + 1273ffc commit cd5b374

File tree

7 files changed

+44
-4
lines changed

7 files changed

+44
-4
lines changed

b2sbackglassdesigner/b2sbackglassdesigner/Modules/moduleB2S.vb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Module moduleB2S
5252

5353
Public Property DefaultOpacity() As Single = 1
5454
Public Property DefaultVPTablesFolder() As String = String.Empty
55+
Public Property LatestAuthor() As String = String.Empty
5556

5657
Public Property NoToolEvents() As Boolean = False
5758

b2sbackglassdesigner/b2sbackglassdesigner/classes/B2S/BackglassData.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ Public Class Backglass
127127
If Not _author.Equals(value) Then
128128
_author = value
129129
IsDirty = True
130+
If value IsNot Nothing Then
131+
LatestAuthor = value
132+
B2SBackglassDesigner.formDesigner.SaveSettings()
133+
End If
130134
End If
131135
End Set
132136
End Property

b2sbackglassdesigner/b2sbackglassdesigner/classes/Base classes/formBase.vb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
If node.SelectSingleNode("VPTablesFolder") IsNot Nothing Then
7070
DefaultVPTablesFolder = node.SelectSingleNode("VPTablesFolder").Attributes("Value").InnerText
7171
End If
72+
If node.SelectSingleNode("LatestAuthor") IsNot Nothing Then
73+
LatestAuthor = node.SelectSingleNode("LatestAuthor").Attributes("Value").InnerText
74+
End If
7275
Me.Location = New Point(x, y)
7376
Me.Size = New Size(width, height)
7477
Me.WindowState = If(maximized, FormWindowState.Maximized, FormWindowState.Normal)
@@ -147,6 +150,7 @@
147150
If SaveName.Equals("formDesigner", StringComparison.CurrentCultureIgnoreCase) Then
148151
helper.AddXMLAttribute(XmlSettings, nodeForm, "Opacity", "Value", CInt(DefaultOpacity * 100).ToString())
149152
helper.AddXMLAttribute(XmlSettings, nodeForm, "VPTablesFolder", "Value", DefaultVPTablesFolder)
153+
helper.AddXMLAttribute(XmlSettings, nodeForm, "LatestAuthor", "Value", LatestAuthor)
150154
End If
151155
' save
152156
Try

b2sbackglassdesigner/b2sbackglassdesigner/classes/Tab/B2STabPage.vb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,26 @@ Public Class B2STabPage
10791079
.Location = loc
10801080
.Image = image
10811081
.IsImageSnippit = True
1082+
If Char.IsDigit(name.Last()) Then
1083+
Dim copy As String = name
1084+
Dim numbers As String = ""
1085+
While Char.IsDigit(copy.Last())
1086+
numbers = copy.Last() + numbers
1087+
copy = copy.Substring(0, copy.Length - 1)
1088+
End While
1089+
If numbers.Length AndAlso copy.Length Then
1090+
If copy.Substring(copy.Length - 1, 1) = "L" Then
1091+
.RomID = CInt(numbers)
1092+
.RomIDType = eRomIDType.Lamp
1093+
ElseIf copy.Substring(copy.Length - 1, 1) = "S" Then
1094+
.RomID = CInt(numbers)
1095+
.RomIDType = eRomIDType.Solenoid
1096+
ElseIf copy.Length > 1 AndAlso copy.Substring(copy.Length - 2, 2) = "Gi" Then
1097+
.RomID = CInt(numbers)
1098+
.RomIDType = eRomIDType.GIString
1099+
End If
1100+
End If
1101+
End If
10821102
End With
10831103
If BackglassData.IsDMDImageShown Then
10841104
newBulb.ParentForm = eParentForm.DMD

b2sbackglassdesigner/b2sbackglassdesigner/forms/formAddSnippit.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@
312312
<data name="txtX.TabIndex" type="System.Int32, mscorlib">
313313
<value>3</value>
314314
</data>
315+
<data name="txtX.Text" xml:space="preserve">
316+
<value>0</value>
317+
</data>
315318
<data name="&gt;&gt;txtX.Name" xml:space="preserve">
316319
<value>txtX</value>
317320
</data>
@@ -372,6 +375,9 @@
372375
<data name="txtY.TabIndex" type="System.Int32, mscorlib">
373376
<value>4</value>
374377
</data>
378+
<data name="txtY.Text" xml:space="preserve">
379+
<value>0</value>
380+
</data>
375381
<data name="&gt;&gt;txtY.Name" xml:space="preserve">
376382
<value>txtY</value>
377383
</data>

b2sbackglassdesigner/b2sbackglassdesigner/forms/formAddSnippit.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Public Class formAddSnippit
111111
PictureBoxImage.BackgroundImage = Nothing
112112
txtImageFileName.Text = String.Empty
113113
txtName.Text = String.Empty
114-
txtX.Text = String.Empty
115-
txtY.Text = String.Empty
114+
txtX.Text = "0"
115+
txtY.Text = "0"
116116
txtImageFileName.Enabled = True
117117
txtName.Enabled = True
118118
btnChooseImageFile.Focus()

b2sbackglassdesigner/b2sbackglassdesigner/forms/formSettings.vb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ Public Class formSettings
2626
txtName.Text = name
2727
txtFileName.Text = filename
2828
chkDualBackglass.Checked = dualbackglass
29-
txtAuthor.Text = author
30-
txtArtwork.Text = artwork
29+
If newtable Then
30+
txtAuthor.Text = LatestAuthor
31+
txtArtwork.Text = LatestAuthor
32+
Else
33+
txtAuthor.Text = author
34+
txtArtwork.Text = artwork
35+
End If
3136
If tabletype = eTableType.NotDefined Then
3237
cmbTableType.Text = String.Empty
3338
Else

0 commit comments

Comments
 (0)