Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c5d4db3e8 | |||
| 8d94ce6d80 | |||
| cc30fe7bf4 | |||
| 0c1061e6f4 | |||
| e3872881f6 | |||
| c02397efd5 | |||
| df9ee8bdb4 | |||
| 114255bb87 | |||
| 4499a042f8 | |||
| f9f0d90334 | |||
| 63f0412065 | |||
| 6eb51e8feb | |||
| 19557d6e05 | |||
| 113ad8bcf6 | |||
| 58acf21f52 |
@@ -593,4 +593,13 @@ Public Class ProcessResult
|
||||
m_nTIME = TIME
|
||||
End Sub
|
||||
|
||||
Public Sub ResetTypeFeature()
|
||||
m_Type = ProcessResultTypes.PART
|
||||
m_nTASKID = 0
|
||||
End Sub
|
||||
Public Sub ResetTypePart()
|
||||
m_Type = ProcessResultTypes.BAR
|
||||
m_nCUTID = 0
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -18,8 +18,6 @@ Public Module LoadingWndHelper
|
||||
CHANGEMATERIAL = 12
|
||||
BACKUP = 13
|
||||
RESTORE = 14
|
||||
UPDATENETWAREHOUSE = 15
|
||||
UPLOADNESTING = 16
|
||||
End Enum
|
||||
|
||||
Dim m_MainWindow As Windows.Window
|
||||
|
||||
@@ -186,7 +186,13 @@ Public Class MyMachGroupPanelM
|
||||
While nOutlineId <> GDB_ID.NULL
|
||||
' verifico che sia feature
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
|
||||
If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
|
||||
Dim nCurrPrId As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(nOutlineId, MGR_FTR_PRID, nCurrPrId) AndAlso nCurrPrId <> GDB_ID.NULL Then
|
||||
If nCurrPrId < nPRId Then
|
||||
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
|
||||
nPRId += 1
|
||||
End If
|
||||
nPRId = Math.Max(nPRId - 1, nCurrPrId) + 1
|
||||
nOutlineId = EgtGetNext(nOutlineId)
|
||||
Continue While
|
||||
Else
|
||||
|
||||
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyVersion("2.6.6.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.6.1")>
|
||||
|
||||
@@ -115,7 +115,7 @@ Public Class SectionXMaterial
|
||||
|
||||
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, sWarehouseMaterial As String)
|
||||
If m_nType = BWType.BEAM Then
|
||||
m_MaterialM = New MaterialM(Math.Min(dW, dH), Math.Max(dW, dH), 0, sMaterial, sWarehouseMaterial)
|
||||
m_MaterialM = New MaterialM(dW, dH, 0, sMaterial, sWarehouseMaterial)
|
||||
ElseIf m_nType = BWType.WALL Then
|
||||
m_MaterialM = New MaterialM(0, dH, 0, sMaterial, sWarehouseMaterial)
|
||||
Else
|
||||
|
||||
@@ -6,7 +6,6 @@ using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
@@ -25,11 +24,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="authToken">Token di autorizzazione</param>
|
||||
public MagmanController(string ServerAddress, string AuthToken)
|
||||
{
|
||||
// forzo a 30 sec...
|
||||
int timeout = 30000;
|
||||
commLib = new DataSyncro(ServerAddress, AuthToken, timeout);
|
||||
commLib = new DataSyncro(ServerAddress, AuthToken);
|
||||
bool servOk = commLib.CheckRemote();
|
||||
Log.Info($"Avviato MagmanController | server: {ServerAddress} | timeout: {timeout}ms | CheckRemote OK: {servOk}");
|
||||
Log.Info($"Avviato MagmanController | server: {ServerAddress} | timeout: standard (500ms)| CheckRemote OK: {servOk}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -374,24 +371,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
// eseguo il sync!
|
||||
List<MaterialDTO> list2send = matListDb.Select(x => MaterialsController.ConvToDto(x)).ToList();
|
||||
// preparo pacchetto invio... 10 alla volta...
|
||||
bool okMat = false;
|
||||
#if false
|
||||
int numRec = list2send.Count;
|
||||
if (numRec > 10)
|
||||
{
|
||||
for (int i = 0; i < numRec / 10; i++)
|
||||
{
|
||||
var currList = list2send.Skip(10 * i).Take(10).ToList();
|
||||
okMat = commLib.MaterialsSend(currList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
okMat = commLib.MaterialsSend(list2send);
|
||||
}
|
||||
#endif
|
||||
okMat = commLib.MaterialsSend(list2send);
|
||||
// preparo pacchetto invio...
|
||||
bool okMat = commLib.MaterialsSend(list2send);
|
||||
// se inviato, scarico x merge locale
|
||||
if (!okMat)
|
||||
{
|
||||
@@ -892,85 +873,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
// loggo completato
|
||||
Log.Info($"ProjAllSyncro | Eseguita sincronizzazione di {numSent}/{recList.Count} record");
|
||||
}
|
||||
/*------------------------------------------------
|
||||
* 2024.07.10 ora faccio giro differente:
|
||||
* - calcolo data limite da MagmanSync x tipo ProjAllSyncro, ultimo rec --> data limite
|
||||
* - recupero progetti modificati dopo data limite (DtLastMod)
|
||||
* - invio TUTTI i record modificati dopo data limite
|
||||
* - recupero tutti i record remoti modificati dopo la stessa data limite
|
||||
* - merge locale (x archiviato)
|
||||
*------------------------------------------------ */
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary> Effettua sync stato archiviato progetti locali <--> cloud </summary> <returns></returns>
|
||||
public SyncResult ProjArchSync()
|
||||
{
|
||||
SyncResult answ = SyncResult.ERR_ND;
|
||||
// per prima cosa calcolo limite sync come ultimo record registrato
|
||||
DateTime dtLastSync = DateTime.MinValue;
|
||||
DateTime adesso = DateTime.Now;
|
||||
string syncType = "ProjArchSync";
|
||||
using (MagmanSyncController msContr = new MagmanSyncController())
|
||||
{
|
||||
var lastRec = msContr.GetLastBySync(syncType);
|
||||
dtLastSync = lastRec.DtReq;
|
||||
// ora uso controller x gestione progetti
|
||||
using (ProdController prodContr = new ProdController())
|
||||
{
|
||||
// recupero elenco prod da inviare...
|
||||
var list2send = prodContr.GetModAfter(dtLastSync);
|
||||
// converto x inviare
|
||||
bool servOk = commLib.CheckRemote();
|
||||
if (!servOk)
|
||||
{
|
||||
answ = SyncResult.ERR_ServerKo;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// converto gli oggetti
|
||||
Dictionary<int, bool> proj2send = list2send.ToDictionary(x => x.ProjCloudId, x => x.IsArchived);
|
||||
// effettuo invio...
|
||||
bool resOk = commLib.ProjectArchSend(proj2send);
|
||||
if (!resOk)
|
||||
{
|
||||
answ = SyncResult.ERR_CloudResNotSent;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ora chiedo da online elenco proj modificati x sync locale...
|
||||
Dictionary<int, bool> cloudUpdated = commLib.ProjectArchGet(dtLastSync);
|
||||
if (cloudUpdated != null)
|
||||
{
|
||||
prodContr.UpdateListArchived(cloudUpdated);
|
||||
}
|
||||
// registro nuovo sync fatto ora...
|
||||
MagmanSyncModel newRec = new MagmanSyncModel()
|
||||
{
|
||||
CloudId = 0,
|
||||
SyncType = syncType,
|
||||
DtReq = adesso,
|
||||
Payload = ""
|
||||
};
|
||||
int syncId = msContr.Insert(newRec);
|
||||
answ = SyncResult.ALL_OK;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = SyncResult.ERR_ServerKo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// restituisco
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue invio info avanzamento di un SINGOLO PROD dato il suo Id + info avanzamento
|
||||
/// </summary>
|
||||
|
||||
@@ -114,37 +114,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero ultimo record di sync dato tipo
|
||||
/// </summary>
|
||||
/// <param name="SyncType">TIpo di sync richiesto, tipicamente ProjArchSync x fix stato archived</param>
|
||||
/// <returns></returns>
|
||||
public MagmanSyncModel GetLastBySync(string SyncType)
|
||||
{
|
||||
// record default a 1 anno fa...
|
||||
DateTime dtLim = DateTime.Today.AddYears(-1);
|
||||
MagmanSyncModel dbResult = new MagmanSyncModel()
|
||||
{
|
||||
CloudId = 0,
|
||||
SyncType = SyncType,
|
||||
DtReq = dtLim,
|
||||
Payload = ""
|
||||
};
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
var rawRes = localDbCtx
|
||||
.SyncList
|
||||
.Where(x => (!string.IsNullOrEmpty(SyncType) && x.SyncType == SyncType))
|
||||
.OrderByDescending(x => x.DtReq)
|
||||
.FirstOrDefault();
|
||||
if (rawRes != null)
|
||||
{
|
||||
dbResult = rawRes;
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista record NON inviati filtrati x tipo e num max
|
||||
/// </summary>
|
||||
|
||||
@@ -231,8 +231,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
.Where(x => (updItem.MatId > 0 && x.MatId == updItem.MatId)
|
||||
|| (updItem.MatCloudId > 0 && x.MatCloudId == updItem.MatCloudId)
|
||||
|| (x.MatCode == updItem.MatCode && x.WMm == updItem.WMm && x.HMm == updItem.HMm && x.LMm == updItem.LMm))
|
||||
.OrderBy(x => x.MatId)
|
||||
.FirstOrDefault();
|
||||
.SingleOrDefault();
|
||||
|
||||
if (item2update != null)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using static EgtBEAMWALL.Core.ConstBeam;
|
||||
|
||||
namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
@@ -23,42 +22,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Helper conversione a ProjectDTO
|
||||
/// </summary>
|
||||
/// <param name="currRec">record in formato ProdModel</param>
|
||||
/// <returns></returns>
|
||||
public static ProjectDTO ConvToDto(ProdModel currRec)
|
||||
{
|
||||
// ho valori mancanti che saranno calcolati dal cloud e valori messi a zero di default
|
||||
ProjectDTO answ = new ProjectDTO()
|
||||
{
|
||||
ProjCloudId = currRec.ProjCloudId,
|
||||
ProjLocalId = currRec.ProdDbId,
|
||||
ProjExtId = currRec.ProdId,
|
||||
// è calcolato sul cloud, da token --> machine ID
|
||||
MachineCloudId = 0,
|
||||
// è calcolato sul cloud, da token --> KeyNum
|
||||
KeyNum = 0,
|
||||
// disponibile solo su PROJ
|
||||
BTLFileName = "",
|
||||
PType = (EgwProxy.MagMan.BWType)currRec.PType,
|
||||
Machine = currRec.Machine,
|
||||
ProjDescription = currRec.Description,
|
||||
DtCreated = currRec.DtCreated,
|
||||
DtLastAction = DateTime.MinValue,
|
||||
DtSchedule = DateTime.MinValue,
|
||||
DtStartProd = DateTime.MinValue,
|
||||
// disponibile solo su PROJ
|
||||
ListName = "",
|
||||
ProcTimeEst = 0,
|
||||
ProcTimeReal = 0,
|
||||
IsActive = currRec.IsActive,
|
||||
IsArchived = currRec.IsArchived
|
||||
};
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiunta di un PROJ ad un PROD
|
||||
/// </summary>
|
||||
@@ -96,6 +59,41 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper conversione a ProjectDTO
|
||||
/// </summary>
|
||||
/// <param name="currRec">record in formato ProdModel</param>
|
||||
/// <returns></returns>
|
||||
public static ProjectDTO ConvToDto(ProdModel currRec)
|
||||
{
|
||||
// ho valori mancanti che saranno calcolati dal cloud e valori messi a zero di default
|
||||
ProjectDTO answ = new ProjectDTO()
|
||||
{
|
||||
ProjCloudId = currRec.ProjCloudId,
|
||||
ProjLocalId = currRec.ProdDbId,
|
||||
ProjExtId = currRec.ProdId,
|
||||
// è calcolato sul cloud, da token --> machine ID
|
||||
MachineCloudId = 0,
|
||||
// è calcolato sul cloud, da token --> KeyNum
|
||||
KeyNum = 0,
|
||||
// disponibile solo su PROJ
|
||||
BTLFileName = "",
|
||||
PType = (EgwProxy.MagMan.BWType)currRec.PType,
|
||||
Machine = currRec.Machine,
|
||||
ProjDescription = currRec.Description,
|
||||
DtCreated = currRec.DtCreated,
|
||||
DtLastAction = DateTime.MinValue,
|
||||
DtSchedule = DateTime.MinValue,
|
||||
DtStartProd = DateTime.MinValue,
|
||||
// disponibile solo su PROJ
|
||||
ListName = "",
|
||||
ProcTimeEst = 0,
|
||||
ProcTimeReal = 0,
|
||||
IsActive = currRec.IsActive,
|
||||
IsArchived = currRec.IsArchived
|
||||
};
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Helper conversione modelli verso Core.ProdItem
|
||||
/// </summary>
|
||||
@@ -126,6 +124,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
public Core.ProdFileM ConvToCoreFile(ProdModel currProd)
|
||||
{
|
||||
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjCloudId);
|
||||
//Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine, currProd.LockedBy, currProd.LockDate, currProd.IsActive, currProd.IsProduced, currProd.IsArchived, currProd.ProjListNav.Select(j => Core.ProjFileM.CreateProjFileM(j.ProdId, currProd.ProdId, j.DtCreated, j.DtExported, j.ListName, j.BTLFileName, j.ProjDescription, j.IsNew, j.Locked, j.PType, j.Machine, j.IsActive, j.IsActive)).ToList());
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -167,7 +166,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
// segno eliminazione logica al prod
|
||||
currProd.IsActive = false;
|
||||
currProd.DtLastMod = DateTime.Now;
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
done = true;
|
||||
@@ -535,24 +533,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero i dati modificati dopo la data richiesta x sincr su cloud
|
||||
/// </summary>
|
||||
/// <param name="DtLimit"></param>
|
||||
/// <returns></returns>
|
||||
public List<ProdModel> GetModAfter(DateTime DtLimit)
|
||||
{
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
// retrieve
|
||||
return localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.DtLastMod >= DtLimit)
|
||||
.OrderBy(x => x.ProdDbId)
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fornisce nuovo indice VUOTO da usare (allocando sul DB)
|
||||
/// </summary>
|
||||
@@ -607,7 +587,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupero i dati NON sincronizzati
|
||||
/// Recupero i dati NON sincronizzati in ordine crescente fino al num max indicato
|
||||
/// </summary>
|
||||
/// <param name="dtStart"></param>
|
||||
/// <param name="dtEnd"></param>
|
||||
@@ -645,11 +625,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return numAssigned > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return Lock by ProdId (proj & prod)
|
||||
/// </summary>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary> Return Lock by ProdId (proj & prod) </summary> <param name="ProdId"></param> <returns></returns>
|
||||
public bool IsLockByProdId(int ProdId)
|
||||
{
|
||||
bool bIsLock = false;
|
||||
@@ -679,13 +655,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return bIsLock;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Manage Lock by ProdId (proj & prod)
|
||||
/// </summary>
|
||||
/// <param name="ProdId"></param>
|
||||
/// <param name="Locked">Stato Lock da impostare</param>
|
||||
/// <param name="UserKey">User ID / Key number</param>
|
||||
/// <returns></returns>
|
||||
/// <summary> Manage Lock by ProdId (proj & prod) </summary> <param name="ProdId"></param>
|
||||
/// <param name="Locked">Stato Lock da impostare</param> <param name="UserKey">User ID / Key
|
||||
/// number</param> <returns></returns>
|
||||
public ProdModel LockByProdId(int ProdId, bool Locked, string UserKey = "USER01")
|
||||
{
|
||||
ProdModel currProd;
|
||||
@@ -702,7 +674,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
currProd.Locked = Locked;
|
||||
currProd.LockDate = DateTime.Now;
|
||||
currProd.LockedBy = Locked ? UserKey : "";
|
||||
localDbCtx.Entry(currProd).State = EntityState.Modified;
|
||||
localDbCtx.Entry(currProd).State = System.Data.Entity.EntityState.Modified;
|
||||
|
||||
var currProj = localDbCtx
|
||||
.ProjList
|
||||
@@ -715,7 +687,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
item.Locked = Locked;
|
||||
item.LockDate = DateTime.Now;
|
||||
item.LockedBy = Locked ? UserKey : "";
|
||||
localDbCtx.Entry(item).State = EntityState.Modified;
|
||||
localDbCtx.Entry(item).State = System.Data.Entity.EntityState.Modified;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,36 +750,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esegue syncro sul DB dell'elenco dei record
|
||||
/// </summary>
|
||||
/// <param name="cloudStatus">Dizionario valori cloudId / isArchived</param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateListArchived(Dictionary<int, bool> cloudStatus)
|
||||
{
|
||||
bool fatto = false;
|
||||
int numDone = 0;
|
||||
int num2do = cloudStatus.Count;
|
||||
try
|
||||
{
|
||||
DateTime adesso = DateTime.Now;
|
||||
// ciclo tutti i record e segno update...
|
||||
foreach (var item in cloudStatus)
|
||||
{
|
||||
// chiamo metodo singolo
|
||||
numDone += UpdateArchivedByCloudId(item.Key, item.Value) ? 1 : 0;
|
||||
}
|
||||
fatto = numDone == num2do;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Prod.UpdateListArchived: {Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update record su DB x campo IsArchived
|
||||
/// </summary>
|
||||
@@ -836,7 +778,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
// aggiorno valore descrizione
|
||||
currData.IsArchived = IsArchived;
|
||||
currData.DtLastMod = DateTime.Now;
|
||||
|
||||
// update dei proj relativi
|
||||
foreach (var item in proj2update)
|
||||
@@ -1290,64 +1231,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
var ProjCtr = new ProjController();
|
||||
return ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update record su DB x campo IsArchived dato CloudId
|
||||
/// </summary>
|
||||
/// <param name="ProjCloudId"></param>
|
||||
/// <param name="IsArchived"></param>
|
||||
/// <returns></returns>
|
||||
protected bool UpdateArchivedByCloudId(int ProjCloudId, bool IsArchived)
|
||||
{
|
||||
bool fatto = false;
|
||||
DateTime adesso = DateTime.Now;
|
||||
// cerco specifico Prod
|
||||
ProdModel currData = new ProdModel();
|
||||
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
|
||||
{
|
||||
currData = localDbCtx
|
||||
.ProdList
|
||||
.Where(x => x.ProjCloudId == ProjCloudId)
|
||||
.SingleOrDefault();
|
||||
if (currData != null)
|
||||
{
|
||||
// sel dei proj da aggiornare...
|
||||
var proj2update = localDbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProdDbId == currData.ProdDbId)
|
||||
.ToList();
|
||||
try
|
||||
{
|
||||
// aggiorno valore descrizione
|
||||
currData.IsArchived = IsArchived;
|
||||
currData.DtLastMod = adesso;
|
||||
|
||||
// update dei proj relativi
|
||||
foreach (var item in proj2update)
|
||||
{
|
||||
item.IsArchived = IsArchived;
|
||||
}
|
||||
|
||||
// Commit changes
|
||||
localDbCtx.SaveChanges();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
string errMessage = $"EXCEPTION on Prod.UpdateArchivedByCloudId:{Environment.NewLine}{exc}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string errMessage = $"ERROR on Prod.UpdateArchivedByCloudId: req item was not found | ProjCloudId {ProjCloudId} | IsArchived {IsArchived}";
|
||||
Console.WriteLine(errMessage);
|
||||
Log.Error(errMessage);
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
//return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
MatId = coreRec.Material.nId,
|
||||
HMm = (decimal)Math.Round(coreRec.Material.dH,2),
|
||||
LMm = (decimal)Math.Round(coreRec.dL,2),
|
||||
WMm = coreRec.dW > 0 ? (decimal)Math.Round(coreRec.dW, 2) : (decimal)Math.Round(coreRec.Material.dW, 2),
|
||||
WMm = coreRec.dW > 0 ? (decimal)Math.Round(coreRec.dW,2) : (decimal)Math.Round(coreRec.Material.dW,2),
|
||||
IsActive = coreRec.bActive,
|
||||
UseQty = coreRec.bUseQuantity,
|
||||
QtyAvail = coreRec.nQuantity
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockDate")]
|
||||
public DateTime LockDate { get; set; } = new DateTime(1900, 01, 01);
|
||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Record attivo (se false == cancellazione logica)
|
||||
@@ -106,13 +106,6 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
[Column("IsArchived")]
|
||||
public bool IsArchived { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Data Creazione
|
||||
/// </summary>
|
||||
[Index]
|
||||
[Column("DtLastMod")]
|
||||
public DateTime DtLastMod { get; set; } = new DateTime(1900, 01, 01);
|
||||
|
||||
/// <summary>
|
||||
/// Collezione oggetti Proj associati (almeno 1 by design)
|
||||
/// </summary>
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
/// dispositivo in rete
|
||||
/// </summary>
|
||||
[Column("LockDate")]
|
||||
public DateTime LockDate { get; set; } = new DateTime(1900, 01, 01);
|
||||
public DateTime LockDate { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Record attivo (se false == cancellazione logica)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.MagMan, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2407.1708\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2406.2911\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
@@ -273,10 +273,6 @@
|
||||
<Compile Include="Migrations\202406070826284_AddStoredProc01.Designer.cs">
|
||||
<DependentUpon>202406070826284_AddStoredProc01.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\202407170704518_AddProdDtLastMod.cs" />
|
||||
<Compile Include="Migrations\202407170704518_AddProdDtLastMod.Designer.cs">
|
||||
<DependentUpon>202407170704518_AddProdDtLastMod.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
@@ -361,9 +357,6 @@
|
||||
<EmbeddedResource Include="Migrations\202406070826284_AddStoredProc01.resx">
|
||||
<DependentUpon>202406070826284_AddStoredProc01.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\202407170704518_AddProdDtLastMod.resx">
|
||||
<DependentUpon>202407170704518_AddProdDtLastMod.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="SqlScripts\Stored\stp_LogMachineFixPid.sql">
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
// <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 AddProdDtLastMod : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(AddProdDtLastMod));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "202407170704518_AddProdDtLastMod"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace EgtBEAMWALL.DataLayer.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class AddProdDtLastMod : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
AddColumn("dbo.ProdList", "DtLastMod", c => c.DateTime(nullable: false, precision: 0, defaultValueSql: "DATE('1900-01-01')"));
|
||||
CreateIndex("dbo.ProdList", "DtLastMod");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropIndex("dbo.ProdList", new[] { "DtLastMod" });
|
||||
DropColumn("dbo.ProdList", "DtLastMod");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Egalware s.r.l.")]
|
||||
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020-2024 by Egalware s.r.l.")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -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.12.2")]
|
||||
[assembly: AssemblyFileVersion("2.5.12.2")]
|
||||
[assembly: AssemblyVersion("2.6.6.1")]
|
||||
[assembly: AssemblyFileVersion("2.6.6.1")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<packages>
|
||||
<package id="BouncyCastle.Cryptography" version="2.4.0" targetFramework="net472" />
|
||||
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2407.1708" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2406.2911" targetFramework="net472" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<package id="Google.Protobuf" version="3.27.0" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net472" />
|
||||
|
||||
@@ -0,0 +1,456 @@
|
||||
Imports System.Buffers.Binary
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports Sharp7
|
||||
|
||||
Public Class SIEMENSSharp7Comm
|
||||
|
||||
Private m_DBVariableList As New List(Of DBBuffer) ' Buffer list
|
||||
|
||||
Private IntBuffer() As Byte = {0, 0}
|
||||
Private BoolBuffer() As Byte = {0}
|
||||
Private DIntBuffer() As Byte = {0, 0, 0, 0}
|
||||
Private RealBuffer() As Byte = {0, 0, 0, 0}
|
||||
Private StringBuffer(65536) As Byte ' Buffer
|
||||
Private Client As New S7Client ' Client Object
|
||||
|
||||
' lista variabili in lettura
|
||||
Private Shared m_ReadingVars(100) As CommVar
|
||||
|
||||
' lista dei messaggi di errore attivi
|
||||
Private m_ActiveMessages As New List(Of SiemensReadMessages)
|
||||
|
||||
Private m_MachManaging As MachManaging
|
||||
Friend ReadOnly Property MachManaging As MachManaging
|
||||
Get
|
||||
Return m_MachManaging
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(MachManaging As MachManaging)
|
||||
m_MachManaging = MachManaging
|
||||
End Sub
|
||||
|
||||
Public Shared Function InitVar(Variable As CommVar) As CommVar
|
||||
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
|
||||
m_ReadingVars(Index) = Variable
|
||||
Return m_ReadingVars(Index)
|
||||
End Function
|
||||
|
||||
' Avvio la connessione Hardware-Client
|
||||
Friend Function InitConnection() As Boolean
|
||||
' Ip del PLC
|
||||
Dim sIp As String = ""
|
||||
GetPrivateProfileString(S_GENERAL, K_IP, "", sIp, CurrentMachine.sMachIniFile)
|
||||
' unità usate dal PLC (Rack e Slot)
|
||||
Dim nRack As Integer = GetPrivateProfileInt(S_GENERAL, K_RACK, 0, CurrentMachine.sMachIniFile)
|
||||
Dim nSlot As Integer = GetPrivateProfileInt(S_GENERAL, K_SLOT, 0, CurrentMachine.sMachIniFile)
|
||||
Map.refMachManaging.DebugMessage(1, "Tentativo di connessione a CN Siemens con Sharp7")
|
||||
Map.refMachManaging.DebugMessage(1, "IP: " & sIp)
|
||||
Map.refMachManaging.DebugMessage(1, "Rack: " & nRack)
|
||||
Map.refMachManaging.DebugMessage(1, "Slot: " & nSlot)
|
||||
Dim nResult As Integer = Client.ConnectTo(sIp, nRack, nSlot)
|
||||
If nResult = 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Connessione effettuata")
|
||||
Else
|
||||
Map.refMachManaging.DebugMessage(1, "Connessione fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
' se la connessione è restituisce 0
|
||||
Return nResult = 0
|
||||
End Function
|
||||
|
||||
' chiudo la connessione
|
||||
Friend Sub CloseConnection()
|
||||
Dim nResult As Integer = Client.Disconnect()
|
||||
If Map.refMachManaging.Debug > 0 Then
|
||||
If nResult = 0 Then
|
||||
EgtOutLog("Disconnessione effettuata")
|
||||
Else
|
||||
EgtOutLog("Disconnessione fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "Read Variables"
|
||||
|
||||
Public Sub RefreshAllVars()
|
||||
m_DBVariableList.Clear()
|
||||
For Each Var In m_ReadingVars
|
||||
' rileggo solo variabili continue
|
||||
If Not IsNothing(Var) AndAlso Var.nReadType = CommVar.ReadTypes.CONTINUOUS Then
|
||||
Dim CompleteAddressSplit() As String = Var.sAddress.Split(":"c)
|
||||
Dim nDBAddress As Integer = 0
|
||||
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
|
||||
If nDBAddress = 0 Then Return
|
||||
Dim DBBuffer As DBBuffer = m_DBVariableList.FirstOrDefault(Function(x) x.DBAddress = nDBAddress)
|
||||
If IsNothing(DBBuffer) Then
|
||||
Dim Buffer(65536) As Byte
|
||||
Dim nAddressByte As Integer = 0
|
||||
Select Case nDBAddress
|
||||
Case 301
|
||||
nAddressByte = 8
|
||||
Case 302
|
||||
nAddressByte = 34
|
||||
End Select
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nAddressByte & " byte dalla variabile " & nDBAddress)
|
||||
Dim nResult As Integer = 1234567890
|
||||
Try
|
||||
nResult = Client.DBRead(nDBAddress, 0, nAddressByte, Buffer)
|
||||
Catch ex As Exception
|
||||
nResult = 1234567890
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " ha generato un'eccezione")
|
||||
Map.refMachManaging.DebugMessage(1, ex.ToString())
|
||||
End Try
|
||||
If nResult = 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Lettura di " & nDBAddress & " effettuata")
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
For Index = 0 To Buffer.Count - 1
|
||||
Map.refMachManaging.DebugMessage(2, Index & ": " & Buffer(Index))
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura fallita con codice di errore: " & nResult)
|
||||
End If
|
||||
If nResult = 0 Then
|
||||
DBBuffer = New DBBuffer(nDBAddress, Buffer)
|
||||
m_DBVariableList.Add(DBBuffer)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(DBBuffer) Then
|
||||
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
|
||||
Dim nStartIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
|
||||
Select Case CompleteAddressSplit(2)
|
||||
Case 1
|
||||
Dim nBytePositionIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
|
||||
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
|
||||
' Dim bValue As Boolean = (TestBuffer(nStartIndex) And nPower) = nPower
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex)
|
||||
Var.SetValue(If((DBBuffer.DBValue(nStartIndex) And nPower) = nPower, 1, 0))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & "." & nBytePositionIndex & " (Tipo 1) = " & Var.sValue)
|
||||
Case 2
|
||||
'Dim x = BitConverter.ToInt16(TestBuffer, nStartIndex)
|
||||
Dim nValue As Int16 = BitConverter.ToInt16(DBBuffer.DBValue, nStartIndex)
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
|
||||
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 2) = " & Var.sValue)
|
||||
Case 3
|
||||
' Dim x = BitConverter.ToInt32(TestBuffer, nStartIndex)
|
||||
Dim nValue As Integer = BitConverter.ToInt32(DBBuffer.DBValue, nStartIndex)
|
||||
Map.refMachManaging.DebugMessage(2, "Lettura variabile " & nDBAddress & ":" & nStartIndex)
|
||||
Var.SetValue(BinaryPrimitives.ReverseEndianness(nValue))
|
||||
Map.refMachManaging.DebugMessage(2, "Variabile " & nDBAddress & ":" & nStartIndex & " (Tipo 3) = " & Var.sValue)
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function WriteVariable(Address As String, Value As String) As Boolean
|
||||
Dim CompleteAddressSplit() As String = Address.Split(":"c)
|
||||
Dim nDBAddress As Integer = 0
|
||||
Integer.TryParse(CompleteAddressSplit(0), nDBAddress)
|
||||
If nDBAddress = 0 Then Return False
|
||||
Dim PositionAddressSplit() As String = CompleteAddressSplit(1).Split("."c)
|
||||
Dim nStartIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(0), nStartIndex)
|
||||
Select Case CompleteAddressSplit(2)
|
||||
Case 1
|
||||
' rileggo int16
|
||||
Dim Buffer(1) As Byte
|
||||
Client.DBRead(nDBAddress, nStartIndex, 1, Buffer)
|
||||
Dim nBytePositionIndex As Integer = 0
|
||||
Integer.TryParse(PositionAddressSplit(1), nBytePositionIndex)
|
||||
Dim nPower As Integer = Math.Pow(2, nBytePositionIndex)
|
||||
Dim nNewValue As Integer = 0
|
||||
If Not Integer.TryParse(Value, nNewValue) Then Return False
|
||||
Dim nOldValue As Integer = If((Buffer(0) And nPower) = nPower, 1, 0)
|
||||
If nOldValue = nNewValue Then
|
||||
Return True
|
||||
ElseIf nOldValue = 0 Then
|
||||
Buffer(0) = Buffer(0) Or nPower
|
||||
ElseIf nOldValue = 1 Then
|
||||
Buffer(0) = Buffer(0) Xor nPower
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
' Buffer(0) = Buffer(0) And nPower
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 1) con valore " & Value)
|
||||
For Index = 0 To Buffer.Count - 1
|
||||
EgtOutLog(Index & ": " & Buffer(Index))
|
||||
Next
|
||||
End If
|
||||
Dim nResult As Integer = Client.DBWrite(nDBAddress, nStartIndex, 1, Buffer) ' DbNumber, Start, Amount, Buffer
|
||||
' Return WriteBool(nDBAddress, nStartIndex, bValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If nResult <> 0 Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return nResult = 0
|
||||
Case 2
|
||||
Dim nValue As Int16 = 0
|
||||
If Not Int16.TryParse(Value, nValue) Then Return False
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 2) con valore " & Value)
|
||||
End If
|
||||
Dim bResult As Boolean = WriteInt(nDBAddress, nStartIndex, nValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If bResult Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return bResult
|
||||
Case 3
|
||||
Dim nValue As Integer = 0
|
||||
If Not Integer.TryParse(Value, nValue) Then Return False
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
EgtOutLog("Scrittura variabile " & Address & " (Tipo 3) con valore " & Value)
|
||||
End If
|
||||
Dim bResult As Boolean = WriteDInt(nDBAddress, nStartIndex, nValue)
|
||||
If Map.refMachManaging.Debug > 1 Then
|
||||
If bResult Then
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " effettuata")
|
||||
Else
|
||||
EgtOutLog("Scrittura variabile " & nDBAddress & ":" & nStartIndex & " con valore " & Value & " fallita")
|
||||
End If
|
||||
End If
|
||||
Return bResult
|
||||
End Select
|
||||
End Function
|
||||
|
||||
#End Region ' Read Variables
|
||||
|
||||
Friend Function ReadInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetIntAt(IntBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteInt(DBNumber As Integer, Start As Integer, Value As Int16) As Boolean
|
||||
S7.SetIntAt(IntBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 2, IntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadBool(DBNumber As Integer, Start As Integer, ByRef Value As Boolean) As Boolean
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = BitConverter.ToBoolean(BoolBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteBool(DBNumber As Integer, Start As Integer, Value As Boolean) As Boolean
|
||||
If Value Then
|
||||
BoolBuffer(0) = &H1
|
||||
Else
|
||||
BoolBuffer(0) = &H0
|
||||
End If
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 1, BoolBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadDInt(DBNumber As Integer, Start As Integer, ByRef Value As Integer) As Boolean
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetDIntAt(DIntBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteDInt(DBNumber As Integer, Start As Integer, Value As Integer) As Boolean
|
||||
S7.SetDIntAt(DIntBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, DIntBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadReal(DBNumber As Integer, Start As Integer, ByRef Value As Double) As Boolean
|
||||
' Read 4 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetRealAt(RealBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteReal(DBNumber As Integer, Start As Integer, Value As Single) As Boolean
|
||||
S7.SetRealAt(RealBuffer, 0, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, 4, RealBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Function ReadString(DBNumber As Integer, Start As Integer, Length As Integer, ByRef Value As String) As Boolean
|
||||
' Read 2 bytes from the DBNumber starting from Start and puts them into ReadBuffer.
|
||||
Dim Result As Integer = Client.DBRead(DBNumber, Start, Length, StringBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
If Result = 0 Then
|
||||
Value = S7.GetStringAt(StringBuffer, 0)
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function WriteString(DBNumber As Integer, Start As Integer, Value As String) As Boolean
|
||||
If Value.Length > 65535 Then
|
||||
Return False
|
||||
End If
|
||||
S7.SetStringAt(StringBuffer, 0, 65535, Value)
|
||||
' Read "Size" bytes from the DB "DBNumber" starting from 0 and puts them into Buffer.
|
||||
Dim Result As Integer = Client.DBWrite(DBNumber, Start, Value.Length + 2, StringBuffer) ' DbNumber, Start, Amount, Buffer
|
||||
Return Result = 0
|
||||
End Function
|
||||
|
||||
Friend Sub ResetStep(bReset As Boolean)
|
||||
Dim ResetStep As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList(19) ' Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP)
|
||||
If bReset Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 1")
|
||||
ResetStep.sValue = 1
|
||||
Threading.Thread.Sleep(100)
|
||||
Dim nResetStepOk As Integer = 0
|
||||
Dim ResetStepOk As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STEP_OK)
|
||||
While nResetStepOk <> 1
|
||||
Map.refMachManaging.DebugMessage(1, "Rileggo variabili")
|
||||
RefreshAllVars()
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo valore ResetStepOk")
|
||||
Integer.TryParse(ResetStepOk.sValue, nResetStepOk)
|
||||
Threading.Thread.Sleep(1000)
|
||||
End While
|
||||
End If
|
||||
ResetStep.sValue = 0
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto variabile ResetStep a 0")
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadPLCMessages()
|
||||
|
||||
Dim nPlc_Msg As New List(Of Byte)
|
||||
For Index As Integer = 1 To 6
|
||||
Dim nIndex As Integer = Index
|
||||
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
|
||||
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
|
||||
Dim nTemp As Int16 = 0
|
||||
Int16.TryParse(PLCMessagesVariable.sValue, nTemp)
|
||||
nTemp = BinaryPrimitives.ReverseEndianness(nTemp)
|
||||
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
|
||||
nPlc_Msg.AddRange(Bytes)
|
||||
Next
|
||||
Dim BitArray As New BitArray(nPlc_Msg.ToArray())
|
||||
Dim ErrorList As New List(Of Integer)
|
||||
For BitIndex = 0 To BitArray.Count - 1
|
||||
If BitIndex <= 169 AndAlso BitArray(BitIndex) Then
|
||||
ErrorList.Add(BitIndex)
|
||||
End If
|
||||
Next
|
||||
ShowPLCError(ErrorList)
|
||||
End Sub
|
||||
|
||||
Friend Sub ShowPLCError(ErrorNumber As List(Of Integer))
|
||||
' resetto stati bFound
|
||||
For Each Message In m_ActiveMessages
|
||||
Message.bFound = False
|
||||
Next
|
||||
|
||||
For index As Integer = 0 To ErrorNumber.Count - 1
|
||||
Dim nIndex As Integer = index
|
||||
Dim NewMessageInList As SiemensReadMessages = m_ActiveMessages.FirstOrDefault(Function(x) x.nIndex = 0.ToString())
|
||||
' se il messaggio e' gia' in lista
|
||||
If Not IsNothing(NewMessageInList) Then
|
||||
' lo segno come trovato
|
||||
NewMessageInList.bFound = True
|
||||
Else
|
||||
' lo aggiungo
|
||||
Dim NewMessage As SiemensReadMessages = New SiemensReadMessages(0.ToString())
|
||||
NewMessage.bFound = True
|
||||
m_ActiveMessages.Add(NewMessage)
|
||||
m_SiemensAlarmCallbackDlg(0, 0)
|
||||
End If
|
||||
Next
|
||||
|
||||
' cancello messaggi non trovati
|
||||
For Index = m_ActiveMessages.Count - 1 To 0 Step -1
|
||||
Dim Message As SiemensReadMessages = m_ActiveMessages(Index)
|
||||
If Not Message.bFound Then
|
||||
m_SiemensAlarmCallbackDlg(Message.nIndex, 1)
|
||||
m_ActiveMessages.RemoveAt(Index)
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Class DBBuffer
|
||||
|
||||
Private m_DBAddress As Integer
|
||||
Public ReadOnly Property DBAddress As Integer
|
||||
Get
|
||||
Return m_DBAddress
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DBValue(65536) As Byte
|
||||
Public ReadOnly Property DBValue As Byte()
|
||||
Get
|
||||
Return m_DBValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(DBAddress As Integer, DBValue As Byte())
|
||||
m_DBAddress = DBAddress
|
||||
m_DBValue = DBValue
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class SiemensReadMessages
|
||||
|
||||
Private m_nIndex As Integer
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
Private m_sMessage As String
|
||||
Public ReadOnly Property sMessage As String
|
||||
Get
|
||||
Return m_sMessage
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetMessage(sValue As String)
|
||||
m_sMessage = sValue
|
||||
End Sub
|
||||
|
||||
Private m_bFound As Boolean = False
|
||||
Friend Property bFound As Boolean
|
||||
Get
|
||||
Return m_bFound
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bFound = value
|
||||
End Set
|
||||
End Property
|
||||
Public Sub New(nIndex As Integer)
|
||||
m_nIndex = nIndex
|
||||
m_sMessage = sMessage
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -19,6 +19,8 @@ Module ConstCommVar
|
||||
NUM_FLEXIUM = 2
|
||||
NUM_AXIUM_APSERVER = 3
|
||||
NUM_AXIUM_PCTOOLKIT = 4
|
||||
SIEMENS_SHARP7 = 5
|
||||
SIEMENS_MYHMI = 6
|
||||
End Enum
|
||||
|
||||
' Assi
|
||||
@@ -54,6 +56,22 @@ Module ConstCommVar
|
||||
Public Const PLC_MESSAGES As String = "PLC_Messages"
|
||||
' variabile per leggere e scrivere permesso invio cn a macchina
|
||||
Public Const SENDPERMISSION As String = "SendPermission"
|
||||
' variabile per confermare lettura dati di stato pezzo
|
||||
Public Const DATAREADED As String = "Data_Readed"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESETREADED As String = "Reset_Readed"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const DATATOREAD As String = "Data_ToRead"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESET_STEP As String = "Reset_Step"
|
||||
' variabile per confermare lettura stato reset
|
||||
Public Const RESET_STEP_OK As String = "Reset_Step_Ok"
|
||||
' variabile per stato CN
|
||||
Public Const NC_STATUS As String = "NC_Status"
|
||||
' variabile per modo CN
|
||||
Public Const NC_MODE As String = "NC_Mode"
|
||||
' variabile per apertura pinze manuale
|
||||
Public Const OPEN_CLAMP As String = "Open_Clamp"
|
||||
|
||||
Public Enum OPStates
|
||||
Start = 1
|
||||
@@ -72,4 +90,11 @@ Module ConstCommVar
|
||||
Home = 8
|
||||
End Enum
|
||||
|
||||
' Variabili Siemens
|
||||
Public Const K_IP As String = "Ip"
|
||||
Public Const K_RACK As String = "Rack"
|
||||
Public Const K_SLOT As String = "Slot"
|
||||
Public Const K_TIMERINTERVAL As String = "TimerInterval"
|
||||
Public Const K_ISOFILEDIR As String = "IsoFileDir"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -16,31 +16,6 @@
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
@@ -53,29 +28,6 @@
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
@@ -102,27 +54,6 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\RemoteDebug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
@@ -161,7 +92,7 @@
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.MagMan, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2407.1708\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2406.2617\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
@@ -232,9 +163,15 @@
|
||||
<Reference Include="SdkApi.Desktop.Usb, Version=2.15.2634.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Zebra.Printer.SDK.2.15.2634\lib\net471\SdkApi.Desktop.Usb.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sharp7.net">
|
||||
<HintPath>..\..\..\EgtProg\EgtBEAMWALL\Sharp7.net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SharpSnmpLib, Version=12.1.0.0, Culture=neutral, PublicKeyToken=4c00852d3788e005, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Lextm.SharpSnmpLib.12.1.0\lib\net471\SharpSnmpLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Siemens_Dll">
|
||||
<HintPath>..\ExtLibs\Siemens_Dll.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -352,6 +289,7 @@
|
||||
<Compile Include="Comms\NUMAxiumComm.vb" />
|
||||
<Compile Include="Comms\NUMAxiumPcToolkitComm.vb" />
|
||||
<Compile Include="Comms\NUMFlexiumComm.vb" />
|
||||
<Compile Include="Comms\SIEMENSSharp7Comm.vb" />
|
||||
<Compile Include="Comms\TPAComm.vb" />
|
||||
<Compile Include="Constants\ConstMachMsg.vb" />
|
||||
<Compile Include="MachineLogPage\MachineLogPageV.xaml.vb">
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
Visibility="{Binding E80002_Visibility}"/>
|
||||
</UniformGrid>
|
||||
<Expander Grid.Row="4"
|
||||
Header="Axis">
|
||||
Header="Axis"
|
||||
Visibility="{Binding Axis_Visibility}">
|
||||
<EgtBEAMWALL:AxesPanelV DataContext="{StaticResource AxesPanelVM}"/>
|
||||
</Expander>
|
||||
|
||||
|
||||
@@ -148,6 +148,17 @@ Public Class LeftPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property m_Axis_Visibility As Visibility
|
||||
Public ReadOnly Property Axis_Visibility As Visibility
|
||||
Get
|
||||
Return m_Axis_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetAxisVisibility()
|
||||
m_Axis_Visibility = If(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Collapsed, Visibility.Visible)
|
||||
NotifyPropertyChanged(NameOf(Axis_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_bRestart As Boolean = False
|
||||
Public Property bRestart As Boolean
|
||||
Get
|
||||
@@ -269,7 +280,7 @@ Public Class LeftPanelVM
|
||||
|
||||
Public ReadOnly Property OPMode_Visibility As Visibility
|
||||
Get
|
||||
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Visibility.Visible, Visibility.Collapsed)
|
||||
Return If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT Or CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -430,7 +441,7 @@ Public Class LeftPanelVM
|
||||
New OPState("Pending", OPStates.Pending),
|
||||
New OPState("Unspecified", OPStates.Unspecified)
|
||||
}
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
m_OPStateList = New List(Of OPState) From {
|
||||
New OPState("Start", OPStates.Start),
|
||||
New OPState("Stop", OPStates.Stop),
|
||||
@@ -462,12 +473,19 @@ Public Class LeftPanelVM
|
||||
New OPState("Manual", OPModes.Manual),
|
||||
New OPState("Home", OPModes.Home)
|
||||
}
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
m_OPModeList = New List(Of OPState) From {
|
||||
New OPState("Auto", OPModes.Auto),
|
||||
New OPState("Mdi", OPModes.Mdi),
|
||||
New OPState("Manual", OPModes.Manual),
|
||||
New OPState("Reference Point", OPModes.Home)
|
||||
}
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Friend Sub SetE80000Visibility()
|
||||
' imposto visibilità variabili E80000 e seconda del tipo di controllo
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
If CurrentMachine.NCType = NCTypes.TPA OrElse CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
m_E80000_Visibility = Visibility.Collapsed
|
||||
m_E80002_Visibility = Visibility.Collapsed
|
||||
Else
|
||||
|
||||
@@ -324,7 +324,7 @@ Public Class MachCommandMessagePanelVM
|
||||
m_MachManagingThread = New Thread(Sub()
|
||||
MachineCommThread.MachManagingThreadFunction(AddressOf ResultCallbackDlg, AddressOf CloseCallbackDlg,
|
||||
AddressOf UpdateCallbackDlg, AddressOf TPAAlarmCallbackDlg, AddressOf NUMAlarmCallbackDlg,
|
||||
AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
|
||||
AddressOf SiemensAlarmCallbackDlg, AddressOf AxisCoordinatesCallbackDlg, AddressOf OpStateCallbackDlg,
|
||||
AddressOf OpModeCallbackDlg, AddressOf ChannelCallbackDlg, AddressOf ReadVarCallbackDlg)
|
||||
End Sub)
|
||||
' avvio thread di gestione della macchina che avvia la connessione
|
||||
@@ -804,6 +804,42 @@ Public Class MachCommandMessagePanelVM
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & ErrorTyp & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator, DbControllers.m_SupervisorId))
|
||||
End Sub
|
||||
|
||||
Friend Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
|
||||
|
||||
' se aggiungo allarme e non ce ne erano
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) AndAlso m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
|
||||
' avvio il timer degli allarmi
|
||||
m_AlarmTimer.Start()
|
||||
End If
|
||||
Dim AlarmMessage As String = nIndex
|
||||
|
||||
' costruisco messaggio errore in base al tipo
|
||||
Dim sErrorMessage As String = AlarmMessage
|
||||
If bMsgTranslationActive Then
|
||||
Dim sTranslatedMsg = MachMsg(MsgParagraphs.PLC, nIndex)
|
||||
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
|
||||
sErrorMessage = sTranslatedMsg
|
||||
End If
|
||||
End If
|
||||
AlarmMessage = If(Not String.IsNullOrWhiteSpace(sErrorMessage), sErrorMessage, "")
|
||||
|
||||
If AlarmOperation = CInt(ISOCNC.Remoting.AlarmOperation.Addition) Then
|
||||
m_ErrCycle.Add(Alarm.CreateAlarm(nIndex, AlarmMessage))
|
||||
Else
|
||||
m_ErrCycle.RemoveAll(Function(x) x.sCode = nIndex)
|
||||
End If
|
||||
|
||||
' forzo aggiornamento allarmi
|
||||
AlarmTimer_Tick()
|
||||
' se non ci sono errori
|
||||
If m_ErrCycle.Count = 0 AndAlso m_Iso.Count = 0 AndAlso m_Message.Count = 0 AndAlso m_ErrSystem.Count = 0 Then
|
||||
' fermo timer degli allarmi
|
||||
m_AlarmTimer.Stop()
|
||||
End If
|
||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & nIndex & LogEvent.cSeparator & sErrorMessage, DbControllers.m_SupervisorId))
|
||||
End Sub
|
||||
|
||||
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
|
||||
Map.refAxesPanelVM.AxisCoordinatesCallbackDlg(AxisValue, AxisIndex)
|
||||
End Sub
|
||||
@@ -821,7 +857,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
Map.refLeftPanelVM.SetOPState(NewState)
|
||||
End Select
|
||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
||||
@@ -835,7 +871,7 @@ Public Class MachCommandMessagePanelVM
|
||||
Return
|
||||
End If
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
Map.refLeftPanelVM.SetOPMode(NewState)
|
||||
End Select
|
||||
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
|
||||
|
||||
@@ -13,9 +13,6 @@ Public Class MyMachGroupPanelVM
|
||||
' lista dei RawPart presenti su db
|
||||
Private m_RawPartDbList As New List(Of RawPartM)
|
||||
|
||||
' tolleranza di ricerca delle barre in magazzino
|
||||
Private m_DimensionRange As Double = 0.1
|
||||
|
||||
Public Shadows Property SelectedMachGroup As MachGroupVM
|
||||
Get
|
||||
Return m_SelectedMachGroup
|
||||
@@ -54,7 +51,7 @@ Public Class MyMachGroupPanelVM
|
||||
MachGroup.UpdateUsage()
|
||||
End If
|
||||
Next
|
||||
ReadAllRawPartFromDb(Map.refSupervisorManagerVM.nPROJTYPE)
|
||||
ReadAllRawPartFromDb()
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -136,18 +133,18 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadAllRawPartFromDb(nPROJTYPE As BWType)
|
||||
Friend Sub ReadAllRawPartFromDb()
|
||||
m_RawPartDbList.Clear()
|
||||
' aggiornamento materiale
|
||||
For Each MachGroup As MyMachGroupVM In Map.refMachGroupPanelVM.m_MachGroupVMList
|
||||
If IsNothing(MachGroup.MyMachGroupM.RawPartM) OrElse MachGroup.MyMachGroupM.RawPartM.nId = 0 OrElse MachGroup.MyMachGroupM.RawPartM.Material.nId = 0 OrElse String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then
|
||||
ReadRawPartFromDb(MachGroup, nPROJTYPE, True)
|
||||
ReadRawPartFromDb(MachGroup, True)
|
||||
End If
|
||||
Next
|
||||
m_RawPartDbList.Clear()
|
||||
End Sub
|
||||
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, nPROJTYPE As BWType, Optional bUseList As Boolean = False)
|
||||
Friend Sub ReadRawPartFromDb(MachGroup As MyMachGroupVM, Optional bUseList As Boolean = False)
|
||||
If Not IsNothing(MachGroup.MyMachGroupM.RawPartM) AndAlso MachGroup.MyMachGroupM.RawPartM.nId > 0 AndAlso MachGroup.MyMachGroupM.RawPartM.Material.nId > 0 AndAlso Not String.IsNullOrWhiteSpace(MachGroup.MyMachGroupM.RawPartM.Material.sWarehouseMaterial) Then Return
|
||||
' aggiornamento materiale
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
@@ -164,36 +161,27 @@ Public Class MyMachGroupPanelVM
|
||||
Next
|
||||
Else
|
||||
Dim Material As MaterialM = Nothing
|
||||
' verifico che il materiale non sia nullo
|
||||
If (String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sMaterial) OrElse String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sWarehouseMaterial)) AndAlso MachGroup.PartVMList.Count > 0 Then
|
||||
MachGroup.MyMachGroupM.sMATERIAL = MachGroup.PartVMList(0).sMATERIAL
|
||||
MachGroup.MyMachGroupM.sWAREHOUSEMATERIAL = MachGroup.PartVMList(0).sWAREHOUSEMATERIAL
|
||||
MachGroup.RawPartM.Material.SetMaterial(MachGroup.PartVMList(0).sMATERIAL)
|
||||
MachGroup.RawPartM.Material.SetWarehouseMaterial(MachGroup.PartVMList(0).sWAREHOUSEMATERIAL)
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sMATERIAL))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sMaterial)
|
||||
Select Case SearchMaterial.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) Math.Abs(x.dH - MachGroup.dH) < m_DimensionRange)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.dH = MachGroup.dH)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
Material = SearchMaterial.Result.FirstOrDefault(Function(x) x.dH = MachGroup.dH)
|
||||
End If
|
||||
Case Else
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
Material = New MaterialM(MachGroup.dW, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
End If
|
||||
End Select
|
||||
Dim SearchRawPart As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.dL = MachGroup.dL)
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||
@@ -204,18 +192,13 @@ Public Class MyMachGroupPanelVM
|
||||
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||
Next
|
||||
Else
|
||||
Dim nRawPartId As Integer = 0
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, 0, MachGroup.dL, 0, False))
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
End If
|
||||
Dim nRawPartId As Integer = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
If nRawPartId > 0 Then
|
||||
SearchRawPart = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.Material.dW - Math.Min(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - Math.Max(MachGroup.dW, MachGroup.dH)) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) Math.Abs(x.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.dL - MachGroup.dL) < m_DimensionRange)
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = SearchRawPart.FirstOrDefault(Function(x) x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.dL = MachGroup.dL)
|
||||
End If
|
||||
If IsNothing(RawPart) Then
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
|
||||
@@ -22,13 +22,14 @@ Public Class MyMachGroupVM
|
||||
ElseIf m_bToBeProduced OrElse m_bSentToMachine Then
|
||||
Return False
|
||||
' se la macchina e' ferma
|
||||
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
|
||||
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
|
||||
' verifico se c'e' un pezzo non finito
|
||||
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not m_bToBeProduced)
|
||||
Dim ToBeRestartedPart As MyMachGroupVM = Map.refSupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x As MyMachGroupVM) x.nProduction_State = Global.EgtBEAMWALL.Core.ItemState.WIP And Not x.m_bToBeProduced)
|
||||
' se c'e', attivo solo il pezzo non finito
|
||||
Return Not (Not IsNothing(ToBeRestartedPart) AndAlso Not ToBeRestartedPart Is Me)
|
||||
Else
|
||||
@@ -48,11 +49,12 @@ Public Class MyMachGroupVM
|
||||
Case ItemState.WIP
|
||||
If Not m_bToBeProduced AndAlso Not m_bSentToMachine Then
|
||||
Return True
|
||||
ElseIf IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified) Then
|
||||
ElseIf CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(IsNothing(Map.refLeftPanelVM.SelOPState) OrElse
|
||||
(Map.refLeftPanelVM.SelOPState.Id = 0 OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.End OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Stop OrElse
|
||||
Map.refLeftPanelVM.SelOPState.Id = OPStates.Unspecified)) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -86,7 +88,7 @@ Public Class MyMachGroupVM
|
||||
Sub New(MyMachGroupM As MyMachGroupM)
|
||||
MyBase.New(MyMachGroupM)
|
||||
' aggiungo RawPartM
|
||||
If Map.refSupervisorManagerVM.nPROJTYPE = BWType.BEAM Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(Math.Min(MyMachGroupM.dW, MyMachGroupM.dH), Math.Max(MyMachGroupM.dW, MyMachGroupM.dH), 0, MyMachGroupM.sMATERIAL), 0, MyMachGroupM.dL)
|
||||
Else
|
||||
MyMachGroupM.RawPartM = New RawPartM(New MaterialM(0, MyMachGroupM.dH, 0, MyMachGroupM.sMATERIAL), MyMachGroupM.dW, MyMachGroupM.dL)
|
||||
@@ -231,27 +233,45 @@ Public Class MyMachGroupVM
|
||||
End If
|
||||
' se progetto travi e lavorazione interrotta da reset
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM AndAlso (bResetWhileCutting OrElse dtStartTime <> DateTime.MinValue) And Not Map.refLeftPanelVM.bRestart Then
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
Dim bRedo As MessageBoxResult = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
Dim bRedo As MessageBoxResult = MessageBoxResult.No
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not IsNothing(Map.refMachManaging) Then
|
||||
' leggo pinze aperte
|
||||
Dim Open_ClampVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = OPEN_CLAMP)
|
||||
Map.refMachManaging.Siemens_Sharp7.RefreshAllVars()
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo variabile pinze aperte " & Open_ClampVariable.sValue)
|
||||
If Open_ClampVariable.sValue = 1 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Pinze aperte, ripartenza impossibile")
|
||||
bRedo = MessageBoxResult.No
|
||||
MessageBox.Show("Pinze aperte, ripartenza impossibile!!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
Else
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
bRedo = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
End If
|
||||
Else
|
||||
' chiedo se riprendere o rifare la barra da zero
|
||||
bRedo = MessageBox.Show(EgtMsg(62509), "", MessageBoxButton.YesNo, MessageBoxImage.Information)
|
||||
End If
|
||||
Select Case bRedo
|
||||
Case MessageBoxResult.Yes
|
||||
' segno da rifare pezzi non completamente lavorati
|
||||
For Each Part As PartVM In PartVMList
|
||||
If Part.dtEndTime <> DateTime.MinValue Then
|
||||
Part.bDO = False
|
||||
Else
|
||||
Part.SetDo(True)
|
||||
End If
|
||||
'Part.bDO = (Part.dtEndTime = DateTime.MinValue)
|
||||
'Part.NotifyPropertyChanged(NameOf(Part.bRedo))
|
||||
Next
|
||||
' se ripresa, mostro lista feature e colonne Redo
|
||||
Map.refLeftPanelVM.bRestart = True
|
||||
' blocco produzione di tutti gli altri
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
' riabilito bottoni di comunicazione a fine invio programma
|
||||
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
|
||||
Return
|
||||
If CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 Then
|
||||
' segno da rifare pezzi non completamente lavorati
|
||||
For Each Part As PartVM In PartVMList
|
||||
If Part.dtEndTime <> DateTime.MinValue Then
|
||||
Part.bDO = False
|
||||
Else
|
||||
Part.SetDo(True)
|
||||
End If
|
||||
'Part.bDO = (Part.dtEndTime = DateTime.MinValue)
|
||||
'Part.NotifyPropertyChanged(NameOf(Part.bRedo))
|
||||
Next
|
||||
' se ripresa, mostro lista feature e colonne Redo
|
||||
Map.refLeftPanelVM.bRestart = True
|
||||
' blocco produzione di tutti gli altri
|
||||
MyMachGroupVM.UpdateProduceIsEnabledForAll()
|
||||
' riabilito bottoni di comunicazione a fine invio programma
|
||||
Map.refMachCommandMessagePanelVM.SetCommBtnIsEnabled(True)
|
||||
Return
|
||||
End If
|
||||
Case MessageBoxResult.No
|
||||
' annullo stati dei pezzi gia' fatti
|
||||
For Each Part In PartVMList
|
||||
|
||||
@@ -50,7 +50,7 @@ Public Class PartVM
|
||||
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
|
||||
MyBase.New(PartM, ParentMachGroupVM)
|
||||
' aggiungo MaterialM
|
||||
If Map.refSupervisorManagerVM.nPROJTYPE = BWType.BEAM Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
PartM.MaterialM = New MaterialM(Math.Min(dW, dH), Math.Max(dW, dH), 0, PartM.sMATERIAL)
|
||||
Else
|
||||
PartM.MaterialM = New MaterialM(0, dH, 0, PartM.sMATERIAL)
|
||||
|
||||
@@ -21,6 +21,7 @@ Module MachCommConst
|
||||
Public Delegate Sub UpdateCallbackDlg(Param As String, Params As String)
|
||||
Public Delegate Sub TPAAlarmCallbackDlg(ByVal AlarmOperation As Integer, ByVal AlarmType As Integer, ByVal AlarmMessage As String, ByVal AlarmCode As String, ByVal AlarmDateTime As String)
|
||||
Public Delegate Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal numberOfError As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
|
||||
Public Delegate Sub SiemensAlarmCallbackDlg(nIndex As Integer, AlarmOperation As Integer)
|
||||
Public Delegate Sub AxisCoordinatesCallbackDlg(ByVal AxisValue As Double, ByVal AxisIndex As Integer)
|
||||
Public Delegate Sub OpStateCallbackDlg(ByVal newOpState As Integer)
|
||||
Public Delegate Sub OpModeCallbackDlg(ByVal newOpState As Integer)
|
||||
@@ -32,6 +33,7 @@ Module MachCommConst
|
||||
Friend m_UpdateCallbackDlg As UpdateCallbackDlg
|
||||
Friend m_TPAAlarmCallbackDlg As TPAAlarmCallbackDlg
|
||||
Friend m_NUMAlarmCallbackDlg As NUMAlarmCallbackDlg
|
||||
Friend m_SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg
|
||||
Friend m_AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg
|
||||
Friend m_OpStateCallbackDlg As OpStateCallbackDlg
|
||||
Friend m_OpModeCallbackDlg As OpModeCallbackDlg
|
||||
|
||||
@@ -7,6 +7,7 @@ Imports EgtWPFLib5
|
||||
Imports System.IO
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Supervisor.CommVar
|
||||
Imports System.Windows.Forms.VisualStyles
|
||||
|
||||
Public Class MachManaging
|
||||
|
||||
@@ -49,6 +50,11 @@ Public Class MachManaging
|
||||
Return m_CN
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Siemens_Sharp7 As SIEMENSSharp7Comm
|
||||
Get
|
||||
Return m_CN
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Shared WithEvents m_CommandList As New ObservableCollection(Of ThreadCommand)
|
||||
Public Shared ReadOnly Property CommandList As ObservableCollection(Of ThreadCommand)
|
||||
@@ -97,7 +103,20 @@ Public Class MachManaging
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' variabile che indica prima barra dopo start (Siemens)
|
||||
Private m_bFirstRaw As Boolean = False
|
||||
|
||||
' variabile che indica se emettere ii messaggi di debug
|
||||
Private m_Debug As Integer = 0
|
||||
Public ReadOnly Property Debug As Integer
|
||||
Get
|
||||
Return m_Debug
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
' leggo variabile debug da ini
|
||||
m_Debug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, CurrentMachine.sMachIniFile)
|
||||
' imposto in Map
|
||||
Map.SetRefMachManaging(Me)
|
||||
AddHandler m_CommandList.CollectionChanged, AddressOf CommandList_CollectionChanged
|
||||
@@ -241,7 +260,7 @@ Public Class MachManaging
|
||||
' Threading.Thread.Sleep(300)
|
||||
' End If
|
||||
' End If
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.TPA, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT, NCTypes.SIEMENS_SHARP7
|
||||
' eseguo ciclo principale
|
||||
Dim nReset_State As Integer
|
||||
Dim nStart_State As Boolean
|
||||
@@ -254,6 +273,9 @@ Public Class MachManaging
|
||||
Dim nISO_Sent As Integer
|
||||
Dim nRunning As Integer
|
||||
Dim nCurrMachIndex As Integer
|
||||
Dim nDataWrite As Integer
|
||||
Dim nNCStatus As Integer
|
||||
Dim nNCMode As Integer
|
||||
Dim ResetVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESET_STATE)
|
||||
Dim StartVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = START_STATE)
|
||||
Dim StopVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = STOP_STATE)
|
||||
@@ -265,6 +287,11 @@ Public Class MachManaging
|
||||
Dim ISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
|
||||
Dim RunningVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RUNNING)
|
||||
Dim MachIndexVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = MACHINDEX)
|
||||
Dim DataReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATAREADED)
|
||||
Dim ResetReadedVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = RESETREADED)
|
||||
Dim DataToReadVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = DATATOREAD)
|
||||
Dim NCStatusVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_STATUS)
|
||||
Dim NCModeVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = NC_MODE)
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
' leggo tutte le variabili
|
||||
@@ -441,7 +468,73 @@ Public Class MachManaging
|
||||
'EgtOutLog("Pre lettura posizioni")
|
||||
Num_Axium_PCToolkit.ReadPosition()
|
||||
'EgtOutLog("Post lettura messaggi")
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' leggo tutte le variabili
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo tutte le variabili")
|
||||
Siemens_Sharp7.RefreshAllVars()
|
||||
If Not IsNothing(ResetVariable.sValue) Then
|
||||
Integer.TryParse(ResetVariable.sValue, nReset_State)
|
||||
Else
|
||||
nReset_State = 1
|
||||
End If
|
||||
If Not IsNothing(ProdVariable.sValue) Then
|
||||
Integer.TryParse(ProdVariable.sValue, nP_Prod)
|
||||
Else
|
||||
nP_Prod = -1
|
||||
End If
|
||||
If Not IsNothing(MachGroupVariable.sValue) Then
|
||||
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
|
||||
Else
|
||||
nP_Machgroup = -1
|
||||
End If
|
||||
If Not IsNothing(PartVariable.sValue) Then
|
||||
Integer.TryParse(PartVariable.sValue, nP_Part)
|
||||
Else
|
||||
nP_Part = -1
|
||||
End If
|
||||
If Not IsNothing(StateVariable.sValue) Then
|
||||
Integer.TryParse(StateVariable.sValue, nP_State)
|
||||
Else
|
||||
nP_State = -1
|
||||
End If
|
||||
If Not IsNothing(ISONumVariable.sValue) Then
|
||||
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
|
||||
Else
|
||||
nISO_Num = -1
|
||||
End If
|
||||
If Not IsNothing(RunningVariable.sValue) Then
|
||||
Integer.TryParse(RunningVariable.sValue, nRunning)
|
||||
Else
|
||||
nRunning = -1
|
||||
End If
|
||||
If Not IsNothing(DataReadedVariable.sValue) Then
|
||||
Integer.TryParse(DataReadedVariable.sValue, nDataWrite)
|
||||
Else
|
||||
nDataWrite = -1
|
||||
End If
|
||||
If Not IsNothing(NCStatusVariable.sValue) Then
|
||||
Integer.TryParse(NCStatusVariable.sValue, nNCStatus)
|
||||
Else
|
||||
nNCStatus = -1
|
||||
End If
|
||||
If Not IsNothing(NCModeVariable.sValue) Then
|
||||
Integer.TryParse(NCModeVariable.sValue, nNCMode)
|
||||
Else
|
||||
nNCMode = -1
|
||||
End If
|
||||
' leggo messaggi plc
|
||||
Siemens_Sharp7.ReadPLCMessages()
|
||||
End Select
|
||||
' se SiemensSharp7 e reset a 0, verifico che conferma lettura reset sia a zero
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And ResetReadedVariable.sValue = "1" And ResetVariable.sValue = "0" Then
|
||||
Map.refMachManaging.DebugMessage(1, "Azzero lettura reset")
|
||||
ResetReadedVariable.sValue = "0"
|
||||
End If
|
||||
' se SiemensSharp7 e dati letti a 1 e dati scritti a 0, verifico che dati letti sia a zero
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 And DataReadedVariable.sValue = "1" And DataToReadVariable.sValue = "0" Then
|
||||
Map.refMachManaging.DebugMessage(1, "Azzero lettura dati")
|
||||
DataReadedVariable.sValue = "0"
|
||||
End If
|
||||
' se NUM aggiorno stato della macchina
|
||||
If CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Then
|
||||
Dim OpState As OPStates
|
||||
@@ -469,6 +562,41 @@ Public Class MachManaging
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
m_OpStateCallbackDlg(OpState)
|
||||
End If
|
||||
ElseIf CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
Dim OpState As OPStates
|
||||
If nNCStatus > 0 Then
|
||||
Select Case nNCStatus
|
||||
Case 1
|
||||
OpState = OPStates.End
|
||||
Case 2
|
||||
OpState = OPStates.Stop
|
||||
Case 3
|
||||
OpState = OPStates.Start
|
||||
Case Else
|
||||
OpState = OPStates.Unspecified
|
||||
End Select
|
||||
End If
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto stato CN: " & OpState)
|
||||
m_OpStateCallbackDlg(OpState)
|
||||
End If
|
||||
Dim OpMode As OPModes
|
||||
If nNCMode > 0 Then
|
||||
Select Case nNCMode
|
||||
Case 1
|
||||
OpMode = OPModes.Manual
|
||||
Case 2
|
||||
OpMode = OPModes.Auto
|
||||
Case 3
|
||||
OpMode = OPModes.Mdi
|
||||
Case 4 ' Reference Point
|
||||
OpMode = OPModes.Home
|
||||
End Select
|
||||
End If
|
||||
If IsNothing(Map.refLeftPanelVM.SelOPMode) OrElse OpMode <> Map.refLeftPanelVM.SelOPMode.Id Then
|
||||
Map.refMachManaging.DebugMessage(1, "Imposto modo CN: " & OpMode)
|
||||
m_OpModeCallbackDlg(OpMode)
|
||||
End If
|
||||
End If
|
||||
' se TPA e non ancora fatto, preparo variabili barra successiva
|
||||
If CurrentMachine.NCType = NCTypes.TPA AndAlso CurrentMachine.Flow = FlowTypes.CONTINUOUS AndAlso m_NextBarId = 0 Then
|
||||
@@ -482,19 +610,31 @@ Public Class MachManaging
|
||||
nISO_Sent = 1) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso
|
||||
Not Num_Axium_PCToolkit.bIsTransferActive AndAlso
|
||||
nISO_Sent = 1) Then
|
||||
nISO_Sent = 1) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
(nISO_Num = 0 OrElse
|
||||
nISO_Num = nRunning)) Then
|
||||
' verifico se c'e' un programma da lanciare
|
||||
Map.refMachManaging.DebugMessage(1, "Entro in SendNextProgram")
|
||||
SendNextProgram()
|
||||
End If
|
||||
' verifico se scattato stato reset
|
||||
If nReset_State <> 0 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Scattato Reset")
|
||||
' resetto tutti i programmi
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then Map.refProjectVM.SupervisorMachGroupPanelVM.ResetAllMachGroups()
|
||||
' resetto variabili P
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
'resetto programma corrente
|
||||
Map.refMachManaging.DebugMessage(1, "Resetto programma corrente")
|
||||
ISONumVariable.sValue = "0"
|
||||
m_bFirstRaw = True
|
||||
Else
|
||||
' resetto variabili P
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
'Tpa.RWVariableManager.WriteVar(P_PROD, 0)
|
||||
'Tpa.RWVariableManager.WriteVar(P_MACHGROUP, 0)
|
||||
'Tpa.RWVariableManager.WriteVar(P_PART, 0)
|
||||
@@ -504,7 +644,12 @@ Public Class MachManaging
|
||||
RemoveAllProgram() ' rimuovo programma default per pending
|
||||
End If
|
||||
' azzero variabile reset
|
||||
ResetVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
Map.refMachManaging.DebugMessage(1, "Confermo lettura reset")
|
||||
ResetReadedVariable.sValue = "1"
|
||||
Else
|
||||
ResetVariable.sValue = "0"
|
||||
End If
|
||||
'Tpa.remObject.SetVariableCommand(CInt(ISOCNC.Remoting.VariableCommands.WriteVar),
|
||||
' RWVariableManager.GetReadVarFromName(RESET_STATE).sAddress, "0")
|
||||
' resetto prossima barra e variabili V
|
||||
@@ -528,10 +673,17 @@ Public Class MachManaging
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
' verifico stati inizio e fine pezzi
|
||||
ElseIf nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0 Then
|
||||
ElseIf (CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso
|
||||
DataToReadVariable.sValue = "1" AndAlso
|
||||
nP_Prod <> 0 AndAlso
|
||||
nP_Machgroup <> 0 AndAlso
|
||||
nP_Part <> 0) Then
|
||||
If nP_State = PartState.START Then
|
||||
Map.refMachManaging.DebugMessage(1, "Leggo dati start")
|
||||
Dim dtStart As DateTime = DateTime.Now()
|
||||
' recupero gruppo di lavorazione del pezzo
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||
@@ -573,6 +725,9 @@ Public Class MachManaging
|
||||
Tpa.RWVariableManager.WriteVarByName(P_STATE, 0)
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
StateVariable.sValue = "0"
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Map.refMachManaging.DebugMessage(1, "Confermo lettura dati start")
|
||||
DataReadedVariable.sValue = "1"
|
||||
End Select
|
||||
' se nessun pezzo della barra diverso da quello corrente e' in start
|
||||
If Not MachGroup.PartVMList.Any(Function(x) x.nPartId <> nP_Part AndAlso x.nProduction_State = 1) Then
|
||||
@@ -590,9 +745,11 @@ Public Class MachManaging
|
||||
End If
|
||||
' flag di aggiornamento log macchina
|
||||
Map.refMachineLogPageVM.UpdateMachineLogList(False)
|
||||
DebugMessage(1, "Fine lettura dati start")
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
ElseIf nP_State = PartState.END_ Then
|
||||
DebugMessage(1, "Leggo dati end")
|
||||
Dim dtEnd As DateTime = DateTime.Now()
|
||||
' recupero gruppo di lavorazione del pezzo
|
||||
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
|
||||
@@ -652,10 +809,16 @@ Public Class MachManaging
|
||||
' scrivo evento fine MachGroup su DB
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
|
||||
' azzero tutte le variabilli per iniziare barra successiva
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
' azzero variabile per far ripartire macchina
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
DebugMessage(1, "Confermo lettura dati end")
|
||||
DataReadedVariable.sValue = "1"
|
||||
Else
|
||||
ProdVariable.sValue = "0"
|
||||
MachGroupVariable.sValue = "0"
|
||||
PartVariable.sValue = "0"
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
|
||||
' se non impostata data start
|
||||
If MachGroup.dtStartTime = DateTime.MinValue Then
|
||||
@@ -683,35 +846,24 @@ Public Class MachManaging
|
||||
End If
|
||||
Else
|
||||
' azzero variabile per far ripartire macchina
|
||||
StateVariable.sValue = "0"
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
DataReadedVariable.sValue = "1"
|
||||
Else
|
||||
StateVariable.sValue = "0"
|
||||
End If
|
||||
End If
|
||||
' aggiorno utilizzo barra da magazzino
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso MachGroup.PartVMList(0).nPartId = nP_Part AndAlso MachGroup.nProduction_State <> ItemState.Scrapped Then
|
||||
Dim nRawPartId As Integer = MachGroup.RawPartM.nId
|
||||
If nRawPartId <= 0 Then
|
||||
Dim nMaterialId As Integer = MachGroup.RawPartM.Material.nId
|
||||
If nMaterialId <= 0 Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
End If
|
||||
Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
If Not IsNothing(RawPartList) Then
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
RawPart = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = Math.Min(MachGroup.dW, MachGroup.dH) AndAlso x.Material.dH = Math.Max(MachGroup.dW, MachGroup.dH) AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
RawPart = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
nRawPartId = RawPart.nId
|
||||
End If
|
||||
Dim nMaterialId As Integer
|
||||
If Map.refSupervisorManagerVM.CurrProd.nType = BWType.BEAM Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(MachGroup.dW, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
ElseIf Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL Then
|
||||
nMaterialId = DbControllers.m_MaterialsController.Insert(New MaterialM(0, MachGroup.dH, 0, MachGroup.sMATERIAL, MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
Dim RawPartList = DbControllers.m_RawItemsController.GetFilt(nMaterialId)
|
||||
Dim RawPart As RawPartM = RawPartList.FirstOrDefault(Function(x) x.dL = MachGroup.dL AndAlso x.Material.dW = MachGroup.dW AndAlso x.Material.dH = MachGroup.dH AndAlso x.Material.sWarehouseMaterial = MachGroup.sWAREHOUSEMATERIAL)
|
||||
Dim RawDictionary As New Dictionary(Of Integer, Integer)
|
||||
RawDictionary.Add(nRawPartId, 1)
|
||||
RawDictionary.Add(RawPart.nId, 1)
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
DbControllers.m_MagmanController.ResourceSendCons(Map.refSupervisorManagerVM.CurrProd.ProdFileM.nProjCloudId, RawDictionary)
|
||||
@@ -732,6 +884,7 @@ Public Class MachManaging
|
||||
End If
|
||||
' flag di aggiornamento log macchina
|
||||
Map.refMachineLogPageVM.UpdateMachineLogList(False)
|
||||
DebugMessage(1, "Fine lettura dati end")
|
||||
' attesa per essere sicuro che abbia scritto e riletto variabili
|
||||
Threading.Thread.Sleep(300)
|
||||
End If
|
||||
@@ -781,25 +934,28 @@ Public Class MachManaging
|
||||
If (CurrentMachine.NCType = NCTypes.TPA AndAlso Not m_bStartPending AndAlso Tpa.opState = MachineOperatingState.Pending) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM AndAlso Not Num_Flexium.bIsTransferActive) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER AndAlso Not Num_Axium_APServer.bIsTransferActive) OrElse
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
||||
(CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT AndAlso Not Num_Axium_PCToolkit.bIsTransferActive) OrElse
|
||||
CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then ' Or Tpa.opState = MachineOperatingState.Start) Then
|
||||
' verifico se c'e' un programma da lanciare
|
||||
If Not IsNothing(Map.refProjectVM.SupervisorMachGroupPanelVM) Then
|
||||
' EgtOutLog("Start " & DateTime.Now())
|
||||
Dim bMachGroupNotReady As Boolean = False
|
||||
SyncLock m_Lock_SendProgram
|
||||
For Each MyMachGroup As MyMachGroupVM In Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList
|
||||
DebugMessage(1, "Ciclo alla ricerca di un programma da mandare")
|
||||
' EgtOutLog("Ciclo su name: " & MyMachGroup.Name & " id: " & MyMachGroup.Id)
|
||||
If Not MyMachGroup.bSentToMachine AndAlso (MyMachGroup.dtStartTime = DateTime.MinValue OrElse
|
||||
If Not MyMachGroup.bSentToMachine AndAlso (If(CurrentMachine.NCType <> NCTypes.SIEMENS_SHARP7, MyMachGroup.dtStartTime = DateTime.MinValue, MyMachGroup.dtEndTime = DateTime.MinValue) OrElse
|
||||
(Map.refSupervisorManagerVM.CurrProd.nType = BWType.WALL AndAlso MyMachGroup.bResetWhileCutting)) Then
|
||||
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " è da fare")
|
||||
' verifico se ricalcolo finito
|
||||
If MyMachGroup.bReadyForMachining AndAlso If(CurrentMachine.NCType = NCTypes.NUM_FLEXIUM Or CurrentMachine.NCType = NCTypes.NUM_AXIUM_APSERVER OrElse CurrentMachine.NCType = NCTypes.NUM_AXIUM_PCTOOLKIT, Not MyMachGroup.bSendingToMachine, True) Then
|
||||
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " pronto per essere lavorato")
|
||||
' lo lancio
|
||||
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name)
|
||||
DebugMessage(1, "Eseguo SendProgram")
|
||||
bSent = SendProgram(MyMachGroup.CnFilePath(), MyMachGroup.Name, MyMachGroup)
|
||||
' EgtOutLog(MyMachGroup.Name & " id: " & MyMachGroup.Id & " mandato " & DateTime.Now() & " " & MyMachGroup.Name & " " & bSent.ToString())
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
Case NCTypes.TPA, NCTypes.SIEMENS_SHARP7
|
||||
MyMachGroup.SetSentToMachine(bSent)
|
||||
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
MyMachGroup.SetSendingToMachine(bSent)
|
||||
@@ -816,6 +972,14 @@ Public Class MachManaging
|
||||
End If
|
||||
Next
|
||||
End SyncLock
|
||||
If CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 AndAlso Not Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State < ItemState.WIP And x.bReadyForMachining) Then
|
||||
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
|
||||
Dim nISONum As Integer = 0
|
||||
If Not Integer.TryParse(ISONumVariable.sValue, nISONum) Or nISONum <> 0 Then
|
||||
DebugMessage(1, "Resetto programma da inviare")
|
||||
ISONumVariable.sValue = 0
|
||||
End If
|
||||
End If
|
||||
If bMachGroupNotReady Then Return False
|
||||
' EgtOutLog("End " & DateTime.Now())
|
||||
End If
|
||||
@@ -933,6 +1097,46 @@ Public Class MachManaging
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End Try
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Try
|
||||
m_CN = New SIEMENSSharp7Comm(Me)
|
||||
If Siemens_Sharp7.InitConnection() Then
|
||||
m_bConnected = True
|
||||
' imposto stato manuale
|
||||
Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
Map.refLeftPanelVM.SetOPMode(ManualMode)
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
Else
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End If
|
||||
' creo classe di gestione variabili
|
||||
Catch ex As Exception
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End Try
|
||||
Case NCTypes.SIEMENS_MYHMI
|
||||
Try
|
||||
Dim SiemensCN = New Siemens_Dll.SiemensDll
|
||||
Dim sLog As String = Path.GetDirectoryName(Map.refMainWindowVM.MainWindowM.sLogFile) & "\SiemensLog.txt"
|
||||
SiemensCN.SetLogPath(Path.GetDirectoryName(Map.refMainWindowVM.MainWindowM.sLogFile) & "\SiemensLog.txt")
|
||||
Dim x As Boolean = SiemensCN.Init()
|
||||
|
||||
'If Siemens_Sharp7.InitConnection() Then
|
||||
' m_bConnected = True
|
||||
' ' imposto stato manuale
|
||||
' Dim ManualMode As OPState = Map.refLeftPanelVM.OPModeList.FirstOrDefault(Function(x) x.Id = OPModes.Manual)
|
||||
' Map.refLeftPanelVM.SetOPMode(ManualMode)
|
||||
' m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
'Else
|
||||
' m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
' Return
|
||||
'End If
|
||||
' creo classe di gestione variabili
|
||||
Catch ex As Exception
|
||||
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.ERROR_, ResultTypes.EXECUTED, "Errore: impossibile connettersi!")
|
||||
Return
|
||||
End Try
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -965,6 +1169,13 @@ Public Class MachManaging
|
||||
' chiudo classe Num_Flexium
|
||||
Me.OnDispose()
|
||||
'Num_Flexium.OnDispose()
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
m_bConnected = False
|
||||
Siemens_Sharp7.CloseConnection()
|
||||
m_ResultCallbackDlg(CommandTypes.DISCONNECT, CommandStates.OK, ResultTypes.EXECUTED, "")
|
||||
' chiudo classe Num_Flexium
|
||||
Me.OnDispose()
|
||||
'Num_Flexium.OnDispose()
|
||||
End Select
|
||||
' termino thread di comunicazione
|
||||
MachineCommThread.StopThread()
|
||||
@@ -1080,7 +1291,7 @@ Public Class MachManaging
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Public Function SendProgram(ProgramPath As String, ProgramId As String) As Boolean
|
||||
Public Function SendProgram(ProgramPath As String, ProgramId As String, Optional MyMachGroup As MyMachGroupVM = Nothing) As Boolean
|
||||
Select Case CurrentMachine.NCType
|
||||
Case NCTypes.TPA
|
||||
If Tpa.opState = MachineOperatingState.Pending Then
|
||||
@@ -1111,6 +1322,27 @@ Public Class MachManaging
|
||||
Num_Axium_PCToolkit.FileDownload(nFileType * 10, ProgramPath)
|
||||
End If
|
||||
Return True
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
' EgtOutLog("Pre Download")
|
||||
Dim nFileType As Integer = 0
|
||||
If Integer.TryParse(ProgramId, nFileType) AndAlso nFileType > 0 Then
|
||||
Dim sDestDir As String = ""
|
||||
GetPrivateProfileString(S_GENERAL, K_ISOFILEDIR, "c:/Saomad/ISO", sDestDir, CurrentMachine.sMachIniFile)
|
||||
DebugMessage(1, "Copio programma")
|
||||
File.Copy(ProgramPath, sDestDir & "/" & nFileType & ".mpf", True)
|
||||
' imposto numero programma scritto
|
||||
Dim ISONumVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_NUM)
|
||||
DebugMessage(1, "Imposto programma inviato: " & nFileType)
|
||||
ISONumVariable.sValue = nFileType
|
||||
' se primo dopo start
|
||||
If m_bFirstRaw Then
|
||||
m_bFirstRaw = False
|
||||
DebugMessage(1, "Primo grezzo")
|
||||
' annullo step di ripartenza
|
||||
Map.refMachManaging.Siemens_Sharp7.ResetStep(Not (MyMachGroup.dtStartTime <> DateTime.MinValue OrElse MyMachGroup.nProduction_State = ItemState.WIP))
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
End Select
|
||||
Return False
|
||||
End Function
|
||||
@@ -1203,6 +1435,13 @@ Public Class MachManaging
|
||||
Case CommVar.Types.CN
|
||||
Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
|
||||
End Select
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Select Case Type
|
||||
Case CommVar.Types.PLC
|
||||
Siemens_Sharp7.WriteVariable(Address, Value)
|
||||
'Case CommVar.Types.CN
|
||||
' Num_Axium_PCToolkit.WriteNCVariables(Address, Value)
|
||||
End Select
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -1218,6 +1457,8 @@ Public Class MachManaging
|
||||
Return NUMAxiumComm.InitVar(NewVar)
|
||||
Case NCTypes.NUM_AXIUM_PCTOOLKIT
|
||||
Return NUMAxiumPcToolkitComm.InitVar(NewVar)
|
||||
Case NCTypes.SIEMENS_SHARP7
|
||||
Return SIEMENSSharp7Comm.InitVar(NewVar)
|
||||
End Select
|
||||
Return Nothing
|
||||
End Function
|
||||
@@ -1310,4 +1551,14 @@ Public Class MachManaging
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#Region "Debug"
|
||||
|
||||
Friend Sub DebugMessage(nLevel As Integer, sMessage As String)
|
||||
If m_Debug >= nLevel Then
|
||||
EgtOutLog(sMessage)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Debug
|
||||
|
||||
End Class
|
||||
|
||||
@@ -21,7 +21,7 @@ Class MachineCommThread
|
||||
Private Shared sResetVarName As String = "0.FUNM.E80048"
|
||||
|
||||
Public Shared Sub MachManagingThreadFunction(ResultCallbackDlg As ResultCallbackDlg, CloseCallbackDlg As CloseCallbackDlg, UpdateCallbackDlg As UpdateCallbackDlg,
|
||||
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
|
||||
TPAAlarmCallbackDlg As TPAAlarmCallbackDlg, NUMAlarmCallbackDlg As NUMAlarmCallbackDlg, SiemensAlarmCallbackDlg As SiemensAlarmCallbackDlg, AxisCoordinatesCallbackDlg As AxisCoordinatesCallbackDlg,
|
||||
OpStateCallbackDlg As OpStateCallbackDlg, OpModeCallbackDlg As OpModeCallbackDlg, ChannelCallbackDlg As ChannelCallbackDlg,
|
||||
ReadVarCallbackDlg As ReadVarCallbackDlg)
|
||||
' inizializzo callback
|
||||
@@ -30,6 +30,7 @@ Class MachineCommThread
|
||||
m_UpdateCallbackDlg = UpdateCallbackDlg
|
||||
m_TPAAlarmCallbackDlg = TPAAlarmCallbackDlg
|
||||
m_NUMAlarmCallbackDlg = NUMAlarmCallbackDlg
|
||||
m_SiemensAlarmCallbackDlg = SiemensAlarmCallbackDlg
|
||||
m_AxisCoordinatesCallbackDlg = AxisCoordinatesCallbackDlg
|
||||
m_OpStateCallbackDlg = OpStateCallbackDlg
|
||||
m_OpModeCallbackDlg = OpModeCallbackDlg
|
||||
|
||||
@@ -176,7 +176,7 @@ Public Class MainMenuVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub SetInputOutputVisibility()
|
||||
If CurrentMachine.NCType = NCTypes.TPA Then
|
||||
If CurrentMachine.NCType = NCTypes.TPA OrElse CurrentMachine.NCType = NCTypes.SIEMENS_SHARP7 Then
|
||||
m_Inputs_Visibility = Visibility.Collapsed
|
||||
m_Outputs_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
@@ -248,8 +248,8 @@ Public Class MainWindowM
|
||||
EgtSetLockId( sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2606, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2606, 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())
|
||||
|
||||
@@ -158,7 +158,7 @@ Public Class MainWindowVM
|
||||
' sincronizzo tutti i progetti
|
||||
DbControllers.m_MagmanController.ProjAllSyncro()
|
||||
' sincronizzo log macchina
|
||||
'DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||
DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -240,7 +240,7 @@ Public Class MainWindowVM
|
||||
Public Sub CloseApplication()
|
||||
' se macchina sta funzionando
|
||||
If Not IsNothing(Map.refMachManaging) AndAlso Map.refMachManaging.bConnected AndAlso
|
||||
(Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified) Then
|
||||
(If(Not IsNothing(Map.refLeftPanelVM.SelOPState), Map.refLeftPanelVM.SelOPState.Id <> OPStates.End AndAlso Map.refLeftPanelVM.SelOPState.Id <> OPStates.Unspecified, True)) Then
|
||||
MessageBox.Show("Impossible closing software while machine is working. If you want to close, first press reset and stop the machine!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
@@ -255,7 +255,7 @@ Public Class MainWindowVM
|
||||
' loggo chiusura programma
|
||||
DbControllers.m_LogMachineController.Create(LogEvent.CreateSoftwareOnOffLog(False, DbControllers.m_SupervisorId))
|
||||
' sincronizzo
|
||||
' DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||
DbControllers.m_MagmanController.CloudLogMaccSyncro(100, 5000, True)
|
||||
End If
|
||||
' Termino il Model
|
||||
MainWindowM.Close()
|
||||
|
||||
@@ -30,7 +30,7 @@ Imports System.Windows
|
||||
#End if
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyVersion("2.6.1.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.1.1")>
|
||||
|
||||
@@ -244,9 +244,15 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.ProdMachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTPROJ, sFile)
|
||||
Map.refSupervisorManagerVM.m_MruFiles.Add(sFile)
|
||||
' aggiorno le colonne in base al tipo macchina
|
||||
Map.refRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
If Not IsNothing(Map.refSupervisorManagerVM) Then
|
||||
Dim DbSupervisorProd As ProdModel = DbControllers.m_ProdController.FindByProdId(Map.refSupervisorManagerVM.nLoadingProdId)
|
||||
If Not IsNothing(DbSupervisorProd) Then
|
||||
Map.refRawPartListVM.UpdateColumns(DbSupervisorProd.PType)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(DbSupervisorProd.PType)
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Map.refSupervisorManagerVM.m_MruFiles.Remove(sFile)
|
||||
EgtNewFile()
|
||||
|
||||
@@ -71,16 +71,6 @@ Public Class SupervisorManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public m_nPROJTYPE As Integer
|
||||
Public Property nPROJTYPE As Integer
|
||||
Get
|
||||
Return m_nPROJTYPE
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPROJTYPE = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
@@ -105,9 +95,7 @@ Public Class SupervisorManagerVM
|
||||
|
||||
|
||||
#End Region ' ToolTip
|
||||
|
||||
#End Region ' Fields & Properties
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
@@ -217,7 +205,6 @@ Public Class SupervisorManagerVM
|
||||
End If
|
||||
Core.ViewPanelVM.UpdateBWType(TempCurrProd.nType)
|
||||
' imposto ProdId di caricamento
|
||||
m_nPROJTYPE = TempCurrProd.nType
|
||||
m_nLoadingProdId = TempCurrProd.nProdId
|
||||
m_bLoadingProd = True
|
||||
If File.Exists(sFilePath) Then
|
||||
@@ -256,7 +243,6 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
m_bLoadingProd = False
|
||||
m_CurrProd = Nothing
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
Return
|
||||
@@ -266,7 +252,6 @@ Public Class SupervisorManagerVM
|
||||
Map.refSceneHostVM.MainController.NewProject()
|
||||
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
|
||||
m_bLoadingProd = False
|
||||
m_CurrProd = Nothing
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
|
||||
Return
|
||||
|
||||
@@ -268,6 +268,8 @@ Public Module CurrentMachine
|
||||
Map.refLeftPanelVM.LoadOPModes()
|
||||
' Imposto visibilità variabili E80000
|
||||
Map.refLeftPanelVM.SetE80000Visibility()
|
||||
' Imposto visibilita' assi
|
||||
Map.refLeftPanelVM.SetAxisVisibility()
|
||||
End Sub
|
||||
|
||||
#End Region 'Init
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<package id="BouncyCastle.Cryptography" version="2.4.0" targetFramework="net472" />
|
||||
<package id="Csv" version="1.0.31" targetFramework="net472" />
|
||||
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2407.1708" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2406.2617" targetFramework="net472" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<package id="FluentFTP" version="19.2.2" targetFramework="net472" />
|
||||
<package id="Google.Protobuf" version="3.27.0" targetFramework="net472" />
|
||||
|
||||
@@ -196,8 +196,7 @@ Public Class AddPartWndVM
|
||||
'verifico che tutti i campi contengano un valore valido
|
||||
If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
|
||||
Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 AndAlso
|
||||
(Not String.IsNullOrWhiteSpace(m_sSelWarehouseMaterial) OrElse Not String.IsNullOrWhiteSpace(m_sNewMaterialName)) Then
|
||||
Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61853), EgtMsg(30007))
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-111.1.0.0" newVersion="111.1.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-111.2.0.0" newVersion="111.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ZstdSharp" publicKeyToken="8d151af33a4ad5cf" culture="neutral" />
|
||||
|
||||
@@ -444,19 +444,12 @@ Public Class BTLPartVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value <> m_BTLPartM.MaterialM.sMaterial Then
|
||||
' se vuoto annullo modifica
|
||||
If String.IsNullOrWhiteSpace(value) Then
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
Return
|
||||
End If
|
||||
' verifico se nuovo materiale
|
||||
Dim MaterialNameManagerVM As New MaterialNameManagerVM()
|
||||
If MaterialNameManagerVM.VerifyNewMaterialNames(New List(Of String)({value})) Then
|
||||
Dim MaterialNameManager As New MaterialNameManagerV(Application.Current.MainWindow, MaterialNameManagerVM)
|
||||
If MaterialNameManager.ShowDialog() = False Then
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
@@ -478,7 +471,13 @@ Public Class BTLPartVM
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(Me, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE, False)
|
||||
' se sezione nuova non presente
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(Section)
|
||||
' creo nuova sezione
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(Section.MaterialM)
|
||||
Dim NewSection = Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
' se sezione vecchia non utilizzata da altri pezzi
|
||||
If Not bOtherSection Then
|
||||
@@ -487,7 +486,6 @@ Public Class BTLPartVM
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(sMATERIAL))
|
||||
NotifyPropertyChanged(NameOf(sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -1001,8 +1001,8 @@ Public Class BTLStructureVM
|
||||
For Each BTLPartVM As BTLPartVM In m_BTLPartVMList
|
||||
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
|
||||
If Not SectionList.Contains(BTLPartVM.Section) Then
|
||||
'Dim NewSection As SectionXMaterial = New SectionXMaterial(BTLPartVM.MaterialM)
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(BTLPartVM.Section)
|
||||
Dim NewSection As SectionXMaterial = New SectionXMaterial(BTLPartVM.MaterialM)
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
End If
|
||||
If Not GroupList.Contains(BTLPartVM.sGROUP) Then
|
||||
GroupList.Add(BTLPartVM.sGROUP)
|
||||
@@ -1338,7 +1338,7 @@ Public Class BTLStructureVM
|
||||
Dim SearchMaterialRes As SearchMaterialRes = m_MaterialDbList.FirstOrDefault(Function(x) x.sMaterialName = Part.MaterialM.sMaterial)
|
||||
If Not IsNothing(SearchMaterialRes) Then
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(Part.dW, Part.dH) AndAlso x.dH = Math.Max(Part.dW, Part.dH))
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dW = Part.dW AndAlso x.dH = Part.dH)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchMaterialRes.SearchRes.Result.FirstOrDefault(Function(x) x.dH = Part.dH)
|
||||
End If
|
||||
@@ -1352,7 +1352,7 @@ Public Class BTLStructureVM
|
||||
Select Case SearchRes.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(Part.dW, Part.dH) AndAlso x.dH = Math.Max(Part.dW, Part.dH))
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Part.dW AndAlso x.dH = Part.dH)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dH = Part.dH)
|
||||
End If
|
||||
@@ -1401,7 +1401,7 @@ Public Class BTLStructureVM
|
||||
If IsNothing(Material) Then
|
||||
EgtOutLog("Error! Impossible creating material on Db!")
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sWarehouseMaterial)
|
||||
Material = New MaterialM(Math.Min(Part.dW, Part.dH), Math.Max(Part.dW, Part.dH), 0, 0, Part.MaterialM.sMaterial)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, Part.dH, 0, 0, Part.MaterialM.sMaterial)
|
||||
End If
|
||||
|
||||
@@ -387,15 +387,15 @@ Public Class CALCPanelVM
|
||||
' aggiorno nuovo pezzo
|
||||
CurrBTLPartVM = GetBTLPartVMFromBTLPartId(Line.nCUTID)
|
||||
If IsNothing(CurrBTLPartVM) Then
|
||||
Line.ResetTypePart()
|
||||
EgtOutLog("Error in CALC ProcessResult. CUTID " & Line.nCUTID & "not found in project(BTLPartVM).")
|
||||
Continue For
|
||||
End If
|
||||
Else
|
||||
' aggiorno nuovo pezzo
|
||||
CurrPartVM = GetPartVMFromPartId(Line.nCUTID)
|
||||
If IsNothing(CurrPartVM) Then
|
||||
Line.ResetTypePart()
|
||||
EgtOutLog("Error in CALC ProcessResult. CUTID " & Line.nCUTID & "not found in project(PartVM).")
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -422,14 +422,14 @@ Public Class CALCPanelVM
|
||||
If nProgramPage = ProjectType.PROJ Then
|
||||
CurrBTLFeatureVM = GetBTLFeatureVMFromBTLPartId(CurrBTLPartVM, Line.nTASKID)
|
||||
If IsNothing(CurrBTLFeatureVM) Then
|
||||
Line.ResetTypeFeature()
|
||||
EgtOutLog("Error in CALC ProcessResult. TASKID " & Line.nTASKID & "not found in BTLPartVM " & CurrBTLPartVM.nPartId)
|
||||
Continue For
|
||||
End If
|
||||
Else
|
||||
CurrBTLFeatureVM = GetFeatureVMFromPartId(CurrPartVM, Line.nTASKID)
|
||||
If IsNothing(CurrBTLFeatureVM) Then
|
||||
Line.ResetTypeFeature()
|
||||
EgtOutLog("Error in CALC ProcessResult. TASKID " & Line.nTASKID & "not found in PartVM " & CurrPartVM.nPartId)
|
||||
Continue For
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
Public Module ConstWarehouseIni
|
||||
|
||||
Public Enum UploadOptimType As Integer
|
||||
NONE = 0
|
||||
UPLOAD = 1
|
||||
ASK = 2
|
||||
End Enum
|
||||
Module ConstWarehouseIni
|
||||
|
||||
Public Const WH_BASIC_INI_FILE_NAME As String = "Basic.ini"
|
||||
Public Const WH_MEDIUM_INI_FILE_NAME As String = "Medium.ini"
|
||||
|
||||
@@ -32,31 +32,6 @@
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
@@ -69,29 +44,6 @@
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<Optimize>true</Optimize>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
@@ -121,27 +73,6 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\RemoteDebug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
|
||||
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
@@ -169,7 +100,7 @@
|
||||
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgwProxy.MagMan, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2407.1708\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
<HintPath>..\packages\EgwProxy.MagMan.1.0.2406.2617\lib\EgwProxy.MagMan.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
|
||||
|
||||
@@ -770,7 +770,7 @@ Public Class LeftPanelVM
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
Dim WallMachGroup As MyMachGroupVM = SelMachGroup
|
||||
' verifico spessore
|
||||
If SelPart.MaterialM <> WallMachGroup.RawPartM.Material Then
|
||||
If SelPart.Section <> WallMachGroup.Section Then
|
||||
MessageBox.Show(EgtMsg(61868), EgtMsg(30007))
|
||||
Return
|
||||
End If
|
||||
@@ -1028,11 +1028,6 @@ Public Class LeftPanelVM
|
||||
If Not IsNothing(AddPartWndVM.sNAM) Then EgtBeamSetPartName(AddPartWndVM.sNAM)
|
||||
EgtBeamSetPartCount(AddPartWndVM.nCNT)
|
||||
EgtBeamSetPartBox(AddPartWndVM.dL, AddPartWndVM.dH, AddPartWndVM.dW)
|
||||
If AddPartWndVM.bNewName_IsChecked Then
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sNewMaterialName)
|
||||
Else
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sSelWarehouseMaterial)
|
||||
End If
|
||||
' se progetto pareti e vista ruotata
|
||||
If nType = BWType.WALL AndAlso (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE) Then
|
||||
'' ruoto le pareti di 180 per raddrizzarle rispetto alla vista
|
||||
@@ -1046,26 +1041,28 @@ Public Class LeftPanelVM
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_ROTATED, 180)
|
||||
End If
|
||||
End If
|
||||
' creo pezzo
|
||||
' aggiungo dati pezzo
|
||||
Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId)
|
||||
' aggiungo dati materiale
|
||||
' aggiungo pezzo alla lista
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
|
||||
Dim NewPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
If AddPartWndVM.bNewName_IsChecked Then
|
||||
' verifico se il nome inserito non e' gia' esistente, lo aggiungo
|
||||
Dim Res As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(AddPartWndVM.sNewMaterialName)
|
||||
If Res.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MISSING_CODE Or Res.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.NOT_FOUND Then
|
||||
' creo questo materiale e lo aggiungo al Db
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(NewPart.MaterialM.dW, NewPart.MaterialM.dH, NewPart.MaterialM.dL, AddPartWndVM.sNewMaterialName, AddPartWndVM.sNewMaterialName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(NewPartVM.Section.MaterialM.dW, NewPartVM.Section.MaterialM.dH, NewPartVM.Section.MaterialM.dL, AddPartWndVM.sNewMaterialName, AddPartWndVM.sNewMaterialName)
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
Else
|
||||
' recupero WarehouseMaterial di questo materiale
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
End If
|
||||
EgtSetInfo(nNewPartId, BTL_PRT_MATERIAL, AddPartWndVM.sNewMaterialName)
|
||||
NewPart.sMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
NewPartVM.BTLPartM.sMATERIAL = AddPartWndVM.sNewMaterialName
|
||||
Else
|
||||
' NewPartVM.sWAREHOUSEMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
NewPart.sMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
NewPartVM.BTLPartM.sMATERIAL = AddPartWndVM.sSelWarehouseMaterial
|
||||
End If
|
||||
' aggiungo pezzo alla lista
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
|
||||
Dim NewPartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
If Not IsNothing(NewPartVM) Then
|
||||
' aggiorno MaterialM da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(NewPartVM, Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
@@ -1073,7 +1070,12 @@ Public Class LeftPanelVM
|
||||
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(NewPartVM, False, True)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(NewPartVM.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewPartVM.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(NewPartVM.Section.MaterialM)
|
||||
Dim NewSection = NewPartVM.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -266,7 +266,7 @@ Public Class MyMachGroupPanelVM
|
||||
' aggiornamento materiale
|
||||
Dim RawPart As RawPartM = Nothing
|
||||
If bUseList Then
|
||||
RawPart = m_RawPartDbList.FirstOrDefault(Function(x) x.Material.sWarehouseMaterial = MachGroup.RawPartM.Material.sMaterial AndAlso Math.Abs(x.Material.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.Material.dL - MachGroup.dL) < m_DimensionRange)
|
||||
RawPart = m_RawPartDbList.FirstOrDefault(Function(x) x.Material.sMaterial = MachGroup.RawPartM.Material.sMaterial AndAlso Math.Abs(x.Material.dW - MachGroup.dW) < m_DimensionRange AndAlso Math.Abs(x.Material.dH - MachGroup.dH) < m_DimensionRange AndAlso Math.Abs(x.Material.dL - MachGroup.dL) < m_DimensionRange)
|
||||
End If
|
||||
If Not IsNothing(RawPart) Then
|
||||
MachGroup.MyMachGroupM.RawPartM.Material.SetId(RawPart.Material.nId)
|
||||
@@ -281,13 +281,12 @@ Public Class MyMachGroupPanelVM
|
||||
' verifico che il materiale non sia nullo
|
||||
If (String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sMaterial) OrElse String.IsNullOrWhiteSpace(MachGroup.RawPartM.Material.sWarehouseMaterial)) AndAlso MachGroup.PartVMList.Count > 0 Then
|
||||
MachGroup.MyMachGroupM.sMATERIAL = MachGroup.PartVMList(0).sMATERIAL
|
||||
MachGroup.MyMachGroupM.sWAREHOUSEMATERIAL = MachGroup.PartVMList(0).sWAREHOUSEMATERIAL
|
||||
MachGroup.RawPartM.Material.SetMaterial(MachGroup.PartVMList(0).sMATERIAL)
|
||||
MachGroup.RawPartM.Material.SetWarehouseMaterial(MachGroup.PartVMList(0).sWAREHOUSEMATERIAL)
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sMATERIAL))
|
||||
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.sWAREHOUSEMATERIAL))
|
||||
End If
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sWarehouseMaterial)
|
||||
Dim SearchMaterial As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(MachGroup.RawPartM.Material.sMaterial)
|
||||
Select Case SearchMaterial.Tipo
|
||||
Case DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS, DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
@@ -298,9 +297,9 @@ Public Class MyMachGroupPanelVM
|
||||
Case Else
|
||||
EgtOutLog("Error! MachGroup material not found!!")
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
Material = New MaterialM(Math.Min(MachGroup.dW, MachGroup.dH), Math.Max(MachGroup.dW, MachGroup.dH), 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
Material = New MaterialM(MachGroup.dW, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sWAREHOUSEMATERIAL)
|
||||
Material = New MaterialM(0, MachGroup.dH, 0, 0, MachGroup.sMATERIAL)
|
||||
End If
|
||||
End Select
|
||||
Dim SearchRawPart As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
@@ -318,12 +317,7 @@ Public Class MyMachGroupPanelVM
|
||||
Part.MaterialM.SetWarehouseMaterial(RawPart.Material.sWarehouseMaterial)
|
||||
Next
|
||||
Else
|
||||
Dim nRawPartId As Integer = 0
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, 0, MachGroup.dL, 0, False))
|
||||
ElseIf nPROJTYPE = BWType.WALL Then
|
||||
nRawPartId = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
End If
|
||||
Dim nRawPartId As Integer = DbControllers.m_RawItemsController.Upsert(New RawPartM(Material, MachGroup.dW, MachGroup.dL, 0, False))
|
||||
If nRawPartId > 0 Then
|
||||
SearchRawPart = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
If nPROJTYPE = BWType.BEAM Then
|
||||
@@ -351,6 +345,7 @@ Public Class MyMachGroupPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -500,10 +500,10 @@ Public Class MainMenuVM
|
||||
' resetto flag inserimento password
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Else
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
|
||||
|
||||
@@ -242,8 +242,8 @@ Public Class MainWindowM
|
||||
EgtSetLockId( sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2512, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2512, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2606, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(5327, 2606, 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())
|
||||
|
||||
@@ -139,8 +139,8 @@ Public Class MainWindowVM
|
||||
'Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
|
||||
' imposto MainWindow per finestra di Loading
|
||||
LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
|
||||
'' verifico se convertire file magazzino su Db
|
||||
'ReadWarehouseFile()
|
||||
' verifico se convertire file magazzino su Db
|
||||
ReadWarehouseFile()
|
||||
' leggo riga di comando
|
||||
Dim nCommandType As Integer = 0
|
||||
Dim nPage As Pages = Pages.VIEW
|
||||
|
||||
@@ -156,7 +156,7 @@ Public Class MaterialNameManagerVM
|
||||
If Material.bNewName_IsChecked Then
|
||||
' cerco un pezzo che usa questo materiale
|
||||
Dim PartVM As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.MaterialM.sMaterial = sMaterialName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.MaterialM.dW, PartVM.MaterialM.dH, PartVM.MaterialM.dL, Material.sNewName, Material.sNewName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.Section.MaterialM.dW, PartVM.Section.MaterialM.dH, PartVM.Section.MaterialM.dL, Material.sNewName, Material.sNewName)
|
||||
' lo aggiungo al Db
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
End If
|
||||
@@ -166,7 +166,7 @@ Public Class MaterialNameManagerVM
|
||||
If IsNothing(PartVM) Then
|
||||
PartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
|
||||
End If
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.MaterialM.dW, PartVM.MaterialM.dH, PartVM.MaterialM.dL, Material.sOrigMaterial, Material.sNewName)
|
||||
Dim NewMaterialM As MaterialM = New MaterialM(PartVM.Section.MaterialM.dW, PartVM.Section.MaterialM.dH, PartVM.Section.MaterialM.dL, Material.sOrigMaterial, Material.sNewName)
|
||||
' lo aggiungo al Db
|
||||
DbControllers.m_MaterialsController.Insert(NewMaterialM)
|
||||
' se diverso dal nome originale, aggiungo anche l'alias
|
||||
|
||||
@@ -30,7 +30,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtBEAMWALL.ViewerOptimizer")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2020-2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -70,5 +70,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyFileVersion("2.5.12.2")>
|
||||
<Assembly: AssemblyVersion("2.6.6.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.6.1")>
|
||||
|
||||
@@ -291,17 +291,9 @@ Public Class NestingRunningWndVM
|
||||
End Select
|
||||
' calcolo lista dei pezzi per ogni sezione
|
||||
For Each SectionProgress In m_SectionProgressList
|
||||
'Dim SectionPartList As List(Of BTLPartM) = (From x In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
' Where x.MaterialM = SectionProgress.Section.MaterialM AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
' (m_SelPartType = OptimizePanelVM.PartType.ALL OrElse ((Map.refProjectVM.BTLStructureVM.SelGroup = "" OrElse x.sGROUP = Map.refProjectVM.BTLStructureVM.SelGroup) AndAlso
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSubGroup = "" OrElse x.sSTOREY = Map.refProjectVM.BTLStructureVM.SelSubGroup) AndAlso
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NULL OrElse Map.refProjectVM.BTLStructureVM.SearchText = String.Empty OrElse (
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.PDN AndAlso x.nPDN.ToString.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0) OrElse
|
||||
' (Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NAM AndAlso x.sNAM.IndexOf(Map.refProjectVM.BTLStructureVM.SearchText, StringComparison.InvariantCultureIgnoreCase) >= 0)))))
|
||||
' Select x.BTLPartM).ToList()
|
||||
'Dim SectionPartList As New List(Of BTLPartM)(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Where(Function(x) x.Section = Section.SectXMat).ToList())
|
||||
Dim SectionPartList As List(Of BTLPartM) = (From x In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Where x.Section.dH = SectionProgress.Section.dH AndAlso x.Section.dW = SectionProgress.Section.dW AndAlso x.Section.MaterialM.sWarehouseMaterial = SectionProgress.Section.MaterialM.sWarehouseMaterial AndAlso
|
||||
x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
Where x.MaterialM = SectionProgress.Section.MaterialM AndAlso x.bDO AndAlso x.nCNT + x.nADDED > x.nINPROD AndAlso
|
||||
(m_SelPartType = OptimizePanelVM.PartType.ALL OrElse ((Map.refProjectVM.BTLStructureVM.SelGroup = "" OrElse x.sGROUP = Map.refProjectVM.BTLStructureVM.SelGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSubGroup = "" OrElse x.sSTOREY = Map.refProjectVM.BTLStructureVM.SelSubGroup) AndAlso
|
||||
(Map.refProjectVM.BTLStructureVM.SelSearchParam.Id = BTLPartParam.NULL OrElse Map.refProjectVM.BTLStructureVM.SearchText = String.Empty OrElse (
|
||||
@@ -353,16 +345,9 @@ Public Class NestingRunningWndVM
|
||||
dOffset = WarehouseHelper.GetWallOffsetByWidth(SectionProgress.Section.dH)
|
||||
End If
|
||||
' passo a lua lista id pezzi da nestare
|
||||
If SectionProgress.SectionPartList.Count > 0 AndAlso SectionProgress.SParamList.Count > 0 AndAlso SectionProgress.SParamList.Sum(Function(x) Math.Max(0, x.RawPart.nQuantity)) > 0 Then
|
||||
If ExecNesting(sLogPath, CurrentMachine.sMachineName, SectionProgress.SectionPartList, SectionProgress.SParamList, dStartOffset, dOffset, dKerf, m_bLDIntersOther, m_nMinScore, SectionProgress.dCalcNestTime) Then
|
||||
' verifico se c'e' un altro nesting con stesso materiale
|
||||
Dim TwinSectionProgress As SectionProgress = m_SectionProgressList.FirstOrDefault(Function(x) x IsNot SectionProgress AndAlso x.Section.MaterialM.nId = SectionProgress.Section.MaterialM.nId)
|
||||
If Not IsNothing(TwinSectionProgress) Then
|
||||
TwinSectionProgress.SetSParamList(SectionProgress.SParamList)
|
||||
End If
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
If SectionProgress.SectionPartList.Count > 0 AndAlso SectionProgress.SParamList.Count > 0 AndAlso SectionProgress.SParamList.Sum(Function(x) Math.Max(0, x.RawPart.nQuantity)) > 0 AndAlso
|
||||
Not ExecNesting(sLogPath, CurrentMachine.sMachineName, SectionProgress.SectionPartList, SectionProgress.SParamList, dStartOffset, dOffset, dKerf, m_bLDIntersOther, m_nMinScore, SectionProgress.dCalcNestTime) Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
@@ -853,9 +838,6 @@ Public Class SectionProgress
|
||||
Return m_SParamList
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSParamList(SParamList As List(Of SParam))
|
||||
m_SParamList = SParamList
|
||||
End Sub
|
||||
|
||||
Private m_SectionPartList As New List(Of BTLPartM)
|
||||
Public ReadOnly Property SectionPartList As List(Of BTLPartM)
|
||||
|
||||
@@ -21,11 +21,6 @@ Public Class NewOpenProjectFileDialogVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
m_ProjectType = ProjectType
|
||||
|
||||
NotifyPropertyChanged(NameOf(FilterTypeList))
|
||||
@@ -145,12 +140,6 @@ Public Class NewOpenProjectFileDialogVM
|
||||
If Not IsNothing(SelProject.ProdFileVM) Then
|
||||
' archivio il progetto
|
||||
DbControllers.m_ProdController.UpdateArchived(SelProject.ProdFileVM.nProdId, Not SelProject.bIsArchived)
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
DbControllers.m_MagmanController.ProjSyncro(SelProject.ProdFileVM.nProdId)
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(Archive_Msg))
|
||||
End If
|
||||
' aggiorno lista progetti
|
||||
|
||||
@@ -11,11 +11,6 @@ Public Class OpenProjectFileDialogVM
|
||||
#Region "METHODS"
|
||||
|
||||
Public Overrides Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
|
||||
' se magazzino di rete attivo
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 Then
|
||||
' aggiorno stato progetti archiviati
|
||||
DbControllers.m_MagmanController.ProjArchSync()
|
||||
End If
|
||||
m_ProjectType = ProjectType
|
||||
m_GoToProd = GoToProd
|
||||
' carico colonne
|
||||
|
||||
@@ -568,7 +568,7 @@ Public Class OptimizePanelVM
|
||||
Public ReadOnly Property UploadNesting_Command As ICommand
|
||||
Get
|
||||
If m_cmdUploadNesting Is Nothing Then
|
||||
m_cmdUploadNesting = New Command(AddressOf UploadNestingCmd)
|
||||
m_cmdUploadNesting = New Command(AddressOf UploadNesting)
|
||||
End If
|
||||
Return m_cmdUploadNesting
|
||||
End Get
|
||||
@@ -577,23 +577,9 @@ Public Class OptimizePanelVM
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Friend Sub UploadNestingCmd()
|
||||
Map.refProdManagerVM.Save(True, UploadOptimType.UPLOAD)
|
||||
'LoadingWndHelper.OpenLoadingWnd(ActiveIds.UPLOADNESTING, 1, "Optimization Upload", "Uploading...", 99) ' Optimization Upload ' Uploading...
|
||||
|
||||
'' chiudo finestra di caricamento progetto
|
||||
'LoadingWndHelper.CloseLoadingWnd(ActiveIds.UPLOADNESTING)
|
||||
'Threading.Thread.Sleep(700)
|
||||
'If UploadNesting(True) Then
|
||||
' If bSave Then Map.refProdManagerVM.Save()
|
||||
' MessageBox.Show("Estimation sent to the server!", "Info", MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
'Else
|
||||
' MessageBox.Show("Impossible sending the estimation to the server!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Friend Function UploadNesting(Optional bSave As Boolean = False) As Boolean
|
||||
Friend Sub UploadNesting(Optional bSave As Boolean = True)
|
||||
Dim nCurrProjectCloudId As Integer = Map.refProdManagerVM.CurrProd.ProdFileM.nProjCloudId
|
||||
'Dim MaterialList As New List(Of Integer)
|
||||
Dim RawPartList As New List(Of RawPartM)
|
||||
Dim RawMaterialList As New Dictionary(Of Integer, Integer)
|
||||
Select Case Map.refProdManagerVM.CurrProd.nType
|
||||
@@ -630,8 +616,13 @@ Public Class OptimizePanelVM
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
Dim SendEstimateResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.ResourceSendEstimate(Map.refProdManagerVM.CurrProd.ProdFileM.nProjCloudId, RawMaterialList)
|
||||
Return SendEstimateResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK
|
||||
End Function
|
||||
If SendEstimateResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK Then
|
||||
If bSave Then Map.refProdManagerVM.Save()
|
||||
MessageBox.Show("Estimation sent to the server!", "Info", MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
Else
|
||||
MessageBox.Show("Impossible sending the estimation to the server!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' UploadNesting
|
||||
|
||||
|
||||
@@ -406,11 +406,11 @@ Public Class ProdManagerVM
|
||||
Save(True)
|
||||
End Sub
|
||||
|
||||
Public Function Save(Optional bShowLoading As Boolean = False, Optional bAskWarehouseUpload As UploadOptimType = UploadOptimType.NONE) As Boolean
|
||||
Public Function Save(Optional bShowLoading As Boolean = False, Optional bAskWarehouseUpload As Boolean = False) As Boolean
|
||||
If IsNothing(m_CurrProd) Then Return False
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 3, EgtMsg(63007), EgtMsg(63012), 60) ' Project saving ' Saving geometry
|
||||
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
|
||||
Dim bOk As Boolean = Map.refSceneHostVM.SaveProject()
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 60, 90) ' Saving data on Db
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
|
||||
Dim MyMachGroupList As New List(Of MyMachGroupM)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
For Each MachGroup In Map.refProjectVM.MachGroupPanelVM.m_MyMachGroupPanelM.MachGroupMList
|
||||
@@ -445,25 +445,13 @@ Public Class ProdManagerVM
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
NotifyPropertyChanged(NameOf(MruFileNames))
|
||||
' se magazzino di rete attivo e carica nesting su salvataggio attiva
|
||||
If Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 AndAlso GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso
|
||||
(GetMainPrivateProfileInt(S_WAREHOUSE, K_SENDESTIMONSAVE, 0) = 1) OrElse
|
||||
bAskWarehouseUpload = UploadOptimType.UPLOAD OrElse
|
||||
(bAskWarehouseUpload = UploadOptimType.ASK AndAlso (MessageBox.Show("Optimization saved but not uploaded to Db. Would you like to upload it?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes)) Then
|
||||
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, "Uploading Optimization...", 90, 100) ' Uploading Optimization...
|
||||
If bAskWarehouseUpload AndAlso GetMainPrivateProfileInt(S_WAREHOUSE, K_NETWAREHOUSE, 0) = 1 AndAlso
|
||||
(GetMainPrivateProfileInt(S_WAREHOUSE, K_SENDESTIMONSAVE, 0) = 1 OrElse (Map.refMachGroupPanelVM.MachGroupVMList.Count > 0 AndAlso
|
||||
MessageBox.Show("Optimization saved but not uploaded to Db. Would you like to upload it?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes)) Then
|
||||
' forzo aggiornamento eventuali dati non inviati su Db
|
||||
DbControllers.m_MagmanController.ForceSyncroSend()
|
||||
' carico progetto su magazzino di rete
|
||||
Dim bUploadRes As Boolean = Map.refOptimizePanelVM.UploadNesting(False)
|
||||
If bShowLoading Then
|
||||
Dim sUploadRes As String = ""
|
||||
If bUploadRes Then
|
||||
sUploadRes = "Estimation sent to the server!"
|
||||
Else
|
||||
sUploadRes = "Impossible sending the estimation to the server!"
|
||||
End If
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 3, sUploadRes, 99, 100) ' Uploading Optimization
|
||||
Threading.Thread.Sleep(2000)
|
||||
End If
|
||||
Map.refOptimizePanelVM.UploadNesting(False)
|
||||
End If
|
||||
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
|
||||
Return bOk
|
||||
|
||||
@@ -384,10 +384,8 @@ Public Class ProjManagerVM
|
||||
' scrivo info proj e tipo su layer BtlInfo
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, nProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, nType)
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_nPROJTYPE = nType
|
||||
' salvo il progetto
|
||||
If EgtSaveFile(sProjFileName, NGE.CMPTEXT) Then
|
||||
Dim n = Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE
|
||||
SectionXMaterial.SetType(nType)
|
||||
Core.ViewPanelVM.UpdateBWType(nType)
|
||||
Map.refPartManagerVM.LockVisibilityUpdate()
|
||||
@@ -721,7 +719,6 @@ Public Class ProjManagerVM
|
||||
' importo file
|
||||
If bOk Then
|
||||
bOk = Map.refSceneHostVM.MainController.ImportProject(sBtlCopyPath, False)
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_nPROJTYPE = nType
|
||||
End If
|
||||
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
|
||||
Dim bFirstPart As Boolean = EgtGetFirstPart() <> GDB_ID.NULL
|
||||
@@ -927,12 +924,8 @@ Public Class ProjManagerVM
|
||||
|
||||
Dim bOk As Boolean = nTempCtx <> 0
|
||||
If bOk Then
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
|
||||
' importo il file BTL
|
||||
bOk = bOk AndAlso Map.refSceneHostVM.MainController.ImportProject(sFile, False)
|
||||
' chiudo finestra di caricamento progetto
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTBTL)
|
||||
|
||||
' carico la lista dei Part importati e rimuovo i parametri generali del BTL
|
||||
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
Dim BtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
@@ -1104,9 +1097,13 @@ Public Class ProjManagerVM
|
||||
Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(AddedBTLPart, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
nNewPartId = EgtGetNextPart(nNewPartId)
|
||||
End While
|
||||
|
||||
@@ -1321,9 +1318,13 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
Dim nMaterialId As Integer = DbControllers.m_MaterialsController.Insert(AddedBTLPart.Section.MaterialM)
|
||||
Dim NewSection = AddedBTLPart.Section
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(NewSection)
|
||||
If nMaterialId <> 0 Then
|
||||
NewSection.MaterialM.SetId(nMaterialId)
|
||||
End If
|
||||
End If
|
||||
Map.refProjectVM.BTLStructureVM.ReadMaterialFromDb(AddedBTLPart, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
nAddedPartId = EgtGetNextPart(nAddedPartId)
|
||||
End While
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, Path.GetDirectoryName(sFile))
|
||||
|
||||
@@ -718,7 +718,7 @@ Public Class MySceneHostVM
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' verifico se ci sono nuovi materiali
|
||||
Dim MaterialNameManagerVM As New MaterialNameManagerVM()
|
||||
Dim bManageMaterial As Boolean = MaterialNameManagerVM.VerifyNewMaterialNames()
|
||||
Dim bManageMaterial As Boolean = MaterialNameManagerVM.VerifyNewMaterialNames
|
||||
' se nuovi materiali
|
||||
If bManageMaterial Then
|
||||
' chiudo finestra di caricamento
|
||||
@@ -731,7 +731,7 @@ Public Class MySceneHostVM
|
||||
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.IMPORTBTL, 2, EgtMsg(63005), 50, 70) ' Loading parts
|
||||
End If
|
||||
' aggiornamento materiale da Db
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjManagerVM.CurrProj.nType)
|
||||
Map.refProjectVM.BTLStructureVM.ReadAllMaterialFromDb(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
|
||||
If bManageMaterial Then
|
||||
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
Part.NotifyPropertyChanged(NameOf(Part.sWAREHOUSEMATERIAL))
|
||||
|
||||
@@ -232,7 +232,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) OrElse IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then Return
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
Dim ErrorMsg As String = ""
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
|
||||
@@ -301,7 +301,7 @@ Public Class TopPanelVM
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub ProduceAllRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) OrElse Map.refMachGroupPanelVM.MachGroupVMList.Count = 0 Then Return
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
' se attiva opzione e non ancora calcolato
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.MachGroupVMList.Any(Function(x As MyMachGroupVM) x.nProduction_State = ItemState.ND AndAlso x.nGlobalState = CalcStates.NOTCALCULATED) Then
|
||||
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCEALL)
|
||||
|
||||
@@ -125,10 +125,6 @@ Module LuaExec
|
||||
For PartIndex = 0 To PartList.Count - 1
|
||||
EgtLuaSetGlobIntVar("PART." & PartList(PartIndex).nPartId.ToString(), PartList(PartIndex).m_nCNT + PartList(PartIndex).m_nADDED - PartList(PartIndex).nINPROD)
|
||||
Next
|
||||
EgtLuaCreateGlobTable("RAWID")
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaSetGlobNumVar("RAWID." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).RawPart.nId)
|
||||
Next
|
||||
EgtLuaCreateGlobTable("LEN")
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaSetGlobNumVar("LEN." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).dL)
|
||||
@@ -152,13 +148,7 @@ Module LuaExec
|
||||
Dim nErr As Integer = 999
|
||||
EgtLuaGetGlobIntVar("NEST.ERR", nErr)
|
||||
bOk = (nErr <= 0)
|
||||
If Not bOk Then
|
||||
EgtOutLog("NestExec Err=" & nErr.ToString())
|
||||
Else
|
||||
For SectionIndex = 0 To SectionList.Count - 1
|
||||
EgtLuaGetGlobIntVar("QTY." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).nQuantity)
|
||||
Next
|
||||
End If
|
||||
If Not bOk Then EgtOutLog("NestExec Err=" & nErr.ToString())
|
||||
Else
|
||||
bOk = False
|
||||
EgtOutLog("Error executing Nest Exec script " & sExecPath)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports System.Web.UI.WebControls.WebParts
|
||||
|
||||
Module WarehouseHelper
|
||||
|
||||
@@ -164,21 +163,10 @@ Module WarehouseHelper
|
||||
Dim nIndex As Integer = 1
|
||||
Dim sSection As String = ""
|
||||
For Each SectionProgress In SectionList
|
||||
Dim Material As MaterialM = Nothing
|
||||
Dim SearchRes As DataLayer.Controllers.MaterialsController.SearchResult = DbControllers.m_MaterialsController.SearchFilt(SectionProgress.Section.MaterialM.sWarehouseMaterial)
|
||||
If SearchRes.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.ALIAS OrElse SearchRes.Tipo = DataLayer.Controllers.MaterialsController.SearchResult.TypeFound.MATERIAL Then
|
||||
If Type = BWType.BEAM Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dW = Math.Min(SectionProgress.Section.MaterialM.dW, SectionProgress.Section.MaterialM.dH) AndAlso x.dH = Math.Max(SectionProgress.Section.MaterialM.dW, SectionProgress.Section.MaterialM.dH))
|
||||
ElseIf Type = BWType.WALL Then
|
||||
Material = SearchRes.Result.FirstOrDefault(Function(x) x.dH = SectionProgress.Section.MaterialM.dH)
|
||||
End If
|
||||
End If
|
||||
If Not IsNothing(Material) Then
|
||||
Dim RawPartList As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(Material.nId)
|
||||
For Each RawPart In RawPartList
|
||||
SectionProgress.SParamList.Add(New SParam(RawPart))
|
||||
Next
|
||||
End If
|
||||
Dim RawPartList As List(Of RawPartM) = DbControllers.m_RawItemsController.GetFilt(SectionProgress.Section.MaterialM.nId)
|
||||
For Each RawPart In RawPartList
|
||||
SectionProgress.SParamList.Add(New SParam(RawPart))
|
||||
Next
|
||||
Next
|
||||
'While GenInterface.GetPrivateProfileString(If(Type = BWType.BEAM, WRH_BEAM, WRH_WALL), If(Type = BWType.BEAM, WRH_L, WRH_S) & nIndex, "", sSection, GetWarehouseIniPath()) > 0
|
||||
' If String.IsNullOrWhiteSpace(sSection) Then Continue While
|
||||
|
||||
@@ -677,7 +677,6 @@ Public Class WarehouseWndVM
|
||||
|
||||
Private Function SectionXMaterialFilter(SectionXMaterial As Object) As Boolean
|
||||
Dim CurrSectionXMaterial As SectionXMaterial = DirectCast(SectionXMaterial, SectionXMaterial)
|
||||
'Return Map.refProjectVM.BTLStructureVM.SectionList.Any(Function(x) x.MaterialM =)
|
||||
Return Map.refProjectVM.BTLStructureVM.SectionList.Contains(CurrSectionXMaterial)
|
||||
End Function
|
||||
|
||||
@@ -1209,18 +1208,12 @@ Public Class WarehouseWndVM
|
||||
End Property
|
||||
|
||||
Public Sub UpdateNetQuantity()
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.UPDATENETWAREHOUSE, 1, "Warehouse Synchronization", "Synchronization in progress...", 99) ' Warehouse Synchronization ' Synchronization in progress...
|
||||
If Not SaveOnDb() Then
|
||||
Return
|
||||
End If
|
||||
If Not SaveOnDb() Then Return
|
||||
Dim SyncResult As DataLayer.Controllers.MagmanController.SyncResult = DbControllers.m_MagmanController.CloudSyncro(True, True, True)
|
||||
' chiudo finestra di caricamento progetto
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.UPDATENETWAREHOUSE)
|
||||
Threading.Thread.Sleep(1000)
|
||||
If SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ALL_OK OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_MergeMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_CloudMatEmpty OrElse
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
SyncResult = DataLayer.Controllers.MagmanController.SyncResult.ERR_Res2SendEmpty Then
|
||||
WriteMainPrivateProfileString(S_WAREHOUSE, K_LASTSYNCHRONIZATION, DateTime.Now.ToString())
|
||||
Map.refOptimizePanelVM.NotifyPropertyChanged(NameOf(Map.refOptimizePanelVM.UseNetWarehouse_ToolTip))
|
||||
NotifyPropertyChanged(NameOf(UpdateNetQuantity_ToolTip))
|
||||
@@ -1233,6 +1226,9 @@ Public Class WarehouseWndVM
|
||||
' aggiorno elementi in lista
|
||||
RefreshSParamList()
|
||||
|
||||
'For Each SParam In m_SParamList
|
||||
' SParam.UpdateRawPart()
|
||||
'Next
|
||||
End Sub
|
||||
|
||||
#End Region ' RemoveWhWallParam
|
||||
@@ -1359,7 +1355,7 @@ Public Class WarehouseWndVM
|
||||
'WritePrivateProfileString(S_BEAM_LIST, sSectXMatIndex, LenToString(SectionXMaterial.dW, 3) & "," &
|
||||
' LenToString(SectionXMaterial.dH, 3) & "," &
|
||||
' SectionXMaterial.sMaterial, sWarehousePath)
|
||||
DbControllers.m_MaterialsController.Insert(New MaterialM(Math.Min(SectionXMaterial.MaterialM.dW, SectionXMaterial.MaterialM.dH), Math.Max(SectionXMaterial.MaterialM.dW, SectionXMaterial.MaterialM.dH), 0, SectionXMaterial.MaterialM.sMaterial, SectionXMaterial.MaterialM.sWarehouseMaterial))
|
||||
DbControllers.m_MaterialsController.Insert(SectionXMaterial.MaterialM)
|
||||
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
|
||||
'' ricavo SectionXMaterial tramite Wall_List
|
||||
'While EgtUILib.GetPrivateProfileString(S_WALL_LIST, sSectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<packages>
|
||||
<package id="BouncyCastle.Cryptography" version="2.4.0" targetFramework="net472" />
|
||||
<package id="DotNetZip" version="1.16.0" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2407.1708" targetFramework="net472" />
|
||||
<package id="EgwProxy.MagMan" version="1.0.2406.2617" targetFramework="net472" />
|
||||
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
|
||||
<package id="Google.Protobuf" version="3.27.0" targetFramework="net472" />
|
||||
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net472" />
|
||||
|
||||
@@ -13,58 +13,33 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgtBEAMWALL.Core", "EgtBEAM
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
RemoteDebug|x64 = RemoteDebug|x64
|
||||
RemoteDebug|x86 = RemoteDebug|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.Build.0 = Debug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.Build.0 = Debug|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.ActiveCfg = Release|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.Build.0 = Release|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.ActiveCfg = Release|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.Build.0 = Release|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.RemoteDebug|x64.ActiveCfg = RemoteDebug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.RemoteDebug|x64.Build.0 = RemoteDebug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.RemoteDebug|x86.ActiveCfg = RemoteDebug|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.RemoteDebug|x86.Build.0 = RemoteDebug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.Build.0 = Debug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.Build.0 = Debug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.ActiveCfg = Release|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.Build.0 = Release|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.ActiveCfg = Release|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.Build.0 = Release|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.RemoteDebug|x64.ActiveCfg = RemoteDebug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.RemoteDebug|x64.Build.0 = RemoteDebug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.RemoteDebug|x86.ActiveCfg = RemoteDebug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.RemoteDebug|x86.Build.0 = RemoteDebug|x86
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.Build.0 = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.Build.0 = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.RemoteDebug|x64.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.RemoteDebug|x86.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.RemoteDebug|x86.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.RemoteDebug|x64.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.RemoteDebug|x86.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.RemoteDebug|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user