Compare commits

...

15 Commits

Author SHA1 Message Date
Samuele Locatelli a464c989c3 Merge branch 'DataLayer' into develop 2024-01-18 16:35:59 +01:00
Samuele Locatelli 559206cd70 Fix migrazioni e naming 2024-01-18 16:35:04 +01:00
Samuele Locatelli 819928805f Fix model names 2024-01-18 16:24:38 +01:00
Samuele Locatelli 24300e8805 Aggiunta migration x Alias 2024-01-18 15:31:30 +01:00
Samuele Locatelli 5896862614 Aggiunta migrazione 2024-01-18 13:08:33 +01:00
Samuele Locatelli 70078533d2 Modifiche modelli x creazione migrations 2024-01-18 13:07:08 +01:00
Samuele Locatelli 07b7ad6ee3 Aggiunta datamodel x Materiali e grezzi (barre, pareti) 2024-01-18 12:45:35 +01:00
Samuele Locatelli fc1ce2ce53 Merge branch 'develop' into DataLayer 2024-01-18 12:15:47 +01:00
Dario Sassi 958421f4f5 EgtBeamWall :
- aggiornate dll da cui dipende.
2024-01-17 17:19:08 +01:00
Demetrio Cassarino ef59f66c67 -correzione dulo ghost
-correzione deleteduplo
2023-12-21 08:48:39 +01:00
Dario Sassi 14bf36ed68 EgtBEAMWALL :
- aggiornamento EgtUILib e EgtWPFLib5
- piccola miglioria per SpecialPanel
- correzione calcolo numero pezzi inseriti in barre grazie a nuova funzione EgtDuploInRawCount.
2023-12-14 20:31:52 +01:00
Dario Sassi 06bac914ef Merge commit '625f12a1e8df19e094d02b068f3bb988602a7c04' 2023-12-14 12:52:12 +01:00
Dario Sassi 1b956580c9 EgtBEAMWALL 2.5l2 :
- ricompilazione con aggiornamento versione.
2023-12-14 12:51:47 +01:00
Demetrio Cassarino 625f12a1e8 - creato nuovo pulsante dump per la visualizzazione file lua 2023-12-14 11:11:50 +01:00
Emmanuele Sassi 84dffd8966 - aggiunta gestione modi controllo in caso di nuovo controllo
- aggiunto refresh sort su lista supervisore
2023-11-08 09:27:21 +01:00
38 changed files with 824 additions and 25 deletions
+1 -1
View File
@@ -587,7 +587,7 @@ Public Class BTLPartM
Public ReadOnly Property nINPROD As Integer
Get
Dim INPROD As Integer = 0
EgtDuploCount(m_nPartId, INPROD)
EgtDuploInRawCount(m_nPartId, INPROD)
Return INPROD
End Get
End Property
+3
View File
@@ -168,4 +168,7 @@ Public Module ConstIni
Public Const K_EXTERNALFILEPATH As String = "ExternalFilePath"
Public Const K_REMINDERFREQUENCY As String = "ReminderFrequency"
Public Const S_SPECIAL As String = "Special"
Public Const K_SPECIALENABLE As String = "SpecialEnable"
End Module
+2 -2
View File
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
+1 -1
View File
@@ -13,7 +13,7 @@
</providers>
</entityFramework>
<connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=steamware_password;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+15
View File
@@ -80,6 +80,21 @@ namespace EgtBEAMWALL.DataLayer
/// </summary>
public DbSet<StatusMapModel> StatusMapList { get; set; }
/// <summary>
/// Wharehouse materials management
/// </summary>
public DbSet<MaterialModel> MaterialsList { get; set; }
/// <summary>
/// Wharehouse items management
/// </summary>
public DbSet<RawItemModel> RawItemList { get; set; }
/// <summary>
/// Alias management
/// </summary>
public DbSet<AliasModel> AliasList { get; set; }
#endregion Public Properties
#region Public Methods
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("AliasList")]
public class AliasModel
{
/// <summary>
/// Famiglia di sinonimi
/// </summary>
[Column("Family", Order = 1), Key]
public string Family { get; set; } = "";
/// <summary>
/// Codice originale (da trasformare)
/// </summary>
[Column("ValueOriginal", Order = 2), Key]
public string ValueOriginal { get; set; } = "";
/// <summary>
/// Codice Alias <inheritdoccui viene convertito/>
/// </summary>
public string ValueAlias { get; set; } = "";
}
}
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
[Table("MaterialsList")]
public partial class MaterialModel
{
/// <summary>
/// Init classe
/// </summary>
public MaterialModel()
{
RawItemList = new HashSet<RawItemModel>();
}
/// <summary>
/// Primary Key AUTO
/// </summary>
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int MatId { get; set; }
/// <summary>
/// Codice materiale (Identificativo esterno del magazzino in sync)
/// </summary>
public int MatExtId { get; set; } = 0;
/// <summary>
/// Codice Materiale
/// </summary>
public string MatCode { get; set; } = "";
/// <summary>
/// Descrizione Materiale
/// </summary>
public string MatDesc { get; set; } = "";
/// <summary>
/// Lenght/Lunghezza in mm
/// </summary>
public decimal LMm { get; set; } = 0;
/// <summary>
/// Width/Larghezza in mm
/// </summary>
public decimal WMm { get; set; } = 0;
/// <summary>
/// Height (Thikness/Spessore) in mm
/// </summary>
public decimal HMm { get; set; } = 0;
/// <summary>
/// ID dell'ultimo articolo (variante) usato per il materiale
/// </summary>
public int RawItemIdLast { get; set; } = 0;
#if false
/// <summary>
/// Lenght/Lunghezza in inch
/// </summary>
[NotMapped]
public decimal LIn
{
get => Math.Round(LMm / (decimal)25.4, 3);
}
/// <summary>
/// Width/Larghezza in inch
/// </summary>
[NotMapped]
public decimal WIn
{
get => Math.Round(WMm / (decimal)25.4, 3);
}
/// <summary>
/// Height/Altezza (Thikness/Spessore) in inch
/// </summary>
[NotMapped]
public decimal HIn
{
get => Math.Round(HMm / (decimal)25.4, 3);
}
/// <summary>
/// Codice materiale x QR/Datamatrix
/// </summary>
[NotMapped]
public string MatDtmx
{
get => $"MT{MatExtId:00000000}";
}
#endif
public virtual ICollection<RawItemModel> RawItemList { get; set; }
}
}
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgtBEAMWALL.Core.ConstBeam;
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
//[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
[Table("RawItemList")]
public partial class RawItemModel
{
/// <summary>
/// Primary Key AUTO
/// </summary>
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int RawItemId { get; set; }
/// <summary>
/// ForeignKey Materiale
/// </summary>
public int MatId { get; set; } = 0;
/// <summary>
/// Qty available on wharehouse
/// </summary>
public int QtyAvail { get; set; } = 0;
/// <summary>
/// Check if is a Remnant
/// </summary>
public bool IsActive { get; set; } = false;
/// <summary>
/// Item's Lenght
/// </summary>
public decimal LMm { get; set; } = 0;
/// <summary>
/// Item's Width
/// </summary>
public decimal WMm { get; set; } = 0;
/// <summary>
/// Item's Height (Thikness/Spessore) in mm
/// </summary>
public decimal HMm { get; set; } = 0;
/// <summary>
/// Note (optional)
/// </summary>
public string Note { get; set; } = "";
#if false
[NotMapped]
public decimal LIn
{
get => Math.Round(LMm / (decimal)25.4, 3);
}
[NotMapped]
public decimal WIn
{
get => Math.Round(WMm / (decimal)25.4, 3);
}
[NotMapped]
public decimal HIn
{
get => Math.Round(HMm / (decimal)25.4, 3);
}
[NotMapped]
public decimal Area
{
get => LMm * WMm;
}
[NotMapped]
public string ItemDtmx
{
get
{
string answ = $"MT99999999-{LMm * 1000:00000000}";
if (MaterialNav != null)
{
answ = $"MT{MaterialNav.MatExtId:00000000}-{LMm * 1000:00000000}";
}
return answ;
}
}
#endif
/// <summary>
/// Navigation property to Material
/// </summary>
[ForeignKey("MatId")]
public virtual MaterialModel MaterialNav { get; set; }
}
}
+2 -2
View File
@@ -33,9 +33,9 @@ namespace EgtBEAMWALL.DataLayer
public static string ADMIN_CONNECTION_STRING { get; set; } = "";
/// <summary>
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;)
/// DB Connection string, per effettuare migration riportare valore connessione admin cablato (server=localhost;port=3306;database=EgtBwDb_000102;uid=root;pwd=Egalware_24068!;)
/// </summary>
public static string CONNECTION_STRING { get; set; } = "";
public static string CONNECTION_STRING { get; set; } = "server=localhost;port=3306;database=EgtBwDb_000470;uid=root;pwd=Egalware_24068!";
#endregion Public Properties
@@ -126,6 +126,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AdminContext.cs" />
<Compile Include="DatabaseModels\AliasModel.cs" />
<Compile Include="DatabaseModels\MaterialModel.cs" />
<Compile Include="DatabaseModels\RawItemModel.cs" />
<Compile Include="DatabaseModels\UserPrivModel.cs" />
<Compile Include="DbConfig.cs" />
<Compile Include="Controllers\LogMachineController.cs" />
@@ -187,6 +190,10 @@
<Compile Include="Migrations\202308250853396_AddProjArchivedField.designer.cs">
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.cs" />
<Compile Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.designer.cs">
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils.cs" />
@@ -235,6 +242,9 @@
<EmbeddedResource Include="Migrations\202308250853396_AddProjArchivedField.resx">
<DependentUpon>202308250853396_AddProjArchivedField.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202401181534084_AddAliasMaterialRawItemsModel.resx">
<DependentUpon>202401181534084_AddAliasMaterialRawItemsModel.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
@@ -0,0 +1,29 @@
// <auto-generated />
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.4.4")]
public sealed partial class AddAliasMaterialRawItemsModel : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddAliasMaterialRawItemsModel));
string IMigrationMetadata.Id
{
get { return "202401181534084_AddAliasMaterialRawItemsModel"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,63 @@
namespace EgtBEAMWALL.DataLayer.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddAliasMaterialRawItemsModel : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.AliasList",
c => new
{
Family = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueOriginal = c.String(nullable: false, maxLength: 128, storeType: "nvarchar"),
ValueAlias = c.String(unicode: false),
})
.PrimaryKey(t => new { t.Family, t.ValueOriginal });
CreateTable(
"dbo.MaterialsList",
c => new
{
MatId = c.Int(nullable: false, identity: true),
MatExtId = c.Int(nullable: false),
MatCode = c.String(unicode: false),
MatDesc = c.String(unicode: false),
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
RawItemIdLast = c.Int(nullable: false),
})
.PrimaryKey(t => t.MatId);
CreateTable(
"dbo.RawItemList",
c => new
{
RawItemId = c.Int(nullable: false, identity: true),
MatId = c.Int(nullable: false),
QtyAvail = c.Int(nullable: false),
IsActive = c.Boolean(nullable: false),
LMm = c.Decimal(nullable: false, precision: 18, scale: 2),
WMm = c.Decimal(nullable: false, precision: 18, scale: 2),
HMm = c.Decimal(nullable: false, precision: 18, scale: 2),
Note = c.String(unicode: false),
})
.PrimaryKey(t => t.RawItemId)
.ForeignKey("dbo.MaterialsList", t => t.MatId, cascadeDelete: true)
.Index(t => t.MatId);
}
public override void Down()
{
DropForeignKey("dbo.RawItemList", "MatId", "dbo.MaterialsList");
DropIndex("dbo.RawItemList", new[] { "MatId" });
DropTable("dbo.RawItemList");
DropTable("dbo.MaterialsList");
DropTable("dbo.AliasList");
}
}
}
File diff suppressed because one or more lines are too long
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.8.1")]
[assembly: AssemblyFileVersion("2.5.8.1")]
[assembly: AssemblyVersion("2.5.12.2")]
[assembly: AssemblyFileVersion("2.5.12.2")]
@@ -219,6 +219,7 @@ Friend Class MyComparer
Return 0
End If
End Select
Return 0
End Function
End Class
@@ -437,6 +437,10 @@ Public Class LeftPanelVM
New OPState("Reset", OPStates.End),
New OPState("Unspecified", OPStates.Unspecified)
}
Case Else
m_OPStateList = New List(Of OPState) From {
New OPState("Unspecified", OPStates.Unspecified)
}
End Select
' seleziono in partenza unspecified
Dim UnspecifiedState As OPState = m_OPStateList.FirstOrDefault(Function(x) x.Id = OPStates.Unspecified)
@@ -317,6 +317,7 @@ Public Class MyMachGroupVM
' segno pezzo da produrre
MachGroup.m_bToBeProduced = True
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
Map.refSupervisorMachGroupPanelVM.MachGroupVMList_View.Refresh()
' sposto MachGroup in lista come ultimo dei pronti da produrre
Dim OldIndex As Integer = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.IndexOf(MachGroup)
@@ -248,8 +248,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2508, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -93,10 +93,14 @@ Public Class BTLPartVM
Dim LSTValues() As String = sSwapItem.Split(","c)
If Not IsNothing(LSTValues(LSTValues.Count - 1)) AndAlso Integer.TryParse(LSTValues(LSTValues.Count - 1), nSwapItem) AndAlso nSwapItem > 0 Then
Dim nMachgroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nSwapItem)))
Dim MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
If MachGroupModel.State > ItemState.ND Then
bDuploInProduction = True
Exit For
If nMachgroupId = GDB_ID.NULL Then
EgtOutLog("Trovato Duplo Ghost")
Else
Dim MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(Map.refProjManagerVM.CurrProj.nProdId, nMachgroupId)
If MachGroupModel.State > ItemState.ND Then
bDuploInProduction = True
Exit For
End If
End If
End If
Next
@@ -398,7 +398,8 @@ Public Class BTLStructureVM
End If
End If
SelBTLParts.AddToList(SelBTLPart)
If Not IsNothing(SelBTLPart) Then SelBTLParts.AddToList(SelBTLPart)
If bByOptim Then
m_bOnlySelectItem = False
End If
@@ -47,6 +47,7 @@
Visibility="{Binding ChooseMachineBtn_Visibility}">
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
</Button>
<Grid Margin="0,0,5,0" Visibility="{Binding ChooseMachine_Visibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -338,6 +338,10 @@
<DependentUpon>SetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUp\SetUpVM.vb" />
<Compile Include="SpecialPanel\SpecialPanelV.xaml.vb">
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SpecialPanel\SpecialPanelVM.vb" />
<Compile Include="StatisticsTimePanel\StatisticsTimePanelV.xaml.vb">
<DependentUpon>StatisticsTimePanelV.xaml</DependentUpon>
</Compile>
@@ -544,6 +548,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SpecialPanel\SpecialPanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="StatisticsTimePanel\StatisticsTimePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -172,13 +172,17 @@ Public Class MyMachGroupPanelVM
' elimino pezzo copia
EgtRemovePartFromRawPart(nDuploId)
EgtErase(nDuploId)
'' recupero gruppo di lavorazione e trave dell'interfaccia
' recupero gruppo di lavorazione e trave dell'interfaccia
Dim BeamMachGroup As MyMachGroupVM = MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
If Not IsNothing(BeamMachGroup) Then
Dim Beam As PartVM = BeamMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nDuploId)
EgtSetCurrMachGroup(BeamMachGroup.Id)
Beam.DeletePart()
End If
' reset necessario per poter ottenere nMachGroupId corretto
EgtResetCurrMachGroup()
' aggiorno dati utilizzo barra
BeamMachGroup.UpdateUsage()
Next
' aggiorno quantita' in prod
Dim BTLPart As BTLPartVM = CALCPanelVM.GetBTLPartVMFromBTLPartId(nPartId)
@@ -157,6 +157,13 @@ Public Class MainWindowM
End Get
End Property
Private m_bSpecialPanel As Boolean = False
Friend ReadOnly Property bSpecialPanel As Boolean
Get
Return m_bSpecialPanel
End Get
End Property
#End Region ' FIELDS
#Region "CONSTRUCTOR"
@@ -235,8 +242,8 @@ Public Class MainWindowM
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2508, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2508, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -278,6 +285,8 @@ Public Class MainWindowM
EgtSetUiUnits(GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
' Leggo e imposto livello utilizzatore
m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Recupero flag SpecialPanel
m_bSpecialPanel = GetMainPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) = 1
' Imposto dir font Nfe e font default
Dim sNfeDir As String = String.Empty
GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.8.1")>
<Assembly: AssemblyFileVersion("2.5.8.1")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
@@ -52,6 +52,8 @@
<EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
<EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
<EgtBEAMWALL:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"
Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
<EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
</WrapPanel>
@@ -3,6 +3,7 @@ Imports EgtBEAMWALL.Core
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.DataLayer.Controllers
Public Class ProjectVM
Inherits VMBase
@@ -11,6 +12,12 @@ Public Class ProjectVM
Private m_Calc_Timer As New DispatcherTimer
Friend Event OnPreControllerExec(sFilePath As String)
Friend Event OnPostControllerExec()
' Flag per non salvare Script appena eseguito in elenco MruScript
Private m_bScriptInMru As Boolean = True
Private Property m_GridDims As New ObservableCollection(Of GridDimension)
Public Property GridDims As ObservableCollection(Of GridDimension)
Get
@@ -189,6 +196,13 @@ Public Class ProjectVM
NotifyPropertyChanged("FreeContourManager_Visibility")
End Sub
Public ReadOnly Property SpecialPanel_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.bSpecialPanel AndAlso Map.refMainWindowVM.MainWindowM.nUserLevel > 5, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Friend Sub NotifyAllPanelVisibility()
NotifyPropertyChanged("LeftPanel_Visibility")
NotifyPropertyChanged("TopPanel_Visibility")
@@ -59,6 +59,8 @@ Public Class MySceneHostVM
PostInitializeScene()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
' Imposto focus pulsante su false
MainScene.SetFocusOnMove(False)
' Recupero e imposto handle finestra principale
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd)
@@ -0,0 +1,24 @@
<EgtFloating:EgtFloatingPanel x:Class="SpecialPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}"
Visibility="{Binding Btn_Visibility}" IsEnabled="{Binding Btn_IsEnabled}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
@@ -0,0 +1,3 @@
Public Class SpecialPanelV
End Class
@@ -0,0 +1,202 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class SpecialPanelVM
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
End Property
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefSpecialPanelVM(Me)
' se attivo, inizializzo i bottoni leggendoli da file ini
If Map.refMainWindowVM.MainWindowM.bSpecialPanel Then
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
#Region "METHODS"
Public Function SetSpecialPanelButtonsVisibility(IsMachMode As Boolean) As Boolean
Dim bSpecialPanel_Visible As Boolean = False
For Each BtnItem In m_ButtonList
' verifico il valore di nDrawMachOrBoth del bottone e IsMachMode per rendere visibile o meno il bottone in ButtonList
Select Case BtnItem.nDrawMachOrBoth
Case 0 ' bottone nascosto
BtnItem.m_Btn_Visibility = Visibility.Collapsed
Case 1 ' bottone visibile solo in Draw
BtnItem.m_Btn_Visibility = If(Not IsMachMode, Visibility.Visible, Visibility.Collapsed)
Case 2 ' bottone visibile solo in Machining
BtnItem.m_Btn_Visibility = If(IsMachMode, Visibility.Visible, Visibility.Collapsed)
Case 3 ' bottone visibile sia in Draw che in Machining
BtnItem.m_Btn_Visibility = Visibility.Visible
End Select
' se anche uno solo è visibile anche lo SpecialPanel dovrà esserlo
If BtnItem.Btn_Visibility = Visibility.Visible Then bSpecialPanel_Visible = True
'BtnItem.OnPropertyChanged(NameOf(BtnItem.Btn_Visibility))
BtnItem.NotifyPropertyChanged(NameOf(BtnItem.Btn_Visibility))
Next
Return bSpecialPanel_Visible
End Function
Friend Sub SpecialPanelIsEnabled(SpecialPanelBtn_IsEnabled As Boolean)
For Each BtnItem In m_ButtonList
BtnItem.m_Btn_IsEnabled = SpecialPanelBtn_IsEnabled
'BtnItem.OnPropertyChanged(NameOf(BtnItem.Btn_IsEnabled))
BtnItem.NotifyPropertyChanged(NameOf(BtnItem.Btn_IsEnabled))
Next
End Sub
Public Function GetPrivateProfileButton(sSection As String, sKey As String, sBaseDir As String, ByRef ReadButtonItem As ButtonItem) As Boolean
ReadButtonItem = Nothing
Dim sVal As String = String.Empty
GetMainPrivateProfileString(sSection, sKey, "", sVal)
If String.IsNullOrWhiteSpace(sVal) Then Return False
Dim sItems() As String = sVal.Split(","c)
If sItems.Count() >= 1 Then
Dim sLuaPath As String = sItems(0)
Dim sImagePath As String = If(sItems.Count() >= 2, sItems(1), "")
Dim sToolTip As String = If(sItems.Count() >= 3, sItems(2), "")
Dim sDrawMachOrBoth As String = If(sItems.Count() >= 4 AndAlso Not String.IsNullOrWhiteSpace(sItems(3)), sItems(3), "1")
If Not String.IsNullOrWhiteSpace(sBaseDir) And Not String.IsNullOrWhiteSpace(sLuaPath) Then
If sLuaPath.Contains(".lua") Then sLuaPath = sBaseDir & "\" & sLuaPath
If Not String.IsNullOrWhiteSpace(sImagePath) Then sImagePath = sBaseDir & "\" & sImagePath
End If
ReadButtonItem = New ButtonItem(sSection, sLuaPath, sImagePath, sToolTip, sDrawMachOrBoth)
Return True
End If
Return False
End Function
#End Region ' Methods
End Class
Public Class ButtonItem
Inherits VMBase
Friend Shared WithEvents m_ProjectVM As ProjectVM
Private Shared m_sCurrBarName As String
Private m_sBarName As String
Private m_sImagePath As String
Public ReadOnly Property ImagePath As String
Get
Return m_sImagePath
End Get
End Property
Private m_sLuaCmdPath As String
Private m_sToolTip As String
Public ReadOnly Property ToolTip As String
Get
Return m_sToolTip
End Get
End Property
Private m_nDrawMachOrBoth As Integer
Public ReadOnly Property nDrawMachOrBoth As Integer
Get
Return m_nDrawMachOrBoth
End Get
End Property
Friend m_Btn_Visibility As Visibility
Public ReadOnly Property Btn_Visibility As Visibility
Get
Return m_Btn_Visibility
End Get
End Property
Friend m_Btn_IsEnabled As Boolean = True
Public ReadOnly Property Btn_IsEnabled As Boolean
Get
Return m_Btn_IsEnabled
End Get
End Property
' Definizione comandi
Private m_cmdLuaExec As ICommand
Sub New( sBarName As String, sLuaCmdPath As String, sImagePath As String, sToolTip As String, sDrawMachOrBoth As String)
m_sBarName = sBarName
If File.Exists(sImagePath) Then
' per lasciare libere le immagini le copio (potrebbe fallire perchè bloccate da altro eseguibile)
Dim sNewPath As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sResourcesRoot, sBarName & "_" & Path.GetFileName(sImagePath))
Try
File.Copy( sImagePath, sNewPath, True)
Catch ex As Exception
End Try
m_sImagePath = sNewPath
Else
m_sImagePath = Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\" & sImagePath
End If
m_sLuaCmdPath = sLuaCmdPath
m_sToolTip = sToolTip
If Not Integer.TryParse(sDrawMachOrBoth, m_nDrawMachOrBoth) Then m_nDrawMachOrBoth = 0
End Sub
#Region "COMMANDS"
#Region "LuaExecCommand"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property LuaExecCommand As ICommand
Get
If m_cmdLuaExec Is Nothing Then
m_cmdLuaExec = New Command(AddressOf LuaExec)
End If
Return m_cmdLuaExec
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Sub LuaExec(ByVal param As Object)
If String.IsNullOrWhiteSpace(m_sLuaCmdPath) Then Return
If Not File.Exists(m_sLuaCmdPath) Then Return
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return
' Abilito eventi se comando lua termina con Beam\Process.lua
m_sCurrBarName = m_sBarName
Dim bRaiseEvent As Boolean = ( m_sBarName = "Beam" OrElse m_sBarName = "Wall")
' eseguo file Lua
EgtBEAMWALL.ViewerOptimizer.LuaExec.ExecScript(m_sLuaCmdPath, bRaiseEvent)
m_sCurrBarName = Nothing
End Sub
'Private Shared Sub OnPreControllerExec(sFilePath As String) Handles m_ProjectVM.OnPreControllerExec
' If m_sCurrBarName = "Beam" Then
' EgtLuaCreateGlobTable("BEAM")
' EgtLuaSetGlobStringVar("BEAM.BASEDIR", IniFile.m_sBeamDirPath)
' If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("BEAM.BW", true)
' ElseIf m_sCurrBarName = "Wall" Then
' EgtLuaCreateGlobTable("WALL")
' EgtLuaSetGlobStringVar("WALL.BASEDIR", IniFile.m_sWallDirPath)
' If EgtGetUserLevel() >= 9 AndAlso GetPrivateProfileInt(S_LUA, K_BWSIM, 0) = 1 then EgtLuaSetGlobBoolVar("WALL.BW", true)
' End If
'End Sub
'Private Shared Sub OnPostControllerExec() Handles m_ProjectVM.OnPostControllerExec
' If m_sCurrBarName = "Beam" Then
' EgtLuaResetGlobVar("BEAM")
' ElseIf m_sCurrBarName = "Wall" Then
' EgtLuaResetGlobVar("WALL")
' End If
'End Sub
#End Region ' LuaExecCommand
#End Region ' Commands
End Class
@@ -51,6 +51,7 @@
<OmagOFFICE:MachiningTabVM x:Key="MachiningTabVM"/>
<OmagOFFICE:SimulTabVM x:Key="SimulTabVM"/>-->
<EgtBEAMWALL:MyMachGroupPanelVM x:Key="MachGroupPanelVM"/>
<EgtBEAMWALL:SpecialPanelVM x:Key="SpecialPanelVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
@@ -310,6 +311,13 @@
</Style.Triggers>
</Style>
<Style x:Key="DrawPanelButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBlock -->
@@ -1,4 +1,5 @@
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.DataLayer.Controllers
Imports EgtUILib
Imports EgtWPFLib5
@@ -203,4 +204,17 @@ Module LuaExec
Return bOk
End Function
' Special Panel
Friend Sub ExecScript(sFilePath As String, Optional bRaiseEvent As Boolean = False)
EgtLuaExecFile(sFilePath)
'Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
'If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
' Dim nCurrPart As Integer = EgtGetCurrPart()
' If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
' EgtResetCurrPartLayer()
' End If
'End If
End Sub
End Module
+14 -1
View File
@@ -34,6 +34,7 @@ Module Map
Private m_refFeatureManagerVM As FeatureManagerVM
Private m_refAddSectionXMaterialWndVM As AddSectionXMaterialWndVM
Private m_refStatisticsTimePanelVM As StatisticsTimePanelVM
Private m_refSpecialPanelVM As SpecialPanelVM
'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
'Private m_refRawPartTabVM As RawPartTabVM
'Private m_refNestingTabVM As NestingTabVM
@@ -241,6 +242,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
Get
Return m_refSpecialPanelVM
End Get
End Property
'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
' Get
' Return m_refOpenProjectFileDialogVM
@@ -453,6 +460,12 @@ Module Map
Return Not IsNothing(m_refStatisticsTimePanelVM)
End Function
Friend Function SetRefSpecialPanelVM(SpecialPanelVM As SpecialPanelVM) As Boolean
m_refSpecialPanelVM = SpecialPanelVM
Return Not IsNothing(m_refSpecialPanelVM)
End Function
'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
' Return Not IsNothing(m_refOpenProjectFileDialogVM)
@@ -526,7 +539,7 @@ Module Map
Not IsNothing(m_refStatisticsVM) AndAlso Not IsNothing(m_refPParameterListVM) AndAlso
Not IsNothing(m_refQParameterListVM) AndAlso Not IsNothing(m_refFeatureManagerVM) AndAlso
Not IsNothing(m_refAddSectionXMaterialWndVM) AndAlso Not IsNothing(m_refStatisticsTimePanelVM) AndAlso
LibMap.EndInit()
Not IsNothing(m_refSpecialPanelVM) AndAlso LibMap.EndInit()
End Function
#End Region ' Init
Binary file not shown.
Binary file not shown.