diff --git a/CompoCsvTrfDataWindow/CompoTrfDataWindowVM.vb b/CompoCsvTrfDataWindow/CompoTrfDataWindowVM.vb index 2204730..a3903b3 100644 --- a/CompoCsvTrfDataWindow/CompoTrfDataWindowVM.vb +++ b/CompoCsvTrfDataWindow/CompoTrfDataWindowVM.vb @@ -140,7 +140,7 @@ Public Class CompoTrfDataWindowVM PartCode = sPartCode MatCode = sMatCode SurfCode = sSurfCode - Thickness = LenToString(dTh, 2) + Thickness = EgtToUiUnits(dTh) End Sub Friend Sub GetData(ByRef sOrdCode As String, ByRef sOrdDesc As String, sPartCode As String, ByRef sMatCode As String, ByRef sSurfCode As String, ByRef dTh As Double) @@ -149,7 +149,7 @@ Public Class CompoTrfDataWindowVM sPartCode = PartCode sMatCode = MatCode sSurfCode = SurfCode - StringToLen(Thickness, dTh) + dTh = EgtFromUiUnits(Thickness) End Sub #End Region diff --git a/CompoWindow/CompoParamPage/CompoParamPageVM.vb b/CompoWindow/CompoParamPage/CompoParamPageVM.vb index 9fd7d1e..cb5f1cb 100644 --- a/CompoWindow/CompoParamPage/CompoParamPageVM.vb +++ b/CompoWindow/CompoParamPage/CompoParamPageVM.vb @@ -712,19 +712,23 @@ Public Class CompoParamItem Private Shared Function FromLua(nInd As Integer, sName As String, nType As Integer, ByRef NewCompo As CompoParamItem) As Boolean Select Case nType Case ParamType.BOOL - Dim Compo As New CheckParamItem(nInd, sName, nType) + Dim Compo As New CheckParamItem(nInd, sName, ParamType.BOOL) NewCompo = Compo Return EgtLuaGetGlobBoolVar(LUA_VALUE & nInd.ToString(), Compo.m_bVal) Case ParamType.INT - Dim Compo As New TextParamItem(nInd, sName, nType) + Dim Compo As New TextParamItem(nInd, sName, ParamType.INT) NewCompo = Compo Return EgtLuaGetGlobIntVar(LUA_VALUE & nInd.ToString(), Compo.m_nVal) - Case ParamType.LEN, ParamType.DOUB - Dim Compo As New TextParamItem(nInd, sName, nType) + Case ParamType.LEN + Dim Compo As New TextParamItem(nInd, sName, ParamType.LEN) + NewCompo = Compo + Return EgtLuaGetGlobNumVar(LUA_VALUE & nInd.ToString(), Compo.m_dVal) + Case ParamType.DOUB + Dim Compo As New TextParamItem(nInd, sName, ParamType.DOUB) NewCompo = Compo Return EgtLuaGetGlobNumVar(LUA_VALUE & nInd.ToString(), Compo.m_dVal) Case ParamType.STR - Dim Compo As New TextParamItem(nInd, sName, nType) + Dim Compo As New TextParamItem(nInd, sName, ParamType.STR) NewCompo = Compo Return EgtLuaGetGlobStringVar(LUA_VALUE & nInd.ToString(), Compo.m_sVal) End Select diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb index 02d0324..6161835 100644 --- a/Constants/ConstGen.vb +++ b/Constants/ConstGen.vb @@ -26,27 +26,27 @@ Module ConstGen ' Abilitazioni licenza Friend Enum KEY_OPT As UInteger - CUT_BASE = 2 ^ 0 ' 1 - Prodotto OmagCUT - MAN_MANIP = 2 ^ 1 ' 2 - AUTO_MANIP = 2 ^ 2 ' 4 - MAN_PHOTO = 2 ^ 3 ' 8 - AUTO_PHOTO = 2 ^ 4 ' 16 - CSV_AUTO = 2 ^ 5 ' 32 - ENABLE_MILL = 2 ^ 6 ' 64 - PRODUCTION_LINE = 2 ^ 7 ' 128 - OFFICE_BASE = 2 ^ 8 ' 256 - Prodotto OmagOFFICE - VM_MULTI = 2 ^ 9 ' 512 - UNDER_CUT = 2 ^ 10 ' 1024 - CSV_SIMPLE = 2 ^ 11 ' 2048 - PHOTO_BASE = 2 ^ 12 ' 4096 - Prodotto OmagPHOTO - TRF_IMPORT = 2 ^ 13 ' 8192 - MOVE_PARTS = 2 ^ 14 ' 16384 - IMPORT_SLABDXF = 2 ^ 15 ' 32768 - CURVED_FRAME = 2 ^ 16 ' 65536 - ENABLE_WJ = 2 ^ 17 ' 131072 - ENABLE_POLISHING = 2 ^ 18 ' 262144 - OFFICE_TYPE = 2 ^ 19 ' 524288 - Solo per OmagCUT - REGISTRATION = 2 ^ 20 ' 1048576 - Solo per OmagCUT + CUT_BASE = CUInt(2 ^ 0) ' 1 - Prodotto OmagCUT + MAN_MANIP = CUInt(2 ^ 1) ' 2 + AUTO_MANIP = CUInt(2 ^ 2) ' 4 + MAN_PHOTO = CUInt(2 ^ 3) ' 8 + AUTO_PHOTO = CUInt(2 ^ 4) ' 16 + CSV_AUTO = CUInt(2 ^ 5) ' 32 + ENABLE_MILL = CUInt(2 ^ 6) ' 64 + PRODUCTION_LINE = CUInt(2 ^ 7) ' 128 + OFFICE_BASE = CUInt(2 ^ 8) ' 256 - Prodotto OmagOFFICE + VM_MULTI = CUInt(2 ^ 9) ' 512 + UNDER_CUT = CUInt(2 ^ 10) ' 1024 + CSV_SIMPLE = CUInt(2 ^ 11) ' 2048 + PHOTO_BASE = CUInt(2 ^ 12) ' 4096 - Prodotto OmagPHOTO + TRF_IMPORT = CUInt(2 ^ 13) ' 8192 + MOVE_PARTS = CUInt(2 ^ 14) ' 16384 + IMPORT_SLABDXF = CUInt(2 ^ 15) ' 32768 + CURVED_FRAME = CUInt(2 ^ 16) ' 65536 + ENABLE_WJ = CUInt(2 ^ 17) ' 131072 + ENABLE_POLISHING = CUInt(2 ^ 18) ' 262144 + OFFICE_TYPE = CUInt(2 ^ 19) ' 524288 - Solo per OmagCUT + REGISTRATION = CUInt(2 ^ 20) ' 1048576 - Solo per OmagCUT End Enum ' File di log generale diff --git a/DxfImportWindow/DxfImportWindowVM.vb b/DxfImportWindow/DxfImportWindowVM.vb index 498a26a..1380f33 100644 --- a/DxfImportWindow/DxfImportWindowVM.vb +++ b/DxfImportWindow/DxfImportWindowVM.vb @@ -310,7 +310,7 @@ Public Class DxfImportWindowVM Private m_PartNum As Integer = 1 Public Property PartNum As String Get - Return m_PartNum + Return m_PartNum.ToString() End Get Set(value As String) Dim TempPartNum As Integer = 0 diff --git a/EgtStoneLib/CurrentMachine.vb b/EgtStoneLib/CurrentMachine.vb index 83220f6..fedab4a 100644 --- a/EgtStoneLib/CurrentMachine.vb +++ b/EgtStoneLib/CurrentMachine.vb @@ -358,11 +358,11 @@ Public Module CurrentMachine End Set End Property - Public Property bOneHoleInCorner As Double + Public Property bOneHoleInCorner As Boolean Get Return m_bOneHoleInCorner End Get - Set(value As Double) + Set(value As Boolean) WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, If(value, "1", "0"), sMachIniFile) m_bOneHoleInCorner = value End Set @@ -786,7 +786,7 @@ Public Module CurrentMachine End Set End Property - Friend ReadOnly Property WaterJettingActive As Double + Friend ReadOnly Property WaterJettingActive As Boolean Get Return m_bWaterJetting AndAlso Not String.IsNullOrWhiteSpace( m_sCurrWaterJetting) End Get diff --git a/EgtStoneLib/EstCalc.vb b/EgtStoneLib/EstCalc.vb index 2524b95..2122c1c 100644 --- a/EgtStoneLib/EstCalc.vb +++ b/EgtStoneLib/EstCalc.vb @@ -365,7 +365,7 @@ Module EstCalc Dim sList As String = String.Empty If Not EgtGetInfo(nId, "!LST", sList) Then Return GDB_ID.NULL Dim sItems() As String = sList.Split(",".ToCharArray) - If sItems.Count() = 0 Then Return True + If sItems.Count() = 0 Then Return GDB_ID.NULL For Each sLstId In sItems Dim nLstId As Integer = GDB_ID.NULL StringToInt(sLstId, nLstId) @@ -465,7 +465,7 @@ Module EstCalc Dim colText As New Color3d() Dim sTextColor As String = " " If GetMainPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor) <> 0 Then - Dim sTextColorArray() As String = sTextColor.Split(",") + Dim sTextColorArray() As String = sTextColor.Split(","c) Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed) Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen) Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue) diff --git a/EgtStoneLib/EstPhoto.vb b/EgtStoneLib/EstPhoto.vb index dcbd948..45be6ae 100644 --- a/EgtStoneLib/EstPhoto.vb +++ b/EgtStoneLib/EstPhoto.vb @@ -177,7 +177,7 @@ Module EstPhoto End If If nErr <> 0 Then EgtOutLog("Error in ReadContour : " & nErr.ToString()) - Return False + Return GDB_ID.NULL End If ' Leggo i risultati Dim nPartId As Integer = GDB_ID.NULL diff --git a/EgtStoneLib/VacuumCups.vb b/EgtStoneLib/VacuumCups.vb index 04d5fe3..f8163cd 100644 --- a/EgtStoneLib/VacuumCups.vb +++ b/EgtStoneLib/VacuumCups.vb @@ -404,7 +404,7 @@ Module VacuumCups If Math.Abs( dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1 Dim dDiffQ = Math.Abs( Q - dRotRefDeg) If Math.Abs( dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1 - Return ( dDiffP - dDiffQ) + Return CInt( dDiffP - dDiffQ) End Function) ' Annullo la rotazione di allineamento dRotAngDeg = 0 diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb index 4d3e7f4..fde9711 100644 --- a/MainWindow/MainWindowM.vb +++ b/MainWindow/MainWindowM.vb @@ -3,7 +3,7 @@ Imports System.Math Imports System.IO Imports EgtUILib Imports EgtWPFLib5 -Imports EgtSTONELib +Imports EgtPHOTOLib Public Class MainWindowM @@ -58,7 +58,7 @@ Public Class MainWindowM End Property Private m_nKeyOptions As UInteger = 0 - Friend ReadOnly Property nKeyOptions As Integer + Friend ReadOnly Property nKeyOptions As UInteger Get Return m_nKeyOptions End Get @@ -265,12 +265,12 @@ Public Class MainWindowM End If ' Info su opzioni chiave EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString() & " " & bProd.ToString()) - EgtSTONELib.MainData.SetConfigDir(m_sConfigDir) - EgtSTONELib.MainData.SetKeyLevel(m_nKeyLevel) - EgtSTONELib.MainData.SetKeyOptions(m_nKeyOptions) - EgtSTONELib.MainData.SetPhotoDir(m_sPhotoDir) - EgtSTONELib.MainData.SetBackUpDir(m_sBackUpDir) - EgtSTONELib.MainData.SetIsOmagOFFICE(True) + EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir) + EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel) + EgtPHOTOLib.MainData.SetKeyOptions( CInt( m_nKeyOptions)) + EgtPHOTOLib.MainData.SetPhotoDir(m_sPhotoDir) + EgtPHOTOLib.MainData.SetBackUpDir(m_sBackUpDir) + EgtPHOTOLib.MainData.SetIsOmagOFFICE(True) End Sub Private Sub ManageInstance() diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb index d71b140..037873c 100644 --- a/MainWindow/MainWindowVM.vb +++ b/MainWindow/MainWindowVM.vb @@ -1,6 +1,6 @@ Imports EgtUILib Imports EgtWPFLib5 -Imports EgtSTONELib +Imports EgtPHOTOLib Imports System.IO Public Class MainWindowVM @@ -124,9 +124,9 @@ Public Class MainWindowVM ' recupero il nome del progetto corrente Dim sFileProject As String = String.Empty EgtGetCurrFilePath(sFileProject) - StoneMap.refOptionPanelVM.sProjectAssigned = sFileProject + PhotoMap.refOptionPanelVM.sProjectAssigned = sFileProject For Each OrigSlab In OmagOFFICEMap.refMachGroupPanelVM.SlabNameListOrig - StoneMap.refOptionPanelVM.SetAssignedSlab(OrigSlab) + PhotoMap.refOptionPanelVM.SetAssignedSlab(OrigSlab) Next End If ProjectSaved = True @@ -186,14 +186,14 @@ Public Class MainWindowVM If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB AndAlso Not ProjectSaved Then For Each CurrSlab In OmagOFFICEMap.refMachGroupPanelVM.SlabNameListCurr - StoneMap.refOptionPanelVM.SetAvailableSlab(CurrSlab) + PhotoMap.refOptionPanelVM.SetAvailableSlab(CurrSlab) Next ' recupero il nome del progetto corrente Dim sFileProject As String = String.Empty EgtGetCurrFilePath(sFileProject) - StoneMap.refOptionPanelVM.sProjectAssigned = sFileProject + PhotoMap.refOptionPanelVM.sProjectAssigned = sFileProject For Each OrigSlab In OmagOFFICEMap.refMachGroupPanelVM.SlabNameListOrig - StoneMap.refOptionPanelVM.SetAssignedSlab(OrigSlab) + PhotoMap.refOptionPanelVM.SetAssignedSlab(OrigSlab) Next End If diff --git a/MyMachGroupPanel/MyMachGroupPanelVM.vb b/MyMachGroupPanel/MyMachGroupPanelVM.vb index 085e87a..85a5b04 100644 --- a/MyMachGroupPanel/MyMachGroupPanelVM.vb +++ b/MyMachGroupPanel/MyMachGroupPanelVM.vb @@ -1,7 +1,7 @@ Imports System.Collections.ObjectModel Imports System.IO Imports EgtUILib -Imports EgtSTONELib +Imports EgtPHOTOLib Imports EgtWPFLib5 Public Class MyMachGroupPanelVM @@ -124,7 +124,7 @@ Public Class MyMachGroupPanelVM If Not String.IsNullOrEmpty(sDefaultSetUpName) Then If Not EgtImportSetup(sDefaultSetUpName) Then EgtOutLog("Error loading default setup " & sDefaultSetUpName) - MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, MessageBoxButton.OK, MessageBoxImage.Exclamation) + MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Exclamation) End If End If ' Aggiungo eventuale sovratavola @@ -272,7 +272,7 @@ Public Class MyMachGroupPanelVM Dim sSlabName As String = GetSlabName() ' rendo AVAILABLE la lastra nel DB dell'OMAGPhoto If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then - StoneMap.refOptionPanelVM.SetAvailableSlab(sSlabName) + PhotoMap.refOptionPanelVM.SetAvailableSlab(sSlabName) For Each ItemSlab In m_SlabNameListCurr If ItemSlab = sSlabName Then m_SlabNameListCurr.Remove(ItemSlab) diff --git a/OmagOFFICE.vbproj b/OmagOFFICE.vbproj index 28ad817..eafd0a8 100644 --- a/OmagOFFICE.vbproj +++ b/OmagOFFICE.vbproj @@ -110,9 +110,8 @@ Resources\OmagOFFICE.ico - - False - ..\..\EgtProg\DllD32\EgtSTONELib.dll + + ..\..\EgtProg\Dll32\EgtPHOTOLib.dll ..\..\EgtProg\DllD32\EgtUILib.dll diff --git a/OptionPanel/NestingTab/NestingTabVM.vb b/OptionPanel/NestingTab/NestingTabVM.vb index 04f1ded..edcd482 100644 --- a/OptionPanel/NestingTab/NestingTabVM.vb +++ b/OptionPanel/NestingTab/NestingTabVM.vb @@ -324,7 +324,7 @@ Public Class NestingTabVM Dim bGuillotineMode As Boolean = bAligned Dim nAutomaticMaxTime As Integer = GetMainPrivateProfileInt( S_NEST, K_AUTOMATICMAXTIME, 20) Dim dPartTime As Double = If( bGuillotineMode, 1.0, 0.5) - Dim nMaxTime As Integer = Math.Min( 2 + dPartTime * vParts.Count(), nAutomaticMaxTime) + Dim nMaxTime As Integer = Math.Min( CInt( 2 + dPartTime * vParts.Count()), nAutomaticMaxTime) EgtAutomaticPackParts( vParts, bOpimizeOnX, CurrentMachine.bReducedCut, bGuillotineMode, nMaxTime) ' Sistemo i pezzi For Each nPartId As Integer In vParts diff --git a/OptionPanel/RawPartTab/OmagPhotoV.xaml b/OptionPanel/RawPartTab/OmagPhotoV.xaml index 035ea8e..05b9fab 100644 --- a/OptionPanel/RawPartTab/OmagPhotoV.xaml +++ b/OptionPanel/RawPartTab/OmagPhotoV.xaml @@ -4,10 +4,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtSTONELib="clr-namespace:EgtSTONELib;assembly=EgtSTONELib" + xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> - + diff --git a/OptionPanel/RawPartTab/RawPartTabV.xaml b/OptionPanel/RawPartTab/RawPartTabV.xaml index a2993f6..96fd8a7 100644 --- a/OptionPanel/RawPartTab/RawPartTabV.xaml +++ b/OptionPanel/RawPartTab/RawPartTabV.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtWpfLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtSTONELib="clr-namespace:EgtSTONELib;assembly=EgtSTONELib" + xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib" Margin="5,5,5,0"> - + diff --git a/OptionPanel/RawPartTab/RawPartTabVM.vb b/OptionPanel/RawPartTab/RawPartTabVM.vb index c78af42..b71b4e1 100644 --- a/OptionPanel/RawPartTab/RawPartTabVM.vb +++ b/OptionPanel/RawPartTab/RawPartTabVM.vb @@ -1,13 +1,13 @@ Imports System.IO Imports System.Collections.ObjectModel Imports EgtWPFLib5 -Imports EgtSTONELib +Imports EgtPHOTOLib Imports EgtUILib Public Class RawPartTabVM Inherits VMBase - Friend OmgaPhotoV As OmagPhotoV + Friend OmagPhoto As OmagPhotoV Private m_bSlabIsSelectedFromDB As Boolean = False #Region "FIELDS & PROPERTIES" @@ -817,7 +817,7 @@ Public Class RawPartTabVM ' Creo riferimento a questa classe in OmagOFFICEMap OmagOFFICEMap.SetRefRawPartTabVM(Me) If OmagOFFICEMap.refMainWindowVM.MainWindowM.m_SlabDB Then - Me.OmgaPhotoV = New OmagPhotoV + Me.OmagPhoto = New OmagPhotoV End If ' Aggiungo voci alla lista di tipi di definizione grezzo m_TypeList.Add(EgtMsg(MSG_RAWPARTPAGEUC + 1)) @@ -835,7 +835,7 @@ Public Class RawPartTabVM SlabIdVisibility = If( bSlabId, Windows.Visibility.Visible, Windows.Visibility.Hidden) ' Se disponibile, imposto possibilità di contorno da foto If EstPhoto.GetContour() = GDB_ID.NULL Then - If m_TypeList.Count = 3 Then m_TypeList.Remove(2) + If m_TypeList.Count = 3 Then m_TypeList.RemoveAt(2) Else If m_TypeList.Count = 2 Then m_TypeList.Add(EgtMsg(MSG_RAWPARTPAGEUC + 35)) End If @@ -1727,7 +1727,7 @@ Public Class RawPartTabVM Public Sub ClosePhotoWnd() m_bSlabIsSelectedFromDB = True - OmgaPhotoV.Close() + OmagPhoto.Close() End Sub Public Sub Photo(ByVal param As Object) @@ -1758,30 +1758,30 @@ Public Class RawPartTabVM EgtSetCurrentContext(MainData.ContextSTONELib) End If ' imposto come prima pagina sempre la lista, altrimenti compare l'ultima selezione - StoneMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST + PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.LIST ' assegno il nome della lastra corrente, se eseguo una nuova selezione la rendo AVAILABLE - StoneMap.refOptionPanelVM.sSlabId = sSlabNameDB - StoneMap.refOptionPanelVM.sProjectAssigned = sFileProject + PhotoMap.refOptionPanelVM.sSlabId = sSlabNameDB + PhotoMap.refOptionPanelVM.sProjectAssigned = sFileProject ' imposto la ricerca attiva - StoneMap.refSearchPanelVM.SetSearchPanel_Visibility(True) - StoneMap.refSearchPanelVM.InitSearchPanel() + PhotoMap.refSearchPanelVM.SetSearchPanel_Visibility(True) + PhotoMap.refSearchPanelVM.InitSearchPanel() ' inserisco in elenco solo i materiali della macchina corrente - AddHandler StoneMap.refOptionPanelVM.SlabIsSelectedOFFICE, AddressOf OmagOFFICEMap.refRawPartTabVM.ClosePhotoWnd - Me.OmgaPhotoV = New OmagPhotoV - Me.OmgaPhotoV.ShowDialog() + AddHandler PhotoMap.refOptionPanelVM.SlabIsSelectedOFFICE, AddressOf OmagOFFICEMap.refRawPartTabVM.ClosePhotoWnd + Me.OmagPhoto = New OmagPhotoV + Me.OmagPhoto.ShowDialog() - EgtSetCurrentContext(EgtSTONELib.MainData.PreviousContext) + EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext) EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx()) ' se non seleziono nessun lastra esco If Not m_bSlabIsSelectedFromDB Then Return m_bSlabIsSelectedFromDB = False - Dim LocalSlab As Slab = EgtSTONELib.StoneMap.refOptionPanelVM.SelSlab + Dim LocalSlab As Slab = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab ' rimuovo la precedente lastra dalla lista OmagOFFICEMap.refMachGroupPanelVM.SlabNameListCurr.Remove(sSlabNameDB) - EgtSTONELib.StoneMap.refOptionPanelVM.SetAvailableSlab(sSlabNameDB) + EgtPHOTOLib.PhotoMap.refOptionPanelVM.SetAvailableSlab(sSlabNameDB) sPhoto = LocalSlab.ImagePath sSlabNameDB = LocalSlab.Id ' imposto lo spessore della lastra @@ -1804,7 +1804,7 @@ Public Class RawPartTabVM End If ' aggiungo la nuova lastra OmagOFFICEMap.refMachGroupPanelVM.SlabNameListCurr.Add(sSlabNameDB) - EgtSTONELib.StoneMap.refOptionPanelVM.SetAssignedSlab(sSlabNameDB) + EgtPHOTOLib.PhotoMap.refOptionPanelVM.SetAssignedSlab(sSlabNameDB) Else ' Apro dialogo per scelta immagine Dim PhotoDlg As New Microsoft.Win32.OpenFileDialog() @@ -1863,7 +1863,7 @@ Public Class RawPartTabVM Dim nCntId As Integer = EstPhoto.GetContour() ' Se disponibile, imposto possibilità di contorno da foto If nCntId = GDB_ID.NULL Then - If m_TypeList.Count = 3 Then m_TypeList.Remove(2) + If m_TypeList.Count = 3 Then m_TypeList.RemoveAt(2) Else If m_TypeList.Count = 2 Then m_TypeList.Add(EgtMsg(MSG_RAWPARTPAGEUC + 35)) SelType = Type.FROM_PHOTO diff --git a/OptionWindow/OptionWindowVM.vb b/OptionWindow/OptionWindowVM.vb index 930b9b9..4efda5d 100644 --- a/OptionWindow/OptionWindowVM.vb +++ b/OptionWindow/OptionWindowVM.vb @@ -104,7 +104,10 @@ Public Class OptionWindowVM Private Property m_TextColorBackground As Color3d Public ReadOnly Property TextColorBackground As Brush Get - Dim x = New SolidColorBrush(Color.FromArgb(m_TextColorBackground.A / 100 * 255, m_TextColorBackground.R, m_TextColorBackground.G, m_TextColorBackground.B)) + Dim x = New SolidColorBrush( Color.FromArgb( CByte( m_TextColorBackground.A / 100 * 255), + CByte( m_TextColorBackground.R), + CByte( m_TextColorBackground.G), + CByte( m_TextColorBackground.B))) Return x End Get 'Set(value As Brush) @@ -234,9 +237,15 @@ Public Class OptionWindowVM ' I parametri di TextColor presenti nell'INI vengono caricati Dim sTextColor As String = " " If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, m_sIniFile) <> 0 Then - Dim sTextColorArray() As String = sTextColor.Split(",") - ' TextColorBackground = New SolidColorBrush(Color.FromRgb(sTextColorArray(0), sTextColorArray(1), sTextColorArray(2))) - m_TextColorBackground = New Color3d(sTextColorArray(0), sTextColorArray(1), sTextColorArray(2)) + Dim sTextColorArray() As String = sTextColor.Split(","c) + If sTextColorArray.Count() >= 3 Then + Dim nRed As Integer = 0 : StringToInt( sTextColorArray(0), nRed) + Dim nGreen As Integer = 0 : StringToInt( sTextColorArray(1), nGreen) + Dim nBlue As Integer = 0 : StringToInt( sTextColorArray(2), nBlue) + m_TextColorBackground = New Color3d( nRed, nGreen, nBlue) + Else + m_TextColorBackground = New Color3d( 0, 0, 0) + End If End If ' Leggo se la modalità ColorToSideAng è abilitata @@ -249,7 +258,7 @@ Public Class OptionWindowVM ' I parametri di ColorSideToAng presenti nell'INI vengono caricati a prescindere dall'abilitazione Dim nVal As Integer nVal = GetPrivateProfileInt(S_COLORTOSIDEANG, K_CTSA_TOLERANCE, nVal, m_sIniFile) - m_sToleranceTxBx = nVal + m_sToleranceTxBx = nVal.ToString() ' Nel caso dei colori singoli viene verificata la presenza della Key corrispondente a ciascuno dei ' 10 singoli colori (CTSAindex) e il Valore associato viene splittato in un array di stringhe For index As Integer = 1 To 10 @@ -257,18 +266,24 @@ Public Class OptionWindowVM Dim sArray() As String If GetPrivateProfileString(S_COLORTOSIDEANG, K_CTSA & index, " ", sColor, m_sIniFile) <> 0 Then sArray = sColor.Split(","c) + Dim bIsActive As Boolean = If( sArray.Length >= 6, sArray(5).Equals("1"), True) + Dim nRed As Integer = 0 : StringToInt( If( sArray.Length >= 1, sArray(0), "0"), nRed) + Dim nGreen As Integer = 0 : StringToInt( If( sArray.Length >= 2, sArray(1), "0"), nGreen) + Dim nBlue As Integer = 0 : StringToInt( If( sArray.Length >= 3, sArray(2), "0"), nBlue) + Dim dSlant As Double = 0 : StringToDouble( If( sArray.Length >= 4, sArray(3), "0"), dSlant) + Dim dHeel As Double = 0 : StringToDouble( If( sArray.Length >= 5, sArray(4), "0"), dHeel) ' Leggo elenco colori disponibili da file ini Dim ReadColor As ColorLsBxItem = New ColorLsBxItem(index, - If(sArray.Length > 5, sArray(5).Equals("1"), True), - New Color3d(sArray(0), sArray(1), sArray(2), 100), - sArray(3), - sArray(4)) + bIsActive, + New Color3d(nRed, nGreen, nBlue, 100), + dSlant, + dHeel) m_ColorItemList.Add(ReadColor) Else ' Se CTSA di indice index non esiste nell'INI lo scrivo con dei valori di default e aggiungo ReadColor ' creato con i valori di default e indice index alla lista di colori WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA & index, "255,255,255,0,0,0", m_sIniFile) - Dim ReadColor As ColorLsBxItem = New ColorLsBxItem(index, 0, New Color3d(255, 255, 255, 100), 0, 0) + Dim ReadColor As ColorLsBxItem = New ColorLsBxItem(index, False, New Color3d(255, 255, 255, 100), 0, 0) m_ColorItemList.Add(ReadColor) End If Next @@ -343,9 +358,9 @@ Public Class OptionWindowVM If value <> m_CTSAChecked Then m_CTSAChecked = value If CTSAChecked = True Then - WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA_ENABLE, 1, m_sIniFile) + WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA_ENABLE, "1", m_sIniFile) ElseIf CTSAChecked = False Then - WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA_ENABLE, 0, m_sIniFile) + WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA_ENABLE, "0", m_sIniFile) End If End If End Set @@ -407,7 +422,7 @@ Public Class OptionWindowVM Set(value As Boolean) If value <> m_CTSAiChecked Then m_CTSAiChecked = value - CTSAiWriteString(value) + CTSAiWriteString() End If End Set End Property @@ -415,7 +430,10 @@ Public Class OptionWindowVM Private Property m_CTSAiBackground As Color3d Public ReadOnly Property CTSAiBackground As Brush Get - Dim x = New SolidColorBrush(Color.FromArgb(m_CTSAiBackground.A / 100 * 255, m_CTSAiBackground.R, m_CTSAiBackground.G, m_CTSAiBackground.B)) + Dim x = New SolidColorBrush( Color.FromArgb( CByte( m_CTSAiBackground.A / 100 * 255), + CByte( m_CTSAiBackground.R), + CByte( m_CTSAiBackground.G), + CByte( m_CTSAiBackground.B))) Return x End Get End Property @@ -427,16 +445,13 @@ Public Class OptionWindowVM End Get Set(value As String) If value <> m_sCTSAiInclinazioneText Then - m_sCTSAiInclinazioneText = value - Dim i As Integer = 0 - Try - If (m_sCTSAiInclinazioneText <> "-") Then - i = Integer.Parse(m_sCTSAiInclinazioneText, Globalization.NumberStyles.Any) - End If - Catch ex As Exception + Dim dVal As Double + If StringToDouble( value, dVal) Then + m_sCTSAiInclinazioneText = value + CTSAiWriteString() + else m_sCTSAiInclinazioneText = "" - End Try - CTSAiWriteString(value) + End If End If End Set End Property @@ -448,16 +463,13 @@ Public Class OptionWindowVM End Get Set(value As String) If value <> m_sCTSAiTalloneText Then - m_sCTSAiTalloneText = value - Dim i As Integer = 0 - Try - If (m_sCTSAiTalloneText <> "-") Then - i = Integer.Parse(m_sCTSAiTalloneText, Globalization.NumberStyles.Any) - End If - Catch ex As Exception + Dim dVal As Double + If StringToLen( value, dVal) Then + m_sCTSAiTalloneText = value + CTSAiWriteString() + else m_sCTSAiTalloneText = "" - End Try - CTSAiWriteString(value) + End If End If End Set End Property @@ -469,12 +481,12 @@ Public Class OptionWindowVM #Region "CONSTRUCTOR" - Sub New(Index As Integer, IsActive As Boolean, Color As Color3d, Inclinazione As Integer, Tallone As Integer) + Sub New(Index As Integer, IsActive As Boolean, Color As Color3d, Inclinazione As Double, Tallone As Double) Me.m_nCTSAIndex = Index Me.m_CTSAiChecked = IsActive Me.m_CTSAiBackground = Color - Me.m_sCTSAiInclinazioneText = Inclinazione - Me.m_sCTSAiTalloneText = Tallone + Me.m_sCTSAiInclinazioneText = DoubleToString( Inclinazione, 3) + Me.m_sCTSAiTalloneText = LenToString( Tallone, 3) End Sub #End Region ' CONSTRUCTOR @@ -493,29 +505,18 @@ Public Class OptionWindowVM End Property Public Sub ChangeCTSAiColor(ByVal param As Object) - ' Recupero colore da Ini - Dim NewCol As New Color3d(192, 192, 192, 100) ' Creo dialogo colori Dim ColorDlg As New System.Windows.Forms.ColorDialog ColorDlg.FullOpen = True ColorDlg.Color = m_CTSAiBackground.ToColor() ' Visualizzo dialogo If ColorDlg.ShowDialog() <> DialogResult.OK Then Return + ' Se ok, aggiorno + Dim NewCol As New Color3d(192, 192, 192, 100) NewCol.FromColor(ColorDlg.Color) - Dim Rvalue As String = NewCol.R - Dim Gvalue As String = NewCol.G - Dim Bvalue As String = NewCol.B - ' Costruisco la string RgbCTSA che corrisponderà al valore da scrivere nell'INI; - ' in caso di valore null o " " verrà scritto nella stringa il valore 0 (o 1 nel caso dell'Enable) - Dim RgbCTSA As String = If(String.IsNullOrWhiteSpace(Rvalue), "0", Rvalue) & "," & - If(String.IsNullOrWhiteSpace(Gvalue), "0", Gvalue) & "," & - If(String.IsNullOrWhiteSpace(Bvalue), "0", Bvalue) & "," & - If(String.IsNullOrWhiteSpace(sCTSAiInclinazioneText), "0", sCTSAiInclinazioneText) & "," & - If(String.IsNullOrWhiteSpace(sCTSAiTalloneText), "0", sCTSAiTalloneText) & "," & - If(CTSAiChecked, "1", "0") - WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA & nCTSAIndex, RgbCTSA, m_sIniFile) ' Imposto il colore scelto sul pulsante m_CTSAiBackground = NewCol + CTSAiWriteString() NotifyPropertyChanged("CTSAiBackground") End Sub @@ -525,19 +526,20 @@ Public Class OptionWindowVM #Region "METHODS" - Private Sub CTSAiWriteString(ByVal param As Object) - Dim Rvalue As String = m_CTSAiBackground.R - Dim Gvalue As String = m_CTSAiBackground.G - Dim Bvalue As String = m_CTSAiBackground.B - ' Costruisco la string RgbCTSA che corrisponderà al valore da scrivere nell'INI; - ' in caso di valore null o " " verrà scritto nella stringa il valore 0 (o 1 nel caso dell'Enable) - Dim RgbCTSA As String = If(String.IsNullOrWhiteSpace(Rvalue), "0", Rvalue) & "," & - If(String.IsNullOrWhiteSpace(Gvalue), "0", Gvalue) & "," & - If(String.IsNullOrWhiteSpace(Bvalue), "0", Bvalue) & "," & - If(String.IsNullOrWhiteSpace(sCTSAiInclinazioneText), "0", sCTSAiInclinazioneText) & "," & - If(String.IsNullOrWhiteSpace(sCTSAiTalloneText) OrElse sCTSAiTalloneText.Equals("-"), "0", sCTSAiTalloneText) & "," & - If(CTSAiChecked, "1", "0") - WritePrivateProfileString(S_COLORTOSIDEANG, K_CTSA & nCTSAIndex, RgbCTSA, m_sIniFile) + Private Sub CTSAiWriteString() + ' Sistemo i parametri double + Dim dSlant As Double = 0 : StringToDouble( sCTSAiInclinazioneText, dSlant) + Dim sSlant As String = DoubleToString( dSlant, 3) + Dim dHeel As Double = 0 : StringToLen( sCTSAiTalloneText, dHeel) + Dim sHeel As String = DoubleToString( dHeel, 3) + ' Costruisco la stringa da mettere nell'INI + Dim sData As String = m_CTSAiBackground.R.ToString() & "," & + m_CTSAiBackground.G.ToString() & "," & + m_CTSAiBackground.B.ToString() & "," & + sSlant & "," & + sHeel & "," & + If( CTSAiChecked, "1", "0") + WritePrivateProfileString( S_COLORTOSIDEANG, K_CTSA & nCTSAIndex.ToString(), sData, m_sIniFile) End Sub #End Region diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb index e4c9022..babd3e8 100644 --- a/SideEntityControl/SideEntityControlVM.vb +++ b/SideEntityControl/SideEntityControlVM.vb @@ -287,7 +287,7 @@ Public Class SideEntityControlVM ' Aggiorno valori If m_Mode = ModeOpt.SIDEANGLE Then Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo - Dim dVal As Double = GetMainPrivateProfileDouble(S_SIDES, K_SIDEANGLE, "45") + Dim dVal As Double = GetMainPrivateProfileDouble(S_SIDES, K_SIDEANGLE, 45) SetParameter1(dVal) Else Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset @@ -789,7 +789,7 @@ Public Class SideEntityControlVM ' Aggiorno valori If m_Mode = ModeOpt.SIDEANGLE Then Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo - Dim dVal As Double = GetMainPrivateProfileDouble(S_SIDES, K_SIDEANGLE, "45") + Dim dVal As Double = GetMainPrivateProfileDouble(S_SIDES, K_SIDEANGLE, 45) SetParameter1(dVal) Else Parameter1Msg = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset @@ -1276,7 +1276,7 @@ End Class Friend Class DripEntity Inherits SideEntity - Friend Shared m_ModifyDrip As Action(Of String, Double) + Friend Shared m_ModifyDrip As Action(Of String, Boolean) Friend Shared m_RefreshSideAngleText As Action Private m_bHaveDrip As Boolean diff --git a/TopCommandBar/TopCommandBarVM.vb b/TopCommandBar/TopCommandBarVM.vb index 45fd075..553bd0b 100644 --- a/TopCommandBar/TopCommandBarVM.vb +++ b/TopCommandBar/TopCommandBarVM.vb @@ -2,7 +2,7 @@ Imports System.IO Imports EgtUILib Imports EgtWPFLib5 -Imports EgtSTONELib +Imports EgtPHOTOLib Public Class TopCommandBarVM Inherits VMBase diff --git a/Utility/OmagOFFICEDictionary.xaml b/Utility/OmagOFFICEDictionary.xaml index f59611f..9f9ad0b 100644 --- a/Utility/OmagOFFICEDictionary.xaml +++ b/Utility/OmagOFFICEDictionary.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:OmagOFFICE="clr-namespace:OmagOFFICE" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" - xmlns:EgtSTONELib="clr-namespace:EgtSTONELib;assembly=EgtSTONELib" + xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"> diff --git a/Utility/OmagOFFICEMap.vb b/Utility/OmagOFFICEMap.vb index 6ca4b0b..aa005ac 100644 --- a/Utility/OmagOFFICEMap.vb +++ b/Utility/OmagOFFICEMap.vb @@ -1,5 +1,5 @@ Imports EgtWPFLib5 -Imports EgtSTONELib +Imports EgtPHOTOLib Module OmagOFFICEMap @@ -123,31 +123,31 @@ Module OmagOFFICEMap 'Public ReadOnly Property refProjectVM As ProjectLibVM ' Get - ' Return StoneMap.refProjectVM + ' Return PhotoMap.refProjectVM ' End Get 'End Property 'Public ReadOnly Property refOptionPanelVM As OptionPanelLibVM ' Get - ' Return StoneMap.refOptionPanelVM + ' Return PhotoMap.refOptionPanelVM ' End Get 'End Property Public ReadOnly Property refListPageVM As ListPageSlabVM Get - Return StoneMap.refListPageVM + Return PhotoMap.refListPageVM End Get End Property Public ReadOnly Property refDetailPageVM As DetailPageSlabVM Get - Return StoneMap.refDetailPageVM + Return PhotoMap.refDetailPageVM End Get End Property Public ReadOnly Property refSearchPanelVM As SearchPanelSlabVM Get - Return StoneMap.refSearchPanelVM + Return PhotoMap.refSearchPanelVM End Get End Property @@ -248,7 +248,7 @@ Module OmagOFFICEMap Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso Not IsNothing(m_refMachiningTabVM) AndAlso - LibMap.EndInit() AndAlso StoneMap.ContninueApplication + LibMap.EndInit() AndAlso PhotoMap.ContninueApplication End Function #End Region ' Init