-migliorata lettura configurazione
This commit is contained in:
+53
-11
@@ -128,7 +128,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAS
|
||||
TwAAAk1TRnQBSQFMAgEBCQEAAbQBAQG0AQEBMgEAATIBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
TwAAAk1TRnQBSQFMAgEBCQEAAbwBAQG8AQEBMgEAATIBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwAByAMAAZYDAAEBAQABCAUAATABdRgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
|
||||
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
|
||||
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
|
||||
@@ -499,7 +499,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>LbImageStatus.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="LbFocalLenght.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -529,7 +529,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>LbFocalLenght.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<metadata name="TimerZoom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>257, 12</value>
|
||||
@@ -640,7 +640,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>GBImgFromCam.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="BtnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
@@ -759,7 +759,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>GBCorrected.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="Label3.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@@ -1181,7 +1181,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>GBCalibration.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>372, 12</value>
|
||||
@@ -1415,7 +1415,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>ToolStrip1.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>479, 12</value>
|
||||
@@ -1463,7 +1463,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>StatusStrip1.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<metadata name="TimerMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>596, 12</value>
|
||||
@@ -1493,7 +1493,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>BtnEnd.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="BtnTakeFoto.ImageIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
@@ -1523,7 +1523,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>BtnTakeFoto.ZOrder" xml:space="preserve">
|
||||
<value>10</value>
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="BtnVentosa.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
@@ -1762,6 +1762,48 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>GBDefAree.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameras.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>624, 8</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameras.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>121, 24</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameras.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameras.Name" xml:space="preserve">
|
||||
<value>ComboBoxCameras</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameras.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameras.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameras.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameraCfg.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>751, 8</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameraCfg.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>121, 24</value>
|
||||
</data>
|
||||
<data name="ComboBoxCameraCfg.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameraCfg.Name" xml:space="preserve">
|
||||
<value>ComboBoxCameraCfg</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameraCfg.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameraCfg.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>ComboBoxCameraCfg.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="ImageControl1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
@@ -1789,7 +1831,7 @@
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>ImageControl1.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
|
||||
+50
-15
@@ -22,6 +22,17 @@ Public Class FrmMain
|
||||
DefStone
|
||||
DefVentosa
|
||||
End Enum
|
||||
|
||||
Private m_sDataRoot As String = ""
|
||||
Public ReadOnly Property sDataRoot As String
|
||||
Get
|
||||
Return m_sDataRoot
|
||||
End Get
|
||||
End Property
|
||||
Public Sub SetDataRoot()
|
||||
m_sDataRoot = GetIniValue("Data", "DataRoot", Application.StartupPath & "\DataRoot.ini")
|
||||
End Sub
|
||||
|
||||
Private m_Image As System.Drawing.Image
|
||||
Private m_ZoomFactor As Double
|
||||
' Permette di aggiornare la pagina principale del programma 'SetFormStatus()'
|
||||
@@ -134,6 +145,7 @@ Public Class FrmMain
|
||||
End Sub
|
||||
|
||||
Public Sub Inizializza()
|
||||
SetDataRoot()
|
||||
' non visualizzo pagina programma
|
||||
If Not ModalitaNascosta Then FrmStart.Show()
|
||||
|
||||
@@ -141,10 +153,20 @@ Public Class FrmMain
|
||||
|
||||
SpessLastra = 0
|
||||
|
||||
For i As Integer = 1 To 4
|
||||
ComboBoxCameraCfg.Items.Add(i)
|
||||
Dim TempListIndCfg As New List(Of String)
|
||||
SearchConfigDir(TempListIndCfg)
|
||||
For i As Integer = 0 To TempListIndCfg.Count - 1
|
||||
ComboBoxCameraCfg.Items.Add(TempListIndCfg(i))
|
||||
Next
|
||||
ComboBoxCameraCfg.SelectedIndex = 0
|
||||
If TempListIndCfg.Count > 1 Then
|
||||
ComboBoxCameraCfg.SelectedIndex = 0
|
||||
Else
|
||||
' Non esiste una configurazione
|
||||
Dim sTextMsg As String = String.Format("Nella cartella '{0}' non sono state trovate configurazioni valide. (CameraMng, CameraMng1, CameraMng2..)", sDataRoot)
|
||||
MessageBox.Show(sTextMsg, "Avvertenza", MessageBoxButtons.OK, MessageBoxIcon.Warning)
|
||||
Me.Close()
|
||||
'Return
|
||||
End If
|
||||
|
||||
LeggiFileConfigurazione()
|
||||
AggiornaPulsantiVIsibili()
|
||||
@@ -167,13 +189,15 @@ Public Class FrmMain
|
||||
For i As Integer = 0 To Camera.m_idList.Count - 1
|
||||
ComboBoxCameras.Items.Add(Camera.m_idList(i))
|
||||
Next
|
||||
ComboBoxCameras.SelectedIndex = 0
|
||||
If Not ModalitaNascosta Then
|
||||
Camera.Connect(ComboBoxCameras.SelectedItem)
|
||||
Else
|
||||
Camera.Connect(CameraID)
|
||||
|
||||
If Camera.m_idList.Count > 1 Then
|
||||
ComboBoxCameras.SelectedIndex = 0
|
||||
If Not ModalitaNascosta Then
|
||||
Camera.Connect(ComboBoxCameras.SelectedItem)
|
||||
Else
|
||||
Camera.Connect(CameraID)
|
||||
End If
|
||||
End If
|
||||
Console.WriteLine("SELECTEDITEMCAMERAID: " & ComboBoxCameras.SelectedItem)
|
||||
|
||||
'Me.Text = "ID Camera = " & Camera.CameraID
|
||||
status = en_status.NoImage
|
||||
@@ -291,10 +315,25 @@ Public Class FrmMain
|
||||
SetFormStatus()
|
||||
End Sub
|
||||
|
||||
' ricerca tutte le configurazioni disponibili
|
||||
Private Sub SearchConfigDir(ListIndCfg As List(Of String))
|
||||
' verifico se esiste la configurazione standard
|
||||
If File.Exists(m_sDataRoot & "\CameraMng.cfg") Then
|
||||
ListIndCfg.Add("")
|
||||
End If
|
||||
' ricerco tutte le configurazioni numerate esistenti
|
||||
For Index As Integer = 0 To 10
|
||||
If File.Exists(m_sDataRoot & Index.ToString & "\CameraMng.cfg") Then
|
||||
ListIndCfg.Add(Index.ToString)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub LeggiFileConfigurazione()
|
||||
Console.WriteLine("LETTURA CONFIGURAZIONE '../CameraMng" & MainModule.IndexProc.ToString())
|
||||
If String.IsNullOrEmpty(m_sDataRoot) Then SetDataRoot()
|
||||
Dim NomeFileCfg, TmpString As String
|
||||
Dim NomeFileIni, DirToReadCfg As String
|
||||
Dim DirToReadCfg As String
|
||||
Dim TmpInt As Integer
|
||||
Dim TmpDou As Double
|
||||
Dim reader As StreamReader
|
||||
@@ -302,9 +341,7 @@ Public Class FrmMain
|
||||
|
||||
' tutto parte dal file DataRoot.ini che deve trovarsi nella stessa
|
||||
' cartelle dell'eseguibile
|
||||
NomeFileIni = Application.StartupPath & "\DataRoot.ini"
|
||||
DirToReadCfg = ""
|
||||
DirToReadCfg = GetIniValue("Data", "DataRoot", NomeFileIni, DirToReadCfg)
|
||||
DirToReadCfg = m_sDataRoot
|
||||
' Indirizzo il programma al processo desiderato
|
||||
If Not ModalitaNascosta Then
|
||||
DirToReadCfg = DirToReadCfg & ComboBoxCameraCfg.SelectedItem.ToString()
|
||||
@@ -1040,8 +1077,6 @@ Public Class FrmMain
|
||||
Case "2"
|
||||
CorrezioneAutomatica = True
|
||||
RichiestaBordi = False
|
||||
'LeggiFileConfigurazione()
|
||||
'Camera.Connect(CameraID)
|
||||
Console.WriteLine("PROCESSO: " & MainModule.IndexProc)
|
||||
Console.WriteLine("CAMERA BODY CFG: " & CameraID)
|
||||
Console.WriteLine("CAMERA BODY CONNECTED: " & Camera.CameraID)
|
||||
|
||||
@@ -107,6 +107,36 @@ CameraMng
|
||||
Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.LeggiFileCalibrazioneLenteOCV(System.String)">
|
||||
<summary>
|
||||
Legge il file che contiene i parametri di correzione della lente
|
||||
</summary>
|
||||
<param name="NomeFile">Percorso file da leggere</param>
|
||||
<returns>Ritorna True se la lettura è andata a buon fine</returns>
|
||||
</member>
|
||||
<member name="M:clsImageMng.LeggiFileCorrezProsp(System.String)">
|
||||
<summary>
|
||||
Lettura del file per la risoluzione della distorsione prospettica
|
||||
</summary>
|
||||
<param name="NomeFile">Percorso del file da leggere</param>
|
||||
<returns>Ritorna True se la lettura è andata a buon fine</returns>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneDiretta">
|
||||
<summary>
|
||||
Ottine la matrice 'm_MatDir' di correzione prospettica
|
||||
Viene richiamato il metodo 'CalcolaDatiCorrezioneDiretta'
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneDirettaNoRett">
|
||||
<summary>
|
||||
Ottiene la matrice 'm_MatDir' per la correzione prospettica nel piano Z=0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneInversa">
|
||||
<summary>
|
||||
Ottiene la matrice 'm_MatInv' per la correzione prospettica nel piano Z=0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsVisione.AddExpRectangle(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Aggiunge una zona rettangolare pe l'analisi ispezione
|
||||
|
||||
@@ -107,6 +107,36 @@ CameraMng
|
||||
Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.LeggiFileCalibrazioneLenteOCV(System.String)">
|
||||
<summary>
|
||||
Legge il file che contiene i parametri di correzione della lente
|
||||
</summary>
|
||||
<param name="NomeFile">Percorso file da leggere</param>
|
||||
<returns>Ritorna True se la lettura è andata a buon fine</returns>
|
||||
</member>
|
||||
<member name="M:clsImageMng.LeggiFileCorrezProsp(System.String)">
|
||||
<summary>
|
||||
Lettura del file per la risoluzione della distorsione prospettica
|
||||
</summary>
|
||||
<param name="NomeFile">Percorso del file da leggere</param>
|
||||
<returns>Ritorna True se la lettura è andata a buon fine</returns>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneDiretta">
|
||||
<summary>
|
||||
Ottine la matrice 'm_MatDir' di correzione prospettica
|
||||
Viene richiamato il metodo 'CalcolaDatiCorrezioneDiretta'
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneDirettaNoRett">
|
||||
<summary>
|
||||
Ottiene la matrice 'm_MatDir' per la correzione prospettica nel piano Z=0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsImageMng.CalcolaDatiCorrezioneInversa">
|
||||
<summary>
|
||||
Ottiene la matrice 'm_MatInv' per la correzione prospettica nel piano Z=0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:clsVisione.AddExpRectangle(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Aggiunge una zona rettangolare pe l'analisi ispezione
|
||||
|
||||
Reference in New Issue
Block a user