using EgwProxy.MultiCncLib.CNC; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IOB_WIN { /// /// Definizione indirizzo memoria FANUC /// public class memAddressFanuc { #region Public Fields /// /// Posizione memoria /// public int mPos; /// /// Tipo memoria /// public FANUC.MemType mType; /// /// Tipo valore /// public string vType; #endregion Public Fields #region Public Constructors /// /// Inizializza da un formato stringa /// /// Stringa TipoMem.Indice.DimMem (es D.1604.DW) public memAddressFanuc(string strFormat) { if (!string.IsNullOrEmpty(strFormat)) { string[] memComp = strFormat.Split('.'); switch (memComp[0]) { case "A": mType = FANUC.MemType.A; break; case "C": mType = FANUC.MemType.C; break; case "CM": mType = FANUC.MemType.CM; break; case "D": mType = FANUC.MemType.D; break; case "E": mType = FANUC.MemType.E; break; case "F": mType = FANUC.MemType.F; break; case "G": mType = FANUC.MemType.G; break; case "K": mType = FANUC.MemType.K; break; case "M": mType = FANUC.MemType.M; break; case "N": mType = FANUC.MemType.N; break; case "R": mType = FANUC.MemType.R; break; case "T": mType = FANUC.MemType.T; break; case "X": mType = FANUC.MemType.X; break; case "Y": mType = FANUC.MemType.Y; break; case "Z": mType = FANUC.MemType.Z; break; default: break; } int.TryParse(memComp[1], out mPos); vType = memComp[2]; } } #endregion Public Constructors } /// /// Definizione area memoria FANUC /// public class memAreaFanuc { #region Public Fields /// /// Nome area memoria /// public string areaName; /// /// Dimensione array memoria /// public int arraySize; /// /// Indice inizio array /// public int startIdx; #endregion Public Fields } /// /// Definizione area memoria SIEMENS /// public class memAreaSiemens { #region Public Fields /// /// Indice DB /// public int DbNum = 0; /// /// Indice partenza memoria (es DBD0 --> 0) /// public int indiceMem = 0; /// /// Tipo Memoria (DBD, DBW...) /// public string tipoMem = ""; #endregion Public Fields #region Public Constructors /// /// Inizializza da un formato stringa /// /// public memAreaSiemens(string strFormat) { if (!string.IsNullOrEmpty(strFormat)) { string[] memComp = strFormat.Split('.'); int.TryParse(memComp[0].Replace("DB", ""), out DbNum); //tipoMem = memComp[1].Substring(2, 1); tipoMem = ""; for (int i = 0; i < memComp[1].Length; i++) { if (char.IsLetter(memComp[1][i])) { tipoMem += memComp[1][i]; } } // rimuovo DB iniziale.. tipoMem = tipoMem.Replace("DB", ""); // ciclo x trovare SOLO stringa int.TryParse(memComp[1].Replace("DB", "").Replace(tipoMem, ""), out indiceMem); } } #endregion Public Constructors } }