diff --git a/ConstIni.vb b/ConstIni.vb index 777d625..11956df 100644 --- a/ConstIni.vb +++ b/ConstIni.vb @@ -75,13 +75,18 @@ Public Const K_MAJLNCOLOR As String = "MajLnColor" Public Const S_TABSPECIAL As String = "TabSpecial" Public Const K_TSSHOW As String = "Show" +Public Const S_FLATPARTS As String = "FlatParts" +Public Const K_FLPWINPLACE As String = "WinPlace" +Public Const K_FLPCURRDIR As String = "CurrDir" + Public Const S_COMPO As String = "Compo" Public Const K_CMPWINPLACE As String = "WinPlace" Public Const K_COMPODIR As String = "CompoDir" -Public Const S_FLATPARTS As String = "FlatParts" -Public Const K_FLPWINPLACE As String = "WinPlace" -Public Const K_FLPCURRDIR As String = "CurrDir" +Public Const S_DOORS As String = "Doors" +Public Const K_DDFEXEC As String = "DdfExec" +Public Const K_DDFFUNCTION As String = "DdfFun" +Public Const K_DDFDIR As String = "DdfDir" Public Const S_MACH As String = "Mach" Public Const K_MACHINESDIR As String = "MachinesDir" diff --git a/Doors.vb b/Doors.vb new file mode 100644 index 0000000..cfe8f79 --- /dev/null +++ b/Doors.vb @@ -0,0 +1,61 @@ +'---------------------------------------------------------------------------- +' EgalTech 2016-2016 +'---------------------------------------------------------------------------- +' File : Doors.vb Data : 22.06.16 Versione : 1.6r10 +' Contenuto : Classe Doors (interfaccia per script Porte). +' +' +' +' Modifiche : 22.06.16 DS Creazione modulo. +' +' +'---------------------------------------------------------------------------- + +Imports Microsoft.VisualBasic +Imports TestEIn.EgtInterface + +Public Module Doors + + Function ExecDoors(ByRef scene As Scene) As Boolean + ' Direttorio corrente per file DDF + Dim sDir As String = String.Empty + GetPrivateProfileString(S_DOORS, K_DDFDIR, "", sDir, Form1.GetIniFile()) + ' Scelta file DDF + Dim OpenFileDialog As New OpenFileDialog + OpenFileDialog.Title = "Open DDF file" + OpenFileDialog.Filter = "Door Description Format(*.ddf)|*.ddf" + OpenFileDialog.FilterIndex = 1 + OpenFileDialog.InitialDirectory = sDir + If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then + Return True + End If + Dim sFile As String = OpenFileDialog.FileName + System.IO.Path.GetDirectoryName(sFile) + WritePrivateProfileString(S_DOORS, K_DDFDIR, System.IO.Path.GetDirectoryName(sFile), Form1.GetIniFile()) + + ' Generazione porta + ' Cursore attesa + scene.Cursor = Cursors.WaitCursor + ' Carico il file + Dim sExecPath As String = String.Empty + GetPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecPath, Form1.GetIniFile()) + If Not EgtLuaExecFile(sExecPath) Then Return False + ' Lancio la generazione + EgtLuaSetGlobStringVar("DGD.FILE", sFile) + Dim sFunction As String = String.Empty + GetPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction, Form1.GetIniFile()) + Dim bOk As Boolean = EgtLuaExecLine(sFunction) + Dim nErr As Integer = 999 + If Not EgtLuaGetGlobIntVar("DGD.ERR", nErr) Or nErr <> 0 Then bOk = False + EgtOutLog("Err=" & nErr.ToString()) + ' Cancello variabile globale + EgtLuaResetGlobVar("DGD") + ' Aggiorno la visualizzazione + EgtZoom(ZM.ALL) + ' Cursore standard + scene.Cursor = Cursors.Default + + Return bOk + End Function + +End Module diff --git a/Form1.Designer.vb b/Form1.Designer.vb index 42e74af..6e7e5ef 100644 --- a/Form1.Designer.vb +++ b/Form1.Designer.vb @@ -25,6 +25,7 @@ Partial Class Form1 Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1)) Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel() + Me.Scene1 = New TestEIn.Scene() Me.TabControl1 = New System.Windows.Forms.TabControl() Me.TabFile = New System.Windows.Forms.TabPage() Me.btnInsert = New System.Windows.Forms.Button() @@ -133,9 +134,11 @@ Partial Class Form1 Me.btnRotate = New System.Windows.Forms.Button() Me.btnMove = New System.Windows.Forms.Button() Me.TabSpecial = New System.Windows.Forms.TabPage() + Me.btnDoors = New System.Windows.Forms.Button() Me.btnFlatParts = New System.Windows.Forms.Button() Me.btnCompo = New System.Windows.Forms.Button() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.tsStatusProgress = New System.Windows.Forms.ToolStripProgressBar() Me.tsStatusStop = New System.Windows.Forms.ToolStripStatusLabel() Me.tsStatusOutput = New System.Windows.Forms.ToolStripStatusLabel() Me.tsStatusSnapPointType = New System.Windows.Forms.ToolStripStatusLabel() @@ -184,8 +187,6 @@ Partial Class Form1 Me.MruSFile6 = New System.Windows.Forms.ToolStripMenuItem() Me.MruSFile7 = New System.Windows.Forms.ToolStripMenuItem() Me.MruSFile8 = New System.Windows.Forms.ToolStripMenuItem() - Me.tsStatusProgress = New System.Windows.Forms.ToolStripProgressBar() - Me.Scene1 = New TestEIn.Scene() Me.TableLayoutPanel1.SuspendLayout() Me.TabControl1.SuspendLayout() Me.TabFile.SuspendLayout() @@ -234,6 +235,17 @@ Partial Class Form1 Me.TableLayoutPanel1.Size = New System.Drawing.Size(1096, 645) Me.TableLayoutPanel1.TabIndex = 0 ' + 'Scene1 + ' + Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D + Me.Scene1.Cursor = System.Windows.Forms.Cursors.Default + Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill + Me.Scene1.Location = New System.Drawing.Point(89, 82) + Me.Scene1.Margin = New System.Windows.Forms.Padding(0) + Me.Scene1.Name = "Scene1" + Me.Scene1.Size = New System.Drawing.Size(787, 541) + Me.Scene1.TabIndex = 1 + ' 'TabControl1 ' Me.TableLayoutPanel1.SetColumnSpan(Me.TabControl1, 3) @@ -1997,6 +2009,7 @@ Partial Class Form1 'TabSpecial ' Me.TabSpecial.BackColor = System.Drawing.SystemColors.Control + Me.TabSpecial.Controls.Add(Me.btnDoors) Me.TabSpecial.Controls.Add(Me.btnFlatParts) Me.TabSpecial.Controls.Add(Me.btnCompo) Me.TabSpecial.Location = New System.Drawing.Point(23, 4) @@ -2006,6 +2019,24 @@ Partial Class Form1 Me.TabSpecial.TabIndex = 1 Me.TabSpecial.Text = "Special" ' + 'btnDoors + ' + Me.btnDoors.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control + Me.btnDoors.FlatAppearance.BorderSize = 0 + Me.btnDoors.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control + Me.btnDoors.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption + Me.btnDoors.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnDoors.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnDoors.Image = CType(resources.GetObject("btnDoors.Image"), System.Drawing.Image) + Me.btnDoors.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnDoors.Location = New System.Drawing.Point(0, 96) + Me.btnDoors.Name = "btnDoors" + Me.btnDoors.Size = New System.Drawing.Size(56, 48) + Me.btnDoors.TabIndex = 48 + Me.btnDoors.Text = "Doors" + Me.btnDoors.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnDoors.UseVisualStyleBackColor = False + ' 'btnFlatParts ' Me.btnFlatParts.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control @@ -2058,6 +2089,13 @@ Partial Class Form1 Me.StatusStrip1.TabIndex = 6 Me.StatusStrip1.Text = "StatusStrip1" ' + 'tsStatusProgress + ' + Me.tsStatusProgress.Margin = New System.Windows.Forms.Padding(0, 3, 0, 3) + Me.tsStatusProgress.Name = "tsStatusProgress" + Me.tsStatusProgress.Size = New System.Drawing.Size(72, 16) + Me.tsStatusProgress.Step = 5 + ' 'tsStatusStop ' Me.tsStatusStop.AutoSize = False @@ -2078,7 +2116,7 @@ Partial Class Form1 Me.tsStatusOutput.Margin = New System.Windows.Forms.Padding(1, 3, 0, 2) Me.tsStatusOutput.MergeIndex = 1 Me.tsStatusOutput.Name = "tsStatusOutput" - Me.tsStatusOutput.Size = New System.Drawing.Size(324, 17) + Me.tsStatusOutput.Size = New System.Drawing.Size(355, 17) Me.tsStatusOutput.Spring = True Me.tsStatusOutput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' @@ -2411,24 +2449,6 @@ Partial Class Form1 Me.MruSFile8.Size = New System.Drawing.Size(160, 22) Me.MruSFile8.Text = "File8" ' - 'tsStatusProgress - ' - Me.tsStatusProgress.Margin = New System.Windows.Forms.Padding(0, 3, 0, 3) - Me.tsStatusProgress.Name = "tsStatusProgress" - Me.tsStatusProgress.Size = New System.Drawing.Size(72, 16) - Me.tsStatusProgress.Step = 5 - ' - 'Scene1 - ' - Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D - Me.Scene1.Cursor = System.Windows.Forms.Cursors.Default - Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill - Me.Scene1.Location = New System.Drawing.Point(89, 82) - Me.Scene1.Margin = New System.Windows.Forms.Padding(0) - Me.Scene1.Name = "Scene1" - Me.Scene1.Size = New System.Drawing.Size(787, 541) - Me.Scene1.TabIndex = 1 - ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -2642,5 +2662,6 @@ End Sub Friend WithEvents btnCompo As System.Windows.Forms.Button Friend WithEvents btnFlatParts As System.Windows.Forms.Button Friend WithEvents tsStatusProgress As System.Windows.Forms.ToolStripProgressBar + Friend WithEvents btnDoors As System.Windows.Forms.Button End Class diff --git a/Form1.resx b/Form1.resx index f620cb3..57ce5dc 100644 --- a/Form1.resx +++ b/Form1.resx @@ -883,7 +883,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAA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,14 @@ 2YdS/gEIUYjCPLwtix5CiFaQ2J+940IvOQgDzRJQlOAXbRneXwOKUvy6HRagMA8n768Bxa2U5rH2B55d AopbIFMypBP1twLFNbTMCSw+Pw6R+0rmRF0ks8f7CmFBNPhdWsYcxRDTJjFPKIWYttMHCBdJCCVzoi4o RCtI7JdvesFiCsLgcxpA0RIoWgJFS6BoCRQtgaIdbvgCS/kFfmOvgmgAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + xAAADsQBlSsOGwAAAAd0SU1FB+AGFgwyOgLEOGYAAABuSURBVFhH7dDBCYBAEEPRacIeLcU6rMoS7CKK + IMiQxd2DEXZzeJcchs8EgF/RUYmOSnRUoqMSHbMlJrTKN0romF0H59hq9RsQ6443DnCAAz4NqOWAMQPi + PHUb8wNPDnCAA/oMaJVvlNBRiY46iAN8jOP/8clzmAAAAABJRU5ErkJggg== diff --git a/Form1.vb b/Form1.vb index 81da67f..9b416e3 100644 --- a/Form1.vb +++ b/Form1.vb @@ -1282,6 +1282,12 @@ Public Class Form1 EgtZoom(ZM.ALL) End Sub + Private Sub btnDoors_Click(sender As Object, e As EventArgs) Handles btnDoors.Click + Dim bOk As Boolean = ExecDoors(Scene1) + OnUpdateUI(Nothing, True) + If Not bOk Then EmitStripStatusOutput("Error running Ddf file") + End Sub + '-------------------------------- KeyDown -------------------------------------------------------- Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown diff --git a/Resources/Door.png b/Resources/Door.png new file mode 100644 index 0000000..b19a786 Binary files /dev/null and b/Resources/Door.png differ diff --git a/TestEIn.vbproj b/TestEIn.vbproj index 3168587..ef35bff 100644 --- a/TestEIn.vbproj +++ b/TestEIn.vbproj @@ -175,6 +175,7 @@ + FlatParts.vb @@ -555,6 +556,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\TestEIn\TestEInR32.exe