-piccole modifiche

This commit is contained in:
Demetrio Cassarino
2025-06-20 09:53:32 +02:00
parent 0a83d85962
commit 756ff63c88
3 changed files with 37 additions and 45 deletions
+7
View File
@@ -176,6 +176,13 @@ ClientBin/
*.publishsettings
node_modules/
orleans.codegen.cs
*.exe
*.cache
*.vbproj
*.pdb
*.dll
*.csproj
*.xml
# RIA/Silverlight projects
Generated_Code/
+11 -19
View File
@@ -37,7 +37,7 @@ Public Class FrmMain
Private _npProspSel As Integer = -1
Private _borderType As Integer
Private WithEvents _search As New clsRicerca(ImageMng)
Private Event _waiting()
Private Event _waitingCmd()
Private Sub BtnTakeFoto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTakeFoto.Click
@@ -236,7 +236,9 @@ Public Class FrmMain
SetFormStatus()
' connessione automatica
Camera.Connect(CameraID)
Camera.Connect(Camera.CameraID)
Console.WriteLine("RICHIESTA CONNESSIONE: " & Camera.CameraID)
MessageBox.Show(Camera.CameraID)
'Me.Text = "ID Camera = " & Camera.CameraID
status = en_status.NoImage
SetFormStatus()
@@ -252,11 +254,9 @@ Public Class FrmMain
TimerMain.Enabled = True
End If
If ModalitaNascosta Then RaiseEvent _waiting()
End Sub
Public Sub WaitingForInstruction() Handles Me._waiting
Public Sub WaitingForInstruction() Handles Me._waitingCmd
Dim sNewReadLine As String = Console.ReadLine
If Not String.IsNullOrEmpty(sNewReadLine) Then
While sNewReadLine <> "CLOSE"
@@ -265,16 +265,12 @@ Public Class FrmMain
ModalitaNascosta = True
Hide()
LeggiFileConfigurazione()
'' connessione automatica
'Camera.Connect(Camera.CameraID)
Case "1"
ModalitaNascosta = False
Visible = True
Case "2"
CorrezioneAutomatica = True
RichiestaBordi = False
Camera.Connect(Camera.CameraID)
MessageBox.Show(Camera.CameraID)
CorrezioneAutomatica = False
'RichiestaBordi = False
Console.WriteLine("CAMERA BODY: " & Camera.CameraID)
RichiestaClick()
Case "3"
@@ -411,9 +407,6 @@ Public Class FrmMain
End Sub
Private Sub BtnCorrCompleta_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCorrCompleta.Click
frmSce.ShowDialog()
@@ -551,7 +544,10 @@ Public Class FrmMain
End Sub
Private Sub FrmMain_VisibleChanged(sender As Object, e As System.EventArgs) Handles Me.VisibleChanged
If ModalitaNascosta Then Me.Hide()
If ModalitaNascosta Then
Me.Hide()
RaiseEvent _waitingCmd()
End If
End Sub
Private Sub LeggiFileConfigurazione()
@@ -986,8 +982,6 @@ Public Class FrmMain
Dim nf As Integer
Try
If Not Camera.Connected Then
Camera.Connect(CameraID)
'Me.Text = "ID Camera = " & Camera.CameraID
@@ -1094,8 +1088,6 @@ Public Class FrmMain
_ActTh = 127
VisualizzaThreshold()
RilevaBordi(m_Image)
End Sub
Private Sub BtnChangeThreshold_Click(sender As System.Object, e As System.EventArgs) Handles BtnChangeThreshold.Click
+19 -26
View File
@@ -77,15 +77,10 @@ Public Class clsCamera
#Region "User defined attributes"
' Save as class variable, new delegates of event handlers.
Public inPropertyEventHandler As New _
EdsPropertyEventHandler(AddressOf handlePropertyEvent)
Public inObjectEventHandler As New _
EdsObjectEventHandler(AddressOf handleObjectEvent)
Public inStateEventHandler As New _
EdsStateEventHandler(AddressOf handleStateEvent)
Public inProgressCallback As New _
EdsProgressCallback(AddressOf ProgressFunc)
Public inPropertyEventHandler As New EdsPropertyEventHandler(AddressOf handlePropertyEvent)
Public inObjectEventHandler As New EdsObjectEventHandler(AddressOf handleObjectEvent)
Public inStateEventHandler As New EdsStateEventHandler(AddressOf handleStateEvent)
Public inProgressCallback As New EdsProgressCallback(AddressOf ProgressFunc)
'
@@ -124,8 +119,6 @@ Public Class clsCamera
Public Sub TakeFoto()
Console.WriteLine("TAKE FOTO: " & MainModule.IndexProc)
Dim err As Integer = EDS_ERR_OK
'// Take a picture.
@@ -138,6 +131,8 @@ Public Class clsCamera
End If
controller.actionPerformed("takepicture")
Console.WriteLine("SCATTO FATTO (FOTTO E SCAPPO): " & MainModule.IndexProc)
End Sub
' Creo la connessione con la camera
@@ -259,7 +254,6 @@ Public Class clsCamera
If IsNothing(model) = True Then
_lastError = EDS_ERR_DEVICE_NOT_FOUND
End If
End If
@@ -297,21 +291,19 @@ Public Class clsCamera
' ------------------------------------------------------------------------
If _lastError <> EDS_ERR_OK Then Return
_lastError = EdsSetPropertyEventHandler(camera, kEdsPropertyEvent_All, _
inPropertyEventHandler, IntPtr.Zero)
_lastError = EdsSetPropertyEventHandler(camera, kEdsPropertyEvent_All, inPropertyEventHandler, IntPtr.Zero)
If _lastError <> EDS_ERR_OK Then Return
'// Set ObjectEventHandler
_lastError = EdsSetObjectEventHandler(camera, kEdsObjectEvent_All, _
inObjectEventHandler, IntPtr.Zero)
_lastError = EdsSetObjectEventHandler(camera, kEdsObjectEvent_All, inObjectEventHandler, IntPtr.Zero)
If _lastError <> EDS_ERR_OK Then Return
'// Set StateEventHandler
_lastError = EdsSetCameraStateEventHandler(camera, kEdsStateEvent_All, _
inStateEventHandler, IntPtr.Zero)
_lastError = EdsSetCameraStateEventHandler(camera, kEdsStateEvent_All, inStateEventHandler, IntPtr.Zero)
Console.WriteLine("CONNESIONE EVENTI: " & MainModule.IndexProc)
If _lastError <> EDS_ERR_OK Then
@@ -388,6 +380,7 @@ Public Class clsCamera
'// Get informations of the downloadling directory item.
Dim dirItemInfo As EdsDirectoryItemInfo = Nothing
Console.WriteLine("HANDLE OBJECT EVENT: " & MainModule.IndexProc)
Select Case inEvent
Case kEdsObjectEvent_DirItemRequestTransfer
@@ -395,25 +388,23 @@ Public Class clsCamera
err = EdsGetDirectoryItemInfo(inRef, dirItemInfo)
If err = EDS_ERR_OK Then
err = EdsCreateFileStream(m_DownloadDir & dirItemInfo.szFileName, EdsFileCreateDisposition.kEdsFileCreateDisposition_CreateAlways, _
EdsAccess.kEdsAccess_ReadWrite, stream)
err = EdsCreateFileStream(m_DownloadDir & dirItemInfo.szFileName, EdsFileCreateDisposition.kEdsFileCreateDisposition_CreateAlways, EdsAccess.kEdsAccess_ReadWrite, stream)
End If
err = EdsDownload(inRef, dirItemInfo.size, stream)
Console.WriteLine("INIZIO DONWLOAD: " & MainModule.IndexProc)
If err = EDS_ERR_OK Then
err = EdsDownloadComplete(inRef)
End If
If IsNothing(inRef) = False Then
If IsNothing(inRef) = False Then
err = EdsRelease(inRef)
directoryItem = Nothing
End If
If IsNothing(stream) = False Then
If IsNothing(stream) = False Then
err = EdsRelease(stream)
stream = Nothing
m_PhotoFileName = m_DownloadDir & dirItemInfo.szFileName
@@ -426,9 +417,9 @@ Public Class clsCamera
m_bDownloaded = True
RaiseEvent DownloadedCompleted()
End If
End If
Console.WriteLine("FINE DONWLOAD: " & MainModule.IndexProc)
Case Else
'//Release unnecessary objects.
@@ -453,6 +444,8 @@ Public Class clsCamera
Dim rtn As Long
Console.WriteLine("BINGO: " & MainModule.IndexProc)
Debug.Print("propId =H" & Hex(inPropertyID))
Select Case inEvent