Skip to content

Commit 1273ffc

Browse files
committed
Detect ROM ID and ROM Type from snippit image name
1 parent b2be4c1 commit 1273ffc

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

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()

0 commit comments

Comments
 (0)