diff --git a/CAM/CamAuto.vb b/CAM/CamAuto.vb index 2be2ea9..6dd362e 100644 --- a/CAM/CamAuto.vb +++ b/CAM/CamAuto.vb @@ -442,7 +442,7 @@ Friend Module CamAuto Dim sInfo As String = String.Empty If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId In sItems + For Each sId As String In sItems Dim nId As Integer = 0 StringToInt(sId, nId) If nId > 0 Then vOthId.Add(nId) @@ -660,7 +660,7 @@ Friend Module CamAuto Dim sInfo As String = String.Empty If EgtGetInfo(nMchId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId2 In sItems + For Each sId2 As String In sItems ' Indice gruppo di preview nella lavorazione Dim nId2 As Integer = GDB_ID.NULL StringToInt(sId2, nId2) @@ -704,6 +704,7 @@ Friend Module CamAuto Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting + Dim sPocketMch As String = m_MainWindow.m_CurrentMachine.sCurrPocketing Dim sDripSawMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripSawing, "") Dim sDripDrillMch As String = If(bDripOk, m_MainWindow.m_CurrentMachine.sCurrDripDrilling, "") Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile()) @@ -718,6 +719,7 @@ Friend Module CamAuto EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch) EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch) EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch) + EgtLuaSetGlobStringVar("CAM.POCKETMCH", sPocketMch) EgtLuaSetGlobStringVar("CAM.WATERJETMCH", sWaterJetMch) EgtLuaSetGlobStringVar("CAM.DRIPSAWMCH", sDripSawMch) EgtLuaSetGlobStringVar("CAM.DRIPDRILLMCH", sDripDrillMch) diff --git a/CadCuts/CSVPage.xaml.vb b/CadCuts/CSVPage.xaml.vb index 8a8d662..c528dc0 100644 --- a/CadCuts/CSVPage.xaml.vb +++ b/CadCuts/CSVPage.xaml.vb @@ -568,7 +568,7 @@ Public Class CSVPage ' Verifico che il pezzo appartenga a questo Csv If String.Compare(sCsvPath, m_sCsvPath, True) = 0 Then ' Cerco il pezzo nella lista dei pezzi - For i = 1 To m_CsvPartList.Count() + For i As Integer = 1 To m_CsvPartList.Count() Dim CurrPart As CsvPart = m_CsvPartList(i - 1) If String.Compare(sName, CurrPart.m_sName, True) = 0 Then ' Se nel grezzo diff --git a/CadCuts/FastGridSlabManager.xaml.vb b/CadCuts/FastGridSlabManager.xaml.vb index 37ab20a..3116a34 100644 --- a/CadCuts/FastGridSlabManager.xaml.vb +++ b/CadCuts/FastGridSlabManager.xaml.vb @@ -41,7 +41,7 @@ Public Class FastGridSlabManager ' Recupero parametri per nesting m_MainWindow.m_CadCutPageUC.m_NestPage.LoadParams() ' Recupero dimensioni pezzi da ini - For Index = 1 To 5 + For Index As Integer = 1 To 5 GetPieceDimensions(Index) Next ' Ne imposto i valori diff --git a/CadCuts/MoveRawPartPage.xaml.vb b/CadCuts/MoveRawPartPage.xaml.vb index 0b6deec..8348a05 100644 --- a/CadCuts/MoveRawPartPage.xaml.vb +++ b/CadCuts/MoveRawPartPage.xaml.vb @@ -507,7 +507,7 @@ Public Class MoveRawPartPage If AngRotList.Count > 0 Then Dim bOkRotate As Boolean = False ' allora provo a ruotare il pezzo nel verso di rotazione della ventosa - For Each AngStep In AngRotList + For Each AngStep As Double In AngRotList If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -AngStep) Then If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then ' riposiziono il pezzo come era prima diff --git a/CadCuts/NestPageUC.xaml.vb b/CadCuts/NestPageUC.xaml.vb index cdd87c1..1cedb2a 100644 --- a/CadCuts/NestPageUC.xaml.vb +++ b/CadCuts/NestPageUC.xaml.vb @@ -848,7 +848,7 @@ Public Class NestPageUC Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click ' Se inserimento automatico - If GetPrivateProfileInt( S_MACH_NEST, K_MACH_NEST_AUTOMATIC, 0, m_MainWindow.GetMachIniFile()) <> 0 And + If GetPrivateProfileInt( S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And m_MainWindow.GetAutoNestingOption() Then AutomaticInsert() ' altrimenti inserimento standard @@ -933,7 +933,7 @@ Public Class NestPageUC EnableReferenceRegion(bAligned) ' Eseguo nesting automatico Dim bOpimizeOnX As Boolean = ( GetPrivateProfileInt( S_NEST, K_AUTOMATICOPTIMIZE, 2, m_MainWindow.GetIniFile()) = 1) - Dim bGuillotineMode As Boolean = bAligned + Dim bGuillotineMode As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_GHIGLIOTTINA, 0, m_MainWindow.GetMachIniFile()) <> 0) Dim nAutomaticMaxTime As Integer = GetPrivateProfileInt( S_NEST, K_AUTOMATICMAXTIME, 20, m_MainWindow.GetIniFile()) Dim dPartTime As Double = If( bGuillotineMode, 1.0, 0.5) Dim nMaxTime As Integer = Math.Min( 2.0 + dPartTime * vParts.Count(), nAutomaticMaxTime) diff --git a/CadCuts/SplitAuto.vb b/CadCuts/SplitAuto.vb index 2cb018a..e6b51bf 100644 --- a/CadCuts/SplitAuto.vb +++ b/CadCuts/SplitAuto.vb @@ -52,7 +52,7 @@ Public Module SplitAuto Dim sInfo As String = String.Empty If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId In sItems + For Each sId As String In sItems Dim nId As Integer = 0 StringToInt(sId, nId) If nId > 0 Then Mach.m_vOthId.Add(nId) @@ -268,7 +268,7 @@ Public Module SplitAuto Dim sInfo As String = String.Empty If EgtGetInfo(nOpeId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId In sItems + For Each sId As String In sItems Dim nId As Integer = GDB_ID.NULL StringToInt(sId, nId) Dim nPvId2 As Integer = GDB_ID.NULL @@ -298,7 +298,7 @@ Public Module SplitAuto Dim sInfo As String = String.Empty If EgtGetInfo(nOpeId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId In sItems + For Each sId As String In sItems Dim nId As Integer = GDB_ID.NULL StringToInt(sId, nId) Dim nPvId2 As Integer = GDB_ID.NULL @@ -384,7 +384,7 @@ Public Module SplitAuto Dim sInfo As String = String.Empty If EgtGetInfo(nId, INFO_MCH_OTHMID, sInfo) Then Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId2 In sItems + For Each sId2 As String In sItems Dim nId2 As Integer = 0 StringToInt(sId2, nId2) If nId2 > 0 Then EgtChangeOperationPhase(nId2, nNewPhase) @@ -811,7 +811,7 @@ Public Module SplitAuto End If Next ' Cancello curve offset - For i = 0 To nCount - 1 + For i As Integer = 0 To nCount - 1 EgtErase(nOffsId + i) Next Return (Not bInterf) diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index eb2583c..5a31eeb 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -151,6 +151,10 @@ Public Class SplitPageUC If Mach.m_sLay = NAME_ONPATH Then AddTopText( sText) If Mach.m_bPause Then AddPauseText( sText) m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled)) + ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura + Dim sText As String = EgtMsg(90796) & " " & i.ToString() + If Mach.m_bPause Then AddPauseText(sText) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled)) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) @@ -176,7 +180,7 @@ Public Class SplitPageUC If MachiningLsBx.SelectedItems.Count = 0 Then Return ' creo lista ordinata dei selezionati Dim ItemList As New List(Of NameIdLsBxItem) - For Each Item In MachiningLsBx.SelectedItems + For Each Item As NameIdLsBxItem In MachiningLsBx.SelectedItems ItemList.Add(Item) Next ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(m_ItemList.IndexOf(x), m_ItemList.IndexOf(y))) @@ -188,7 +192,7 @@ Public Class SplitPageUC If MachiningLsBx.SelectedItems.Count = 1 Then bContigus = True Else - For Each Item In ItemList + For Each Item As NameIdLsBxItem In ItemList If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then bContigus = True End If @@ -201,7 +205,7 @@ Public Class SplitPageUC End If ' resetto marcatura lavorazioni If m_CurrFirstInd > -1 Then - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd MarkMachining(m_ItemList(Index).Ind, False) Next End If @@ -209,7 +213,7 @@ Public Class SplitPageUC m_CurrFirstInd = -1 m_CurrLastInd = -1 ' marco lavorazioni selezionate - For Each Item In ItemList + For Each Item As NameIdLsBxItem In ItemList MarkMachining(Item.Ind, True) Next m_CurrFirstInd = m_ItemList.IndexOf(ItemList(0)) @@ -237,7 +241,7 @@ Public Class SplitPageUC m_ItemList.Move(m_CurrLastInd + 1, m_CurrFirstInd) MoveMachining(m_CurrLastInd + 1, m_CurrFirstInd) ' aggiorno gli indici degli elementi coinvolti nello spostamento (selezionati e non) - For index = m_CurrLastInd + 1 To m_CurrFirstInd Step -1 + For index As Integer = m_CurrLastInd + 1 To m_CurrFirstInd Step -1 m_ItemList(index).Ind = index Next m_CurrFirstInd += 1 @@ -247,7 +251,7 @@ Public Class SplitPageUC m_ItemList.Move(m_CurrFirstInd - 1, m_CurrLastInd) MoveMachining(m_CurrFirstInd - 1, m_CurrLastInd) ' aggiorno gli indici degli elementi coinvolti nello spostamento (selezionati e non) - For index = m_CurrFirstInd - 1 To m_CurrLastInd + For index As Integer = m_CurrFirstInd - 1 To m_CurrLastInd m_ItemList(index).Ind = index Next m_CurrFirstInd -= 1 @@ -266,7 +270,7 @@ Public Class SplitPageUC Private Sub OnOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles OnOffBtn.Click If m_CurrFirstInd = -1 Then Return - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind If m_MachiningList(nI).m_bEnabled Then m_MachiningList(nI).m_bEnabled = False @@ -320,7 +324,7 @@ Public Class SplitPageUC Private Sub CutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind ' Provo ad entrambi gli estremi Dim bModif As Boolean = AdjustBothCuts(nI) @@ -345,7 +349,7 @@ Public Class SplitPageUC Private Sub CutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutEndBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind ' Eseguo If AdjustEndCut(nI) Then @@ -364,7 +368,7 @@ Public Class SplitPageUC Private Sub CutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutStartBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind ' Eseguo If AdjustStartCut(nI) Then @@ -492,7 +496,7 @@ Public Class SplitPageUC Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then EgtSetCurrMachining(m_MachiningList(nI).m_nId) @@ -590,7 +594,7 @@ Public Class SplitPageUC Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then EgtSetCurrMachining(m_MachiningList(nI).m_nId) @@ -743,7 +747,7 @@ Public Class SplitPageUC ' Recupero la lavorazione corrente If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind Dim nOperId As Integer = m_MachiningList(nI).m_nId Dim nMachiningType As Integer = EgtGetOperationType(nOperId) @@ -897,7 +901,7 @@ Public Class SplitPageUC ' Recupero la lavorazione corrente If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind Dim nOperId As Integer = m_MachiningList(nI).m_nId Dim nMachiningType As Integer = EgtGetOperationType(nOperId) @@ -1018,7 +1022,7 @@ Public Class SplitPageUC Private Sub InvertBtn_Click(sender As Object, e As RoutedEventArgs) Handles InvertBtn.Click If m_CurrFirstInd = -1 Then Return - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind ' Si possono invertire solo i tagli di lama If m_MachiningList( nI).m_nType <> MCH_OY.SAWING Then Continue For @@ -1063,7 +1067,7 @@ Public Class SplitPageUC Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click If m_CurrFirstInd = -1 Then Return Dim bGenModif As Boolean = False - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As Integer = m_CurrFirstInd To m_CurrLastInd Dim nI As Integer = m_ItemList(Index).Ind Dim nOperId As Integer = m_MachiningList(nI).m_nId If GetPause(nOperId) Then @@ -1183,7 +1187,7 @@ Public Class SplitPageUC If m_bModified Then ' Al primo posto deve rimanere la disposizione della fase Dim nFirstOperId As Integer = EgtGetPhaseDisposition(m_nCurrPhase) - For i = m_ItemList.Count() - 1 To 0 Step -1 + For i As Integer = m_ItemList.Count() - 1 To 0 Step -1 Dim nI As Integer = m_ItemList(i).Ind Dim nMchId As Integer = m_MachiningList(nI).m_nId EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER) @@ -1509,7 +1513,7 @@ Public Class SplitPageUC EgtDisableModified() ' cancello evidenziazione If m_CurrFirstInd >= 0 Then - For Index = m_CurrFirstInd To m_CurrLastInd + For Index As integer = m_CurrFirstInd To m_CurrLastInd MarkMachining(m_ItemList(Index).Ind, False) Next m_CurrFirstInd = -1 diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index 8c28bfe..61a198c 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -196,7 +196,6 @@ Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth" Public Const K_MACH_NEST_ALIGNED As String = "Aligned" Public Const K_MACH_NEST_GHIGLIOTTINA As String = "Guillotine" - Public Const K_MACH_NEST_AUTOMATIC As String = "Automatic" Public Const K_MACH_WASHING As String = "Washing" Public Const K_MACH_SACPROBE As String = "SacProbe" Public Const K_MACH_ENABLERESTART As String = "EnableRestart" diff --git a/DirectCuts/ControlsMachineButtonUC.xaml.vb b/DirectCuts/ControlsMachineButtonUC.xaml.vb index c65d074..949c8f9 100644 --- a/DirectCuts/ControlsMachineButtonUC.xaml.vb +++ b/DirectCuts/ControlsMachineButtonUC.xaml.vb @@ -78,7 +78,7 @@ Public Class ControlsMachineButtonUC Friend Sub SpindleStateChanged(SpindleState As Boolean) Dim SpindleButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_SPINDLE Then SpindleButton = MachineButton End If @@ -90,7 +90,7 @@ Public Class ControlsMachineButtonUC Friend Sub LaserStateChanged(LaserState As Boolean) Dim LaserButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_LASER Then LaserButton = MachineButton End If @@ -102,7 +102,7 @@ Public Class ControlsMachineButtonUC Friend Sub FeedHoldChanged(FeedHoldState As Boolean) Dim FeedHoldButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_FEEDHOLD Then FeedHoldButton = MachineButton End If @@ -114,7 +114,7 @@ Public Class ControlsMachineButtonUC Friend Sub SpeedHoldChanged(SpeedHoldState As Boolean) Dim SpeedHoldButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_SPEEDHOLD Then SpeedHoldButton = MachineButton End If @@ -126,7 +126,7 @@ Public Class ControlsMachineButtonUC Friend Sub LaserTracStateChanged(LaserTracState As Boolean) Dim LaserTracButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_LASERTRAC Then LaserTracButton = MachineButton End If @@ -138,7 +138,7 @@ Public Class ControlsMachineButtonUC Friend Sub CoolantStateChanged(CoolantState As Boolean) Dim CoolantButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_COOLANT Then CoolantButton = MachineButton End If @@ -150,7 +150,7 @@ Public Class ControlsMachineButtonUC Friend Sub InternalCoolantStateChanged(InternalCoolantState As Boolean) Dim IntCoolantButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_INTERNALCOOLANT Then IntCoolantButton = MachineButton End If @@ -162,7 +162,7 @@ Public Class ControlsMachineButtonUC Friend Sub ExternCoolantStateChanged(ExternCoolantState As Boolean) Dim ExtCoolantButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_EXTERNCOOLANT Then ExtCoolantButton = MachineButton End If @@ -175,7 +175,7 @@ Public Class ControlsMachineButtonUC Friend Sub CBAxesStateChanged(CBAxesState As Boolean) Dim CAxesButton As TwoStateButton = Nothing Dim BAxesButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_CAXES Then CAxesButton = MachineButton ElseIf MachineButton.StateFlag = K_BAXES Then @@ -192,7 +192,7 @@ Public Class ControlsMachineButtonUC Friend Sub AirBlowStateChanged(AirBlowState As Boolean) Dim AirBlowButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_AIRBLOW Then AirBlowButton = MachineButton End If @@ -204,7 +204,7 @@ Public Class ControlsMachineButtonUC Friend Sub HomeStateChanged(HomeState As Boolean) Dim HomeButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_HOME Then HomeButton = MachineButton End If @@ -216,7 +216,7 @@ Public Class ControlsMachineButtonUC Friend Sub TableUpChanged(TableUpState As Boolean) Dim TableUpButton As PressedCommandButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_TABLEUP Then TableUpButton = MachineButton End If @@ -228,7 +228,7 @@ Public Class ControlsMachineButtonUC Friend Sub TableDownChanged(TableDownState As Boolean) Dim TableDownButton As PressedCommandButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_TABLEDOWN Then TableDownButton = MachineButton End If @@ -240,7 +240,7 @@ Public Class ControlsMachineButtonUC Friend Sub HSMChanged(HsmState As Boolean) Dim HsmButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_HSM Then HsmButton = MachineButton End If @@ -253,7 +253,7 @@ Public Class ControlsMachineButtonUC Friend Sub DoorClosedChanged(DoorClosedState As Integer) Dim DoorClosedButton As ThreeStateButton = Nothing Dim DoorOpenedButton As ThreeStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_DOORCLOSED Then 'If TypeOf MachineButton Is NoStateButton Then ' DoorClosedButton = DirectCast(MachineButton, NoStateButton) @@ -295,7 +295,7 @@ Public Class ControlsMachineButtonUC Friend Sub LimitZChanged(LimitZState As Boolean) Dim TwoLimitZButton As TwoStateButton = Nothing Dim DoubleLimitZButton As DoubleCommandButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_LIMITZ Then If TypeOf MachineButton Is DoubleCommandButton Then DoubleLimitZButton = MachineButton @@ -315,7 +315,7 @@ Public Class ControlsMachineButtonUC Friend Sub FiveAxisStateChanged(FiveAxisState As Boolean) Dim ThreeAxesButton As TwoStateButton = Nothing Dim FiveAxesButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_THREEAXES Then ThreeAxesButton = MachineButton ElseIf MachineButton.StateFlag = K_FIVEAXES Then diff --git a/DirectCuts/DirectCutPageUC.xaml.vb b/DirectCuts/DirectCutPageUC.xaml.vb index bd4c9b6..20a12df 100644 --- a/DirectCuts/DirectCutPageUC.xaml.vb +++ b/DirectCuts/DirectCutPageUC.xaml.vb @@ -324,7 +324,7 @@ Public Class DirectCutPageUC Friend Sub XYJogChanged(bXYAxes As Boolean) ' devo decodificare il tipo di pulsante, quindi eseguire la conversione... Dim XYJogButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonJogList + For Each MachineButton As MachineButton In m_ButtonJogList ' elimino gli spazi ad inizio e fine della stringa If MachineButton.StateFlag.Trim = K_XYJOG Then XYJogButton = MachineButton @@ -346,7 +346,7 @@ Public Class DirectCutPageUC Friend Sub ZJogChanged(bZAxes As Boolean) ' devo decodificare il tipo di pulsante, quindi eseguire la conversione... Dim ZJogButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonJogList + For Each MachineButton As MachineButton In m_ButtonJogList If MachineButton.StateFlag.Trim = K_ZJOG Then ZJogButton = MachineButton Exit For @@ -367,7 +367,7 @@ Public Class DirectCutPageUC Friend Sub BCJogChanged(bBCAxes As Boolean) ' devo decodificare il tipo di pulsante, quindi eseguire la conversione... Dim BCJogButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonJogList + For Each MachineButton As MachineButton In m_ButtonJogList If MachineButton.StateFlag.Trim = K_BCJOG Then BCJogButton = MachineButton Exit For diff --git a/DirectCuts/SingleCutAuto.xaml.vb b/DirectCuts/SingleCutAuto.xaml.vb index cb0ab26..2177cf0 100644 --- a/DirectCuts/SingleCutAuto.xaml.vb +++ b/DirectCuts/SingleCutAuto.xaml.vb @@ -161,7 +161,7 @@ Public Class SingleCutAuto ShowCoord() ' carico la lista dei materiali lavorabili in macchina m_MaterialsList.Clear() - For Each Material In m_MainWindow.m_CurrentMachine.Materials + For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName)) Next ' Carico l'elenco dei materiali presenti in macchina per l'assegnata lavorazione diff --git a/DirectCuts/VacuumMachineButtonUC.xaml.vb b/DirectCuts/VacuumMachineButtonUC.xaml.vb index bec7f23..c8d87b8 100644 --- a/DirectCuts/VacuumMachineButtonUC.xaml.vb +++ b/DirectCuts/VacuumMachineButtonUC.xaml.vb @@ -77,7 +77,7 @@ Public Class VacuumMachineButtonUC Friend Sub VacuumUpChanged(VacuumUpState As Boolean) Dim VacuumUpButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUMUP Then VacuumUpButton = MachineButton End If @@ -89,7 +89,7 @@ Public Class VacuumMachineButtonUC Friend Sub VacuumDownChanged(VacuumDownState As Boolean) Dim VacuumDownButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUMDOWN Then VacuumDownButton = MachineButton End If @@ -101,7 +101,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum2UpChanged(Vacuum2UpState As Boolean) Dim Vacuum2UpButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM2UP Then Vacuum2UpButton = MachineButton End If @@ -113,7 +113,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum2DownChanged(Vacuum2DownState As Boolean) Dim Vacuum2DownButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM2DOWN Then Vacuum2DownButton = MachineButton End If @@ -125,7 +125,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum0Changed(Vacuum0State As Boolean) Dim Vacuum0Button As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM0 Then Vacuum0Button = MachineButton End If @@ -137,7 +137,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum90Changed(Vacuum90State As Boolean) Dim VacuumRotButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM90 Then VacuumRotButton = MachineButton End If @@ -149,7 +149,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum1Changed(Vacuum1State As Boolean) Dim Vacuum1StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM1STATE Then Vacuum1StateButton = MachineButton End If @@ -161,7 +161,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum2Changed(Vacuum2State As Boolean) Dim Vacuum2StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM2STATE Then Vacuum2StateButton = MachineButton End If @@ -173,7 +173,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum3Changed(Vacuum3State As Boolean) Dim Vacuum3StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM3STATE Then Vacuum3StateButton = MachineButton End If @@ -185,7 +185,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum4Changed(Vacuum4State As Boolean) Dim Vacuum4StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM4STATE Then Vacuum4StateButton = MachineButton End If @@ -197,7 +197,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum5Changed(Vacuum5State As Boolean) Dim Vacuum5StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM5STATE Then Vacuum5StateButton = MachineButton End If @@ -209,7 +209,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum6Changed(Vacuum6State As Boolean) Dim Vacuum6StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM6STATE Then Vacuum6StateButton = MachineButton End If @@ -221,7 +221,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum135Changed(Vacuum135State As Boolean) Dim Vacuum135StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM135STATE Then Vacuum135StateButton = MachineButton End If @@ -233,7 +233,7 @@ Public Class VacuumMachineButtonUC Friend Sub Vacuum246Changed(Vacuum246State As Boolean) Dim Vacuum246StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUM246STATE Then Vacuum246StateButton = MachineButton End If @@ -245,7 +245,7 @@ Public Class VacuumMachineButtonUC Friend Sub OpenAllChanged(OpenAllState As Boolean) Dim OpenAllStateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_OPENALLSTATE Then OpenAllStateButton = MachineButton End If @@ -257,7 +257,7 @@ Public Class VacuumMachineButtonUC Friend Sub CloseAllChanged(CloseAllState As Boolean) Dim CloseAllStateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_CLOSEALLSTATE Then CloseAllStateButton = MachineButton End If @@ -269,7 +269,7 @@ Public Class VacuumMachineButtonUC Friend Sub Open123Changed(Open123State As Boolean) Dim Open123StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_OPEN123STATE Then Open123StateButton = MachineButton End If @@ -281,7 +281,7 @@ Public Class VacuumMachineButtonUC Friend Sub Open456Changed(Open456State As Boolean) Dim Open456StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_OPEN456STATE Then Open456StateButton = MachineButton End If @@ -293,7 +293,7 @@ Public Class VacuumMachineButtonUC Friend Sub Close123Changed(Close123State As Boolean) Dim Close123StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_CLOSE123STATE Then Close123StateButton = MachineButton End If @@ -305,7 +305,7 @@ Public Class VacuumMachineButtonUC Friend Sub Close456Changed(Close456State As Boolean) Dim Close456StateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_CLOSE456STATE Then Close456StateButton = MachineButton End If @@ -317,7 +317,7 @@ Public Class VacuumMachineButtonUC Friend Sub BlowChanged(BlowState As Boolean) Dim BlowStateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_BLOWSTATE Then BlowStateButton = MachineButton End If @@ -329,7 +329,7 @@ Public Class VacuumMachineButtonUC Friend Sub VacuumOnChanged(VacuumState As Boolean) Dim VacuumOnButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUMON Then VacuumOnButton = MachineButton End If @@ -341,7 +341,7 @@ Public Class VacuumMachineButtonUC Friend Sub VacuumOffChanged(VacuumState As Boolean) Dim VacuumOffButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_VACUUMOFF Then VacuumOffButton = MachineButton End If @@ -354,7 +354,7 @@ Public Class VacuumMachineButtonUC Friend Sub BypassChanged(BypassState As Boolean) Dim PressedBypassStateButton As PressedCommandButton = Nothing Dim TwoBypassStateButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonList + For Each MachineButton As MachineButton In m_ButtonList If MachineButton.StateFlag = K_BYPASSTATE Then If TypeOf MachineButton Is TwoStateButton Then TwoBypassStateButton = MachineButton diff --git a/DrawImport/Engrave.vb b/DrawImport/Engrave.vb index c9f2180..660071f 100644 --- a/DrawImport/Engrave.vb +++ b/DrawImport/Engrave.vb @@ -79,7 +79,7 @@ Module Engrave End Function Friend Function GetEngraveAff(cCol As Color3d, ByRef dAff As Double, ByRef dLar As Double) As Boolean - For Each Ctsa In m_ListCte + For Each Ctsa As CTE In m_ListCte If Ctsa.m_bOk And Math.Abs(cCol.R - Ctsa.m_R) < m_nTol And Math.Abs(cCol.G - Ctsa.m_G) < m_nTol And diff --git a/DrawImport/InternalComponentPageUC.xaml.vb b/DrawImport/InternalComponentPageUC.xaml.vb index 6ac6312..89bf82d 100644 --- a/DrawImport/InternalComponentPageUC.xaml.vb +++ b/DrawImport/InternalComponentPageUC.xaml.vb @@ -266,7 +266,7 @@ Public Class InternalComponentPageUC Dim ThicknessConverter As New ThicknessConverter ' Assegnazione immagine e testo ai Button - For index = 1 To 8 + For index As Integer = 1 To 8 Dim CustomThickness As Thickness = ThicknessConverter.ConvertFromString("0") Dim nCompoName As Integer Dim sCompo As String = "" diff --git a/DrawImport/MainComponentPageUC.xaml.vb b/DrawImport/MainComponentPageUC.xaml.vb index 5ae8317..0be8d68 100644 --- a/DrawImport/MainComponentPageUC.xaml.vb +++ b/DrawImport/MainComponentPageUC.xaml.vb @@ -268,7 +268,7 @@ Public Class MainComponentPageUC Dim ThicknessConverter As New ThicknessConverter 'Assegnazione immagine e testo ai Button - For index = 1 To 8 + For index As Integer = 1 To 8 Dim CustomThickness As New Thickness(0) Dim nCompoName As Integer = GetPrivateProfileInt("Compo" & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile()) Dim sCompoImage As String = "" diff --git a/DrawImport/SideAngle.vb b/DrawImport/SideAngle.vb index 3e532b2..908934b 100644 --- a/DrawImport/SideAngle.vb +++ b/DrawImport/SideAngle.vb @@ -371,7 +371,7 @@ Module SideAngle End Function Friend Function GetSideAngHeel( cCol As Color3d, ByRef dAng As Double, ByRef dHeel As Double) As Boolean - For Each Ctsa In m_ListCtsa + For Each Ctsa As CTSA In m_ListCtsa If Ctsa.m_bOk And Math.Abs( cCol.R - Ctsa.m_R) < m_nTol And Math.Abs( cCol.G - Ctsa.m_G) < m_nTol And diff --git a/DrawImport/SideAngleUc.xaml.vb b/DrawImport/SideAngleUc.xaml.vb index d29a7b0..a30f4b1 100644 --- a/DrawImport/SideAngleUc.xaml.vb +++ b/DrawImport/SideAngleUc.xaml.vb @@ -528,7 +528,7 @@ Public Class SideAngleUC ' Se modalità angoli di inclinazione... If m_Mode = ModeOpt.SIDEANGLE Then ' Per ogni entità (della lista inizializzata), creo testo con nome e angolo di inclinazione - For Each Entity In m_SideAngleEntityList + For Each Entity As SideAngleEntity In m_SideAngleEntityList Dim sText As String = Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 2) & "°" If Entity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(Entity.dSideHeel, 2) SideAngle.AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True) @@ -536,7 +536,7 @@ Public Class SideAngleUC ' Altrimenti modalità gocciolatoio Else ' Per ogni entità creo testo con nome - For Each Entity In m_DripEntityList + For Each Entity As DripEntity In m_DripEntityList SideAngle.AddTextToLine(Entity.sEntityName, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True) Next ' Creo le geometrie dei gocciolatoi @@ -549,7 +549,7 @@ Public Class SideAngleUC ' refresh dei checkbox e della caselle di testo per tutte le entità presenti nelle liste SideAngle/DripEntity Private Sub RefreshCheckAndValue() If m_Mode = ModeOpt.SIDEANGLE Then - For nIndex = 1 To m_nCount + For nIndex As Integer = 1 To m_nCount Dim Entity As SideAngleEntity = m_SideAngleEntityList(nIndex - 1) ' Creo testo con angolo di inclinazione e dimensione tallone If nIndex < (m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For @@ -560,7 +560,7 @@ Public Class SideAngleUC GetHeelTxBxFromIndex(nTxBxIndex).Text = LenToString(Entity.dSideHeel, 1) Next Else - For nIndex = 1 To m_nCount + For nIndex As Integer = 1 To m_nCount Dim Entity As DripEntity = m_DripEntityList(nIndex - 1) ' Imposto check box (se sono stati definiti il numero corretto di CheckBox If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For @@ -633,7 +633,7 @@ Public Class SideAngleUC End If ' Per ogni entità con gocciolatoio, ne inserisco una copia nel layer Dim vSelId As New List(Of Integer) - For Each Entity In m_DripEntityList + For Each Entity As DripEntity In m_DripEntityList If Entity.bHaveDrip Then Dim nSouId As Integer = EgtGetFirstNameInGroup(nOutLoopId, Entity.sEntityName) Dim nNewId As Integer = EgtCopyGlob(nSouId, DripLayer) @@ -731,7 +731,7 @@ Public Class SideAngleUC Dim vJoint As New List(Of Boolean) Dim bJointStart As Boolean = False - For Each Entity In m_DripEntityList + For Each Entity As DripEntity In m_DripEntityList If Entity.bHaveDrip Then vJoint.Add(True) Else @@ -742,7 +742,7 @@ Public Class SideAngleUC bJointStart = True End If - For Each Entity In m_DripEntityList + For Each Entity As DripEntity In m_DripEntityList If Entity.bHaveDrip Then Dim nSouId As Integer = EgtGetFirstNameInGroup(nOutLoopId, Entity.sEntityName) @@ -753,7 +753,7 @@ Public Class SideAngleUC End If ' devo distingure i casi in cui inserisco un valore positivo ed uno negativo! - For Each IdCurve In vTempSelId + For Each IdCurve As Integer In vTempSelId ' accorcio entrmabi i lati Dim dLen As Double @@ -1366,7 +1366,7 @@ Friend Class SideAngleEntity Return Nothing End If - For Each Entity In EntityList + For Each Entity As SideAngleEntity In EntityList If Entity.m_sEntityName = sEntityName Then Return Entity End If @@ -1455,7 +1455,7 @@ Friend Class DripEntity Return Nothing End If - For Each Entity In EntityList + For Each Entity As DripEntity In EntityList If Entity.m_sEntityName = sEntityName Then Return Entity End If diff --git a/Frames/FrameMachiningUC.xaml.vb b/Frames/FrameMachiningUC.xaml.vb index 4dc2491..7f5ba4c 100644 --- a/Frames/FrameMachiningUC.xaml.vb +++ b/Frames/FrameMachiningUC.xaml.vb @@ -147,7 +147,7 @@ Public Class FrameMachiningUC If SysNotes <> String.Empty Then Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray) SysNotes = String.Empty - For Each Material In MachiningMaterials + For Each Material As Object In MachiningMaterials Dim Param() As String = Material.Split(",".ToCharArray) If Param(0) = m_CurrMachine.CurrMat.nId.ToString() Then Dim dRawHeight = GetRawHeight() diff --git a/Machine/AlarmsPageUC.xaml b/Machine/AlarmsPageUC.xaml index 3f02ebd..9943cd4 100644 --- a/Machine/AlarmsPageUC.xaml +++ b/Machine/AlarmsPageUC.xaml @@ -460,6 +460,7 @@ + - - - - - - + + + diff --git a/Machine/AlarmsPageUC.xaml.vb b/Machine/AlarmsPageUC.xaml.vb index fd56b17..5635a89 100644 --- a/Machine/AlarmsPageUC.xaml.vb +++ b/Machine/AlarmsPageUC.xaml.vb @@ -81,7 +81,7 @@ Public Class AlarmsPageUC WjIntCutsTxBl.Text = EgtMsg( 90930) ' Sempre sugli interni NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting AlignTxBl.Text = EgtMsg(90932) ' Allineato - GhigliottinaTxBl.Text = EgtMsg(90966) ' Ghigliottina + GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina AutomaticTxBl.Text = EgtMsg(91059) ' Automatico SetUpBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 33) ' Attrezzaggio NewMatBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 34) ' Nuovo @@ -100,6 +100,7 @@ Public Class AlarmsPageUC CurrSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 2) ' Taglio lama CurrDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 3) ' Foratura CurrMillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 4) ' Fresatura + CurrPocketingTxBl.Text = EgtMsg(91069) ' Svuotatura CurrWaterJettingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 7) ' WaterJet CurrDripSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 5) ' DripSawing CurrDripDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 6) ' DripDrilling @@ -118,7 +119,7 @@ Public Class AlarmsPageUC Select Case m_CurrentMachine.MountedToolConfig Case CurrentMachine.MountedToolConfigs.SAW ' Elimino le righe inutili e riduco il groupbox utensili correnti - For Index = 7 - 1 To 2 Step -1 + For Index As Integer = 7 - 1 To 2 Step -1 CurrToolsGrid.RowDefinitions.RemoveAt(Index) Next Dim EndRow As New RowDefinition @@ -244,6 +245,8 @@ Public Class AlarmsPageUC CurrDrillingTxBx.Visibility = Windows.Visibility.Hidden CurrMillingTxBl.Visibility = Windows.Visibility.Hidden CurrMillingTxBx.Visibility = Windows.Visibility.Hidden + CurrPocketingTxBl.Visibility = Windows.Visibility.Hidden + CurrpocketingTxBx.Visibility = Windows.Visibility.Hidden CurrWaterJettingTxBl.Visibility = Windows.Visibility.Hidden CurrWaterJettingTxBx.Visibility = Windows.Visibility.Hidden CurrDripSawingTxBl.Visibility = Windows.Visibility.Hidden @@ -266,6 +269,11 @@ Public Class AlarmsPageUC CurrMillingTxBl.Visibility = Windows.Visibility.Visible CurrMillingTxBx.Visibility = Windows.Visibility.Visible End If + If m_CurrentMachine.sCurrPocketing <> String.Empty Then + CurrPocketingTxBx.Text = m_CurrentMachine.sCurrPocketing + CurrPocketingTxBl.Visibility = Windows.Visibility.Visible + CurrPocketingTxBx.Visibility = Windows.Visibility.Visible + End If If m_CurrentMachine.sCurrwaterJetting <> String.Empty Then CurrWaterJettingTxBx.Text = m_CurrentMachine.sCurrwaterJetting CurrWaterJettingTxBl.Visibility = Windows.Visibility.Visible @@ -353,11 +361,11 @@ Public Class AlarmsPageUC (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_GHIGLIOTTINA, 0, m_MainWindow.GetMachIniFile()) <> 0) ' Flag per nesting automatico AutomaticChBx.IsChecked = - (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_AUTOMATIC, 0, m_MainWindow.GetMachIniFile()) <> 0) - AdjustAlignTextOnAutomaticOrCompleteCuts() + (GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0) + AdjustGhigliottinaTextOnAutomaticOrCompleteCuts() ' Flag per inserire la puasa dopo la sgrossatura delle cornici FramePauseChBx.IsChecked = - (GetPrivateProfileInt(S_MACH_FRAME, K_MACH_PAUSE, 0, m_MainWindow.GetMachIniFile()) <> 0) + (GetPrivateProfileInt(S_MACH_FRAME, K_MACH_PAUSE, 1, m_MainWindow.GetMachIniFile()) <> 0) ' Aggiorno messaggio sovratavola con numero tavola If GetTableCount() > 1 Then AdditionalTableTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 36) & " " & GetCurrentTable().ToString() @@ -664,7 +672,7 @@ Public Class AlarmsPageUC Else WritePrivateProfileString(S_MACH_NEST, K_MACH_REDUCEDCUT, "1", m_MainWindow.GetMachIniFile()) End If - AdjustAlignTextOnAutomaticOrCompleteCuts() + AdjustGhigliottinaTextOnAutomaticOrCompleteCuts() End Sub Private Sub CornerCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CornerCutsChBx.Click @@ -743,20 +751,18 @@ Public Class AlarmsPageUC Private Sub AutomaticChBx_Click(sender As Object, e As RoutedEventArgs) Handles AutomaticChBx.Click If AutomaticChBx.IsChecked() Then - WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_AUTOMATIC, "1", m_MainWindow.GetMachIniFile()) + WritePrivateProfileString(S_NEST, K_AUTOMATICOPTIMIZE, "1", m_MainWindow.GetIniFile()) Else - WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_AUTOMATIC, "0", m_MainWindow.GetMachIniFile()) + WritePrivateProfileString(S_NEST, K_AUTOMATICOPTIMIZE, "0", m_MainWindow.GetIniFile()) End If - AdjustAlignTextOnAutomaticOrCompleteCuts() + AdjustGhigliottinaTextOnAutomaticOrCompleteCuts() End Sub - Private Sub AdjustAlignTextOnAutomaticOrCompleteCuts() + Private Sub AdjustGhigliottinaTextOnAutomaticOrCompleteCuts() If AutomaticChBx.IsChecked() And Not CompleteCutsChBx.IsChecked() Then - AlignTxBl.Text = EgtMsg(90932) ' Allineato e Ghigliottina - 91060 GhigliottinaTxBl.Visibility = Visibility.Visible GhigliottinaChBx.Visibility = Visibility.Visible Else - AlignTxBl.Text = EgtMsg(90932) ' Allineato GhigliottinaTxBl.Visibility = Visibility.Collapsed GhigliottinaChBx.Visibility = Visibility.Collapsed End If @@ -780,7 +786,7 @@ Public Class AlarmsPageUC If Not String.IsNullOrWhiteSpace(MatNameTxBx.Text) Then ' Verifico che il nome non sia già utilizzato Dim bNameExist As Boolean = False - For Each Material In m_CurrentMachine.Materials + For Each Material As Material In m_CurrentMachine.Materials If Material.sName = MatNameTxBx.Text Then bNameExist = True Exit For @@ -946,7 +952,7 @@ Public Class AlarmsPageUC m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0 ' Definisco flag tastatura Dim bProbingOk As Boolean = False - For I = 0 To 120 + For I As Integer = 0 To 120 ' Devo rileggere la variabile ad ogni ciclo m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(ProbingStateNameVar, 3) System.Threading.Thread.Sleep(100) @@ -988,7 +994,7 @@ Public Class AlarmsPageUC Dim SawDiameterNameVar As String = String.Empty GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile()) m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0 - For I = 0 To 20 + For I As Integer = 0 To 20 ' Devo rileggere la variabile ad ogni ciclo m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(SawDiameterNameVar, 3) System.Threading.Thread.Sleep(100) diff --git a/Machine/ChooseToolWD.xaml.vb b/Machine/ChooseToolWD.xaml.vb index ed26900..1918cea 100644 --- a/Machine/ChooseToolWD.xaml.vb +++ b/Machine/ChooseToolWD.xaml.vb @@ -53,7 +53,7 @@ Public Class ChooseToolWD m_SetUpToolList.Add(New ToolPos(m_MainWindow.m_CurrentMachine.sCurrSaw, sToolPos, True)) End If ' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) - For Each ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger + For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) Next Return True @@ -65,12 +65,12 @@ Public Class ChooseToolWD EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) m_SetUpToolList.Add(New ToolPos(m_MainWindow.m_CurrentMachine.sCurrSaw, sToolPos, True)) End If - For Each ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger + For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) End If Next - For Each ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger + For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) End If diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index a7fa948..cdf3994 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -886,7 +886,7 @@ Public Class CurrentMachine End Property Friend Sub AddMaterial(value As Material) - For Each Material In Materials + For Each Material As Material In Materials If Material.nId = value.nId Then Exit Sub End If @@ -910,7 +910,7 @@ Public Class CurrentMachine End If Next Dim TempMat As Material = Nothing - For I = Index To m_MaxIdMat - 1 + For I As Integer = Index To m_MaxIdMat - 1 GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 2, TempMat, sMachIniFile) WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 1, TempMat, sMachIniFile) Next @@ -946,7 +946,7 @@ Public Class CurrentMachine If SysNotes <> String.Empty Then Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray) SysNotes = String.Empty - For Each Material In MachiningMaterials + For Each Material As Object In MachiningMaterials Dim Param() As String = Material.Split(",".ToCharArray) If Param(0) <> valueId.ToString Then SysNotes &= Material & ";" @@ -975,7 +975,7 @@ Public Class CurrentMachine ' Se stringa vuota If String.IsNullOrWhiteSpace(sMatName) Then Return False ' Cerco il nome nella lista dei materiali - For Index = 0 To Materials.Count - 1 + For Index As Integer = 0 To Materials.Count - 1 If String.Compare(Materials(Index).sName, sMatName, True) = 0 Then CurrMat = Materials(Index) End If @@ -1155,7 +1155,7 @@ Public Class CurrentMachine m_ManualToolChangerNbr = Math.Min(m_ManualToolChangerNbr, MAX_TCMAN_TOOLS) ' Leggo da file ini nomi e utensili manuali presenti - For Index = 1 To m_ManualToolChangerNbr + For Index As Integer = 1 To m_ManualToolChangerNbr Dim sName As String = String.Empty Dim sTool As String = String.Empty GetPrivateProfileString(S_TOOLCHANGER, K_MANUALNAME & Index, Nothing, sName, sMachIniFile) @@ -1330,7 +1330,7 @@ Friend Class Material Sub New(sName As String, MaterialList As ObservableCollection(Of Material)) Dim nMaxId As Integer = 0 - For Each Material In MaterialList + For Each Material As Material In MaterialList If Material.nId > nMaxId Then nMaxId = Material.nId End If diff --git a/Machine/MachineCNPageUC.xaml.vb b/Machine/MachineCNPageUC.xaml.vb index fd1bb1a..78d7a79 100644 --- a/Machine/MachineCNPageUC.xaml.vb +++ b/Machine/MachineCNPageUC.xaml.vb @@ -245,7 +245,7 @@ Public Class MachineCNPageUC Friend Sub PowerONChanged(bPowerON As Boolean) ' devo decodificare il tipo di pulsante, quindi eseguire la conversione... Dim PowerONButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonPower + For Each MachineButton As MachineButton In m_ButtonPower If MachineButton.StateFlag.Trim = K_POWERON Then PowerONButton = MachineButton Exit For @@ -260,7 +260,7 @@ Public Class MachineCNPageUC Friend Sub PowerOFFChanged(bPowerOFF As Boolean) ' leggo solo una varibile -> quindi quando modifico lo stato di PowerON devo modificare lo stato di PowerOFF Dim PowerOFFButton As TwoStateButton = Nothing - For Each MachineButton In m_ButtonPower + For Each MachineButton As MachineButton In m_ButtonPower If MachineButton.StateFlag.Trim = K_POWEROFF Then PowerOFFButton = MachineButton Exit For diff --git a/Machine/MachineStatusUC.xaml.vb b/Machine/MachineStatusUC.xaml.vb index 7f12cbf..b414ffe 100644 --- a/Machine/MachineStatusUC.xaml.vb +++ b/Machine/MachineStatusUC.xaml.vb @@ -111,7 +111,7 @@ Public Class MachineStatusUC ' modifico uniformgrid AxisUniformGrid.Columns = 1 AxisUniformGrid.Rows = m_AxesNumber + 2 - For Index = 0 To 12 - 1 + For Index As Integer = 0 To 12 - 1 Dim HorizontalGrid As Grid = DirectCast(AxisUniformGrid.Children(Index), Grid) HorizontalGrid.ColumnDefinitions.Clear() HorizontalGrid.RowDefinitions.Clear() @@ -124,7 +124,7 @@ Public Class MachineStatusUC Dim AxisGrid As New RowDefinition AxisGrid.Height = New GridLength(1, GridUnitType.Star) HorizontalGrid.RowDefinitions.Add(AxisGrid) - For Each Children In HorizontalGrid.Children + For Each Children As UIElement In HorizontalGrid.Children If TypeOf Children Is System.Windows.Controls.Primitives.UniformGrid Then Dim AxisUniformGrid As System.Windows.Controls.Primitives.UniformGrid = DirectCast(Children, System.Windows.Controls.Primitives.UniformGrid) AxisUniformGrid.SetValue(Grid.RowProperty, 1) diff --git a/Machine/MachiningDbPageUC.xaml.vb b/Machine/MachiningDbPageUC.xaml.vb index 4dec195..adb4e0d 100644 --- a/Machine/MachiningDbPageUC.xaml.vb +++ b/Machine/MachiningDbPageUC.xaml.vb @@ -227,7 +227,7 @@ Public Class MachiningDbPageUC 'Funzione che permette l'inizializzazione di albero e parametri all'apertura della pagina ToolsDb Private Sub InitializeFirstSelectedItem() If MachiningsList.Count > 0 Then - For Each MachiningFamily In MachiningsList + For Each MachiningFamily As CathegoryItem In MachiningsList If MachiningFamily.Items.Count > 0 Then MachiningFamily.IsExpanded = True MachiningFamily.Items(0).IsSelected = True @@ -250,7 +250,7 @@ Public Class MachiningDbPageUC Dim NewName As String = SelectedCathegory.Name EgtMdbGetMachiningNewName(NewName) If EgtMdbAddMachining(NewName, SelectedCathegory.nTType) Then - For Each MachiningFamily In MachiningsList + For Each MachiningFamily As CathegoryItem In MachiningsList If MachiningFamily.nTType = SelectedCathegory.nTType Then Dim NewMachiningItem As New CustomItem(NewName, SelectedCathegory.nTType) MachiningFamily.Items.Add(NewMachiningItem) @@ -270,7 +270,7 @@ Public Class MachiningDbPageUC If EgtMdbCopyMachining(SelectedCathegory.Name, NewName) Then Dim CurrType As Integer EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, CurrType) - For Each MachiningFamily In MachiningsList + For Each MachiningFamily As CathegoryItem In MachiningsList If MachiningFamily.nTType = CurrType Then Dim NewMachiningItem As New CustomItem(NewName, CurrType) MachiningFamily.Items.Add(NewMachiningItem) @@ -303,7 +303,7 @@ Public Class MachiningDbPageUC ' Cancello la lavorazione EgtMdbRemoveMachining(SelectedItem.Name) ' Rimuovo dall'albero - For Each MachiningFamily In MachiningsList + For Each MachiningFamily As CathegoryItem In MachiningsList If (MachiningFamily.nTType And SelectedItem.nType) <> 0 Then MachiningFamily.Items.Remove(SelectedItem) If MachiningFamily.Items.Count = 0 Then @@ -457,7 +457,7 @@ Public Class MachiningDbPageUC Case MCH_MY.MILLING 'Fresatura ToolCmBx.ItemsSource = MillTool Case MCH_MY.POCKETING 'Svuotatura - ToolCmBx.ItemsSource = MillTool + ToolCmBx.ItemsSource = PocketTool Case MCH_MY.DRILLING 'Foratura ToolCmBx.ItemsSource = DrillTool Case MCH_MY.SAWROUGHING 'Sgrossatura con lama @@ -472,7 +472,7 @@ Public Class MachiningDbPageUC EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid) EgtTdbGetToolFromUUID(sTuuid, ToolString) Dim bToolExist As Boolean = False - For Each CurrTool In ToolCmBx.ItemsSource + For Each CurrTool As IEnumerable In ToolCmBx.ItemsSource If CurrTool.ToString() = ToolString Then bToolExist = True Exit For @@ -514,14 +514,14 @@ Public Class MachiningDbPageUC RadOffsetTxBx.Text = LenToString(ToolDouble, 3) ' Lista materiali m_MaterialsList.Clear() - For Each Material In m_MainWindow.m_CurrentMachine.Materials + For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName)) Next EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString) If ToolString <> String.Empty Then Dim sItems() = ToolString.Split(";".ToCharArray) Dim Index As Integer = 0 - For Each Material In m_MaterialsList + For Each Material As MachiningMaterial In m_MaterialsList Dim Param() As String = sItems(Index).Split(",".ToCharArray) Dim nParId As Integer = 0 If StringToInt(Param(0), nParId) AndAlso nParId = Material.nId Then @@ -606,6 +606,18 @@ Public Class MachiningDbPageUC nTemp = If(AcrossChBx.IsChecked(), MCH_SAWFIN_SUB.ACROSS, MCH_SAWFIN_SUB.ALONG) EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, nTemp) End If + ' Parmetri nascosti di svuotatura + If nMachiningType = MCH_MY.POCKETING Then + EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALOUT) + EgtMdbSetCurrMachiningParam( MCH_MP.LEADINTYPE, MCH_POCK_LI.HELIX) + Dim dToolDiam As Double = 100 + If Not IsNothing(ToolCmBx.SelectedItem) Then + EgtTdbSetCurrTool( ToolCmBx.SelectedItem.ToString()) + EgtTdbGetCurrToolParam( MCH_TP.DIAM, dToolDiam) + End If + EgtMdbSetCurrMachiningParam( MCH_MP.LITANG, 0.495 * dToolDiam) + EgtMdbSetCurrMachiningParam( MCH_MP.LIELEV, 2.0) + End If ' Parametri WaterJetting StringToDouble(ForwardAngleTxBx.Text, dTemp) EgtMdbSetCurrMachiningParam(MCH_MP.FORWARDANGLE, dTemp) @@ -671,7 +683,7 @@ Public Class MachiningDbPageUC EgtMdbSetCurrMachiningParam(MCH_MP.OFFSR, dTemp) ' Scrivo stringa materiali da lista Dim sMaterialString As String = String.Empty - For Each Material In m_MaterialsList + For Each Material As MachiningMaterial In m_MaterialsList If Material.bIsActive Then sMaterialString += Material.nId.ToString & "," & DoubleToString(Material.dMinThickness, 0) & "," & DoubleToString(Material.dMaxThickness, 0) & ";" End If @@ -712,7 +724,7 @@ Public Class MachiningDbPageUC ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum > 2 Then - For Index = RowNum - 1 To 2 Step -1 + For Index As Integer = RowNum - 1 To 2 Step -1 TypeGrd.RowDefinitions.RemoveAt(Index) Next LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2) @@ -800,7 +812,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -809,7 +821,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 6 Then - For Index = RowNum To 5 + For Index As Integer = RowNum To 5 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -891,7 +903,7 @@ Public Class MachiningDbPageUC ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum > 2 Then - For Index = RowNum - 1 To 2 Step -1 + For Index As Integer = RowNum - 1 To 2 Step -1 TypeGrd.RowDefinitions.RemoveAt(Index) Next LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2) @@ -974,7 +986,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -983,7 +995,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 4 Then - For Index = RowNum To 3 + For Index As Integer = RowNum To 3 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -1096,7 +1108,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza Dim RowNum As Integer = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -1105,7 +1117,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 4 Then - For Index = RowNum To 3 + For Index As Integer = RowNum To 3 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -1185,7 +1197,7 @@ Public Class MachiningDbPageUC ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum > 2 Then - For Index = RowNum - 1 To 2 Step -1 + For Index As Integer = RowNum - 1 To 2 Step -1 TypeGrd.RowDefinitions.RemoveAt(Index) Next LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2) @@ -1253,7 +1265,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -1262,7 +1274,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 4 Then - For Index = RowNum To 3 + For Index As Integer = RowNum To 3 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -1355,7 +1367,7 @@ Public Class MachiningDbPageUC ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum > 2 Then - For Index = RowNum - 1 To 2 Step -1 + For Index As Integer = RowNum - 1 To 2 Step -1 TypeGrd.RowDefinitions.RemoveAt(Index) Next LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2) @@ -1423,7 +1435,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -1432,7 +1444,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 5 Then - For Index = RowNum To 4 + For Index As Integer = RowNum To 4 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -1461,7 +1473,7 @@ Public Class MachiningDbPageUC ' Eliminazione di una riga della tabella Offset RowNum = OffsetGrd.RowDefinitions.Count If RowNum > 1 Then - For Index = RowNum - 1 To 1 Step -1 + For Index As Integer = RowNum - 1 To 1 Step -1 OffsetGrd.RowDefinitions.RemoveAt(Index) OffsetGpBx.SetValue(Grid.RowSpanProperty, 4) Next @@ -1513,15 +1525,15 @@ Public Class MachiningDbPageUC StepTypeCmBx.Visibility = Windows.Visibility.Hidden SideBrd.SetValue(Grid.RowProperty, 9) SideBrd.Visibility = Windows.Visibility.Visible - WorkSideTxBl.Visibility = Windows.Visibility.Visible - WorkSideCmBx.Visibility = Windows.Visibility.Visible + WorkSideTxBl.Visibility = Windows.Visibility.Hidden + WorkSideCmBx.Visibility = Windows.Visibility.Hidden HeadSideTxBl.Visibility = Windows.Visibility.Hidden HeadSideCmBx.Visibility = Windows.Visibility.Hidden TypeBrd.Visibility = Windows.Visibility.Visible ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum > 2 Then - For Index = RowNum - 1 To 2 Step -1 + For Index As Integer = RowNum - 1 To 2 Step -1 TypeGrd.RowDefinitions.RemoveAt(Index) Next LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2) @@ -1584,27 +1596,30 @@ Public Class MachiningDbPageUC BackwardStepSideAngTxBl.Visibility = Windows.Visibility.Hidden BackwardStepSideAngTxBx.Visibility = Windows.Visibility.Hidden ForwardSawStepTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 15) - If SawStepGrd.Children.Contains(ArcIntTxBl) Then - SawStepGrd.Children.Remove(ArcIntTxBl) - SawStepGrd.Children.Remove(ArcIntTxBx) - SawStepGrd.Children.Remove(ArcExtTxBl) - SawStepGrd.Children.Remove(ArcExtTxBx) - SawStepGrd.RowDefinitions.RemoveAt(2) - End If - If SawStepGrd.Children.Contains(LastSawStepTxBl) Then - SawStepGrd.Children.Remove(LastSawStepTxBl) - SawStepGrd.Children.Remove(LastSawStepTxBx) - SawStepGrd.RowDefinitions.RemoveAt(2) + If DrillStepGrd.Children.Contains(StepTxBx) Then + DrillStepGrd.Children.Remove(StepTxBx) + SawRouStepGrd.Children.Add(StepTxBx) + StepTxBx.SetValue(Grid.ColumnProperty, 1) + StepTxBx.SetValue(Grid.RowProperty, 0) + StepTxBx.Style = Application.Current.FindResource("OmagCut_CalculatorTextBoxInGroupBox") + ElseIf SawStepGrd.Children.Contains(StepTxBx) Then + SawStepGrd.Children.Remove(StepTxBx) + SawRouStepGrd.Children.Add(StepTxBx) + StepTxBx.SetValue(Grid.ColumnProperty, 1) + StepTxBx.SetValue(Grid.RowProperty, 0) + StepTxBx.Style = Application.Current.FindResource("OmagCut_CalculatorTextBoxInGroupBox") End If DrillStepBrd.Visibility = Windows.Visibility.Hidden - SawRouStepGpBx.Visibility = Windows.Visibility.Hidden + SawStepGpBx.Visibility = Windows.Visibility.Hidden + SawRouStepGpBx.Visibility = Windows.Visibility.Visible + SawRouStepTxBl.Visibility = Windows.Visibility.Visible ReturnPosTxBl.Visibility = Windows.Visibility.Hidden ReturnPosTxBx.Visibility = Windows.Visibility.Hidden OffsetGpBx.Visibility = Windows.Visibility.Hidden ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 4 Then - For Index = RowNum - 1 To 4 Step -1 + For Index As Integer = RowNum - 1 To 4 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -1613,7 +1628,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella Feed RowNum = FeedGrd.RowDefinitions.Count If RowNum < 4 Then - For Index = RowNum To 3 + For Index As Integer = RowNum To 3 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) FeedGrd.RowDefinitions.Add(Row) @@ -1693,7 +1708,7 @@ Public Class MachiningDbPageUC ' Definizione della grid TypeGrd con la giusta altezza e numero di righe Dim RowNum As Integer = TypeGrd.RowDefinitions.Count If RowNum < 3 Then - For Index = RowNum To 2 + For Index As Integer = RowNum To 2 Dim Row As New RowDefinition Row.Height = New GridLength(1, GridUnitType.Star) ' Row.SetValue(Grid.RowSpanProperty, 3) @@ -1782,7 +1797,7 @@ Public Class MachiningDbPageUC ' Definizione di una riga della tabella con la giusta altezza RowNum = FeedGrd.RowDefinitions.Count If RowNum > 3 Then - For Index = RowNum - 1 To 3 Step -1 + For Index As Integer = RowNum - 1 To 3 Step -1 FeedGrd.RowDefinitions.RemoveAt(Index) Next End If @@ -1794,7 +1809,7 @@ Public Class MachiningDbPageUC ' Eliminazione di una riga della tabella Offset RowNum = OffsetGrd.RowDefinitions.Count If RowNum > 1 Then - For Index = RowNum - 1 To 1 Step -1 + For Index As Integer = RowNum - 1 To 1 Step -1 OffsetGrd.RowDefinitions.RemoveAt(Index) OffsetGpBx.SetValue(Grid.RowSpanProperty, 4) Next @@ -2145,7 +2160,7 @@ Public Structure IdNameStruct End Function Friend Shared Function IndFromId(Id As Integer, List As ObservableCollection(Of IdNameStruct)) As Integer - For i = 0 To List.Count - 1 + For i As Integer = 0 To List.Count - 1 If List(i).Id = Id Then Return i Next Return 0 diff --git a/Machine/PolishingsPageUC.xaml.vb b/Machine/PolishingsPageUC.xaml.vb index 3500070..107eda4 100644 --- a/Machine/PolishingsPageUC.xaml.vb +++ b/Machine/PolishingsPageUC.xaml.vb @@ -113,12 +113,12 @@ Public Class PolishingsPageUC ' Recupero nome utensile tramite UUID Dim ToolString As String = String.Empty - For Each KitItem In m_KitList - For Each KitMachItem In KitItem.KitMachList + For Each KitItem As Kit In m_KitList + For Each KitMachItem As KitMach In KitItem.KitMachList Dim selToolIndex As Integer = 0 EgtTdbGetToolFromUUID(KitMachItem.sToolUUID, ToolString) Dim bToolExist As Boolean = False - For Each CurrTool In ToolList + For Each CurrTool As String In ToolList If CurrTool.ToString() = ToolString Then bToolExist = True Exit For @@ -177,7 +177,7 @@ Public Class PolishingsPageUC If Not String.IsNullOrWhiteSpace( KitNameTxBx.Text) Then ' Verifico che il nome non sia già utilizzato Dim bNameExist As Boolean = False - For Each Kit In m_KitList + For Each Kit As Kit In m_KitList If Kit.sName = KitNameTxBx.Text Then bNameExist = True Exit For @@ -448,7 +448,7 @@ Public Class PolishingsPageUC If Not IsNothing(m_OldItem) Then Dim nKitIndex As Integer = m_OldItem.nId If nKitIndex <= m_KitList.Count Then - For Each KitMachItem In m_KitList(nKitIndex - 1).KitMachList + For Each KitMachItem As KitMach In m_KitList(nKitIndex - 1).KitMachList If KitMachItem.m_IsModifiedId OrElse KitMachItem.m_IsModifiedToolUUID OrElse KitMachItem.m_IsModifiedToolName OrElse KitMachItem.m_IsModifiedSelTool OrElse KitMachItem.m_IsModifiedActive OrElse KitMachItem.m_IsModifiedContour OrElse KitMachItem.m_IsModifiedOffCnt OrElse KitMachItem.m_IsModifiedZigZagX OrElse KitMachItem.m_IsModifiedOffZigZagX OrElse KitMachItem.m_IsModifiedZigZagY OrElse KitMachItem.m_IsModifiedStepX OrElse KitMachItem.m_IsModifiedStepY OrElse @@ -466,7 +466,7 @@ Public Class PolishingsPageUC If IsNothing( m_OldItem) Then Return Dim nKitIndex As Integer = m_OldItem.nId If nKitIndex <= m_KitList.Count Then - For Each KitMachItem In m_KitList(nKitIndex - 1).KitMachList + For Each KitMachItem As KitMach In m_KitList(nKitIndex - 1).KitMachList KitMachItem.m_IsModifiedId = False KitMachItem.m_IsModifiedToolUUID = False KitMachItem.m_IsModifiedToolName = False @@ -911,7 +911,7 @@ Class KitMach m_sToolName = sToolNameDummy End If - For Each sToolUuidItem In m_MainWindow.m_MachinePageUC.m_PolishingsPageUC.ToolUuidList + For Each sToolUuidItem As String In m_MainWindow.m_MachinePageUC.m_PolishingsPageUC.ToolUuidList EgtTdbGetToolFromUUID(sToolUuidItem, sToolNameDummy) If sToolNameDummy.Equals(m_sToolName) Then m_sToolUUID = sToolUuidItem diff --git a/Machine/SetUpPage.xaml.vb b/Machine/SetUpPage.xaml.vb index e65072d..e53aa6c 100644 --- a/Machine/SetUpPage.xaml.vb +++ b/Machine/SetUpPage.xaml.vb @@ -34,8 +34,8 @@ Public Class SetUpPage EgtOutLog("TC warning : too many tools (max 12 * 5)") ColNum = 12 End If - For Index = 12 To ColNum + 1 Step -1 - For Index2 = Index * 5 To (Index - 1) * 5 + 1 Step -1 + For Index As Integer = 12 To ColNum + 1 Step -1 + For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1 TlChGrid.Children.Remove(GetTlChPosFromIndex(Index2)) TlChGrid.Children.Remove(GetTxBxFromIndex(Index2)) Next @@ -43,14 +43,14 @@ Public Class SetUpPage TlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2) Next ' Modifico il numero di elementi presenti sull'ultima colonna - For Index = ColNum * 5 To m_CurrMachine.ToolChangerNbr + 1 Step -1 + For Index As Integer = ColNum * 5 To m_CurrMachine.ToolChangerNbr + 1 Step -1 TlChGrid.Children.Remove(GetTlChPosFromIndex(Index)) TlChGrid.Children.Remove(GetTxBxFromIndex(Index)) Next ' Assegno lunghezza alla scrollviewer TlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ColNum * 2 ' Carico i nomi dei portautensili - For Index = 1 To m_CurrMachine.ToolChangerNbr + For Index As Integer = 1 To m_CurrMachine.ToolChangerNbr GetTlChPosFromIndex(Index).PositionNameTxBl.Text = m_CurrMachine.ToolChangerName(Index - 1) Next Else @@ -64,8 +64,8 @@ Public Class SetUpPage EgtOutLog("ManTC warning : too many tools (max 12 * 5)") ManColNum = 12 End If - For Index = 12 To ManColNum + 1 Step -1 - For Index2 = Index * 5 To (Index - 1) * 5 + 1 Step -1 + For Index As Integer = 12 To ManColNum + 1 Step -1 + For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1 ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index2)) ManTlChGrid.Children.Remove(GetManTxBxFromIndex(Index2)) Next @@ -73,14 +73,14 @@ Public Class SetUpPage ManTlChGrid.ColumnDefinitions.RemoveAt(Index * 2 - 2) Next ' Modifico il numero di elementi presenti sull'ultima colonna - For Index = ManColNum * 5 To m_CurrMachine.ManualToolChangerNbr + 1 Step -1 + For Index As Integer = ManColNum * 5 To m_CurrMachine.ManualToolChangerNbr + 1 Step -1 ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index)) ManTlChGrid.Children.Remove(GetManTxBxFromIndex(Index)) Next ' Assegno lunghezza alla scrollviewer ManTlChGrid.Width = m_MainWindow.ActualWidth / 15 * 1.6 * ManColNum * 2 ' Carico i nomi dei portautensili - For Index = 1 To m_CurrMachine.ManualToolChangerNbr + For Index As Integer = 1 To m_CurrMachine.ManualToolChangerNbr GetManTlChPosFromIndex(Index).PositionNameTxBl.Text = m_CurrMachine.ManualToolChangerName(Index - 1) Next @@ -112,10 +112,10 @@ Public Class SetUpPage InitializeToolGroup( m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg( 90756), m_PolishingsList) ' Posiziono utensili già posizionati sul portautensili - For Each ToolPosition In m_CurrMachine.ToolChanger + For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger If ToolPosition.sTool <> String.Empty Then If Not IsNothing( m_DrillbitsList) Then - For Each Item In m_DrillbitsList.Items + For Each Item As CustomItem In m_DrillbitsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_DrillbitsList.Items.Remove(Item) @@ -124,7 +124,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_MillsList) Then - For Each Item In m_MillsList.Items + For Each Item As CustomItem In m_MillsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_MillsList.Items.Remove(Item) @@ -133,7 +133,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_CupsList) Then - For Each Item In m_CupsList.Items + For Each Item As CustomItem In m_CupsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_CupsList.Items.Remove(Item) @@ -142,7 +142,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_PolishingsList) Then - For Each Item In m_PolishingsList.Items + For Each Item As CustomItem In m_PolishingsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_PolishingsList.Items.Remove(Item) @@ -156,10 +156,10 @@ Public Class SetUpPage Next ' Posiziono utensili già posizionati sul portautensili manuale - For Each ToolPosition In m_CurrMachine.ManualToolChanger + For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger If ToolPosition.sTool <> String.Empty Then If Not IsNothing( m_DrillbitsList) Then - For Each Item In m_DrillbitsList.Items + For Each Item As CustomItem In m_DrillbitsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_DrillbitsList.Items.Remove(Item) @@ -168,7 +168,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_MillsList) Then - For Each Item In m_MillsList.Items + For Each Item As CustomItem In m_MillsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_MillsList.Items.Remove(Item) @@ -177,7 +177,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_CupsList) Then - For Each Item In m_CupsList.Items + For Each Item As CustomItem In m_CupsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_CupsList.Items.Remove(Item) @@ -186,7 +186,7 @@ Public Class SetUpPage Next End If If Not IsNothing( m_PolishingsList) Then - For Each Item In m_PolishingsList.Items + For Each Item As CustomItem In m_PolishingsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) m_PolishingsList.Items.Remove(Item) @@ -784,7 +784,7 @@ Public Class SetUpPage ' Funzione che rimette un utensile nell'albero Private Sub RestoreToolInList(sToolName As String) - For Each Tool In m_SetUpToolsList.Items + For Each Tool As CustomItem In m_SetUpToolsList.Items If Tool.Name = sToolName Then If Tool.nType = MCH_TY.DRILL_STD Then m_DrillbitsList.Items.Add(Tool) @@ -1119,7 +1119,7 @@ Public Class SetUpPage EgtTdbGetCurrToolParam(MCH_TP.TCPOS, ToolPositionName) If String.IsNullOrEmpty(ToolPositionName) Then Return ' Cerco il portautensile nella lista degli automatici per vederne lo stato - For Each TlChPos In m_CurrMachine.ToolChanger + For Each TlChPos As ToolChangerPos In m_CurrMachine.ToolChanger If TlChPos.sName = ToolPositionName Then ' Se la posizione è libera If GetTxBxFromIndex(TlChPos.nPosition).Text = String.Empty Then @@ -1137,7 +1137,7 @@ Public Class SetUpPage End If Next ' Cerco il portautensile nella lista dei manuali per vederne lo stato - For Each ManTlChPos In m_CurrMachine.ManualToolChanger + For Each ManTlChPos As ToolChangerPos In m_CurrMachine.ManualToolChanger If ManTlChPos.sName = ToolPositionName Then ' Se la posizione è libera If GetManTxBxFromIndex(ManTlChPos.nPosition).Text = String.Empty Then diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index 07eda49..308ec43 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -182,7 +182,7 @@ Public Class ToolsDbPageUC 'Funzione che permette l'inizializzazione di albero e parametri all'apertura della pagina ToolsDb Private Sub InitializeFirstSelectedItem() If ToolsList.Count > 0 Then - For Each ToolFamily In ToolsList + For Each ToolFamily As CathegoryItem In ToolsList If ToolFamily.Items.Count > 0 Then ToolFamily.IsExpanded = True ToolFamily.Items(0).IsSelected = True @@ -227,7 +227,7 @@ Public Class ToolsDbPageUC Dim NewName As String = SelectedCathegory.Name EgtTdbGetToolNewName(NewName) If EgtTdbAddTool(NewName, SelectedCathegory.nTType) Then - For Each ToolFamily In ToolsList + For Each ToolFamily As CathegoryItem In ToolsList If ToolFamily.nTType = SelectedCathegory.nTType Then Dim NewToolItem As New CustomItem(NewName, SelectedCathegory.nTType) ToolFamily.Items.Add(NewToolItem) @@ -315,7 +315,7 @@ Public Class ToolsDbPageUC ' Aggiorno lista utensili Dim CurrType As Integer EgtTdbGetCurrToolParam(MCH_TP.TYPE, CurrType) - For Each ToolFamily In ToolsList + For Each ToolFamily As CathegoryItem In ToolsList If ToolFamily.nTType = CurrType Then Dim NewToolItem As New CustomItem( NewName, CurrType) ToolFamily.Items.Add( NewToolItem) @@ -459,7 +459,7 @@ Public Class ToolsDbPageUC ' Cancello l'utensile EgtTdbRemoveTool(SelectedItem.Name) ' Rimuovo il nome dell'albero - For Each ToolFamily In ToolsList + For Each ToolFamily As CathegoryItem In ToolsList If (ToolFamily.nTType And SelectedItem.nType) <> 0 Then ToolFamily.Items.Remove(SelectedItem) If ToolFamily.Items.Count = 0 Then diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index e005941..be334a4 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -1153,7 +1153,7 @@ Class MainWindow m_CNCommunication.m_CN.n_DReadELS_handle = 0 m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1) Dim nVarFin As Integer = 0 - For I = 1 To 4 + For I As Integer = 1 To 4 System.Threading.Thread.Sleep(50) If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value) @@ -1215,7 +1215,7 @@ Class MainWindow m_CNCommunication.m_CN.n_DReadELS_handle = 0 m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1) Dim nVarCopy As Integer = 0 - For I = 1 To 10 + For I As Integer = 1 To 10 System.Threading.Thread.Sleep(50) If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value) @@ -1268,7 +1268,7 @@ Class MainWindow m_CNCommunication.m_CN.n_DReadELS_handle = 0 m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sProdLiProbingStateVar(nI), 1) Dim nProbingState As Integer = 0 - For I = 1 To 5 + For I As Integer = 1 To 5 System.Threading.Thread.Sleep(20) If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then nProbingState = CInt(m_CNCommunication.m_CN.d_DReadELS_value) @@ -1281,7 +1281,7 @@ Class MainWindow If m_CurrentMachine.sProdLiProbingTcPosVar(nI) <> "0" Then m_CNCommunication.m_CN.n_DReadELS_handle = 0 m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sProdLiProbingTcPosVar(nI), 1) - For I = 1 To 5 + For I As Integer = 1 To 5 System.Threading.Thread.Sleep(20) If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then nTcPos = CInt(m_CNCommunication.m_CN.d_DReadELS_value) @@ -1296,7 +1296,7 @@ Class MainWindow m_CNCommunication.m_CN.n_DReadELS_handle = 0 m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sProdLiSawDiameterVar(nI), 1) Dim dDiam As Double = 0 - For I = 1 To 5 + For I As Integer = 1 To 5 System.Threading.Thread.Sleep(20) If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then dDiam = m_CNCommunication.m_CN.d_DReadELS_value diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 8b56c10..cc32123 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/NcComm/CNCommunication.vb b/NcComm/CNCommunication.vb index 5b37cf0..535d850 100644 --- a/NcComm/CNCommunication.vb +++ b/NcComm/CNCommunication.vb @@ -488,7 +488,7 @@ Public Class CNCommunication If m_CN.b_NC_error Then ErrorList.Clear() SyncLock m_CN - For Each Item In m_CN.sz_NC_error_messages + For Each Item As String In m_CN.sz_NC_error_messages ErrorList.Add(Item) Next End SyncLock @@ -701,7 +701,7 @@ Public Class CNCommunication If m_CN.b_NC_error Then ErrorList.Clear() SyncLock m_CN - For Each Item In m_CN.sz_NC_error_messages + For Each Item As String In m_CN.sz_NC_error_messages ErrorList.Add(Item) Next End SyncLock diff --git a/NcComm/M_MMFiles.vb b/NcComm/M_MMFiles.vb index 598271a..1fe61d9 100644 --- a/NcComm/M_MMFiles.vb +++ b/NcComm/M_MMFiles.vb @@ -719,7 +719,7 @@ Module M_MMFiles Next ' Copia variabili R - For n = 0 To (N_R_VAR - 1) + For n As Integer = 0 To (N_R_VAR - 1) CurrCN.d_Dvariable_values(n) = SiemensRet.d_interf_variable_values(n) Next diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj index 9f45cd7..ac6623e 100644 --- a/OmagCUT.vbproj +++ b/OmagCUT.vbproj @@ -22,7 +22,7 @@ true bin\Debug\ OmagCUT.xml - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 @@ -36,7 +36,7 @@ true bin\Release\ OmagCUT.xml - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 @@ -50,7 +50,7 @@ Off - On + Off true @@ -58,7 +58,7 @@ true bin\x86\Debug\ OmagCUT.xml - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 full x86 MinimumRecommendedRules.ruleset @@ -70,7 +70,7 @@ bin\x86\Release\ OmagCUT.xml true - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 None x86 MinimumRecommendedRules.ruleset @@ -96,7 +96,7 @@ bin\Trial\ OmagCUT.xml true - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 pdbonly AnyCPU MinimumRecommendedRules.ruleset @@ -105,7 +105,7 @@ bin\x86\Trial\ OmagCUT.xml true - 41999,42016,42017,42018,42019,42032,42036 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 None x86 MinimumRecommendedRules.ruleset diff --git a/Options/OptionsPageUC.xaml.vb b/Options/OptionsPageUC.xaml.vb index 3a19837..817f3d6 100644 --- a/Options/OptionsPageUC.xaml.vb +++ b/Options/OptionsPageUC.xaml.vb @@ -1209,7 +1209,7 @@ Public Class OptionsPageUC Dim sCurrProjectDir As String = Path.GetDirectoryName(sCurrProject) If Not String.IsNullOrWhiteSpace(sCurrProjectDir) Then Dim TempFiles() As String = Directory.GetFiles(sCurrProjectDir) - For FileIndex = 0 To TempFiles.Count - 1 + For FileIndex As Integer = 0 To TempFiles.Count - 1 If Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).Contains(Path.GetFileNameWithoutExtension(sCurrProject)) AndAlso TempFiles(FileIndex) <> sCurrProject Then OtherFiles.Add(TempFiles(FileIndex)) End If diff --git a/Project/ProjectMgrUC.xaml.vb b/Project/ProjectMgrUC.xaml.vb index 45084c1..68ce065 100644 --- a/Project/ProjectMgrUC.xaml.vb +++ b/Project/ProjectMgrUC.xaml.vb @@ -541,7 +541,7 @@ Public Class ProjectMgrUC m_CurrNcComm.m_CN.n_DReadELS_handle = 0 m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProg1, 1) Dim nVarProg1 As Integer = 99 - For I = 0 To 10 + For I As Integer = 0 To 10 System.Threading.Thread.Sleep(50) If m_CurrNcComm.m_CN.n_DReadELS_handle = 1 Then nVarProg1 = CInt(m_CurrNcComm.m_CN.d_DReadELS_value) @@ -552,7 +552,7 @@ Public Class ProjectMgrUC m_CurrNcComm.m_CN.n_DReadELS_handle = 0 m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProg2, 1) Dim nVarProg2 As Integer = 99 - For I = 0 To 10 + For I As Integer = 0 To 10 System.Threading.Thread.Sleep(50) If m_CurrNcComm.m_CN.n_DReadELS_handle = 1 Then nVarProg2 = CInt(m_CurrNcComm.m_CN.d_DReadELS_value) @@ -564,7 +564,7 @@ Public Class ProjectMgrUC If Not String.IsNullOrWhiteSpace(m_CurrMachine.sVarProgTwins) Then m_CurrNcComm.m_CN.n_DReadELS_handle = 0 m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProgTwins, 1) - For I = 0 To 10 + For I As Integer = 0 To 10 System.Threading.Thread.Sleep(50) If m_CurrNcComm.m_CN.n_DReadELS_handle = 1 Then nVarProgTwins = CInt(m_CurrNcComm.m_CN.d_DReadELS_value) diff --git a/RawPhoto/ChooseMachining.xaml.vb b/RawPhoto/ChooseMachining.xaml.vb index 56cda90..cf86e7b 100644 --- a/RawPhoto/ChooseMachining.xaml.vb +++ b/RawPhoto/ChooseMachining.xaml.vb @@ -90,7 +90,7 @@ Public Class ChooseMachining End If End If ' Definizione di due righe della tabella con la giusta altezza - For Index = 0 To 1 + For Index As Integer = 0 To 1 Dim Row As New RowDefinition Row.Height = New GridLength(0.5, GridUnitType.Star) ChooseMachiningGrid.RowDefinitions.Add(Row) @@ -171,7 +171,7 @@ Public Class ChooseMachining If SysNotes <> String.Empty Then Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray) SysNotes = String.Empty - For Each Material In MachiningMaterials + For Each Material As Object In MachiningMaterials Dim Param() As String = Material.Split(",".ToCharArray) If Param(0) = m_CurrentMachine.CurrMat.nId.ToString() Then Dim dRawHeight = GetRawHeight() @@ -196,13 +196,13 @@ Public Class ChooseMachining Private Sub CreateMachiningList(MachiningType As Integer, MachiningList As List(Of String)) ' Recupero UUID di tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) Dim TuuidList As New List(Of String) - For Each ToolChangerPos In m_CurrentMachine.ToolChanger + For Each ToolChangerPos As ToolChangerPos In m_CurrentMachine.ToolChanger Dim sTuuid As String = String.Empty EgtTdbSetCurrTool(ToolChangerPos.sTool) EgtTdbGetCurrToolParam(MCH_TP.UUID, sTuuid) TuuidList.Add(sTuuid) Next - For Each ToolChangerPos In m_CurrentMachine.ManualToolChanger + For Each ToolChangerPos As ToolChangerPos In m_CurrentMachine.ManualToolChanger Dim sTuuid As String = String.Empty EgtTdbSetCurrTool(ToolChangerPos.sTool) EgtTdbGetCurrToolParam(MCH_TP.UUID, sTuuid) @@ -217,7 +217,7 @@ Public Class ChooseMachining Dim sMachTuuid As String = String.Empty EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sMachTuuid) ' Cerco UUID nella lista degli attrezzati - For Each Tuuid In TuuidList + For Each Tuuid As String In TuuidList If sMachTuuid = Tuuid Then If VerifyMatThickCompatibility() Then MachiningList.Add(MachiningName) @@ -241,7 +241,7 @@ Public Class ChooseMachining Select Case SelectedItem.nId Case 0 ' Nessuna If m_RowNumber > 8 Then - For Index = m_RowNumber - 1 To 8 Step -1 + For Index As Integer = m_RowNumber - 1 To 8 Step -1 ChooseMachiningGrid.RowDefinitions.RemoveAt(Index) Next m_RowNumber = 8 @@ -254,7 +254,7 @@ Public Class ChooseMachining Case 1 ' Foratura ' Definizione di due righe della tabella con la giusta altezza If m_RowNumber < 10 Then - For Index = 1 To 10 - m_RowNumber + For Index As Integer = 1 To 10 - m_RowNumber Dim Row As New RowDefinition Row.Height = New GridLength(0.5, GridUnitType.Star) ChooseMachiningGrid.RowDefinitions.Add(Row) @@ -275,7 +275,7 @@ Public Class ChooseMachining Case 2 ' Fresatura ' Definizione di due righe della tabella con la giusta altezza If m_RowNumber < 10 Then - For Index = 1 To 10 - m_RowNumber + For Index As Integer = 1 To 10 - m_RowNumber Dim Row As New RowDefinition Row.Height = New GridLength(0.5, GridUnitType.Star) ChooseMachiningGrid.RowDefinitions.Add(Row) @@ -296,7 +296,7 @@ Public Class ChooseMachining Case 3 ' Foratura + Fresatura (Entrambe) ' Definizione di quattro righe della tabella con la giusta altezza If m_RowNumber < 12 Then - For Index = 1 To 12 - m_RowNumber + For Index As Integer = 1 To 12 - m_RowNumber Dim Row As New RowDefinition Row.Height = New GridLength(0.5, GridUnitType.Star) ChooseMachiningGrid.RowDefinitions.Add(Row) @@ -323,7 +323,7 @@ Public Class ChooseMachining Case 4 ' WaterJetting ' Definizione di due righe della tabella con la giusta altezza If m_RowNumber < 10 Then - For Index = 1 To 10 - m_RowNumber + For Index As Integer = 1 To 10 - m_RowNumber Dim Row As New RowDefinition Row.Height = New GridLength(0.5, GridUnitType.Star) ChooseMachiningGrid.RowDefinitions.Add(Row) @@ -376,7 +376,7 @@ Class StringIdCmBx Private m_sName As String Friend Overloads Shared Function FromIdToStringIdCmBx(nId As Integer, List As List(Of StringIdCmBx)) As StringIdCmBx - For Each Item In List + For Each Item As StringIdCmBx In List If Item.nId = nId Then Return Item End If @@ -385,7 +385,7 @@ Class StringIdCmBx End Function Friend Overloads Shared Function FromIdToStringIdCmBx(nId As Integer, List As ObservableCollection(Of StringIdCmBx)) As StringIdCmBx - For Each Item In List + For Each Item As StringIdCmBx In List If Item.nId = nId Then Return Item End If diff --git a/RawPhoto/RawPartPageUC.xaml.vb b/RawPhoto/RawPartPageUC.xaml.vb index e17ae3f..7bcc85e 100644 --- a/RawPhoto/RawPartPageUC.xaml.vb +++ b/RawPhoto/RawPartPageUC.xaml.vb @@ -1289,7 +1289,7 @@ Public Class RawPartPageUC Return False End If ' Cancello eventuali curve risultato dell'offset oltre la prima - For i = 1 To nCount - 1 + For i As Integer = 1 To nCount - 1 EgtErase(nKerfId + i) Next ' Cancello il vecchio kerf @@ -1656,7 +1656,7 @@ Public Class RawPartPageUC m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0 ' Definisco flag tastatura Dim bProbingOk As Boolean = False - For I = 0 To 120 + For I As integer = 0 To 120 ' Devo rileggere la variabile ad ogni ciclo m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(ProbingStateNameVar, 3) System.Threading.Thread.Sleep(100) @@ -1693,7 +1693,7 @@ Public Class RawPartPageUC Dim RawThicknessNameVar As String = String.Empty GetPrivateProfileString(S_MACH_PROBING, K_RAWTHICKNESS, "", RawThicknessNameVar, m_MainWindow.GetMachIniFile()) m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0 - For I = 0 To 20 + For I As integer = 0 To 20 ' Devo rileggere la variabile ad ogni ciclo m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(RawThicknessNameVar, 3) If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then @@ -1813,7 +1813,7 @@ Public Class RawPartPageUC CloseRawByLaser() Else ' Elimino tutti i segmenti disegnati - For Each nEntityId In m_CurveXKerfList + For Each nEntityId As Integer In m_CurveXKerfList If EgtGetType(nEntityId) = GDB_TY.CRV_LINE Then EgtErase(nEntityId) End If diff --git a/Simulation/SimulationPageUC.xaml.vb b/Simulation/SimulationPageUC.xaml.vb index 51519b0..4dc7ca1 100644 --- a/Simulation/SimulationPageUC.xaml.vb +++ b/Simulation/SimulationPageUC.xaml.vb @@ -57,7 +57,7 @@ Public Class SimulationPageUC UsageTxBl.Text = EgtMsg(MSG_SIMULATIONPAGEUC + 18) ' Utilizzo ' Impostazioni box assi m_SimulationAxesNum = GetPrivateProfileInt(S_AXES, K_SIMULATIONAXESNUM, 5, m_MainWindow.GetMachIniFile()) - For Index = 0 To AxesUniformGrid.Children.Count - 1 + For Index As Integer = 0 To AxesUniformGrid.Children.Count - 1 If Index > m_SimulationAxesNum - 1 And Index < AxesUniformGrid.Children.Count - 2 Then If TypeOf AxesUniformGrid.Children(Index) Is Grid Then Dim AxisGrid As Grid = DirectCast(AxesUniformGrid.Children(Index), Grid) diff --git a/WorkInProgress/WorkInProgressPageUC.xaml.vb b/WorkInProgress/WorkInProgressPageUC.xaml.vb index 9d2e597..626fefe 100644 --- a/WorkInProgress/WorkInProgressPageUC.xaml.vb +++ b/WorkInProgress/WorkInProgressPageUC.xaml.vb @@ -121,7 +121,7 @@ Public Class WorkInProgressPageUC m_CurrNcComm.m_CN.n_DReadELS_handle = 0 m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProg1, 1) Dim nVarProg1 As Integer = 99 - For I = 0 To 20 + For I As Integer = 0 To 20 System.Threading.Thread.Sleep(100) If m_CurrNcComm.m_CN.n_DReadELS_handle = 1 Then nVarProg1 = CInt(m_CurrNcComm.m_CN.d_DReadELS_value) @@ -135,7 +135,7 @@ Public Class WorkInProgressPageUC m_CurrNcComm.m_CN.n_DReadELS_handle = 0 m_CurrNcComm.m_CN.ReadEls_Add_Parameter(m_CurrMachine.sVarProg2, 1) Dim nVarProg2 As Integer = 99 - For I = 0 To 20 + For I As Integer = 0 To 20 System.Threading.Thread.Sleep(100) If m_CurrNcComm.m_CN.n_DReadELS_handle = 1 Then nVarProg2 = CInt(m_CurrNcComm.m_CN.d_DReadELS_value)