Merge remote-tracking branch 'origin/develop' into feature/Remove_autoinc_from_db

This commit is contained in:
Lucio Maranta
2018-10-04 17:19:41 +02:00
106 changed files with 2232 additions and 1223 deletions
+6 -8
View File
@@ -20,9 +20,8 @@ namespace Client.Utils
public static String CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
public static String CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
public static String errorPageFile = BASE_PATH + "error.pg";
public static String JOB_OPENING_PATH = BASE_PATH + "TempJob\\";
public static String JOB_OPENING_PATH = "C:\\CMS\\STEP\\TMP\\clientTmpJob\\";
//Config Names
public const string CONFIG_KEY = "Config";
public const string CLIENT_CONFIG_KEY = "Client";
@@ -74,12 +73,11 @@ namespace Client.Utils
public const string KEYB_PROC_NAME = "OSK";
public const string StartingPage = "index.html";
public const string Uploadpage = "/api/file_manager/upload";
public const string UPLOAD_PAGE = "/api/file_manager/upload";
public const string UPLOAD_ADD_QUEUE = "/api/file_manager/queue/add";
public const string ConfigPage = "api/configuration/client";
public const string errorPageUrl = @"error://error/";
public const string errorPageUrl = @"error://error/";
public static string[] JOB_EXTENSIONS = { ".job", ".zip" };
}
}
+212 -46
View File
@@ -27,7 +27,7 @@ namespace CMS_Client.Browser_Tools
// The first letter of All PUBLIC Variables and Methods must be Lower-Case (CEF Settings)
private MainForm mainForm;
private static readonly string[] _validExtensions = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
private static readonly string[] _validExtensions = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf", ".job", ".zip" };
private static readonly string[] _validImages = { ".jpg", ".jpeg", ".png" };
private static string jobPath = "";
@@ -66,11 +66,14 @@ namespace CMS_Client.Browser_Tools
AddFunction("openJob").Execute += openJob;
AddFunction("saveJob").Execute += saveJob;
AddFunction("newJob").Execute += newJob;
AddFunction("closeJob").Execute += closeJob;
AddFunction("saveJobNewPath").Execute += saveJobNewPath;
AddFunction("addImageToJob").Execute += addImageToJob;
AddFunction("delImageFromJob").Execute += delImageFromJob;
AddFunction("addPPToJob").Execute += addPPToJob;
AddFunction("delPPFromJob").Execute += delPPFromJob;
AddFunction("readJobMetadata").Execute += readJobMetadata;
AddFunction("updateJobMetadata").Execute += updateJobMetadata;
}
#endregion CONSTRUCTOR_METHOD
@@ -325,7 +328,7 @@ namespace CMS_Client.Browser_Tools
{
if (_validExtensions.Contains(Path.GetExtension(item).ToLower()))
{
bool isJob = Path.GetExtension(item) == "job";
bool isJob = JOB_EXTENSIONS.Contains(Path.GetExtension(item));
filelist.Add(new Models.File
{
Name = Path.GetFileName(item),
@@ -357,7 +360,7 @@ namespace CMS_Client.Browser_Tools
//Check the arguments numbers
if (e.Arguments.Length < 1 || e.Arguments[0] == null)
{
e.SetReturnValue(Constants.Uploadpage + "INVALID_ARGUMENTS");
e.SetReturnValue(UPLOAD_PAGE + "INVALID_ARGUMENTS");
return;
}
@@ -365,7 +368,7 @@ namespace CMS_Client.Browser_Tools
fileToUpload = e.Arguments[0].StringValue;
if (!System.IO.File.Exists(fileToUpload))
{
e.SetReturnValue(Constants.Uploadpage + ";FILE_NOT_FOUND");
e.SetReturnValue(UPLOAD_PAGE + ";FILE_NOT_FOUND");
return;
}
@@ -390,22 +393,23 @@ namespace CMS_Client.Browser_Tools
using (HttpClient httpClient = new HttpClient())
{
//Create the new FORM
MultipartFormDataContent form = new MultipartFormDataContent();
//Add the content to the form
form.Add(new ByteArrayContent(filecontent), "file", fileName);
MultipartFormDataContent form = new MultipartFormDataContent
{
//Add the content to the form
{ new ByteArrayContent(filecontent), "file", fileName }
};
if (imagecontent != null)
form.Add(new ByteArrayContent(imagecontent), "image", imageName);
//Send them
HttpResponseMessage response = httpClient.PostAsync(
"http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.Uploadpage,
"http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.UPLOAD_PAGE,
form).Result;
//Wait the answer
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
e.SetReturnValue(Constants.Uploadpage + ";" + await response.Content.ReadAsStringAsync());
e.SetReturnValue(UPLOAD_PAGE + ";" + await response.Content.ReadAsStringAsync());
else if (response.StatusCode != System.Net.HttpStatusCode.OK)
e.SetReturnValue(Constants.Uploadpage + ";" + response.ReasonPhrase);
e.SetReturnValue(UPLOAD_PAGE + ";" + response.ReasonPhrase);
else
e.SetReturnValue("");
}
@@ -425,7 +429,7 @@ namespace CMS_Client.Browser_Tools
//Check the arguments numbers
if (e.Arguments.Length < 1 || e.Arguments[0] == null)
{
e.SetReturnValue(Constants.UPLOAD_ADD_QUEUE + "INVALID_ARGUMENTS");
e.SetReturnValue(UPLOAD_ADD_QUEUE + "INVALID_ARGUMENTS");
return;
}
@@ -435,7 +439,7 @@ namespace CMS_Client.Browser_Tools
if (!System.IO.File.Exists(fileToUpload))
{
e.SetReturnValue(Constants.UPLOAD_ADD_QUEUE + ";FILE_NOT_FOUND");
e.SetReturnValue(UPLOAD_ADD_QUEUE + ";FILE_NOT_FOUND");
return;
}
@@ -471,14 +475,14 @@ namespace CMS_Client.Browser_Tools
//Send them
HttpResponseMessage response = httpClient
.PostAsync("http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.UPLOAD_ADD_QUEUE,
.PostAsync("http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + UPLOAD_ADD_QUEUE,
form)
.Result;
//Wait the answer
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
e.SetReturnValue(Constants.UPLOAD_ADD_QUEUE + ";" + await response.Content.ReadAsStringAsync());
e.SetReturnValue(UPLOAD_ADD_QUEUE + ";" + await response.Content.ReadAsStringAsync());
else if (response.StatusCode != System.Net.HttpStatusCode.OK)
e.SetReturnValue(Constants.UPLOAD_ADD_QUEUE + ";" + response.ReasonPhrase);
e.SetReturnValue(UPLOAD_ADD_QUEUE + ";" + response.ReasonPhrase);
else
e.SetReturnValue("");
}
@@ -573,7 +577,7 @@ namespace CMS_Client.Browser_Tools
#region JOB_METHODS
// Read job data
// Read all the job data
public void openJob(object sender, CfrV8HandlerExecuteEventArgs e)
{
JobToStep job = new JobToStep();
@@ -585,6 +589,14 @@ namespace CMS_Client.Browser_Tools
if (jobOpenFileDialog.ShowDialog() == DialogResult.OK)
{
// Check if zip is valid
var zipIsValid = ValidateZip(jobOpenFileDialog.FileName);
if (zipIsValid != null)
{
e.SetReturnValue(JsonConvert.SerializeObject(zipIsValid));
return;
}
if (!Directory.Exists(JOB_OPENING_PATH))
Directory.CreateDirectory(JOB_OPENING_PATH);
@@ -632,15 +644,15 @@ namespace CMS_Client.Browser_Tools
metasFromFile = JsonConvert.DeserializeObject<MetadataToFile>(reader.ReadToEnd());
if (metasFromFile == null)
{
e.SetReturnValue(null);
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
else
{
job.metadata.generics.Description = metasFromFile.Description;
job.metadata.generics.ExecutionTime = metasFromFile.ExecutionTime;
job.metadata.tools = metasFromFile.Tools;
job.metadata.customs = metasFromFile.Customs;
job.metadata.generics.description = metasFromFile.description;
job.metadata.generics.executionTime = metasFromFile.executionTime;
job.metadata.tools = metasFromFile.tools;
job.metadata.customs = metasFromFile.customs;
}
}
}
@@ -648,10 +660,11 @@ namespace CMS_Client.Browser_Tools
else
{
entry.ExtractToFile(JOB_OPENING_PATH + entry.Name, true);
job.partPrograms.Add(new PPContainer(Path.GetFileName(entry.Name)));
}
}
}
jobPath = Path.GetFileName(jobOpenFileDialog.FileName);
jobPath = jobOpenFileDialog.FileName;
e.SetReturnValue(JsonConvert.SerializeObject(job));
return;
}
@@ -662,7 +675,116 @@ namespace CMS_Client.Browser_Tools
}
}
// create job data
public void readJobMetadata(object sender, CfrV8HandlerExecuteEventArgs e)
{
// Get file path
string filePath = e.Arguments[0].StringValue;
// Check if zip is valid
var zipIsValid = ValidateZip(filePath);
if (zipIsValid != null)
{
e.SetReturnValue(JsonConvert.SerializeObject(zipIsValid));
return;
}
// Open zip archive
using (ZipArchive zipArchive = ZipFile.OpenRead(filePath))
{
// Setup main Fields
JobToStep jobData = new JobToStep()
{
name = Path.GetFileName(filePath),
lastEditTimestamp = new FileInfo(filePath).LastAccessTime
};
foreach (ZipArchiveEntry entry in zipArchive.Entries)
{
// Get images content without extract files
if (_validImages.Contains(Path.GetExtension(entry.Name).ToLower()))
{
using (var memoryReader = new MemoryStream())
{
entry.Open().CopyTo(memoryReader);
jobData.metadata.generics.images.Add(new ImageParam()
{
name = Path.GetFileName(entry.Name),
base64 = "data:image/" + Path.GetExtension(entry.Name).ToLower().TrimStart('.') + ";base64," + Convert.ToBase64String(memoryReader.ToArray())
});
}
}
// Metadata
else if (entry.Name.Equals(JOB_METADATA_FILENAME, StringComparison.OrdinalIgnoreCase))
{
MetadataToFile metasFromFile = new MetadataToFile();
using (var reader = new StreamReader(entry.Open()))
{
metasFromFile = JsonConvert.DeserializeObject<MetadataToFile>(reader.ReadToEnd());
if (metasFromFile == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
else
{
jobData.metadata.generics.description = metasFromFile.description;
jobData.metadata.generics.executionTime = metasFromFile.executionTime;
jobData.metadata.tools = metasFromFile.tools;
jobData.metadata.customs = metasFromFile.customs;
}
}
}
}
e.SetReturnValue(JsonConvert.SerializeObject(jobData));
return;
}
}
public void updateJobMetadata(object sender, CfrV8HandlerExecuteEventArgs e)
{
MetadataToFile metafile = new MetadataToFile();
// Deserialize job
JobToStep job = JsonConvert.DeserializeObject<JobToStep>(e.Arguments[1].StringValue);
if (job == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
// Set meta data
metafile.description = job.metadata.generics.description;
metafile.executionTime = job.metadata.generics.executionTime;
metafile.tools = job.metadata.tools;
metafile.customs = job.metadata.customs;
// Open zipArchive in update mode
using (ZipArchive zipArchive = ZipFile.Open(e.Arguments[0].StringValue, ZipArchiveMode.Update))
{
// Find metadata.json file
var file = zipArchive.Entries.Where(x => x.FullName == JOB_METADATA_FILENAME).FirstOrDefault();
if(file == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
// Update metadata file
using (StreamWriter streamWriter = new StreamWriter(file.Open()))
{
JsonSerializer serializer = new JsonSerializer
{
Formatting = Formatting.Indented
};
// Write
serializer.Serialize(streamWriter, metafile);
}
}
}
// Create job data
public void newJob(object sender, CfrV8HandlerExecuteEventArgs e)
{
JobToStep job = new JobToStep();
@@ -671,15 +793,26 @@ namespace CMS_Client.Browser_Tools
Directory.CreateDirectory(JOB_OPENING_PATH);
ClearTempPath();
job.name = "newjob_" + DateTime.Now.ToFileTime() + ".job";
jobPath = "";
e.SetReturnValue(JsonConvert.SerializeObject(job));
return;
}
// close job
public void closeJob(object sender, CfrV8HandlerExecuteEventArgs e)
{
if (!Directory.Exists(JOB_OPENING_PATH))
Directory.CreateDirectory(JOB_OPENING_PATH);
ClearTempPath();
jobPath = "";
e.SetReturnValue(null);
return;
}
// Save all job
public void saveJobNewPath(object sender, CfrV8HandlerExecuteEventArgs e)
@@ -699,15 +832,16 @@ namespace CMS_Client.Browser_Tools
JobToStep job = JsonConvert.DeserializeObject<JobToStep>(e.Arguments[0].StringValue);
if (job == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("corrupted_model")));
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
//Metadata
metafile.Description = job.metadata.generics.Description;
metafile.ExecutionTime = job.metadata.generics.ExecutionTime;
metafile.Tools = job.metadata.tools;
metafile.Customs = job.metadata.customs;
metafile.description = job.metadata.generics.description;
metafile.executionTime = job.metadata.generics.executionTime;
metafile.tools = job.metadata.tools;
metafile.customs = job.metadata.customs;
using (StreamWriter file = System.IO.File.CreateText(JOB_OPENING_PATH + JOB_METADATA_FILENAME))
{
JsonSerializer serializer = new JsonSerializer
@@ -727,16 +861,16 @@ namespace CMS_Client.Browser_Tools
//Create Zip File
ZipFile.CreateFromDirectory(JOB_OPENING_PATH, jobSaveFileDialog.FileName);
jobPath = Path.GetFileName(jobSaveFileDialog.FileName);
jobPath = jobSaveFileDialog.FileName;
job.name = jobPath;
e.SetReturnValue(JsonConvert.SerializeObject(job));
return;
}
e.SetReturnValue(null);
return;
}
// Save all job
public void saveJob(object sender, CfrV8HandlerExecuteEventArgs e)
{
@@ -744,16 +878,14 @@ namespace CMS_Client.Browser_Tools
SaveFileDialog jobSaveFileDialog = new SaveFileDialog();
jobSaveFileDialog.Filter = "CMS Job Files(*.JOB)|*.job|Zip Files(*.ZIP)|*.zip";
// Job deserialize
JobToStep job = JsonConvert.DeserializeObject<JobToStep>(e.Arguments[0].StringValue);
if (job == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("corrupted_model")));
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
}
//check the arguments
if (e.Arguments.Count() == 0)
return;
@@ -770,16 +902,15 @@ namespace CMS_Client.Browser_Tools
e.SetReturnValue(null);
return;
}
}
if (!String.IsNullOrEmpty(jobPath))
{
//Metadata
metafile.Description = job.metadata.generics.Description;
metafile.ExecutionTime = job.metadata.generics.ExecutionTime;
metafile.Tools = job.metadata.tools;
metafile.Customs = job.metadata.customs;
metafile.description = job.metadata.generics.description;
metafile.executionTime = job.metadata.generics.executionTime;
metafile.tools = job.metadata.tools;
metafile.customs = job.metadata.customs;
using (StreamWriter file = System.IO.File.CreateText(JOB_OPENING_PATH + JOB_METADATA_FILENAME))
{
JsonSerializer serializer = new JsonSerializer
@@ -797,16 +928,24 @@ namespace CMS_Client.Browser_Tools
System.IO.File.Delete(jobPath);
//Create Zip File
ZipFile.CreateFromDirectory(JOB_OPENING_PATH, jobPath);
try
{
ZipFile.CreateFromDirectory(JOB_OPENING_PATH, jobPath);
}
catch(Exception ex)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_save_file")));
return;
}
e.SetReturnValue(JsonConvert.SerializeObject(job));
return;
}
e.SetReturnValue(null);
return;
}
// Add an image
public void addImageToJob(object sender, CfrV8HandlerExecuteEventArgs e)
{
@@ -873,7 +1012,7 @@ namespace CMS_Client.Browser_Tools
//Check the extension
if (!_validExtensions.Contains(Path.GetExtension(PPOpenFileDialog.FileName).ToLower()))
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("extension_not_available")));
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("ext_not_available")));
return;
}
@@ -944,6 +1083,33 @@ namespace CMS_Client.Browser_Tools
return base64img.Substring(base64img.IndexOf(";base64,") + ";base64,".Length);
}
private static ErrorContainer ValidateZip(string filePath)
{
ErrorContainer result = null;
if (!System.IO.File.Exists(filePath))
return new ErrorContainer("error_file_not_found");
try
{
using (var archive = ZipFile.OpenRead(filePath))
{
List<ZipArchiveEntry> files = archive.Entries.Where(x => x.FullName == JOB_MAIN_FILENAME || x.FullName == JOB_METADATA_FILENAME).ToList();
if (files.Count() < 2)
return new ErrorContainer("error_job_not_valid");
else
result = null;
}
}
catch (Exception)
{
result = new ErrorContainer("error_job_not_valid");
}
return result;
}
#endregion JOB_METHODS
}
}
+3 -1
View File
@@ -12,11 +12,13 @@ namespace CMS_Client.Browser_Tools.Models
public string name;
public DateTime lastEditTimestamp;
public string isoMainProgram;
public Metas metadata;
public Metas metadata;
public List<PPContainer> partPrograms;
public JobToStep()
{
metadata = new Metas();
partPrograms = new List<PPContainer>();
}
}
}
@@ -8,10 +8,10 @@ namespace CMS_Client.Browser_Tools.Models.Metadata
{
public class CustomParam
{
public string Name;
public string Type;
public string name;
public string type;
public List<string> selectionList;
public int Value;
public int value;
public CustomParam()
{
@@ -9,8 +9,8 @@ namespace CMS_Client.Browser_Tools.Models.Metadata
public class GenericsParam
{
public List<ImageParam> images;
public string Description;
public TimeSpan ExecutionTime;
public string description;
public TimeSpan executionTime;
public GenericsParam()
{
@@ -9,15 +9,15 @@ namespace CMS_Client.Browser_Tools.Models
{
public class MetadataToFile
{
public string Description;
public TimeSpan ExecutionTime;
public List<int> Tools;
public List<CustomParam> Customs;
public string description;
public TimeSpan executionTime;
public List<int> tools;
public List<CustomParam> customs;
public MetadataToFile()
{
Tools = new List<int>();
Customs = new List<CustomParam>();
tools = new List<int>();
customs = new List<CustomParam>();
}
}
}
Binary file not shown.
+170 -32
View File
@@ -1,35 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<maintenances>
<maintenance>
<id>1</id>
<localizedName>
<lang langKey="en">Manutenzione scaduta</lang>
<lang langKey="it">Manutenzione scaduta</lang>
</localizedName>
<interval>10</interval>
<deadline>15/06/2018 13:00</deadline>
<type>EXP_DATE</type>
<localizedDescription>
<lang langKey="en">Test 2 </lang>
<lang langKey="it">Ita 2</lang>
</localizedDescription>
<unitOfMeasure>D</unitOfMeasure>
<counterId>2</counterId>
</maintenance>
<maintenance>
<id>2</id>
<localizedName>
<lang langKey="en">Test 2 </lang>
<lang langKey="it">Ita 2</lang>
</localizedName>
<interval>1000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Test 2 </lang>
<lang langKey="it">Ita 2</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>1</id>
<localizedName>
<lang langKey="en">5-Axis operating-unit management</lang>
<lang langKey="it">Gestione gruppo operatore 5 assi</lang>
</localizedName>
<interval>2000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Replace air/liquid seals of rotary axis joint</lang>
<lang langKey="it">Sostituire tenute aria/liquido giunto assi rotanti</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>2</id>
<localizedName>
<lang langKey="en">Transmission member check</lang>
<lang langKey="it">Gestione Organi di trasmissione</lang>
</localizedName>
<interval>2000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Transmission members check</lang>
<lang langKey="it">Necessary control of all transmission system</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>3</id>
<localizedName>
<lang langKey="en">Mechanical/electrical safety systems</lang>
<lang langKey="it">Sistemi di sicurezza meccanici/elettrici</lang>
</localizedName>
<interval>2000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Necessary control of mechanical/electrical safety systems</lang>
<lang langKey="it">Necessario controllo di tutti i sistemi di sicurezza meccanici/elettrici presenti in macchina</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>4</id>
<localizedName>
<lang langKey="en">Check of axis geometry</lang>
<lang langKey="it">Controllo geometria assi</lang>
</localizedName>
<interval>2000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Necessary control of axis geometry</lang>
<lang langKey="it">Necessario controllo della corretta geometria assi</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>5</id>
<localizedName>
<lang langKey="en">Machine System check</lang>
<lang langKey="it">Controllo impianti macchina necessario</lang>
</localizedName>
<interval>2000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Necessary control Electric / Mechanical / Pneumatic Systems</lang>
<lang langKey="it">Necessario controllo impianti Elettrico / Meccanico / Pneumatico</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>6</id>
<localizedName>
<lang langKey="en">Tool holder clamps management</lang>
<lang langKey="it">Gestione manine portautensili</lang>
</localizedName>
<interval>4000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Replace composite material tool holder clamps</lang>
<lang langKey="it">Sostituire manine portautensili in materiale composito</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>7</id>
<localizedName>
<lang langKey="en">Balancing cylinders management</lang>
<lang langKey="it">Gestione cilindri di bilanciamento</lang>
</localizedName>
<interval>4000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Replace seals on balancing cylinders</lang>
<lang langKey="it">Sostituire tenute su cilindri di bilanciamento</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>1</counterId>
</maintenance>
<maintenance>
<id>8</id>
<localizedName>
<lang langKey="en">Lower-grinder servicing necessary</lang>
<lang langKey="it">Revisione mola inferiore necessaria</lang>
</localizedName>
<interval>4000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Execute spindle service of Lower-grinder</lang>
<lang langKey="it">Eseguire revisione al mandrino della mola inferiore</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>2</counterId>
</maintenance>
<maintenance>
<id>9</id>
<localizedName>
<lang langKey="en">Upper-grinder servicing necessary</lang>
<lang langKey="it">Revisione mola superiore necessaria</lang>
</localizedName>
<interval>4000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Execute spindle service of Upper-grinder</lang>
<lang langKey="it">Eseguire revisione al mandrino della mola superiore</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>3</counterId>
</maintenance>
<maintenance>
<id>10</id>
<localizedName>
<lang langKey="en">Drill servicing necessary</lang>
<lang langKey="it">Revisione foratore necessario</lang>
</localizedName>
<interval>4000</interval>
<deadline>15/07/2018 13:00</deadline>
<type>MACHINE_INTERVAL</type>
<localizedDescription>
<lang langKey="en">Execute spindle service of the driller</lang>
<lang langKey="it">Eseguire revisione al mandrino del foratore</lang>
</localizedDescription>
<unitOfMeasure>mm</unitOfMeasure>
<counterId>4</counterId>
</maintenance>
</maintenances>
+2 -2
View File
@@ -1,4 +1,5 @@
using Step.Core;
using CMS_CORE_Library.Models;
using Step.Core;
using Step.Model.DTOModels;
using Step.Model.DTOModels.ToolModels;
using Step.NC;
@@ -6,7 +7,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using TeamDev.SDK.MVVM;
using static CMS_CORE_Library.DataStructures;
using static Step.Model.Constants;
using static Step.Utils.ExceptionManager;
@@ -3,7 +3,7 @@ using Step.Model.DTOModels;
using System;
using System.Collections.Generic;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
using static Step.Config.ServerConfig;
namespace Step.Database.Controllers
+14 -16
View File
@@ -6,17 +6,6 @@ namespace Step.Model
{
public static class Constants
{
public static readonly string[] VALID_FILE_EXTENSIONS = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
public static readonly string[] VALID_IMAGE_EXTENSIONS = { ".jpg", ".jpeg", ".png" };
public const double EPSILON = 0.001;
public static string QUEUE_FILE_NAME = "pp";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public static String JOB_OPENING_PATH = BASE_PATH + "TempJob\\";
public enum ROLE_IDS
{
CMS_SERVICE_ONLY = 1,
@@ -213,10 +202,19 @@ namespace Step.Model
}
// File paths
public const string MAINTENANCE_ATTACHMENT_PATH = "C:\\CMS\\STEP\\attachment\\";
public const string TEMP_FILE = @"C:\CMS\STEP\tmp\pp\";
public const string JOB_TMP_DIRECTORY = @"C:\CMS\STEP\tmp\pp\job\";
public const string QUEUE_TMP_FILE = @"C:\CMS\STEP\tmp\pp\queue\";
public const string PART_PRG_IMAGES = @"C:\CMS\STEP\pp_img/";
public const string MAINTENANCE_ATTACHMENT_PATH = @"C:\CMS\STEP\attachment\";
public const string TEMP_FOLDER = @"C:\CMS\STEP\TMP\";
public const string TEMP_PP_FOLDER = TEMP_FOLDER + @"pp\";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string QUEUE_TMP_FOLDER = TEMP_PP_FOLDER + @"queue\";
public const string PART_PRG_IMAGES = @"C:\CMS\STEP\pp_img\";
public static readonly string[] VALID_FILE_EXTENSIONS = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
public static readonly string[] VALID_IMAGE_EXTENSIONS = { ".jpg", ".jpeg", ".png" };
public const double EPSILON = 0.001;
public static string QUEUE_FILE_NAME = "pp";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public static string[] JOB_EXTENSIONS = { ".job", ".zip" };
}
}
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static CMS_CORE_Library.DataStructures;
using System.Linq;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels
{
@@ -17,7 +13,7 @@ namespace Step.Model.DTOModels
if (Path != item.Path)
return false;
if(IsoLines != null && item.IsoLines != null)
if (IsoLines != null && item.IsoLines != null)
if (!IsoLines.SequenceEqual(item.IsoLines))
return false;
@@ -27,4 +23,4 @@ namespace Step.Model.DTOModels
return true;
}
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels
{
+1 -1
View File
@@ -1,4 +1,4 @@
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels
{
+2 -1
View File
@@ -1,4 +1,5 @@
using static CMS_CORE_Library.DataStructures;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels
{
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels
{
+4 -10
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static CMS_CORE_Library.DataStructures;
using static Step.Model.Constants;
using static Step.Model.Constants;
namespace Step.Model.DTOModels
{
@@ -14,7 +8,7 @@ namespace Step.Model.DTOModels
public string PartProgramName { get; set; }
public int Reps { get; set; }
public int Reps { get; set; }
public int RemainingReps { get; set; }
@@ -36,7 +30,7 @@ namespace Step.Model.DTOModels
if (Reps != item.Reps)
return false;
if (RemainingReps != item.RemainingReps)
return false;
@@ -46,4 +40,4 @@ namespace Step.Model.DTOModels
return true;
}
}
}
}
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.JobModels
{
@@ -17,4 +14,4 @@ namespace Step.Model.DTOModels.JobModels
Images = new List<DTOImageParamModel>();
}
}
}
}
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.JobModels
namespace Step.Model.DTOModels.JobModels
{
public class DTOImageParamModel
{
public string Name;
public string Base64;
}
}
}
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Step.Model.DTOModels.JobModels
{
@@ -18,4 +14,4 @@ namespace Step.Model.DTOModels.JobModels
SelectionList = new List<string>();
}
}
}
}
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.JobModels
{
@@ -12,10 +9,12 @@ namespace Step.Model.DTOModels.JobModels
public DateTime LastEditTimestamp;
public string IsoMainProgram;
public DTOMetadataModel Metadata;
public List<string> PartPrograms;
public DTOJobModel()
{
Metadata = new DTOMetadataModel();
PartPrograms = new List<string>();
}
}
}
}
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.JobModels
{
@@ -19,4 +16,4 @@ namespace Step.Model.DTOModels.JobModels
Customs = new List<DTOJobCustomParamModel>();
}
}
}
}
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Step.Model.DTOModels.JobModels
{
@@ -19,4 +15,4 @@ namespace Step.Model.DTOModels.JobModels
Customs = new List<DTOJobCustomParamModel>();
}
}
}
}
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using CMS_CORE_Library.Models;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DTOModels.ToolModels
{
@@ -1,4 +1,5 @@
using static CMS_CORE_Library.DataStructures;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels.ToolModels
{
@@ -1,10 +1,6 @@
using Step.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.ToolModels
{
@@ -80,4 +76,4 @@ namespace Step.Model.DTOModels.ToolModels
};
}
}
}
}
@@ -1,8 +1,7 @@
using Step.Model.DatabaseModels;
using System;
using CMS_CORE_Library.Models;
using Step.Model.DatabaseModels;
using System.Collections;
using System.ComponentModel.DataAnnotations;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DTOModels.ToolModels
{
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using CMS_CORE_Library.Models;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DTOModels.ToolModels
{
@@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations;
using static CMS_CORE_Library.DataStructures;
using CMS_CORE_Library.Models;
using System.ComponentModel.DataAnnotations;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Model.DTOModels.ToolModels
{
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using CMS_CORE_Library.Models;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DatabaseModels
{
@@ -1,6 +1,8 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static CMS_CORE_Library.DataStructures;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.NcMagazinePositionModel;
namespace Step.Model.DatabaseModels
{
+3 -2
View File
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static CMS_CORE_Library.DataStructures;
using CMS_CORE_Library.Models;
namespace Step.Model.DatabaseModels
{
+2 -2
View File
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
using CMS_CORE_Library.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static CMS_CORE_Library.DataStructures;
namespace Step.Model.DatabaseModels
{
+115 -46
View File
@@ -1,11 +1,13 @@
using CMS_CORE;
using CMS_CORE.Demo;
using CMS_CORE.Fanuc;
using CMS_CORE.Osai;
using CMS_CORE.Siemens;
using CMS_CORE_Library;
using CMS_CORE_Library.Demo;
using CMS_CORE_Library.Fanuc;
using CMS_CORE_Library.Models;
using CMS_CORE_Library.Osai;
using CMS_CORE_Library.Siemens;
using Step.Database.Controllers;
using Step.Model.DatabaseModels;
using Step.Model.DTOModels;
using Step.Model.DTOModels.JobModels;
using Step.Model.DTOModels.MaintenanceModels;
using Step.Model.DTOModels.ToolModels;
using Step.Utils;
@@ -15,17 +17,17 @@ using System.Data.Entity;
using System.Globalization;
using System.IO;
using System.Linq;
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
using static Step.Database.Controllers.QueueController;
using static Step.Model.Constants;
namespace Step.NC
{
public class NcHandler : IDisposable
{
public Nc numericalControl;
public NcHandler()
{
// Choose NC
@@ -85,13 +87,57 @@ namespace Step.NC
return numericalControl.FILES_RGetFileInfo(path, ref fileInfo);
}
public CmsError GetActiveFileInfo(string path, out InfoFile fileInfo)
{
fileInfo = new InfoFile();
PROGRAM_TYPE_ENUM program = PROGRAM_TYPE_ENUM.NONE;
CmsError cmsError = numericalControl.FILES_RGetProgramType(ref program);
if (cmsError.IsError())
return cmsError;
// If the program is a job
if (program == PROGRAM_TYPE_ENUM.JOB)
{
ushort selectedProcess = 0;
cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess);
if (cmsError.IsError())
return cmsError;
string jobFolderPath = JOB_TMP_DIRECTORY + "\\" + selectedProcess + "\\";
DTOJobModel model = SupportFunctions.ReadExtractedJobMetadata(selectedProcess);
if (model == null)
return FILE_NOT_FOUND_ERROR;
string base64Img = model.Metadata.Generics.Images.Count() > 0 ? model.Metadata.Generics.Images[0].Base64 : "";
fileInfo = new InfoFile()
{
AbsolutePath = path,
Content = model.IsoMainProgram.Split('\n').ToList(),
PreviewBase64 = base64Img
};
return NO_ERROR;
}
else
{
if (File.Exists(path))
return GetQueueFileInfo(path, out fileInfo);
else
return numericalControl.FILES_RGetFileInfo(path, ref fileInfo);
}
}
public CmsError GetQueueFileInfo(string path, out InfoFile fileInfo)
{
FileInfo fileData = new FileInfo(path);
StreamReader fileRead = new StreamReader(path);
int count = 0;
string line = "";
fileInfo = new InfoFile()
{
Name = fileData.Name,
@@ -205,25 +251,34 @@ namespace Step.NC
{
programData = new ActiveProgramDataModel();
// Upload to NC
CmsError cmsError = UploadPartProgram(localPath, fileName, out string newFilePath);
if (cmsError.IsError())
return cmsError;
// Get selectedProcess id
ushort selectedProcess = 0;
cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess);
CmsError cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess);
if (cmsError.IsError())
return cmsError;
// Activate updated program
return numericalControl.FILES_WSetActiveProgram(selectedProcess, newFilePath, ref programData);
}
if (!JOB_EXTENSIONS.Contains(Path.GetExtension(fileName)))
{
// Upload to NC
cmsError = UploadPartProgram(localPath, fileName, out string newFilePath);
if (cmsError.IsError())
return cmsError;
// Activate updated program
return numericalControl.FILES_WSetActiveProgram(selectedProcess, newFilePath, ref programData);
}
else
{
DTOJobModel job = SupportFunctions.UnpackJobAndReadMetadata(localPath + fileName, selectedProcess);
return numericalControl.FILES_WUploadJobFilesAndActivate(selectedProcess, JOB_TMP_DIRECTORY, JOB_MAIN_FILENAME);
}
}
public CmsError UploadPartProgramAndAddToQueue(string localPath, string fileName, int reps, out DTOQueueModel queueItem)
{
queueItem = new DTOQueueModel();
// Get selectedProcess id
ushort selectedProcess = 0;
CmsError cmsError = numericalControl.PROC_RSelectedProcess(ref selectedProcess);
@@ -248,7 +303,6 @@ namespace Step.NC
// Add new process to
PartProgramQueue[selectedProcess].Add(queueItem);
using (QueueController queueController = new QueueController())
{
queueController.UpdateQueue();
@@ -259,12 +313,12 @@ namespace Step.NC
public CmsError UpdateQueue()
{
// Get selectedProcess id
// Get queue data
List<QueueStatusModel> queueData = new List<QueueStatusModel>();
CmsError cmsError = numericalControl.FILES_RQueueData(ref queueData);
foreach(var item in queueData)
foreach (var item in queueData)
{
if (!QueueRunningIndexes.ContainsKey(item.ProcessId))
QueueRunningIndexes.Add(item.ProcessId, 0);
@@ -286,16 +340,31 @@ namespace Step.NC
// Set as finished
actualItem.RemainingReps = 0;
actualItem.Status = QUEUE_ITEM_STATUS.FINISHED;
//while(PartProgramQueue[item.ProcessId].ElementAtOrDefault(QueueRunningIndexes[item.ProcessId] + 1) != null && !File.Exists(PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].AbsolutePath))
//{
// QueueRunningIndexes[item.ProcessId] += 1;
//}
if (PartProgramQueue[item.ProcessId].ElementAtOrDefault(QueueRunningIndexes[item.ProcessId] + 1) != null)
// if next part program exists, set next pp as current pp
QueueRunningIndexes[item.ProcessId] += 1;
// Change part program
cmsError = numericalControl
.FILES_WLoadNextPartProgram(
PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].AbsolutePath,
QUEUE_FILE_NAME
);
// Check if file is a valid job
if (SupportFunctions.IsValidJob(PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].AbsolutePath))
{
// Unpack job
DTOJobModel job = SupportFunctions.UnpackJobAndReadMetadata(PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].AbsolutePath, item.ProcessId);
// Load JOB to NC
return numericalControl.FILES_WUploadJobFilesAndActivate(item.ProcessId, JOB_TMP_DIRECTORY + "\\" + item.ProcessId + "\\", JOB_MAIN_FILENAME);
}
else
// Upload & activate new part program
cmsError = numericalControl
.FILES_WLoadNextPartProgram(
PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].AbsolutePath,
QUEUE_FILE_NAME
);
if (cmsError.IsError())
return cmsError;
@@ -303,8 +372,8 @@ namespace Step.NC
}
}
}
// Check if queue exists for the process
// Check if queue exists for the process
if (PartProgramQueue.ContainsKey(item.ProcessId) && PartProgramQueue[item.ProcessId].ElementAtOrDefault(QueueRunningIndexes[item.ProcessId]) != null)
{
// Set status based on queue status
@@ -317,16 +386,11 @@ namespace Step.NC
if (item.Status == QUEUE_STATUS.WAITING_OPERATOR)
PartProgramQueue[item.ProcessId][QueueRunningIndexes[item.ProcessId]].Status = QUEUE_ITEM_STATUS.WAITING_OPERATOR;
}
}
// Update data
//using (QueueController queueController = new QueueController())
//{
// queueController.UpdateQueue();
//}
}
return NO_ERROR;
}
public CmsError GetSelectedProcessQueue(out List<DTOQueueModel> queueList)
{
queueList = new List<DTOQueueModel>();
@@ -396,15 +460,15 @@ namespace Step.NC
return INCORRECT_PARAMETERS_ERROR;
var item = PartProgramQueue[processId][itemId];
// Remove item in the old positions
// Remove item in the old positions
PartProgramQueue[processId].RemoveAt(itemId);
// Add in the new position
PartProgramQueue[processId].Insert(newIndex, item);
// Fix new ids
for (int i = 0; i < PartProgramQueue[processId].Count(); i++)
PartProgramQueue[processId][i].Id = i + 1;
using (QueueController queueController = new QueueController())
queueController.UpdateQueueIdsAndSave(processId);
@@ -451,12 +515,14 @@ namespace Step.NC
if (tmpQueueItem != null)
PartProgramQueue[processId].Remove(tmpQueueItem);
if (File.Exists(tmpQueueItem.AbsolutePath))
File.Delete(tmpQueueItem.AbsolutePath);
}
// Update database data
using (QueueController queueController = new QueueController())
queueController.UpdateQueueIdsAndSave(processId);
return NO_ERROR;
}
@@ -466,11 +532,16 @@ namespace Step.NC
// Check if there is a queue
if (PartProgramQueue.ContainsKey(processId))
PartProgramQueue[processId] = new List<DTOQueueModel>();
// Update db
using (QueueController queueController = new QueueController())
queueController.UpdateQueue();
// Clean directory
SupportFunctions.EmptyFolder(JOB_TMP_DIRECTORY);
QueueRunningIndexes[processId] = 0;
return NO_ERROR;
}
@@ -1292,7 +1363,7 @@ namespace Step.NC
config.ToolsConfiguration = config.ToolsConfiguration.Concat(config.FamiliesConfiguration.FamilyReadOnlyConfiguration).ToList();
}
if(!ToolManagerConfig.OffsetOpt)
if (!ToolManagerConfig.OffsetOpt)
config.OffsetOptionActive = false;
if (!ToolManagerConfig.OffsetOpt)
@@ -1443,7 +1514,7 @@ namespace Step.NC
public CmsError SetActiveScreen(short screen)
{
// Set to true power on data by id
return numericalControl.NC_SetScreenVisible((Nc.SCREEN_PAGE) screen);
return numericalControl.NC_SetScreenVisible((Nc.SCREEN_PAGE)screen);
}
#endregion Write data
@@ -1628,7 +1699,6 @@ namespace Step.NC
{
DbNcToolModel ncTool = toolsManager.AddTool(tool, toolId);
if (!ToolManagerConfig.OffsetOpt)
{
CmsError cmsError = UpdateToolOffsetId(ncTool.ToolId, 1, ncTool.ToolId, out DTONcToolModel toolWithOffset);
@@ -1640,7 +1710,6 @@ namespace Step.NC
GetToolData(ncTool, ref dtoTool);
return NO_ERROR;
}
}
+2 -1
View File
@@ -115,7 +115,7 @@
<hmi_cmd_fanuc_5>Msg</hmi_cmd_fanuc_5>
<!-- Tool Manager - Op. Selection -->
<tooling_title_label>Tool Manager</tooling_title_label>
<tooling_title_label>Gestore Utensili</tooling_title_label>
<store_title_magazine>Magazzino</store_title_magazine>
<store_title_spindle>Mandrino</store_title_spindle>
<launch_tools>Utensili</launch_tools>
@@ -496,6 +496,7 @@
<create_maintenance_btn_edit_confirm>Modifica Manutenzione</create_maintenance_btn_edit_confirm>
<!-- Production Manager -->
<production_header_title>Gestore della produzione</production_header_title>
<production_box_video_button_cms>CMS</production_box_video_button_cms>
<production_box_video_button_cnc>CNC</production_box_video_button_cnc>
<production_softkeys_prefered_header_title>Softkey Preferite</production_softkeys_prefered_header_title>
+1
View File
@@ -495,6 +495,7 @@
<create_maintenance_btn_edit_confirm>Edit Maintenance</create_maintenance_btn_edit_confirm>
<!-- Production Manager -->
<production_header_title>Production manager</production_header_title>
<production_box_video_button_cms>CMS</production_box_video_button_cms>
<production_box_video_button_cnc>CNC</production_box_video_button_cnc>
<production_softkeys_prefered_header_title>Favorite Softkey</production_softkeys_prefered_header_title>
+100 -12
View File
@@ -129,37 +129,41 @@ namespace Step.Utils
return 1;
}
public static DTOJobModel UnpackJobAndReadMetadata(string path)
public static DTOJobModel UnpackJobAndReadMetadata(string filePath, int processId)
{
DTOJobModel job = new DTOJobModel();
string jobFolderPath = JOB_TMP_DIRECTORY + "\\" + processId + "\\";
if (!Directory.Exists(jobFolderPath))
Directory.CreateDirectory(jobFolderPath);
// Check if job exists
if (!File.Exists(path))
if (!File.Exists(filePath))
return null;
EmptyFolder(path);
string fileName = Path.GetFileName(path);
using (ZipArchive zipExtractor = ZipFile.OpenRead(fileName))
EmptyFolder(jobFolderPath);
using (ZipArchive zipExtractor = ZipFile.OpenRead(filePath))
{
// Setup main job fields
job.Name = Path.GetFileName(fileName);
job.LastEditTimestamp = new FileInfo(fileName).LastAccessTime;
job.Name = Path.GetFileName(filePath);
job.LastEditTimestamp = new FileInfo(filePath).LastAccessTime;
foreach (ZipArchiveEntry entry in zipExtractor.Entries)
{
// Extract file
entry.ExtractToFile(jobFolderPath + entry.Name, true);
// Get main program content
if (entry.Name.Equals(JOB_MAIN_FILENAME, StringComparison.OrdinalIgnoreCase))
{
using (var reader = new StreamReader(entry.Open()))
job.IsoMainProgram = (reader.ReadToEnd());
}
// Read images
else if (VALID_IMAGE_EXTENSIONS.Contains(Path.GetExtension(entry.Name).ToLower()))
{
var bytes = default(byte[]);
entry.ExtractToFile(JOB_OPENING_PATH + entry.Name, true);
// Populate metadata
using (var memstream = new MemoryStream())
{
entry.Open().CopyTo(memstream);
@@ -194,7 +198,9 @@ namespace Step.Utils
}
// Consider other file as part program
else
entry.ExtractToFile(JOB_OPENING_PATH + entry.Name, true);
{
job.PartPrograms.Add(jobFolderPath + entry.Name);
}
}
return job;
@@ -209,5 +215,87 @@ namespace Step.Utils
foreach (DirectoryInfo dir in di.GetDirectories())
dir.Delete(true);
}
public static bool IsValidJob(string filePath)
{
if (!File.Exists(filePath))
return false;
try
{
using (var archive = ZipFile.OpenRead(filePath))
{
// Find key files
List<ZipArchiveEntry> files = archive
.Entries
.Where(x => x.FullName == JOB_MAIN_FILENAME || x.FullName == JOB_METADATA_FILENAME)
.ToList();
// if there aren't both
if (files.Count() < 2)
return false;
else
return true;
}
}
catch (Exception)
{
return false;
}
}
public static DTOJobModel ReadExtractedJobMetadata(int processId)
{
string filePath = JOB_TMP_DIRECTORY + "\\" + processId + "\\";
if (!Directory.Exists(filePath))
return null;
// Setup main Fields
DTOJobModel jobData = new DTOJobModel()
{
Name = Path.GetFileName(filePath),
LastEditTimestamp = new FileInfo(filePath).LastAccessTime
};
DirectoryInfo di = new DirectoryInfo(filePath);
foreach (FileInfo file in di.GetFiles())
{
// Get main program content
if (file.Name.Equals(JOB_MAIN_FILENAME, StringComparison.OrdinalIgnoreCase))
{
jobData.IsoMainProgram = (File.ReadAllText(file.FullName));
}
// Get images content without extract files
else if (VALID_IMAGE_EXTENSIONS.Contains(Path.GetExtension(file.Name).ToLower()))
{
byte[] bytes = File.ReadAllBytes(file.FullName);
jobData.Metadata.Generics.Images.Add(new DTOImageParamModel()
{
Name = file.Name,
Base64 = "data:image/" + Path.GetExtension(file.Name).ToLower().TrimStart('.') + ";base64," + Convert.ToBase64String(bytes)
});
}
// Metadata
else if (file.Name.Equals(JOB_METADATA_FILENAME, StringComparison.OrdinalIgnoreCase))
{
DTOMetadataFieldsModel metasFromFile = new DTOMetadataFieldsModel();
metasFromFile = JsonConvert
.DeserializeObject<DTOMetadataFieldsModel>
(File.ReadAllText(file.FullName));
if (metasFromFile == null)
return null;
else
{
jobData.Metadata.Generics.Description = metasFromFile.Description;
jobData.Metadata.Generics.ExecutionTime = metasFromFile.ExecutionTime;
jobData.Metadata.Tools = metasFromFile.Tools;
jobData.Metadata.Customs = metasFromFile.Customs;
}
}
}
return jobData;
}
}
}
+4 -4
View File
@@ -144,8 +144,8 @@ namespace Step.App_Start
if (!Directory.Exists(MAINTENANCE_ATTACHMENT_PATH))
Directory.CreateDirectory(MAINTENANCE_ATTACHMENT_PATH);
if (!Directory.Exists(TEMP_FILE))
Directory.CreateDirectory(TEMP_FILE);
if (!Directory.Exists(TEMP_PP_FOLDER))
Directory.CreateDirectory(TEMP_PP_FOLDER);
if (!Directory.Exists(PART_PRG_IMAGES))
Directory.CreateDirectory(PART_PRG_IMAGES);
@@ -153,8 +153,8 @@ namespace Step.App_Start
if (!Directory.Exists(JOB_TMP_DIRECTORY))
Directory.CreateDirectory(JOB_TMP_DIRECTORY);
if (!Directory.Exists(QUEUE_TMP_FILE))
Directory.CreateDirectory(QUEUE_TMP_FILE);
if (!Directory.Exists(QUEUE_TMP_FOLDER))
Directory.CreateDirectory(QUEUE_TMP_FOLDER);
}
}
}
+2 -2
View File
@@ -1,10 +1,10 @@
using Microsoft.AspNet.SignalR;
using CMS_CORE_Library.Models;
using Microsoft.AspNet.SignalR;
using Step.Attributes;
using Step.NC;
using System.Collections.Generic;
using System.Threading.Tasks;
using TeamDev.SDK.MVVM;
using static CMS_CORE_Library.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
using static Step.Model.Constants.FUNCTIONALITY_NAMES;
@@ -1,12 +1,11 @@
using Step.Database.Controllers;
using CMS_CORE_Library.Models;
using Step.Database.Controllers;
using Step.Model.DTOModels;
using Step.NC;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
namespace Step.Controllers.WebApi
{
@@ -1,9 +1,10 @@
using Step.Model.DTOModels;
using CMS_CORE_Library.Models;
using Step.Model.DTOModels;
using Step.NC;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static CMS_CORE_Library.Models.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
using static Step.Utils.LanguageController;
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using CMS_CORE_Library.Models;
using Newtonsoft.Json;
using Step.Database.Controllers;
using Step.Model.DatabaseModels;
using Step.Model.DTOModels.MaintenanceModels;
@@ -16,7 +17,6 @@ using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
+2 -2
View File
@@ -1,8 +1,8 @@
using Step.Model.DTOModels;
using CMS_CORE_Library.Models;
using Step.Model.DTOModels;
using Step.NC;
using System.Globalization;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static Step.Model.Constants;
namespace Step.Controllers.WebApi
+21 -5
View File
@@ -10,10 +10,11 @@ using static Step.Model.Constants;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using System.Linq;
using static Step.Config.ServerConfig;
using System.ComponentModel.DataAnnotations;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.DataStructures;
namespace Step.Controllers.WebApi
{
@@ -50,6 +51,21 @@ namespace Step.Controllers.WebApi
}
}
[Route("file/active/info"), HttpGet]
public IHttpActionResult GetActiveFileInfo([FromUri]string filePath)
{
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError cmsError = ncHandler.GetActiveFileInfo(filePath, out InfoFile fileInfo);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
return Ok(fileInfo);
}
}
[Route("file/active"), HttpPut]
public IHttpActionResult SetActiveProgram([FromUri]string filePath)
{
@@ -100,9 +116,9 @@ namespace Step.Controllers.WebApi
{
ncHandler.Connect();
File.WriteAllBytes(TEMP_FILE + item.FileName, item.Data);
File.WriteAllBytes(TEMP_PP_FOLDER + item.FileName, item.Data);
CmsError cmsError = ncHandler.UploadPartProgramAndActivate(TEMP_FILE, item.FileName, out ActiveProgramDataModel programData);
CmsError cmsError = ncHandler.UploadPartProgramAndActivate(TEMP_PP_FOLDER, item.FileName, out ActiveProgramDataModel programData);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
}
@@ -181,7 +197,7 @@ namespace Step.Controllers.WebApi
{
ncHandler.Connect();
File.WriteAllBytes(QUEUE_TMP_FILE + item.FileName, item.Data);
File.WriteAllBytes(QUEUE_TMP_FOLDER + item.FileName, item.Data);
// Get reps
var repsParam = formItems.Where(x => x.ParameterName == "reps").FirstOrDefault();
@@ -189,7 +205,7 @@ namespace Step.Controllers.WebApi
if (repsParam == null || !Int32.TryParse(repsParam.Value, out int reps))
return BadRequest();
CmsError cmsError = ncHandler.UploadPartProgramAndAddToQueue(QUEUE_TMP_FILE, item.FileName, reps, out queueItem);
CmsError cmsError = ncHandler.UploadPartProgramAndAddToQueue(QUEUE_TMP_FOLDER, item.FileName, reps, out queueItem);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
}
@@ -1,4 +1,5 @@
using Step.Database.Controllers;
using CMS_CORE_Library.Models;
using Step.Database.Controllers;
using Step.Model.DatabaseModels;
using Step.Model.DTOModels.ToolModels;
using Step.NC;
@@ -7,7 +8,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static Step.Config.ServerConfig;
using static Step.Model.Constants;
@@ -551,6 +551,8 @@ namespace Step.Controllers.WebApi
if (shankId.ShankId == 0)
return BadRequest(API_ERROR_KEYS.INCORRECT_PARAMETERS);
DTONcShankModel dtoShank = new DTONcShankModel();
// Check data
DbNcShankModel shank;
using (NcToolManagerController toolsManager = new NcToolManagerController())
@@ -586,6 +588,9 @@ namespace Step.Controllers.WebApi
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
dtoShank = toolsManager.GetShank(shank.ShankId);
}
// Update shank data
@@ -593,7 +598,10 @@ namespace Step.Controllers.WebApi
// Set shankId
magazinePos.ShankId = shank.ShankId;
return Ok(magazinePos);
dtoShank.MagazineId = magazineId;
dtoShank.PositionId = positionId;
return Ok(dtoShank);
}
}
@@ -1,4 +1,5 @@
using Step.Model.DatabaseModels;
using CMS_CORE_Library.Models;
using Step.Model.DatabaseModels;
using Step.Model.DTOModels.ToolModels;
using Step.NC;
using System;
@@ -6,7 +7,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
namespace Step.Controllers.WebApi
{
+5 -2
View File
@@ -17,9 +17,12 @@ button {
button[disabled] {
cursor: not-allowed !important;
*{
cursor: not-allowed !important;
}
}
button.btn[disabled] {
button.btn[disabled]{
border-radius: 2px;
border-radius: 2px;
background-color: #dddddd;
@@ -50,7 +53,7 @@ button.btn {
border: none;
background-image: linear-gradient(to bottom, @color-white2, @color-silver);
color: @color-darkish-blue;
&:active {
&:active:not([disabled]){
background-image: linear-gradient(to bottom, @color-silver, @color-white2);
border: none !important;
box-shadow: inset @button-shadow !important;
+93 -30
View File
@@ -7,6 +7,7 @@
display: flex;
justify-content: center;
padding-top: 104px;
.job-editor-box{
width: 1808px;
height: 872px;
@@ -41,10 +42,28 @@
// border-radius: 2px;
// font-size: 20px;
// }
.job-name-box{
font-size: 18px;
line-height: 1.11;
color: #4b4b4b;
padding: 0 5px;
box-sizing: border-box;
width: 300px;
}
.btn{
width: 70px;
}
.fa{
font-size: 24px;
cursor: pointer;
}
span{
display: flex;
align-items: center;
width: 288px;
// width: 288px;
text-align: center;
color: @color-darkish-blue;
height: 48px;
@@ -200,38 +219,43 @@
line-height: 1.43;
color: @color-greyish-brown;
}
.filename{
display: flex;
height: 64px;
align-items: center;
cursor: pointer;
i{
margin: 0 20px 0 15px;
}
span{
width: 100%;
font-size: 14px;
line-height: 1.43;
color: @color-greyish-brown;
}
.right{
width: 100%;
.box-image{
max-height: 192px;
overflow: auto;
.filename{
display: flex;
justify-content: flex-end;
button.btn-hidden{
visibility: hidden;
i{
font-size: 26px;
visibility: visible;
margin: 0 12px;
cursor: pointer;
height: 64px;
align-items: center;
cursor: pointer;
i{
margin: 0 20px 0 15px;
}
span{
width: 100%;
font-size: 14px;
line-height: 1.43;
color: @color-greyish-brown;
}
.right{
width: 100%;
display: flex;
justify-content: flex-end;
button.btn-hidden{
visibility: hidden;
i{
font-size: 26px;
visibility: visible;
margin: 0 12px;
cursor: pointer;
}
}
}
}
}
.filename.selected{
background-color: rgba(255, 255, 255, 0.8);
}
.filename.selected{
background-color: rgba(255, 255, 255, 0.8);
}
}
.all-message-box{
max-height: 310px;
.message-box{
@@ -486,9 +510,40 @@
background-color: @color-clear-blue-30;
}
}
.job-editor-button{
display: flex;
width: 100%;
justify-content: flex-end;
margin-top: 16px;
margin-bottom: 16px;
}
.job-editor-tools.scrollable{
height: 519px;
height: 439px;
margin-top: 14px;
.tool{
cursor: pointer;
img{
background-color: #DDD;
}
}
.tool.selected{
background-color: rgba(23, 145, 255, 0.75);
color: white !important;
img{
background-color: #FFF;
}
}
.notfound{
color: @color-scarlet;
.selected img{
background-color: @color-scarlet !important;
}
}
.notfound.selected{
img{
background-color: @color-scarlet !important;
}
}
}
.job-editor-tools-footer{
display: flex;
@@ -517,6 +572,7 @@
height: 80px;
box-shadow: 0 1px 2px 0 @color-black-40;
margin: 8px 2px;
cursor: pointer;
.title{
display: flex;
align-items: center;
@@ -542,6 +598,13 @@
.togglebutton label input[type=checkbox]{
display: flex;
}
.input-box.selected{
background-color: rgba(23, 145, 255, 0.75);
color: white;
.title{
color: white;
}
}
}
.job-editor-parameters-footer{
display: flex;
+96 -30
View File
@@ -798,6 +798,50 @@
}
}
.@{modal}.modal-image {
width: @modal-iframe-width;
height: @modal-iframe-height;
border-radius: 2px;
background-color: @color-background-white;
top: calc(~"50%" - @modal-iframe-height / 2);
left: calc(~"50%" - @modal-iframe-width / 2);
header {
font-size: 20px;
color: @color-cyan-blue;
padding-left: 23px;
button.close {
position: absolute;
width: 28px;
height: 28px;
border-radius: 50%;
border: none;
background-color: @color-darkish-blue;
color: #fff;
top: calc(50% - 20px);
right: 14px;
font-size: 16px;
cursor: pointer;
}
button.close:active {
background-color: @color-clear-blue;
color: #fff;
}
}
.body{
height: calc(~"100%" - 64px);
overflow: hidden;
align-items: center;
justify-content: center;
display: flex;
background-color: #cccccc;
}
#imagecontainer{
position: relative;
max-width: 100%;
max-height: 100%;
}
}
.@{modal}.modal-load-program, .@{modal}.modal-add-element-queue {
width: @modal-load-program-width;
height: @modal-load-program-height;
@@ -1235,51 +1279,67 @@
}
.items-list {
width: 475px;
min-height: 191px;
max-height: 248px;
display: flex;
flex-flow: column;
.group-item {
.title{
height: 20px;
font-size: 18px;
line-height: 1.11;
margin: 0 10px;
color: @color-greyish-brown;
}
.items{
width: 100%;
min-height: 128px;
max-height: 185px;
min-height: 185px;
display: flex;
flex-flow: column;
.item {
overflow: auto;
.group-item {
width: 100%;
height: 48px;
min-height: 60px;
display: flex;
flex-flow: row;
align-items: center;
.number {
font-size: 18px;
line-height: 1.11;
color: @color-greyish-brown;
margin-right: 16px;
}
.input-text-box {
margin-right: 8px;
input {
width: 304px;
height: 48px;
border-radius: 2px;
box-shadow: inset 0 1px 3px 0 @color-black-50;
border: solid 1px @color-silver;
flex-flow: column;
.item {
width: 100%;
height: 48px;
display: flex;
flex-flow: row;
align-items: center;
.number {
font-size: 18px;
line-height: 1.11;
color: @color-greyish-brown;
margin-right: 16px;
}
}
.group-button {
button.btn {
padding: 0 12px;
.fa {
font-size: 24px;
.input-text-box {
margin-right: 8px;
input {
width: 304px;
height: 48px;
border-radius: 2px;
box-shadow: inset 0 1px 3px 0 @color-black-50;
border: solid 1px @color-silver;
}
}
.group-button {
button.btn {
padding: 0 12px;
.fa {
font-size: 24px;
}
}
}
}
}
.item:first-child {
margin-top: 12px;
.item:first-child {
margin-top: 12px;
}
}
}
.add-item {
width: 100%;
margin-top: 10px;
display: flex;
}
}
@@ -1746,6 +1806,12 @@
}
.box-missing-tools{
margin-top: 26px;
.missing-tool{
cursor: pointer;
}
.missing-tool.selected{
background-color: @color-clear-blue;
}
}
}
}
@@ -52,6 +52,14 @@
flex-flow: row;
justify-content: center;
align-items: center;
position: relative;
.title-header-label{
position: absolute;
left: 0;
top: 22px;
font-size: 20px;
color: #002680;
}
button.btn{
margin: 0;
}
+151 -20
View File
@@ -733,6 +733,49 @@
width: 100%;
border: none;
}
.modal.modal-image {
width: 1800px;
height: 800px;
border-radius: 2px;
background-color: #fff;
top: calc(50% - 400px);
left: calc(50% - 900px);
}
.modal.modal-image header {
font-size: 20px;
color: #002e6e;
padding-left: 23px;
}
.modal.modal-image header button.close {
position: absolute;
width: 28px;
height: 28px;
border-radius: 50%;
border: none;
background-color: #002680;
color: #fff;
top: calc(30%);
right: 14px;
font-size: 16px;
cursor: pointer;
}
.modal.modal-image header button.close:active {
background-color: #1791ff;
color: #fff;
}
.modal.modal-image .body {
height: calc(100% - 64px);
overflow: hidden;
align-items: center;
justify-content: center;
display: flex;
background-color: #cccccc;
}
.modal.modal-image #imagecontainer {
position: relative;
max-width: 100%;
max-height: 100%;
}
.modal.modal-load-program,
.modal.modal-add-element-queue {
width: 1808px;
@@ -1307,50 +1350,66 @@
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list {
width: 475px;
min-height: 191px;
max-height: 248px;
display: flex;
flex-flow: column;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .title {
height: 20px;
font-size: 18px;
line-height: 1.11;
margin: 0 10px;
color: #4b4b4b;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items {
width: 100%;
min-height: 128px;
max-height: 185px;
min-height: 185px;
display: flex;
flex-flow: column;
overflow: auto;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item {
width: 100%;
min-height: 60px;
display: flex;
flex-flow: column;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item {
width: 100%;
height: 48px;
display: flex;
flex-flow: row;
align-items: center;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item .number {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item .number {
font-size: 18px;
line-height: 1.11;
color: #4b4b4b;
margin-right: 16px;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item .input-text-box {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item .input-text-box {
margin-right: 8px;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item .input-text-box input {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item .input-text-box input {
width: 304px;
height: 48px;
border-radius: 2px;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
border: solid 1px #bbbcbc;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item .group-button button.btn {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item .group-button button.btn {
padding: 0 12px;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item .group-button button.btn .fa {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item .group-button button.btn .fa {
font-size: 24px;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .group-item .item:first-child {
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .items .group-item .item:first-child {
margin-top: 12px;
}
.modal.modal-job-add-parameter .job-add-parameter-body .items-list .add-item {
width: 100%;
margin-top: 10px;
display: flex;
}
.modal.modal-job-add-parameter .job-add-parameter-footer {
@@ -1779,6 +1838,12 @@
.modal.modal-missing-tools .modal-missing-tools-body.scrollable .modal-missing-tools-box .box-missing-tools {
margin-top: 26px;
}
.modal.modal-missing-tools .modal-missing-tools-body.scrollable .modal-missing-tools-box .box-missing-tools .missing-tool {
cursor: pointer;
}
.modal.modal-missing-tools .modal-missing-tools-body.scrollable .modal-missing-tools-box .box-missing-tools .missing-tool.selected {
background-color: #1791ff;
}
.modal.modal-missing-tools .modal-missing-tools-footer {
height: 79px;
width: 100%;
@@ -2012,6 +2077,9 @@ button {
button[disabled] {
cursor: not-allowed !important;
}
button[disabled] * {
cursor: not-allowed !important;
}
button.btn[disabled] {
border-radius: 2px;
background-color: #dddddd;
@@ -2041,7 +2109,7 @@ button.btn {
background-image: linear-gradient(to bottom, #f1f1f1, #bbbcbc);
color: #002680;
}
button.btn:active {
button.btn:active:not([disabled]) {
background-image: linear-gradient(to bottom, #bbbcbc, #f1f1f1);
border: none !important;
box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.4) !important;
@@ -12266,6 +12334,14 @@ footer .container button.big:before {
flex-flow: row;
justify-content: center;
align-items: center;
position: relative;
}
.production-container .production-box .production-left-box .box-left .box-left-video .box-header .title-header-label {
position: absolute;
left: 0;
top: 22px;
font-size: 20px;
color: #002680;
}
.production-container .production-box .production-left-box .box-left .box-left-video .box-header button.btn {
margin: 0;
@@ -12834,10 +12910,24 @@ footer .container button.big:before {
flex-flow: row;
margin-left: 24px;
}
.job-editor-container .job-editor-box .job-editor-header .search-job .job-name-box {
font-size: 18px;
line-height: 1.11;
color: #4b4b4b;
padding: 0 5px;
box-sizing: border-box;
width: 300px;
}
.job-editor-container .job-editor-box .job-editor-header .search-job .btn {
width: 70px;
}
.job-editor-container .job-editor-box .job-editor-header .search-job .fa {
font-size: 24px;
cursor: pointer;
}
.job-editor-container .job-editor-box .job-editor-header .search-job span {
display: flex;
align-items: center;
width: 288px;
text-align: center;
color: #002680;
height: 48px;
@@ -12997,36 +13087,40 @@ footer .container button.big:before {
line-height: 1.43;
color: #4b4b4b;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image {
max-height: 192px;
overflow: auto;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename {
display: flex;
height: 64px;
align-items: center;
cursor: pointer;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename i {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename i {
margin: 0 20px 0 15px;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename span {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename span {
width: 100%;
font-size: 14px;
line-height: 1.43;
color: #4b4b4b;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename .right {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename .right {
width: 100%;
display: flex;
justify-content: flex-end;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename .right button.btn-hidden {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename .right button.btn-hidden {
visibility: hidden;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename .right button.btn-hidden i {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename .right button.btn-hidden i {
font-size: 26px;
visibility: visible;
margin: 0 12px;
cursor: pointer;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .filename.selected {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .box-image .filename.selected {
background-color: rgba(255, 255, 255, 0.8);
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .all-message-box {
@@ -13279,10 +13373,39 @@ footer .container button.big:before {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .historical tr:nth-child(odd) {
background-color: rgba(23, 145, 255, 0.3);
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-button {
display: flex;
width: 100%;
justify-content: flex-end;
margin-top: 16px;
margin-bottom: 16px;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable {
height: 519px;
height: 439px;
margin-top: 14px;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .tool {
cursor: pointer;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .tool img {
background-color: #DDD;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .tool.selected {
background-color: rgba(23, 145, 255, 0.75);
color: white !important;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .tool.selected img {
background-color: #FFF;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .notfound {
color: #d0021b;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .notfound .selected img {
background-color: #d0021b !important;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools.scrollable .notfound.selected img {
background-color: #d0021b !important;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-tools-footer {
display: flex;
height: 62px;
@@ -13311,6 +13434,7 @@ footer .container button.big:before {
height: 80px;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
margin: 8px 2px;
cursor: pointer;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-parameters.scrollable .input-box .title {
display: flex;
@@ -13334,6 +13458,13 @@ footer .container button.big:before {
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-parameters.scrollable .togglebutton label input[type=checkbox] {
display: flex;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-parameters.scrollable .input-box.selected {
background-color: rgba(23, 145, 255, 0.75);
color: white;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-parameters.scrollable .input-box.selected .title {
color: white;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box .job-editor-body-box-right .box-right-body .box-right-body-container .job-editor-parameters-footer {
display: flex;
height: 62px;
+67 -69
View File
@@ -3,89 +3,87 @@ import Vue from "vue";
// credit: http://www.javascriptkit.com/javatutors/touchevents2.shtml
function swipedetect(el, callback, onmovecallback, onstart, onstop) {
var touchsurface = el,
swipedir,
startX,
startY,
lastXswipe,
lastYswipe,
distX,
distY,
threshold = 10, //required min distance traveled to be considered swipe
restraint = 1000, // maximum distance allowed at the same time in perpendicular direction
allowedTime = 300, // maximum time allowed to travel that distance
elapsedTime,
handleswipe = callback || function(swipedir) {}
var touchsurface = el,
swipedir,
startX,
startY,
lastXswipe,
lastYswipe,
distX,
distY,
threshold = 10, //required min distance traveled to be considered swipe
restraint = 1000, // maximum distance allowed at the same time in perpendicular direction
allowedTime = 300, // maximum time allowed to travel that distance
elapsedTime,
handleswipe = callback || function (swipedir) { }
touchsurface.addEventListener('touchstart', function(e) {
var touchobj = e.changedTouches[0]
swipedir = 'none'
distX = 0
distY = 0
startX = touchobj.pageX
startY = touchobj.pageY
lastXswipe = touchobj.pageX
lastYswipe = touchobj.pageY
e.preventDefault()
touchsurface.addEventListener('touchstart', function (e) {
var touchobj = e.changedTouches[0]
swipedir = 'none'
distX = 0
distY = 0
startX = touchobj.pageX
startY = touchobj.pageY
lastXswipe = touchobj.pageX
lastYswipe = touchobj.pageY
e.preventDefault()
if (onstart) onstart(e);
if (onstart) onstart(e);
}, false)
}, false)
touchsurface.addEventListener('touchmove', function(e) {
e.preventDefault() // prevent scrolling when inside DIV
touchsurface.addEventListener('touchmove', function (e) {
e.preventDefault() // prevent scrolling when inside DIV
var touchobj = e.changedTouches[0];
distX = touchobj.pageX - lastXswipe;
distY = touchobj.pageY - lastYswipe;
var touchobj = e.changedTouches[0];
distX = touchobj.pageX - lastXswipe;
distY = touchobj.pageY - lastYswipe;
if (Math.abs(distY) >= threshold && Math.abs(distX) < restraint && swipedir != 'left' && swipedir != 'right') {
swipedir = (distY < 0) ? 'up' : 'down'
}
if (Math.abs(distX) >= threshold && Math.abs(distY) < restraint && swipedir != 'up' && swipedir != 'down') {
swipedir = (distX < 0) ? 'left' : 'right'
}
if (Math.abs(distY) >= threshold && Math.abs(distX) < restraint && swipedir != 'left' && swipedir != 'right') {
swipedir = (distY < 0) ? 'up' : 'down'
}
if (Math.abs(distX) >= threshold && Math.abs(distY) < restraint && swipedir != 'up' && swipedir != 'down') {
swipedir = (distX < 0) ? 'left' : 'right'
}
lastXswipe = touchobj.pageX
lastYswipe = touchobj.pageY
lastXswipe = touchobj.pageX
lastYswipe = touchobj.pageY
if (onmovecallback)
onmovecallback(e)
if (onmovecallback)
onmovecallback(e)
}, false)
}, false)
touchsurface.addEventListener('touchend', function(e) {
var touchobj = e.changedTouches[0];
if (onstop) onstop(e);
touchsurface.addEventListener('touchend', function (e) {
var touchobj = e.changedTouches[0];
if (onstop) onstop(e);
handleswipe(swipedir)
e.preventDefault()
}, false)
handleswipe(swipedir)
e.preventDefault()
}, false)
}
Vue.component('vue-gesture', {
template: '<span><slot></slot></span>',
props: {
template: '<span><slot></slot></span>',
props: {
call: { type: Function },
onmove: { type: Function },
onstart: { type: Function },
onstop: { type: Function }
},
mounted: function() {
var self = this;
call: { type: Function },
onmove: { type: Function },
onstart: { type: Function },
onstop: { type: Function }
},
mounted: function () {
var self = this;
if (typeof this.call !== 'function') {
console.log(this.call);
return console.error('The expression of directive "v-gesture call" must be a function!');
}
if (this.onmove && typeof this.onmove !== 'function') {
console.log(this.call);
return console.error('The expression of directive "v-gesture onmove" must be a function!');
}
if (this.$el)
swipedetect(this.$el, this.call, this.onmove, this.onstart, this.onstop);
if (typeof this.call !== 'function') {
return console.error('The expression of directive "v-gesture call" must be a function!');
}
});
if (this.onmove && typeof this.onmove !== 'function') {
return console.error('The expression of directive "v-gesture onmove" must be a function!');
}
if (this.$el)
swipedetect(this.$el, this.call, this.onmove, this.onstart, this.onstop);
}
});
+3
View File
@@ -43,7 +43,10 @@ export const SummaryDepot = () =>
export const ModalIframe = () =>
import ("./modules/base-components/modal-iframe.vue");
export const ModalImage = () =>
import ("./modules/base-components/modal-image.vue");
export const ToolingEquipment = () =>
import ("./components/tooling/tooling-equipment.vue");
export const InfoEquipment = () =>
+20 -20
View File
@@ -10,31 +10,31 @@
<div class="alarm-history-body-left">
<div class="alarm-history-left-filter">
<div class="filter-text">
<label>Filtro</label>
<label>{{'alarm_history_body_filter' | localize("Filtro")}}</label>
<input type="text">
</div>
<div class="filter-state">
<label>Stato</label>
<label>{{'alarm_history_body_state' | localize("Stato")}}</label>
<select>
<option>Tutti</option>
<option>{{'alarm_history_body_select_state_option' | localize("Tutti")}}</option>
</select>
</div>
<div class="filter-type">
<label>Tipo</label>
<label>{{'alarm_history_body_filter_type' | localize("Tipo")}}</label>
<select>
<option>Tutti</option>
<option>{{'alarm_history_body_select_type_option' | localize("Tutti")}}</option>
</select>
</div>
<div class="filter-date-range">
<label>Intervallo date</label>
<label>{{'alarm_history_body_date_range' | localize("Intervallo date")}}</label>
<select>
<option>Ultimo mese</option>
<option>{{'alarm_history_body_select_option_date_range_last_month' | localize("Ultimo mese")}}</option>
</select>
</div>
<div class="filter-user">
<label>Utente</label>
<label>{{'alarm_history_body_user' | localize("Utente")}}</label>
<select>
<option>Utente01</option>
<option>{{'alarm_history_body_select_option_user_user01' | localize("Utente01")}}</option>
</select>
</div>
<div class="group-button">
@@ -77,7 +77,7 @@
<div class="box-right-info">
<div class="box-right-info-header">
<div class="title">
<span>#### La macchina non è tarata</span>
<span>#### {{'alarm_history_box_right_info_description_machine_not_calibrated' | localize("La macchina non è tarata")}}La macchina non è tarata</span>
</div>
<div class="subtitle">
<label>3 AUX</label>
@@ -88,12 +88,12 @@
</div>
<div class="box-right-info-body">
<span>
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
{{'alarm_history_box_right_info_first_description' | localize("Lorem ipsum dolor sit amet, consectetur")}}
{{'alarm_history_box_right_info_second_description' | localize("adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.")}}
</span>
</div>
<div class="box-right-info-footer">
<span><label>Stato:</label> attivo</span>
<span><label>{{'alarm_history_box_right_info_footer_state' | localize("Stato:")}}</label> attivo</span>
</div>
</div>
<div class="box-right-action">
@@ -110,9 +110,9 @@
</div>
</div>
<div class="group-button">
<button class="btn">Vedi manuale</button>
<button class="btn">Chiedi aiuto</button>
<button class="btn btn-success">Refresh</button>
<button class="btn">{{'alarm_history_manual_btn_view_manual' | localize("Vedi manuale")}}</button>
<button class="btn">{{'alarm_history_manual_btn_ask_help' | localize("Chiedi aiuto")}}</button>
<button class="btn btn-success">{{'alarm_history_manual_btn_refresh' | localize("Refresh")}}</button>
</div>
<div class="attach">
<accordion :title="'Allegati'" :counter="5">
@@ -128,11 +128,11 @@
</div>
<div class="allattach">
<button class="btn-hidden">
<span>Mostra tutti gli allegati</span>
<span>{{'alarm_history_allattach_btn' | localize("Mostra tutti gli allegati")}}</span>
</button>
</div>
<div class="item text-success">
<strong> Aggiungi un allegato</strong> <button class="btn text-22"><i class="fa fa-plus"></i></button>
<strong>{{'alarm_history_allattach_strong_label_add_attach' | localize("Aggiungi un allegato")}}</strong> <button class="btn text-22"><i class="fa fa-plus"></i></button>
</div>
</accordion>
</div>
@@ -150,11 +150,11 @@
</div>
<div class="allnote">
<button class="btn-hidden">
<span>Mostra tutte le note</span>
<span>{{'alarm_history_allnote_btn' | localize("Mostra tutte le note")}}</span>
</button>
</div>
<div class="item text-success">
<strong> Aggiungi una nota</strong> <button class="btn text-22"><i class="fa fa-plus"></i></button>
<strong> {{'alarm_history_allnote_strong_label_add_note' | localize("Aggiungi una nota")}}</strong> <button class="btn text-22"><i class="fa fa-plus"></i></button>
</div>
</accordion>
</div>
+13 -13
View File
@@ -4,15 +4,15 @@
<div class="create-queue-add-queue-header">
<div class="title">
<i class="fa fa-chevron-left"></i>
Selezione programma da aggiungere in coda
{{'create_queue_title' | localize("Selezione programma da aggiungere in coda")}}
</div>
<div class="box-search">
<div class="path">
<div class="root">PC</div>
<div class="root">{{'create_queue_path_pc' | localize("PC")}}</div>
<div v-if="true"><i class="fa fa-chevron-right"></i></div>
<div class="child">Cliente A</div>
<div class="child">{{'create_queue_path_client' | localize("Cliente A")}}</div>
<div v-if="true"><i class="fa fa-chevron-right"></i></div>
<div class="child">Part Program 01</div>
<div class="child">{{'create_queue_path_part_program' | localize("Part Program 01")}}</div>
</div>
<div class="search">
<input type="text" />
@@ -37,7 +37,7 @@
</div>
<div class="selected-item" v-if="enableSelectedItem">
<div class="selected-item-header">
<label class="selected-item-title">Job 1</label>
<label class="selected-item-title">{{'create_queue_select_item_job' | localize("Job 1")}}</label>
<div class="group-button">
<button class="btn"><i class="fa fa-clone"></i></button>
<button class="btn"><i class="fa fa-pencil-square-o"></i></button>
@@ -48,20 +48,20 @@
<img src="">
</div>
<div class="selected-item-body-description">
<label class="title">Descrizione</label>
<label class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</label>
<label class="title">{{'create_queue_description' | localize("Descrizione")}}</label>
<label class="text">{{'create_queue_description_text' | localize("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}}</label>
</div>
</div>
</div>
</div>
<div class="create-queue-add-queue-footer">
<button class="btn">Aggiungi in coda</button>
<button class="btn">{{'create_queue_add_queue' | localize("Aggiungi in coda")}}</button>
</div>
</div>
<div class="create-queue-queue">
<div class="create-queue-queue-header">
<div class="title">
<label>Coda</label>
<label>{{'create_queue_queue' | localize("Coda")}}</label>
</div>
<div class="group-button">
<button class="btn"><i class="fa fa-floppy-o"></i></button>
@@ -71,18 +71,18 @@
</div>
<div class="create-queue-queue-body scrollable">
<div class="create-queue-queue-body-box">
<label class="number-card">1</label> <card-element-queue></card-element-queue>
<label class="number-card">{{'create_queue_number_card' | localize("1")}}</label> <card-element-queue></card-element-queue>
</div>
<div class="create-queue-queue-body-box">
<label class="number-card">2</label> <card-element-queue></card-element-queue>
<label class="number-card">{{'create_queue_number_card' | localize("2")}}</label> <card-element-queue></card-element-queue>
</div>
</div>
<div class="create-queue-queue-footer">
<div class="label-footer">
<label class="lbl-number-queue">4 elementi in coda</label>
<label class="lbl-number-queue">{{'create_queue_number_in_queue' | localize("4 elementi in coda")}}</label>
</div>
<div class="button-load-queue">
<button class="btn btn-success">Carica coda</button>
<button class="btn btn-success">{{'create_queue_load_queue' | localize("Carica coda")}}</button>
</div>
</div>
</div>
@@ -61,7 +61,7 @@ export default class JobEditorDetail extends Vue {
commandsChanged(n, o) {
if (n && this.interactive) {
var result = "";
this.commands.forEach(c => {
result += pf.vsprintf(c.definition.command, [c.value || "", c.value2 || ""]) + "\n";
});
@@ -97,7 +97,7 @@ export default class JobEditorDetail extends Vue {
}
dropNewCommand(event) {
console.log("drop", event)
const { removedIndex, addedIndex, payload, element } = event;
this.commands.splice(addedIndex, 0, {
definition: payload,
@@ -2,10 +2,10 @@
<div class="editor">
<div class="buttons">
<button class="btn" :active="interactive" @click="interactive = !interactive">
<img src="">
<i class="fa fa-th-large"></i>
</button>
<button class="btn" :active="!interactive" @click="interactive = !interactive">
<img src="">
<i class="fa fa-code"></i>
</button>
</div>
<div class="interactive-editor scrollable" v-if="interactive">
@@ -18,7 +18,7 @@
<button class="btn" @click="removeCommand(p)"><i class="fa fa-trash"></i></button>
</div>
<div class="details" slot v-if="p.title=='job_item_part_program'">
<input type="text" v-model="p.value"><button class="btn" @click="selectProgram(p)"><i class="fa fa-folder"></i></button>
<input type="text" v-model="p.value"><button class="btn" @click="selectProgram(p)"><i class="fa fa-folder-open"></i></button>
</div>
<div class="details" slot v-if="p.title=='job_item_delay'">
<input type="number" v-model="p.value">
+228 -50
View File
@@ -5,90 +5,268 @@ import { objectsJob } from "src/modules/base-components/cards";
import { tool } from "src/modules/base-components/cards";
import { inputBox } from "src/modules/base-components/cards";
import jobEditorDetail from "./job-editor-detail.vue";
import { jobEditorActions } from "../store/jobEditor.store";
import { store, AppModel } from "../store";
import { ToolingService } from "../services/toolingService";
import { ModalHelper, ModalMissingTools, ModalJobAddParameter } from "../modules/base-components";
import * as iziToast from "izitoast";
import { awaiter } from "src/_base";
import { ModalImage} from "src/modules/base-components/index";
import { Watch } from "vue-property-decorator";
declare let $: any;
declare let cmsClient: any;
@Component({ components: { objectsJob, tool, inputBox, Container, Draggable, jobEditorDetail } })
export default class JobEditor extends Vue {
public get job(): server.Job {
return (this.$store.state as AppModel).jobEditor.job;
}
public get ncTools(): server.ToolNc[] { return (this.$store.state as AppModel).tooling.ncTools; }
toolsJob: Array<any> = [];
programName: string = null;
editing: boolean = false;
currentJob: server.Job = null;
imagesOfTheJob: Array<any> = [];
limitationList: number = 3;
selectedParam = null;
selectedTool = null;
// occorre uno switch per la scelta del linguaggio in base al CN
jobitems = siemensJobItems;
public selectedTab: string = "ParBase";
selectedTab: string = "ParBase";
public selectTab(value) {
get ncTools(): server.ToolNc[] { return (this.$store.state as AppModel).tooling.ncTools; }
get ncFamilies(): server.FamiliesNc[] { return (this.$store.state as AppModel).tooling.ncFamilies; }
get jobTools() {
var $this = this;
return this.currentJob.metadata.tools.map(t =>
{
var tool = $this.ncTools.find(i => i.id == t);
if(tool)
return tool
else
return t
});
}
public get familyOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.familyOptionActive;
}
get jobGenerics() {
return this.currentJob ? this.currentJob.metadata.generics : null;
}
async mounted(){
awaiter (Promise.all([
await new ToolingService().GetNcTools(),
await new ToolingService().GetNcFamilies(),
await new ToolingService().GetToolsConfiguration()
]));
}
selectTab(value) {
this.selectedTab = value;
}
getChildPayload(index) {
// console.log("childPayload", index, this.jobitems[index - 1])
return this.jobitems[index - 1];
}
addImageToJob(){
addImageToJob() {
var res = JSON.parse(cmsClient.addImageToJob());
if(this.currentJob){
if (this.currentJob) {
this.currentJob.metadata.generics.images.push(res);
}
}
deleteImageFromJob(){
var res = JSON.parse(cmsClient.deleteImageFromJob());
console.log(res);
}
addPPToJob(){
var res = JSON.parse(cmsClient.addPPToJob());
console.log(res);
}
delPPFromJob(){
var res = JSON.parse(cmsClient.delPPFromJob());
console.log(res);
}
async openJob(){
var toolsJ, tJ;
this.currentJob = JSON.parse(cmsClient.openJob());
jobEditorActions.updateJob(store,this.currentJob);
await new ToolingService().GetNcTools();
toolsJ = this.ncTools;
console.log(this.currentJob);
if(this.currentJob.metadata.tools.length > 0){
this.currentJob.metadata.tools.forEach(function(value){
toolsJ.forEach(function(tools){
if(tools.id == value){
tJ.push(tools);
deleteImageFromJob(image) {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_delete_image_job", "Richiesta di conferma"),
this.$options.filters.localize("modal_delete_image_job_confirm", "Sei sicuro di voler eliminare l'immagine?"),
() => {
var res = cmsClient.delImageFromJob(image.name);
if (this.currentJob) {
var images = this.currentJob.metadata.generics.images;
images.splice(images.indexOf(image), 1);
}
});
})
}
this.toolsJob = tJ;
}, null);
}
openImage(image){
ModalHelper.modalImage.content = image.base64;
ModalHelper.modalImage.title = image.name;
ModalHelper.ShowModal(ModalImage);
}
saveJob(){
if(this.currentJob){
var res = JSON.parse(cmsClient.saveJob(this.currentJob));
console.log(res);
newJob() {
if (this.currentJob)
ModalHelper.AskConfirm(this.$options.filters.localize("modal_open_job", "Richiesta di conferma"),
this.$options.filters.localize("modal_open_job_body", "Sei sicuro di aver salvato il Job?"),
() => {
var res = cmsClient.newJob();
if(res){
var obj = JSON.parse(res);
if(obj.error)
this.showError(obj.error);
else
this.currentJob = obj;
}
}, null);
else
this.currentJob = JSON.parse(cmsClient.newJob());
}
updateLimitation() {
if (this.limitationList == this.currentJob.metadata.generics.images.length) {
this.limitationList = 3;
} else {
this.limitationList = this.currentJob.metadata.generics.images.length;
}
}
async openJob() {
if (this.currentJob)
ModalHelper.AskConfirm(this.$options.filters.localize("modal_open_job", "Richiesta di conferma"),
this.$options.filters.localize("modal_open_job_body", "Sei sicuro di aver salvato il Job?"),
this.loadJob, null);
else
this.loadJob();
}
async loadJob() {
var res = cmsClient.openJob();
if(res){
var obj = JSON.parse(res);
if(obj.error)
this.showError(obj.error);
else{
this.currentJob = obj;
}
}
}
saveJobNewPath() {
if (this.currentJob) {
var res = cmsClient.saveJobNewPath(JSON.stringify(this.currentJob));
if(res){
var obj = JSON.parse(res);
if(obj.error)
this.showError(obj.error);
else
this.currentJob.name = obj.name;
}
}
}
saveJob() {
if (this.currentJob) {
var res = cmsClient.saveJob(JSON.stringify(this.currentJob));
if(res){
var obj = JSON.parse(res);
if(obj.error)
this.showError(obj.error);
else
this.currentJob.name = obj.name;
}
}
}
closeJob() {
if (this.currentJob) {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_open_job", "Richiesta di conferma"),
this.$options.filters.localize("modal_open_job_body", "Sei sicuro di aver salvato il Job?"),
() => {
var res = cmsClient.closeJob();
if(res){
var obj = JSON.parse(res);
if(obj.error)
this.showError(obj.error);
}
else
this.currentJob = null;
}, null);
}
}
selectParam(param) {
this.selectedParam = param;
}
selectTool(tool) {
this.selectedTool = tool;
}
async openModalAddToolToJob() {
ModalHelper.avaiableTools = this.ncTools.filter(t => this.currentJob.metadata.tools.indexOf(t.id) < 0);
ModalHelper.job = this.currentJob;
var newTool = await ModalHelper.ShowModalAsync(ModalMissingTools);
if (newTool) {
this.currentJob.metadata.tools.push(newTool.id);
}
}
removeTool(tool) {
var idx = this.currentJob.metadata.tools.indexOf(tool.id);
if (idx >= 0)
this.currentJob.metadata.tools.splice(idx, 1);
}
removeParam(parameter) {
var idx = this.currentJob.metadata.customs.indexOf(parameter);
if (idx >= 0)
this.currentJob.metadata.customs.splice(idx, 1);
}
async editParam(parameter) {
var result = await ModalHelper.ShowModalAsync(ModalJobAddParameter, parameter);
if (result)
Object.assign(parameter, result);
}
async openModalJobAddParameter() {
var result = await ModalHelper.ShowModalAsync(ModalJobAddParameter, null);
if (result)
this.currentJob.metadata.customs.push(result);
}
showError(error) {
(iziToast as any).error({
title: "Error",
message: error,
theme: "dark",
timeout: 10000,
class: "t-error",
transitionOut: "fadeOut",
})
}
familyNameFromId(id): any{
var found = this.ncFamilies.find(k => k.id == id);
if(found)
return found.name;
return '';
}
calcFamilyName(id): any{
if(this.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
}
getToolIcon = function (id) {
if (id == 9999)
return "../assets/iicons/Tools/Undefined.png"
else if (id == 151 || id == 700)
return "../assets/icons/Tools/Saw.png"
else
return "../assets/icons/Tools/Tools.png"
}
}
+50 -73
View File
@@ -3,22 +3,21 @@
<div class="job-editor-box">
<div class="job-editor-header">
<div class="title">
<label>Job editor</label>
<label>{{'job_editor_title' | localize('Job editor')}}</label>
</div>
<div class="search-job">
<!-- <input v-if="currentJob" type="text" v-model="currentJob.name" :disabled="editing"> -->
<span v-if="currentJob">{{currentJob.name}}</span>
<button class="btn" @click="openJob()"><i class="fa fa-folder"></i></button>
<button class="btn"><i class="fa fa-plus"></i></button>
</div>
<div class="group-button">
<!-- <button class="btn"><i class="fa fa-clone"></i></button> -->
<button class="btn"><i class="fa fa-trash"></i></button>
<input type="text" :placeholder="'job_editor_box_name_placeholder' | localize('Apri il Job o creane uno nuovo..')" class="job-name-box" v-if="!currentJob" readonly="readonly">
<input type="text" class="job-name-box" v-if="currentJob" v-model="currentJob.name" readonly="readonly">
<button class="btn" @click="newJob()" :title="'job_editor_btn_new' | localize('Crea Job')"><i class="fa fa-file-o"></i></button>
<button class="btn" @click="openJob()" :title="'job_editor_btn_open' | localize('Apri Job')"><i class="fa fa-folder-open"></i></button>
<button class="btn" :disabled="!currentJob" @click="saveJob()" :title="'job_editor_btn_save' | localize('Salva Job')"><i class="fa fa-floppy-o"></i></button>
<button class="btn" :disabled="!currentJob" @click="saveJobNewPath()" :title="'job_editor_btn_save_path' | localize('Salva con nome')"><i class="fa fa-files-o"></i></button>
<button class="btn" :disabled="!currentJob" @click="closeJob()" :title="'job_editor_btn_close' | localize('Chiudi Job')"><i class="fa fa-window-close"></i></button>
</div>
</div>
<div class="job-editor-body">
<!-- Lista degli elementi disponibili -->
<div class="job-editor-column-left">
<div class="job-editor-column-left" >
<Container :group-name="'commands'" :get-child-payload="getChildPayload" >
<div class="column-left-title">
<span>{{'drag_job_items_to_compose_job' | localize('Trascina nella parte centrale della pagina gli oggetti che desideri aggiungere al job')}}</span>
@@ -32,112 +31,90 @@
<job-editor-detail v-if="currentJob" v-model="currentJob.isoMainProgram"
:active-command-set="jobitems"></job-editor-detail>
</div>
<div class="job-editor-body-box-right">
<div class="job-editor-body-box-right" v-if="jobGenerics">
<div class="box-right-header">
<label>Metadati</label>
<label>{{'job_editor_box_right_metadata' | localize('Metadati')}}</label>
</div>
<div class="box-right-body">
<div class="tab-box">
<div class="tab-box-scroll">
<button class="tab" :class="{'active': selectedTab == 'ParBase'}" @click="selectTab('ParBase')">
<span>Parametri base</span>
<span>{{'job_editor_box_right_basic_parameters' | localize('Parametri base')}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Utensili'}" @click="selectTab('Utensili')">
<span>Utensili</span>
<span>{{'job_editor_box_right_tools' | localize('Utensili')}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Parametri'}" @click="selectTab('Parametri')">
<span>Parametri</span>
<span>{{'job_editor_box_right_parameters' | localize('Parametri')}}</span>
</button>
</div>
</div>
<div class="box-right-body-container scrollable" v-if="selectedTab == 'ParBase' && currentJob">
<div class="title">
<span>Immagini</span>
<span>{{'job_editor_box_right_images' | localize('Immagini')}}</span>
</div>
<div v-for="(image,key) in currentJob.metadata.generics.images" :key="key" class="filename">
<i class="fa fa-file-image-o"></i>
<span>{{image.name}}</span>
<!-- <div class="right">
<button class="btn-hidden" v-if="selectedAttachMaintenance == a" @click="openAttach(a)"><i class="fa fa-file-o"></i></button>
<button class="btn-hidden" v-if="selectedAttachMaintenance == a && a.userId == currentUser.id" @click="onClickDeleteAttach(a)"><i class="fa fa-trash" ></i></button>
</div> -->
<div class="box-image scrollable" >
<div v-for="(image,key) in jobGenerics.images" :key="key" v-if="key < limitationList" class="filename">
<i class="fa fa-file-image-o" @click="openImage(image)"></i>
<span @click="openImage(image)">{{image.name}}</span>
<div class="right">
<!-- <button class="btn-hidden" v-if="selectedAttachMaintenance == a" @click="openAttach(a)"><i class="fa fa-file-o"></i></button> -->
<button class="btn-hidden" @click="deleteImageFromJob(image)"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
<div class="allattach">
<button class="btn-hidden">
<!-- <span v-if="limitationList == attachmentsMaintenance.length">{{'maintenance_card_btn_hide_all_attach' | localize("Nascondi tutti gli allegati")}}</span>
<span v-if="limitationList != attachmentsMaintenance.length">{{'maintenance_card_btn_view_all_attach' | localize("Mostra tutti gli allegati")}}</span> -->
<span>Mostra tutti gli allegati</span>
<div class="allattach" >
<button class="btn-hidden" @click="updateLimitation()">
<span v-if="limitationList == jobGenerics.images.length">{{'job_editor_btn_hide_all_attach' | localize("Nascondi tutti gli allegati")}}</span>
<span v-if="limitationList != jobGenerics.images.length">{{'job_editor_btn_view_all_attach' | localize("Mostra tutti gli allegati")}}</span>
</button>
</div>
<div class="addattach">
<!-- <div class="group-button-add-attach"><label for="input">Aggiungi un allegato<label for="input" class="btn"><i class="fa fa-plus"><input id="input" type="file" accept="application/pdf,image/jpeg,image/png" style="display: none"/></i></label></label></div> -->
<div class="group-button-add-attach"><label for="input">Aggiungi un allegato<button for="input" class="btn" @click="addImageToJob()"><i class="fa fa-plus"></i></button></label></div>
<div class="group-button-add-attach"><label for="input">{{'job_add_attach' | localize('Aggiungi un allegato')}}<button for="input" class="btn" @click="addImageToJob()"><i class="fa fa-plus"></i></button></label></div>
</div>
<div class="description">
<div class="description-title">
<label>Descrizione</label>
<label>{{'job_editor_box_right_description' | localize('Descrizione')}}</label>
</div>
<textarea v-model="currentJob.metadata.generics.Description"></textarea>
<textarea v-model="jobGenerics.Description" ></textarea>
</div>
<div class="times">
<div class="times-title">
<label>Tempi</label>
<label>{{'job_editor_box_right_times' | localize('Tempi')}}</label>
</div>
<div class="average-time">
<label>Tempo medio:</label>
<span>{{currentJob.metadata.generics.ExecutionTime}}</span>
</div>
<div class="historical">
<label>Storico:</label>
<table>
<thead>
<tr>
<th>{{'modal_edit_job_table_date' | localize("Data")}}</th>
<th>{{'modal_edit_job_table_start_time' | localize("Ora inizio")}}</th>
<th>{{'modal_edit_job_table_medium_override' | localize("Override medio")}}</th>
<th>{{'modal_edit_job_table_total_time' | localize("T totale")}}</th>
</tr>
</thead>
<tbody class="scrollable">
<tr>
<td colspan="1"><div><label>12/03/2016</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
<td colspan="1"><div><label>100%</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
</tr>
<tr>
<td colspan="1"><div><label>12/03/2016</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
<td colspan="1"><div><label>100%</label></div></td>
<td colspan="1"><div><label>15:24:53</label></div></td>
</tr>
</tbody>
</table>
<label>{{'job_editor_box_right_average_time' | localize('Tempo medio')}}Tempo medio:</label>
<span >{{jobGenerics.ExecutionTime}}</span>
</div>
</div>
</div>
<div class="box-right-body-container" v-if="selectedTab == 'Utensili' && currentJob">
<div class="job-editor-button">
<button class="btn" @click="removeTool(selectedTool)"><i class="fa fa-trash"></i></button>
</div>
<div class="job-editor-tools scrollable">
<tool v-for="t in toolsJob" :key="t.id" :code="'jobeditor_tool_abbreviation' | localize('T%d',t.id)" :title="t.familyId" img-source="../assets/icons/Tools/Shanks.png"></tool>
<tool :class="{'selected': selectedTool == t}" v-if="t && t.id" @click.native="selectTool(t)" v-for="t in jobTools" :key="'tool_'+t.id" :code="'jobeditor_tool_abbreviation' | localize('T%d',t.id)" :title="calcFamilyName(t.id)" :img-source="getToolIcon(t.toolType)"></tool>
<tool :class="{'selected': selectedTool == t}" v-if="!t || !t.id" @click.native="selectTool(t)" v-for="(t,key) in jobTools" class="notfound" :key="'und_'+key" :code="'jobeditor_tool_abbreviation' | localize('T%d',t)" :title="'jobeditor_tool_notfound' | localize('Tool Not Found')" img-source="../assets/icons/Tools/Undefined.png"></tool>
</div>
<div class="job-editor-tools-footer">
<div>Aggiungi un utensile <button class="btn"><i class="fa fa-plus"></i></button></div>
<div>{{'job_editor_box_right_add_tool' | localize('Aggiungi un utensile')}}<button class="btn" @click="openModalAddToolToJob()"><i class="fa fa-plus"></i></button></div>
</div>
</div>
<div class="box-right-body-container" v-if="selectedTab == 'Parametri' && currentJob">
<div class="job-editor-parameters scrollable">
<div class="group-button">
<button class="btn"><i class="fa fa-pencil-square-o"></i></button>
<button class="btn"><i class="fa fa-trash"></i></button>
<button class="btn" @click="editParam(selectedParam)"><i class="fa fa-pencil-square-o"></i></button>
<button class="btn" @click="removeParam(selectedParam)"><i class="fa fa-trash"></i></button>
</div>
<input-box v-for="c in currentJob.metadata.customs" v-model="c.Value" :key="c.Name" :title="c.Name" :type="c.Type">
<option v-if="c.type == 'select'" v-for="(s, k) in c.selectionList" :key="k" :selected="s" :value="s">
<div>{{s}}</div>
<input-box :class="{'selected': selectedParam == c}" v-for="c in currentJob.metadata.customs" v-model="c.value" :key="c.name" :title="c.name" :type="c.type.toLowerCase()" @click.native="selectParam(c)">
<option v-if="c.type && c.type.toLowerCase() == 'select'" v-for="(s, k) in c.selectionList" :key="k" :value="s">
<div>{{s}}</div>
</option>
</input-box>
</div>
<div class="job-editor-parameters-footer">
<div>Aggiungi un parametro<button class="btn"><i class="fa fa-plus"></i></button></div>
<div>{{'job_editor_box_right_add_parameter' | localize('Aggiungi un parametro')}}<button class="btn" @click="openModalJobAddParameter()"><i class="fa fa-plus"></i></button></div>
</div>
</div>
</div>
@@ -145,11 +122,11 @@
</div>
</div>
<div class="job-editor-footer">
<div class="button-left">
<!-- <div class="button-left">
<button class="btn">Svuota job</button>
</div>
</div> -->
<div class="button-right">
<button class="btn btn-success" @click="saveJob()">Salva</button>
<button class="btn btn-success" :disabled="!currentJob" @click="saveJob()">{{'job_editor_save_job' | localize('Salva')}}</button>
</div>
</div>
</div>
+181
View File
@@ -0,0 +1,181 @@
import Vue from "vue";
import softkeysPrefered from "../modules/base-components/cards/softkeys-prefered.vue"
import headProduction from "../modules/heads/head-production.vue"
import cardAxesProduction from "../modules/base-components/cards/card-axes-production.vue"
import processSelectionMaintenance from "../modules/base-components/cards/process-selection-maintenance.vue";
import cardProductionCms from "../modules/base-components/cards/card-production-cms.vue";
import { Hub } from "src/services/hub";
import { Factory, MessageService, awaiter } from "src/_base";
import { appModelActions, alarmsModelActions, store } from "src/store";
import { ModalHelper } from "src/modules/base-components";
import { DataService } from '../services/dataService';
import Component from "vue-class-component";
import { Watch } from "vue-property-decorator";
@Component({
components: {
softkeysPrefered, headProduction, cardAxesProduction, processSelectionMaintenance, cardProductionCms
}
})
export default class Production extends Vue {
isCnReady: Function;
activeCms = true;
activeCnc = false;
headsR = [];
selectedHead = null;
selectedPositionTop = 0;
userSubkeysMenuOpened = false;
waitingForSftkConfirm = false;
confirmationDelegate = null;
async created() {
await awaiter(new DataService().GetUserSoftkeyFavorite());
}
async mounted() {
this.confirmationDelegate = null;
ModalHelper.HideModal("modal2");
}
get machineInfo() {
return this.$store.state.machineInfo;
}
get heads() {
return this.$store.state.machineInfo.heads;
}
softkeyFavorite() {
function compare(a, b) {
if (a.id < b.id) {
return -1;
}
if (a.id > b.id) {
return 1;
}
return 0;
}
var array = this.$store.state.machineInfo.softkeysFavorites;
return array.sort(compare);
}
@Watch("activeCnc")
activeCncChanged() {
if (this.activeCnc) {
Factory.Get(MessageService).publishToChannel("HMI-production-show");
Factory.Get(MessageService).publishToChannel("HMI-production-show-state");
}
else {
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
}
}
beforeDestroy() {
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
}
closeAlarmsRibbon() {
alarmsModelActions.toggleOpened(this.$store, false);
alarmsModelActions.toggleServiceOpened(this.$store, false);
}
selectHead(h) {
this.selectedHead = h;
}
getHeadsProperty(id) {
var r = this.$store.getters.getHeadsProperty(id);
return r || {};
}
clickCms() {
this.activeCms = true;
this.activeCnc = false;
}
clickCnc() {
this.activeCnc = true;
this.activeCms = false;
}
ncClick(id) {
Hub.Current.ncSoftKeyClick(id);
}
isReadOnly(id) {
let r = this.$store.getters.getNcSoftKeyInfo(id);
if (r) return r.isReadOnly;
return false;
}
isKeyActive(id) {
let r = this.$store.getters.getNcSoftKeyStatus(id);
if (r) return r.active;
return false;
}
name(id) {
let r = this.$store.getters.getNcSoftKeyInfo(id);
if (r) return r.visualizedName;
return null;
}
isKeySelected(id) {
let r = this.$store.getters.getNcSoftKeyStatus(id);
if (r) return r.value;
return false;
}
overrideMinus(id) {
Hub.Current.headOverrideMinus(id);
}
overridePlus(id) {
Hub.Current.headOverridePlus(id);
}
positionBox(arg1, arg2) {
this.selectedPositionTop = (arg1.offsetTop - (this.$refs.scrollable as any).scrollTop - (this.$refs.scrollable as any).offsetHeight + 155);
this.userSubkeysMenuOpened = arg2;
}
toggleMainView() {
Factory.Get(MessageService).publishToChannel("enable-selected-softkeys-prefered", true);
appModelActions.MainViewToggle(this.$store);
}
getSubKeysActive(keys) {
let result = {};
for (const key in keys) {
result[key] = this.getSoftKeyActive(key);
}
return result;
}
getSoftKeyActive(id) {
if (!this.isCnReady()) return false;
var sk = this.$store.getters.getSoftKeyStatus(id);
if (sk)
return sk.active;
return false;
}
softKeyChanged(id, confirm) {
if (!confirm)
Hub.Current.sendUserSoftKey(id);
else {
this.confirmationDelegate = () => {
Hub.Current.sendUserSoftKey(id);
};
this.waitingForSftkConfirm = true;
}
}
sendKeyCancel() {
this.confirmationDelegate = null;
}
sendKeyConfirm() {
if (this.confirmationDelegate)
this.confirmationDelegate();
this.confirmationDelegate = null;
}
getSubKeysStatus(keys) {
let result = {};
for (const key in keys) {
result[key] = this.getSoftKeyStatus(key);
}
return result;
}
getSoftKeyStatus(id) {
if (!this.isCnReady()) return false;
var sk = this.$store.getters.getSoftKeyStatus(id);
if (sk)
return sk.value;
return false;
}
};
+7 -183
View File
@@ -8,10 +8,13 @@
<div class="box-left">
<div class="box-left-video">
<div class="box-header">
<div class="title-header-label">
{{'production_header_title' | localize("Gestore della produzione")}}
</div>
<button class="btn" :class="{'pressed': activeCms}" @click="clickCms()">{{'production_box_video_button_cms' | localize("CMS")}}</button>
<button class="btn" :class="{'pressed': activeCnc}" @click="clickCnc()">{{'production_box_video_button_cnc' | localize("CNC")}}</button>
</div>
<div class="cnc" v-if="activeCnc">
<div class="cnc" v-if="activeCnc">
<img id="cnc-img" src="assets/images/Siemens_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isSiemens()">
<img id="cnc-img-fanuc" src="assets/images/Fanuc_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isFanuc()">
<img id="cnc-img" src="assets/images/Osai_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isOsai()">
@@ -32,7 +35,7 @@
<button @click="ncClick(17)" :disabled="!isKeyActive(17)" :class="{active:isKeySelected(17) , inverted:isReadOnly(17)}" class="soft "><img src="../../assets/icons/under-hood-png/dry-run-active.png" />{{name(17)}}</button>
<button v-if="machineInfo.isFanuc" @click="ncClick(18)" :disabled="!isKeyActive(18)" :class="{active:isKeySelected(18) , inverted:isReadOnly(18)}" class="soft ">{{name(18)}}</button>
<button v-if="machineInfo.isFanuc" @click="ncClick(19)" :disabled="!isKeyActive(19)" :class="{active:isKeySelected(19) , inverted:isReadOnly(19)}" class="soft ">{{name(19)}}</button>
<button v-if="machineInfo.isSiemens" @click="ncClick(18)" :disabled="!isKeyActive(18)" :class="{active:isKeySelected(18) , inverted:isReadOnly(18)}" class="soft ">{{name(18)}}</button>
<button v-if="machineInfo.isSiemens" @click="ncClick(19)" :disabled="!isKeyActive(19)" :class="{active:isKeySelected(19) , inverted:isReadOnly(19)}" class="soft ">{{name(19)}}</button>
<button v-if="machineInfo.isSiemens || isDemo()" @click="ncClick(20)" :disabled="!isKeyActive(20)" :class="{active:isKeySelected(20) , inverted:isReadOnly(20)}" class="soft "><img class="teach" src="../../assets/icons/under-hood-png/teach.png" />{{name(20)}}</button>
@@ -99,185 +102,6 @@
</div>
</div>
</template>
<script>
import softkeysPrefered from "../modules/base-components/cards/softkeys-prefered.vue"
import headProduction from "../modules/heads/head-production.vue"
import cardAxesProduction from "../modules/base-components/cards/card-axes-production.vue"
import processSelectionMaintenance from "../modules/base-components/cards/process-selection-maintenance.vue";
import cardProductionCms from "../modules/base-components/cards/card-production-cms.vue";
import { Hub } from "src/services/hub";
import { Factory, MessageService,awaiter } from "src/_base";
import { appModelActions, alarmsModelActions,store } from "src/store";
import { ModalHelper } from "src/modules/base-components";
import { DataService } from '../services/dataService';
export default {
components:{
softkeysPrefered, headProduction, cardAxesProduction, processSelectionMaintenance, cardProductionCms
},
props:["sk"],
data: function(){
return {
activeCms: true,
activeCnc: false,
headsR: [],
selectedHead: null,
selectedPositionTop: 0,
userSubkeysMenuOpened:false,
waitingForSftkConfirm:false,
confirmationDelegate:null
}
},
async created(){
await awaiter(new DataService().GetUserSoftkeyFavorite());
},
async mounted() {
this.confirmationDelegate= null;
ModalHelper.HideModal("modal2");
},
computed:{
machineInfo: function() {
return this.$store.state.machineInfo;
},
heads: function(){
return this.$store.state.machineInfo.heads;
},
softkeyFavorite: function(){
<script src="./production.ts" lang="ts">
function compare(a,b){
if(a.id < b.id){
return -1;
}
if(a.id > b.id){
return 1;
}
return 0;
}
var array = this.$store.state.machineInfo.softkeysFavorites;
return array.sort(compare);
}
},
watch:
{
activeCnc: function() {
if(this.activeCnc){
Factory.Get(MessageService).publishToChannel("HMI-production-show");
Factory.Get(MessageService).publishToChannel("HMI-production-show-state");
}
else{
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
}
}
},
beforeDestroy: function () {
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
},
methods:{
closeAlarmsRibbon(){
alarmsModelActions.toggleOpened(this.$store, false);
alarmsModelActions.toggleServiceOpened(this.$store, false);
},
selectHead(h){
this.selectedHead = h;
},
getHeadsProperty: function(id) {
var r = this.$store.getters.getHeadsProperty(id);
return r || {};
},
clickCms(){
this.activeCms = true;
this.activeCnc = false;
},
clickCnc(){
this.activeCnc = true;
this.activeCms = false;
},
ncClick(id) {
Hub.Current.ncSoftKeyClick(id);
},
isReadOnly(id) {
let r = this.$store.getters.getNcSoftKeyInfo(id);
if (r) return r.isReadOnly;
return false;
},
isKeyActive(id) {
let r = this.$store.getters.getNcSoftKeyStatus(id);
if (r) return r.active;
return false;
},
name(id){
let r = this.$store.getters.getNcSoftKeyInfo(id);
if(r) return r.visualizedName;
return null;
},
isKeySelected(id) {
let r = this.$store.getters.getNcSoftKeyStatus(id);
if (r) return r.value;
return false;
},
overrideMinus: function(id) {
Hub.Current.headOverrideMinus(id);
},
overridePlus: function(id) {
Hub.Current.headOverridePlus(id);
},
positionBox(arg1,arg2){
this.selectedPositionTop = (arg1.offsetTop - (this.$refs.scrollable).scrollTop - (this.$refs.scrollable).offsetHeight + 155);
this.userSubkeysMenuOpened = arg2;
},
toggleMainView() {
Factory.Get(MessageService).publishToChannel("enable-selected-softkeys-prefered", true);
appModelActions.MainViewToggle(this.$store);
},
getSubKeysActive(keys){
let result = {};
for (const key in keys) {
result[key] = this.getSoftKeyActive(key);
}
return result;
},
getSoftKeyActive(id){
if(!this.isCnReady()) return false;
var sk = this.$store.getters.getSoftKeyStatus(id);
if (sk)
return sk.active;
return false;
},
softKeyChanged(id, confirm) {
if (!confirm)
Hub.Current.sendUserSoftKey(id);
else {
this.confirmationDelegate = () => {
Hub.Current.sendUserSoftKey(id);
};
this.waitingForSftkConfirm= true;
}
},
sendKeyCancel() {
this.confirmationDelegate = null;
},
sendKeyConfirm() {
if (this.confirmationDelegate)
this.confirmationDelegate();
this.confirmationDelegate = null;
},
getSubKeysStatus(keys){
let result = {};
for (const key in keys) {
result[key] = this.getSoftKeyStatus(key);
}
return result;
},
getSoftKeyStatus(id){
if(!this.isCnReady()) return false;
var sk = this.$store.getters.getSoftKeyStatus(id);
if (sk)
return sk.value;
return false;
}
}
};
</script>
</script>
+2 -2
View File
@@ -4,10 +4,10 @@
<div class="scada-tab-box">
<!-- :class="{'active': selectedTab == 'Scada1'}" @click="selectTab('Scada1')" -->
<button class="tab" :class="{'active': selectedTab == 'Scada1'}" @click="selectTab('Scada1')">
<span>Scada 1</span>
<span>{{'scada_tab_1' | localize("Scada 1")}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Scada2'}" @click="selectTab('Scada2')">
<span>Scada 2</span>
<span>{{'scada_tab_2' | localize("Scada 2")}}</span>
</button>
</div>
<div class="scada-box-body" v-if="selectedTab == 'Scada1'">
@@ -12,10 +12,10 @@
<div class="list-vertical">
<div class="list-vertical-box scrollable">
<div class="list-vertical-header">
Magazzino 1 - Lineare
{{'summary_depot_header_linear' | localize("Magazzino 1 - Lineare")}}
</div>
<div class="list-vertical-body">
<div class="title_up">Utensili caricati</div>
<div class="title_up">{{'summary_depot_list_vertical_loaded_tools' | localize("Utensili caricati")}}</div>
<div>
<loadequipment img-source="../assets/images/tool.PNG" code="E43" title="Utensile AAA" is-up="true"></loadequipment>
<loadequipment is-up="true"></loadequipment>
@@ -24,7 +24,7 @@
<loadequipment is-up="true"></loadequipment>
<loadequipment is-up="true"></loadequipment>
</div>
<div class="title_down">Utensili scaricati</div>
<div class="title_down">{{'summary_depot_list_vertical_download_tools' | localize("Utensili scaricati")}}</div>
<div>
<loadequipment is-down="true"></loadequipment>
<loadequipment is-down="true"></loadequipment>
@@ -3,7 +3,7 @@
<div class="assisted-tooling-box">
<div class="assisted-tooling-header">
<button class="close" @click="close()"><i class="fa fa-remove"></i></button>
<div class="assisted-tooling-header-label">Attrezzaggio assistito - Magazzino 1</div>
<div class="assisted-tooling-header-label">{{'assisted_tooling_label_header' | localize('Attrezzaggio assistito - Magazzino 1')}}</div>
</div>
<div class="assisted-tooling-body">
<div class="assisted-tooling-body-group">
@@ -3,10 +3,10 @@
<div class="assisted-toolingfive-box">
<div class="assisted-toolingfive-header">
<button class="close"><i class="fa fa-remove"></i></button>
<div class="assisted-toolingfive-header-label">Attrezzaggio assistito - Magazzino 1</div>
<div class="assisted-toolingfive-header-label">{{'assisted_toolingfive_header_label' | localize("Attrezzaggio assistito - Magazzino 1")}}</div>
</div>
<div class="assisted-toolingfive-body">
<span>Procedura di attrezzaggio assistito completata con successo!</span>
<span>{{'assisted_toolingfive_body' | localize("Procedura di attrezzaggio assistito completata con successo!")}}</span>
</div>
<div class="assisted-toolingfive-footer">
<button class="btn btn-success">{{'assisted_toolingfive_button_ok' | localize("OK")}}</button>
@@ -3,7 +3,7 @@
<div class="assisted-toolingfour-box">
<div class="assisted-toolingfour-header">
<button class="close"><i class="fa fa-remove"></i></button>
<div class="assisted-toolingfour-header-label">Attrezzaggio assistito - Magazzino 1</div>
<div class="assisted-toolingfour-header-label">{{'assisted_toolingfour_header_label' | localize("Attrezzaggio assistito - Magazzino 1")}}</div>
</div>
<div class="assisted-toolingfour-body">
<div class="assisted-toolingfour-body-header">
@@ -3,7 +3,7 @@
<div class="assisted-toolingthree-box">
<div class="assisted-toolingthree-header">
<button class="close"><i class="fa fa-remove"></i></button>
<div class="assisted-toolingthree-header-label">Attrezzaggio assistito - Magazzino 1</div>
<div class="assisted-toolingthree-header-label">{{'assisted_toolingthree_header_label' | localize("Attrezzaggio assistito - Magazzino 1")}}</div>
</div>
<div class="assisted-toolingthree-body">
<div class="assisted-toolingthree-body-header">
@@ -3,7 +3,7 @@
<div class="assisted-toolingtwo-box">
<div class="assisted-toolingtwo-header">
<button class="close"><i class="fa fa-remove"></i></button>
<div class="assisted-toolingtwo-header-label">Attrezzaggio assistito - Magazzino 1</div>
<div class="assisted-toolingtwo-header-label">{{'assisted_toolingtwo_header_label' | localize("Attrezzaggio assistito - Magazzino 1")}}</div>
</div>
<div class="assisted-toolingtwo-body">
<div class="assisted-toolingtwo-body-header">
@@ -33,10 +33,13 @@ export default class depot extends Vue {
public calcItemName(shank): any{
if(shank.childsTools && shank.childsTools.length > 1)
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d',shank.id);
if(!shank.childsTools)
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d',shank.shankId);
if(shank.childsTools.length > 1)
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d', shank.id);
else
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d',shank.childsTools[0].id);
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d',shank.childsTools[0].id);
}
public calcItemTitle(shank): any{
@@ -54,20 +57,24 @@ export default class depot extends Vue {
else{
if(this.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',shank.childsTools[0].familyId) + ' - ' + this.familyNameFromId(shank.childsTools[0].id);
else
return this.familyNameFromId(shank.childsTools[0].id);
else{
if(shank.childsTools)
return this.familyNameFromId(shank.childsTools[0].id);
else
return this.familyNameFromId(shank.shankId)
}
}
}
public get offsetOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.offsetOptionActive;
}
public get familyOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.familyOptionActive;
}
public familyNameFromId(id): any{
public familyNameFromId(id): any{
var found = (this.$store.state as AppModel).tooling.ncFamilies.find(k => k.id == id);
if(found)
return found.name;
@@ -171,7 +178,7 @@ export default class depot extends Vue {
}
return [];
}
// public get positions(): server.MagazinesPositions[] {
// return (this.$store.state as AppModel).tooling.magazinesPositions.filter(p => p.magazineId == this.depotId); }
public get availableMultiTools(): server.MultiTools[] { return (this.$store.state as AppModel).depot.availableMultiTool; }
@@ -231,7 +238,7 @@ export default class depot extends Vue {
return this.depotNc.find(d => d.positionId == position && d.magazineId == this.depotId);
}
public
public
@@ -284,7 +291,7 @@ export default class depot extends Vue {
else{
$('.square-container').css('width', this.calculateSquaresWidth(this.ncPositions.length));
}
})
}
@@ -381,11 +388,11 @@ export default class depot extends Vue {
public returnNcChild(elem){
if(!elem)
return null;
let model = (this.$store.state as AppModel);
var result = model.tooling.ncShanks.find(t => t.id == elem.shankId) as any;
var idName = "";
if(result){
idName = this.$options.filters.localize("tooling_ncshank_abbreviation", 'S%d', result.id);
return { id: result.id, name: idName };
@@ -425,30 +432,30 @@ export default class depot extends Vue {
new ToolingService().GetNcTools()
]));
}
// this.magazines;
}
public dataForOpenInfoShank(id){
let shank = (this.$store.state as AppModel).tooling.shanks.find(s => s.id == id);
console.log(ModalHelper.infoEquipmentModal.editEnabled)
ModalHelper.infoEquipmentModal.enableModalShank = true;
ModalHelper.infoEquipmentModal.enableModalTool = false;
ModalHelper.infoEquipmentModal.currentShank = shank;
ModalHelper.infoEquipmentModal.editEnabled = !this.editable;
ModalHelper.ShowModal(InfoEquipment);
}
public dataForOpenInfoNcShank(id){
let shank = (this.$store.state as AppModel).tooling.ncShanks.find(s => s.id == id);
console.log(ModalHelper.infoEquipmentModal.editEnabled)
ModalHelper.infoEquipmentModal.enableModalShank = true;
ModalHelper.infoEquipmentModal.enableModalTool = false;
ModalHelper.infoEquipmentModal.currentShank = shank;
ModalHelper.infoEquipmentModal.editEnabled = !this.editable;
ModalHelper.ShowModal(InfoEquipment);
}
public openInfoShank(id) {
if(this.isSiemens){
@@ -514,10 +521,10 @@ export default class depot extends Vue {
}
public doAddToDepotPosition(position, event){
if (this.draggingTool && this.draggingPosition == position.positionId) {
if (this.draggingTool && this.draggingPosition == position.positionId) {
if (this.toolAtPosition(position.positionId) || position.disabled || !this.checkMagPosType(position.type))
return
this.draggingIn = false;
this.draggingTool = null;
var toolToAdd = event.payload;
@@ -528,7 +535,7 @@ export default class depot extends Vue {
}
public doAddToNcDepotPosition(position, event){
if (this.draggingTool && this.draggingPosition == position.positionId) {
if (this.draggingTool && this.draggingPosition == position.positionId) {
if (this.ncToolAtPosition(position.positionId) || position.disabled || !this.checkMagPosType(position.type))
return
this.draggingIn = false;
@@ -564,7 +571,7 @@ export default class depot extends Vue {
}
else{
new DepotService().RemoveToolToDepotNc(this.depotId, position, {shankId: model.id}).then(response => {
});
}
}
@@ -595,7 +602,7 @@ export default class depot extends Vue {
return "../assets/icons/Tools/Shanks.png";
}
public getInfoNcShankIcon(shank){
public getInfoNcShankIcon(shank){
if(shank.childsTools && shank.childsTools.length > 1)
return "../assets/icons/Tools/Shanks.png";
else
@@ -609,10 +616,9 @@ export default class depot extends Vue {
}
public updateMagStatusAndgetStoreTitle(id: number): string {
if(this.magazines.length > 0){
var mag = this.magazines.find(d => d.id == id);
// console.log("MAG", mag.signalRLoadingIsActive)
if (mag && mag.loadingIsActive)
this.magazineLocked = false;
@@ -21,15 +21,15 @@ export default class toolingEquipment extends Vue {
public get magazineStatusModel(): server.MagazineStatus {
return (this.$store.state as AppModel).depot.magazineStatusModel;
}
public get familyOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.familyOptionActive;
}
public get offsetOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.offsetOptionActive;
}
public get tools(): server.Tool[] { return (this.$store.state as AppModel).tooling.tools; }
public get ncTools(): server.ToolNc[] { return (this.$store.state as AppModel).tooling.ncTools; }
@@ -92,11 +92,11 @@ export default class toolingEquipment extends Vue {
return Array.from(cat.values());
}
public get families(): any{
public get families(): any{
return (this.$store.state as AppModel).tooling.ncFamilies;
}
public familyNameFromId(id): any{
public familyNameFromId(id): any{
var found = (this.$store.state as AppModel).tooling.ncFamilies.find(k => k.id == id);
if(found)
return found.name;
@@ -105,9 +105,9 @@ export default class toolingEquipment extends Vue {
public calcFamilyName(id): any{
if(this.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
return this.familyNameFromId(id);
}
@@ -153,7 +153,7 @@ export default class toolingEquipment extends Vue {
}
async mounted() {
console.log("E' Siemens? " + this.isSiemens);
if(this.isSiemens){
awaiter (Promise.all([
@@ -172,9 +172,9 @@ export default class toolingEquipment extends Vue {
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
let arrayIdFamily = [];
console.log(this.toolsConfiguration);
if(this.isSiemens){
await this.maxToolsSiemens();
}
@@ -229,7 +229,7 @@ export default class toolingEquipment extends Vue {
public pushOffset(item){
this.selectedTool.offsetData = [item.offset1, item.offset2, item.offset3];
}
// public enableAddOffset(){
// if (this.selectedTool.offsetData.length < this.maxEdgesPerTools) {
// this.enableAddEdge = false;
@@ -388,9 +388,9 @@ export default class toolingEquipment extends Vue {
public canDeleteSelectedEdge = function (){
if(!this.selectedTool || !this.selectedTool.edgesData)
return false;
if(this.selectedTool.edgesData.length > 1)
return true;
return true;
return false;
}
@@ -538,7 +538,7 @@ export default class toolingEquipment extends Vue {
this.selectedTool = response;
let htmlelement = this.$refs.toolList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
@@ -550,13 +550,13 @@ export default class toolingEquipment extends Vue {
this.selectedTool = response;
let htmlelement = this.$refs.toolList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.toolsConfiguration = (this.$store.state as AppModel).tooling.toolsConfiguration;
this.edgeConfiguration = (this.$store.state as AppModel).tooling.edgesConfiguration;
this.disableList = false;
this.enableModify = false;
});
}));
}
@@ -302,18 +302,6 @@ export default class toolingShanks extends Vue {
this.posSelected = this.getFirstAvailablePosition();
});
}
// this.disableList = true;
// this.enableModify = true;
// var obj = { edgeAdditionalParams:{}};
// this.fieldEdge(obj);
// obj["id"] = -1;
// this.selectedTool.edgesData.push(obj);
// this.selectTab(obj);
// console.log(this.selectedTool.edgesData);
}
public cancel = function () {
@@ -388,7 +376,7 @@ export default class toolingShanks extends Vue {
this.selectedTool = response;
let htmlelement = this.$refs.shankList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
}));
@@ -398,7 +386,7 @@ export default class toolingShanks extends Vue {
this.selectedTool = response;
let htmlelement = this.$refs.shankList as any;
htmlelement.scrollTop = htmlelement.scrollHeight;
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
}));
@@ -415,7 +403,7 @@ export default class toolingShanks extends Vue {
}));
}
else{
awaiter(new ToolingService().UpdateNcShank(model).then(response => {
this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration;
this.disableList = false;
@@ -475,7 +463,7 @@ export default class toolingShanks extends Vue {
this.enableEquipment = false;
this.selectedEquipment = null;
this.checkChildsToolsenabled();
}))
}
else{
@@ -486,7 +474,7 @@ export default class toolingShanks extends Vue {
this.enableEquipment = false;
this.selectedEquipment = null;
this.checkChildsToolsenabled();
}))
}
}, null);
+1 -1
View File
@@ -6,7 +6,7 @@ var mixin = {
if (this.errors && this.errors.items.length > 0) return false;
console.log("entrato")
for (const key in this.$children) {
const element = this.$children[key];
+1 -1
View File
@@ -18,7 +18,7 @@
:disabled="!isAreaEnabled('scada')" v-if="isAreaVisible('scada')" class="oval scada" :class="{ big:isInPath('/test/header') && !state.isMainViewLiftedUp}"></button>
<button @click="openProgram('/job-editor')" :title="'footer_tooltip_job_editor' | localize('Job-Editor')"
:disabled="!isAreaEnabled('jobeditor')" v-if="isAreaVisible('jobeditor')" class="oval jobeditor" :class="{ big:isInPath('jobeditor') && !state.isMainViewLiftedUp}"></button>
:disabled="!isAreaEnabled('jobeditor')" v-if="isAreaVisible('jobeditor')" class="oval jobeditor" :class="{ big:isInPath('job-editor') && !state.isMainViewLiftedUp}"></button>
<div v-if="isAreaVisible('utilities') && getUtilities().length > 0" class="divider"><i class="fa fa-circle"></i></div>
<button @click="startUtility(software.id)" :title="software.longName" v-for="software in getUtilities()" :key="software.id"
+1 -1
View File
@@ -19,7 +19,7 @@ export default {
computed: {
axes: function() {
console.log(this.$store.state.process.axes);
return this.$store.state.process.axes;
},
emptySpaces: function() {
@@ -1,6 +1,7 @@
import Vue from "vue";
import { Factory, MessageService } from "src/_base";
import { ConfirmModal, Modal } from "./";
import { Deferred } from "../../services/Deferred";
export class ModalHelper {
public static loadDepotModal = {
@@ -8,6 +9,11 @@ export class ModalHelper {
positionType: 0,
magazineId: 0
};
public static avaiableTools: Array<any> = [];
public static job: server.Job = null;
public static infoEquipmentModal = {
currentShank: null,
currentEquipment: null,
@@ -19,6 +25,10 @@ export class ModalHelper {
content: null,
title: null
};
public static modalImage = {
content: null,
title: null
};
public static maintenanceModal = {
currentMaintenance: null,
};
@@ -41,10 +51,15 @@ export class ModalHelper {
};
public static ShowModal(view, modalname: string = "modal") {
Factory.Get(MessageService).publishToChannel("show-" + modalname, view);
}
public static ShowModalAsync(view, model= null, modalname: string = "modal"): Promise<any> {
let deferred = new Deferred();
Factory.Get(MessageService).publishToChannel("show-" + modalname, view, deferred, model);
return deferred.promise;
}
public static HideModal(modalname: string = "modal") {
Factory.Get(MessageService).publishToChannel("hide-" + modalname);
@@ -36,14 +36,7 @@ export default {
enablePopup: false
}
},
// watch: {
// numberReps: function(test){
// debugger
// this.numberReps = test;
// console.log("number reps: " +this.numberReps);
// console.log("number reps: " +this.number);
// }
// },
methods:{
onClick: function(){
this.$emit("click");
@@ -56,4 +49,4 @@ export default {
// }
}
};
</script>
</script>
@@ -8,7 +8,7 @@
<div class="box-right">
<button class="btn" v-if="noQueue" @click="deactivateProgram()"><i class="fa fa-trash" aria-hidden="true"></i></button>
<button class="btn" v-if="!noQueue" @click="stopQueue()" :disabled="!startStopQueueEnabled"><i class="fa fa-stop" aria-hidden="true"></i></button>
<div class="rectangle">
<label>- {{timeleft}}</label>
</div>
@@ -23,8 +23,8 @@
</div>
<div class="card-job-production-body-bottom" :class="{'width-body-bottom':noQueue}">
<div class="tabs">
<button class="tab" :class="{'active': enableIsoLines}" @click="selectTab('IsoLines')">Linee ISO</button>
<button class="tab" :class="{'active': enableFileSections}" @click="selectTab('FileSections')" v-if="false">Sezioni File</button>
<button class="tab" :class="{'active': enableIsoLines}" @click="selectTab('IsoLines')">{{'card_job_production_iso_lines' | localize('Linee ISO')}}</button>
<button class="tab" :class="{'active': enableFileSections}" @click="selectTab('FileSections')" v-if="false">{{'card_job_production_section_file' | localize('Sezioni file')}}</button>
</div>
<div class="content-box" v-if="enableIsoLines && currentProgram">
<div class="row" :class="{'selected': idx==indexofActiveLine,'width-100':noQueue}" v-for="(l, idx) in currentProgram.isoLines" :key="idx" >
@@ -40,7 +40,7 @@
</div>
<div class="card-job-production-box-start" v-if="!noQueue && startStopQueue">
<div>
<button class="btn btn-success" @click="startQueue()" :disabled="!startStopQueueEnabled">Start Queue</button>
<button class="btn btn-success" @click="startQueue()" :disabled="!startStopQueueEnabled">{{'card_job_production_btn_start_queue' | localize('Start Queue')}}</button>
</div>
</div>
</div>
@@ -92,7 +92,7 @@ export default {
return this.$store.state.process.selectedProcess;
},
currentProgram: function() {
console.log(this.$store.state.process.currentProgram);
return this.$store.state.process.currentProgram;
},
indexofActiveLine: function() {
@@ -106,7 +106,7 @@ export default {
},
currentProgramName: function() {
return this.$store.state.process.currentProgramName;
},
},
timeleft: function(){
if(this.currentProgram)
return new moment(this.currentProgram.timeLeft).format("HH : mm : SS");
@@ -146,7 +146,7 @@ export default {
else{
this.startStopQueue = true;
}
},
async stopQueue(){
await new FileService().stopQueue(this.selectedProcess);
@@ -3,7 +3,7 @@
<div class="card-queue-production">
<div class="card-queue-production-header">
<div class="title">
<label>Coda</label>
<label>{{'card_queue_production_title' | localize('Coda')}}</label>
</div>
<div class="group-button">
<button class="btn"><i class="fa fa-floppy-o"></i></button>
@@ -34,22 +34,22 @@
<popup v-if="enablePopup" :style="{top: selectedPositionTop + 'px'}" :arrow="'arrow-top'" :title="'Modifica ripetizioni'">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<div class="edit-reps">
<label>Ripetizioni</label>
<label>{{'card_queue_production_title_reps' | localize('Ripetizioni')}}</label>
<input type="number" v-model.number="numberReps">
</div>
<div class="group-button">
<button class="btn btn-success btn-small" @click="changeReps(numberReps)">Salva</button>
<button class="btn btn-success btn-small" @click="changeReps(numberReps)">{{'card_queue_production_save' | localize('Salva')}}</button>
</div>
</popup>
</Container>
</div>
<div class="queue-footer">
<label>{{partPrograms.length}} elementi in coda</label>
<label>{{partPrograms.length}} {{'card_queue_production_items_queue' | localize('items queue')}}</label>
</div>
</div>
<div class="card-queue-production-footer">
<div class="add-item">
<label>Aggiungi elemento</label>
<label>{{'card_queue_production_add_item' | localize('Aggiungi elemento')}}</label>
<button class="btn" @click="openModal()"><i class="fa fa-plus"></i></button>
</div>
</div>
@@ -113,38 +113,15 @@ export default {
async deleteItemQueue(processId, item){
await new FileService().deleteItemQueue(processId, item);
},
// onDrag({ isSource, payload, willAcceptDrop }) {
// this.enablePopup = false;
// this.draggingIn = true;
// this.draggingItem = payload;
// },
// onDragEnd({ isSource, payload, willAcceptDrop }) {
// debugger
// this.draggingIn = false;
// this.draggingItem = payload;
// },
// onDragEnter(position) {
// this.draggingPosition = position;
// },
// onDragLeave() {
// debugger
// this.draggingPosition = null;
// },
async changePosition(event){
var response = false;
if(event.payload && event.payload.status != 1 && event.payload.status != 3 && event.addedIndex != event.removedIndex){
this.draggingIn = false;
this.draggingItem = null;
var itemsPositions = {objectId: event.payload.id, newPosition: event.addedIndex, oldPosition: event.removedIndex};
await new FileService().moveItemsQueue(this.selectedProcess,itemsPositions,this.partPrograms);
// .then(function(){
// response = true;
// });
// if(response && event.addedIndex && event.removeIndex){
// this.partPrograms.splice(event.addedIndex, 0, this.partPrograms.splice(event.removedIndex,1)[0]);
// }
await new FileService().moveItemsQueue(this.selectedProcess,itemsPositions,event.payload);
}
else{
event = null;
@@ -166,7 +143,7 @@ export default {
this.enablePopup = false;
},
async changeReps(value){
console.log(value);
this.modelPartProgram.reps = value;
await new FileService().changeReps(this.selectedProcess, this.modelPartProgram)
this.enablePopup = false;
@@ -174,4 +151,4 @@ export default {
}
}
</script>
</script>
@@ -341,7 +341,7 @@ export default {
},
async openAttach(attach){
if(attach){
await new MaintenanceService().OpenModal(attach);
await new MaintenanceService().OpenModal(attach,this.isimage(attach.fileName));
}
}
}
@@ -13,29 +13,21 @@
<div class="text-right">{{error}}</div>
<i @click="onClick" class="fa fa-info-circle"></i>
<!-- <header>
<span>{{title}}</span>
<button class="btn" @click="onClick()"><i class="fa fa-arrow-right"></i></button>
</header>
<section @click="onClick()">
<img :src="imgSource" alt="">
</section> -->
</div>
<!-- </div> -->
</template>
<script>
export default {
props:{
code: {default: "E23"},
title: {default: "Utensile ABC"},
error: {default: "Non presente in macchina"},
imgSource: {default:"../assets/icons/Tools/Saw.png"}
},
methods:{
onClick: function(){
this.$emit("click");
}
props: {
code: { default: "E23" },
title: { default: "Utensile ABC" },
error: { default: "Non presente in macchina" },
imgSource: { default: "../assets/icons/Tools/Saw.png" }
},
methods: {
onClick: function() {
this.$emit("click");
}
}
}
};
</script>
@@ -16,7 +16,10 @@ import MaintenanceProgress from "./maintenance-progress.vue";
import LoadDepot from "./load-depot.vue";
import CreateMaintenance from "../create-maintenance.vue";
import ModalIframe from "./modal-iframe.vue";
import ModalImage from "./modal-image.vue";
import ModalAddOffsetTool from "./modal-add-offset-tool.vue";
import ModalMissingTools from "./modal-missing-tools.vue";
import ModalJobAddParameter from "./modal-job-add-parameter.vue";
export {
@@ -38,5 +41,8 @@ export {
LoadDepot,
CreateMaintenance,
ModalIframe,
ModalAddOffsetTool
ModalImage,
ModalAddOffsetTool,
ModalMissingTools,
ModalJobAddParameter
};
@@ -5,8 +5,14 @@
<label>{{'load_depot_lbl_select' | localize("Seleziona l'utensile da aggiungere")}}</label>
<div class="load-depot-box-select">
<input-box type="select" :title="'load_depot_select_title' | localize('Utensile')" v-model="toolSelected">
<option v-for="s in availableMultiTools" :key="s.id" :value="s">{{s.name}} - {{'tooling_shank_abbreviation' | localize('S%d',s.id)}}</option>
<option v-for="s in availableTools" :key="s.id" v-if="isPositionCompatible(s)" :value="s">{{s.familyName}} - {{'tooling_tool_abbreviation' | localize('T%d',s.id)}}</option>
<option v-if="isSiemens()" v-for="s in availableMultiTools" :key="s.id" :value="s">{{s.name}} - {{'tooling_shank_abbreviation' | localize('S%d',s.id)}}</option>
<option v-if="isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{s.familyName}} - {{'tooling_tool_abbreviation' | localize('T%d',s.id)}}
</option>
<option v-if="!isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{calcItemName(s)}}
</option>
</input-box>
<!-- <select>
</select> -->
@@ -44,12 +50,18 @@ export default {
return this.$store.state.depot.availableMultiTool;
},
availableTools: function(){
return this.$store.state.depot.availableTool;
}
if(this.isSiemens())
return this.$store.state.depot.availableTool;
else
return this.$store.state.depot.ncAvailableShank;
}
},
mounted: function(){
this.$nextTick(function(){
new DepotService().GetToolAvailable();
if(this.isSiemens())
new DepotService().GetToolAvailable();
else
new DepotService().GetNcToolAvailable();
})
},
@@ -58,6 +70,9 @@ export default {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
},
isSiemens: function(){
return this.$store.state.machineInfo.isSiemens;
},
isPositionCompatible(tool){
return (this.$store.getters).positionCompatible(tool.id,ModalHelper.loadDepotModal.positionType);
},
@@ -69,6 +84,24 @@ export default {
ModalHelper.HideModal();
});
console.log(this.toolSelected);
},
calcItemName(shank){
if(shank.childsTools && shank.childsTools.length > 1)
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d', shank.id);
else
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d',shank.childsTools[0].id) + " - " + this.calcFamilyName(shank.childsTools[0].id);
},
familyNameFromId(id){
var found = this.$store.state.tooling.ncFamilies.find(k => k.id == id);
if(found)
return found.name;
return '';
},
calcFamilyName(id){
if(this.$store.state.tooling.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
}
}
};
@@ -2,21 +2,18 @@ import Vue from "vue";
import Component from "vue-class-component";
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper";
import { Factory, MessageService,awaiter } from "../../_base";
// import { MaintenanceService } from "../services/maintenanceService";
// import { store } from "src/store";
// import { maintenanceActions } from "../store/maintenance.store";
import { Factory, MessageService, awaiter } from "../../_base";
import moment from "moment";
import cardFolderPath from "./cards/card-folder-path.vue";
import cardElementQueue from "./cards/card-element-queue.vue";
import * as iziToast from "izitoast";
import { fileService } from "../../services/fileService";
import ModalEditJob from "./modal-edit-job.vue";
declare var cmsClient: any;
interface PathInfo {
Name: string;
AbsolutePath: string;
@@ -31,6 +28,7 @@ interface FileInfo {
LastModDate: string;
Content: Array<any>;
PreviewBase64: any;
IsJob: boolean;
}
@Component({
@@ -65,41 +63,6 @@ export default class ModalAddElementQueue extends Vue {
}
}
// async navigateTo(
// path: string,
// absolutePath: string,
// local: boolean,
// todepth: number,
// fromdepth: number
// ) {
// debugger
// this.currentPath = absolutePath;
// this.lastClickPath = absolutePath;
// this.checkChangeNavigationType(local);
// var files = await this.getFilesForPath(absolutePath, path, local);
// // controlla se impostare il currentDrive
// if (fromdepth == 0) this.currentDrive = absolutePath;
// // controlla come organizzare le colonne.
// if (this.navigationDepth == 2 && todepth == 2 && fromdepth == 2) {
// this.fillArray(this.firstColumnData, this.secondColumnData);
// }
// this.navigationDepth = todepth;
// if (todepth == 1) {
// this.fillArray(this.firstColumnData, files);
// this.secondColumnData.splice(0, this.secondColumnData.length);
// this.currentFilterFirst = "";
// this.selectedFile = null;
// }
// if (todepth == 2) {
// this.fillArray(this.secondColumnData, files);
// this.currentFilterSecond = "";
// }
// this.calcBreadCrumb(absolutePath);
// }
async navigateTo(
path: string,
@@ -108,8 +71,8 @@ export default class ModalAddElementQueue extends Vue {
todepth: number,
fromdepth: number
) {
if(!absolutePath){
if (!absolutePath) {
absolutePath = path;
}
this.currentPath = absolutePath;
@@ -161,36 +124,38 @@ export default class ModalAddElementQueue extends Vue {
async getFilesForPath(absolutePath: string, path: string, local: boolean): Promise<Array<any>> {
this.isLocalNavigation = local;
var result = null;
console.log(path);
if (local) result = JSON.parse(cmsClient.getFileList(absolutePath));
else result = await awaiter(fileService.getFiles(path));
else result = await awaiter(fileService.getFiles(path));
debugger
return this.toUpperCaseModel(result).sort(this.compareDirectoriesFirst);
}
private compareDirectoriesFirst(x,y){
return (x.IsDirectory === y.IsDirectory)? 0 : x.IsDirectory? -1 : 1;
private compareDirectoriesFirst(x, y) {
return (x.IsDirectory === y.IsDirectory) ? 0 : x.IsDirectory ? -1 : 1;
}
toUpperCaseModel(data: Array<any>): Array<PathInfo> {
console.log(data)
return data.map(i => {
return {
Name: i.name || i.Name,
AbsolutePath: i.absolutePath || i.AbsolutePath,
Path: i.path || i.Path,
IsDirectory: (i.isDirectory != null && i.isDirectory) || (i.IsDirectory != null && i.IsDirectory)
IsDirectory: (i.isDirectory != null && i.isDirectory) || (i.IsDirectory != null && i.IsDirectory),
};
});
}
calcBreadCrumb(path: string) {
this.breadcrumbs.splice(0, this.breadcrumbs.length);
if (path && path.startsWith("\\\\")) {
this.breadcrumbs.push({
name: "CN",
path: "\\\\"
});}
this.breadcrumbs.push({
name: "CN",
path: "\\\\"
});
}
if (path) {
var fragments = path.split("\\");
var __p = "";
@@ -217,11 +182,12 @@ export default class ModalAddElementQueue extends Vue {
CreationDate: data.creationDate || data.CreationDate,
LastModDate: data.lastModDate || data.LastModDate,
Name: data.name || data.Name,
PreviewBase64: data.previewBase64 || data.PreviewBase64
PreviewBase64: data.previewBase64 || data.PreviewBase64,
IsJob: data.isJob || data.IsJob
} as FileInfo;
}
async fileInfo(str, fromdepth: number) {
async fileInfo(str, fromdepth: number, isJob: boolean = null) {
this.lastClickPath = str;
if (fromdepth == 1)
this.secondColumnData.splice(0, this.secondColumnData.length);
@@ -234,6 +200,9 @@ export default class ModalAddElementQueue extends Vue {
if (!this.isLocalNavigation)
this.selectedFile = this.toUpperCaseFileModel(
await awaiter(fileService.getFileInfo(str)));
if (this.selectedFile && isJob != null)
this.selectedFile.IsJob = isJob;
}
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
@@ -247,10 +216,17 @@ export default class ModalAddElementQueue extends Vue {
return moment(date).format("L");
}
async load(item: FileInfo) {
if (item.IsJob)
this.loadJob(item.AbsolutePath);
else
this.loadProgram(item.AbsolutePath);
}
async loadProgram(path: string) {
if (this.isLocalNavigation && typeof cmsClient != "undefined") {
var resp = cmsClient.uploadAndAddToQueue(path, 1);
if(resp != "")
if (resp != "")
(iziToast as any).error({
title: resp.split(";")[0],
message: resp.split(";")[1],
@@ -262,10 +238,17 @@ export default class ModalAddElementQueue extends Vue {
else
this.close();
}
}
// if (!this.isLocalNavigation) {
// await awaiter(fileService.activateProgram(path));
// this.close();
// }
async loadJob(path: string) {
var jobMetadata = JSON.parse(cmsClient.readJobMetadata(path));
var result = await ModalHelper.ShowModalAsync(ModalEditJob, jobMetadata);
if (result) {
cmsClient.updateJobMetadata(path, JSON.stringify(result));
}
}
}
@@ -41,7 +41,7 @@
:selected="isInPath(val.AbsolutePath) || val.AbsolutePath == lastClickPath"
:withArrow="val.IsDirectory == true"
:iconType="val.IsDirectory? 'FOLDER':'FILE'"
@click="val.IsDirectory ? navigateTo(val.Path, val.AbsolutePath, isLocalNavigation, 2,1): fileInfo(val.AbsolutePath,1)"></card-folder-path>
@click="val.IsDirectory ? navigateTo(val.Path, val.AbsolutePath, isLocalNavigation, 2,1): fileInfo(val.AbsolutePath,1, val.IsJob)"></card-folder-path>
</div>
</div>
<div class="third-column" v-if="navigationDepth <2"></div>
@@ -63,7 +63,7 @@
:selected="isInPath(val.AbsolutePath) || val.AbsolutePath == lastClickPath"
:withArrow="val.IsDirectory == true"
:iconType="val.IsDirectory? 'FOLDER':'FILE'"
@click="val.IsDirectory? navigateTo(val.Path, val.AbsolutePath, isLocalNavigation, 2,2):fileInfo(val.AbsolutePath,2) "></card-folder-path>
@click="val.IsDirectory? navigateTo(val.Path, val.AbsolutePath, isLocalNavigation, 2,2):fileInfo(val.AbsolutePath,2, val.IsJob) "></card-folder-path>
<!-- <card-folder-path name="Cliente A" @click="selectItem()" :with-arrow="false"></card-folder-path>-->
</div>
</div>
@@ -71,7 +71,7 @@
<div class="selected-item-header">
<div>
<label class="selected-item-title">{{selectedFile.Name}}</label>
<div class="subtitle">
<label class="title">{{'modal_add_element_queue_creation_date' | localize("Creation Date:")}}</label>
<label class="text">{{getDate(selectedFile.CreationDate)}}</label>
@@ -105,19 +105,13 @@
</div>
</div>
<div class="modal-add-element-queue-footer">
<!-- <button class="btn btn-success"
:disabled="!selectedFile || !isCnReady()"
v-if="!this.isLocalNavigation"
@click="loadProgram(selectedFile.AbsolutePath)">
{{'modal_add_element_queue_btn_load_program' | localize('Attiva programma')}}
</button> -->
<button class="btn btn-success"
:disabled="!selectedFile || !isCnReady()"
v-if="this.isLocalNavigation"
@click="loadProgram(selectedFile.AbsolutePath)">
@click="load(selectedFile)">
{{'modal_add_element_queue_btn_upload_program' | localize('Aggiungi elemento')}}
</button>
</div>
</modal>
</template>
<script src="./modal-add-element-queue.ts" lang="ts"></script>
<script src="./modal-add-element-queue.ts" lang="ts"></script>
@@ -11,8 +11,8 @@
</div>
<div class="modal-add-offset-tool-footer">
<div class="group-btn">
<button class="btn">Annulla</button>
<button class="btn btn-success" @click="addOffsetToTool(posSelected,offsetSelected)">Aggiungi</button>
<button class="btn">{{'modal_add_offset_tool_cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="addOffsetToTool(posSelected,offsetSelected)">{{'modal_add_offset_tool_add' | localize("Aggiungi")}}</button>
</div>
</div>
</modal>
@@ -11,7 +11,9 @@ export default {
},
data: function () {
return {
currentView: null
currentView: null,
deferred: null,
model: null,
};
},
created() {
@@ -20,6 +22,10 @@ export default {
if (this.informHmi)
Factory.Get(MessageService).publishToChannel("HMI-show-modal");
this.currentView = args[0];
if (args[1])
this.deferred = args[1];
if (args[2])
this.model = args[2];
});
Factory.Get(MessageService).subscribeToChannel("hide-" + this.containerName, args => {
@@ -1,7 +1,7 @@
<template>
<transition v-if="isVisible" name="modal">
<div class="backdrop" :class="{'internal':!informHmi}">
<component v-bind:is="currentView">
<component v-bind:is="currentView" :deferred="deferred" v-model="model">
</component>
</div>
</transition>
@@ -0,0 +1,59 @@
import Vue from "vue";
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper";
import { Factory, MessageService } from '../../_base';
import { tool } from "src/modules/base-components/cards";
import { inputBox } from "src/modules/base-components/cards";
import Component from "vue-class-component";
import { Prop } from "vue-property-decorator";
import { Deferred } from "../../services/Deferred";
import { AppModel } from "src/store";
@Component({
components: {
modal: Modal, tool, inputBox
}
})
export default class ModalEditJob extends Vue {
@Prop()
deferred: Deferred<any>;
@Prop()
value: any;
get ncTools(): server.ToolNc[] { return (this.$store.state as AppModel).tooling.ncTools; }
get jobTools() {
var $this = this;
debugger
return this.value.metadata.tools.map(t => $this.ncTools.find(i => i.id == t));
}
get title() {
return this.$options.filters.localize('modal_edit_job_title_window', 'Setup di ') + this.value.name;
}
selectedTab = "ParBase";
selectedNumber = 0;
close() {
if (this.deferred) this.deferred.reject();
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
confirm() {
if (this.deferred) this.deferred.resolve(this.value);
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
selectTab(value) {
this.selectedTab = value;
}
selectNumber(value) {
this.selectedNumber = value;
}
};
@@ -1,77 +1,80 @@
<template>
<modal type="modal-edit-job" :title="'modal_edit_job_title_window' | localize('Setup di Job 1')">
<modal type="modal-edit-job" :title="title">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<div class="modal-edit-job-body">
<div class="tab-box">
<div class="tab-box-scroll">
<button class="tab" :class="{'active': selectedTab == 'ParBase'}" @click="selectTab('ParBase')">
<span>Parametri di base</span>
<span>{{'modal_edit_job_tab_basic_parameter' | localize("Parametri di base")}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Utensili'}" @click="selectTab('Utensili')">
<span>Utensili</span>
<span>{{'modal_edit_job_tab_tools' | localize("Utensili")}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Parametri'}" @click="selectTab('Parametri')">
<span>Parametri</span>
<span>{{'modal_edit_job_tab_parameters' | localize("Parametri")}}</span>
</button>
<button class="tab" :class="{'active': selectedTab == 'Tempi'}" @click="selectTab('Tempi')">
<span>Tempi</span>
<button class="tab" :class="{'active': selectedTab == 'Tempi'}" @click="selectTab('Tempi')" v-if="false">
<span>{{'modal_edit_job_tab_times' | localize("Tempi")}}</span>
</button>
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'ParBase'">
<div class="box-image">
<img src="assets/images/job_poduction_image.png">
<img :src="value.metadata.generics.images[selectedNumber].base64" v-if="value.metadata.generics.images[selectedNumber]">
<div class="linenumber">
<div v-for="n in 5" :key="n"><button :class="{'target': n == selectedNumber}" @click="selectNumber(n)">{{n}}</button></div>
<div v-for="(n,i) in value.metadata.generics.images" :key="i"><button :class="{'target': i == selectedNumber}" @click="selectNumber(i)">{{i+1}}</button></div>
</div>
</div>
<div class="box-text">
<div class="title">
<label>Descrizione</label>
</div>
<div class="text">
<span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
</span>
<label>{{'modal_edit_job_box_title' | localize("Descrizione")}}</label>
</div>
{{value.metadata.generics.description}}
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'Utensili'">
<div class="box-tag-tool">
<tool class="tag-tool-first" code="E23" title="Utensile ABC" img-source="../assets/icons/Tools/Tools.png"></tool>
<tool v-for="t in jobTools"
v-if="t"
:key="t.id"
:code="'jobeditor_tool_abbreviation' | localize('T%d',t.id)"
:title="t.familyId" img-source="../assets/icons/Tools/Shanks.png"></tool>
<!-- <tool class="tag-tool-first" code="E23" title="Utensile ABC" img-source="../assets/icons/Tools/Tools.png"></tool>
<tool code="E12" title="Utensile XYZ" img-source="../assets/icons/Tools/Saw.png"></tool>
<tool code="E43" title="Utensile AAA" img-source="../assets/icons/Tools/Saw.png"></tool>
<tool code="E43" title="Utensile AAA" img-source="../assets/icons/Tools/Saw.png"></tool> -->
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'Parametri'">
<div class="box-tag-params">
<input-box class="tag-params-first" title="Posizione in coda" type="increment-number"></input-box>
<input-box title="Posizione in coda" type="increment-number"></input-box>
<input-box title="Posizione in coda" type="increment-number"></input-box>
<input-box title="Posizione in coda" type="increment-number"></input-box>
<input-box v-for="c in value.metadata.customs" v-model="c.value" :key="c.name" :title="c.name" :type="c.type.toLowerCase()">
<option v-if="c.type && c.type.toLowerCase() == 'select'" v-for="(s, k) in c.selectionList" :key="k" :value="s">
<div>{{s}}</div>
</option>
</input-box>
</div>
</div>
<div class="modal-edit-job-box" v-if="selectedTab == 'Tempi'">
<div class="box-tag-times">
<div class="row-time">
<div class="box-time-to-use">
<label>Tempo da utilizzare</label>
<label>{{'modal_edit_job_box_time' | localize("Tempo da utilizzare")}}</label>
<input type="text" />
</div>
<div class="box-time-average-time">
<label>Tempo medio</label>
<label>{{'modal_edit_job_average_time' | localize("Tempo medio")}}</label>
<span>00 : 23' : 12"</span>
</div>
</div>
<div class="box-history-time">
<div class="box-history-time-title">
<label>Storico tempi</label>
<label>{{'modal_edit_job_historical_times' | localize("Storico tempi")}}</label>
</div>
<table>
<thead>
<tr>
<tr>
<th>{{'modal_edit_job_table_selection' | localize("Selezione")}}</th>
<th>{{'modal_edit_job_table_date' | localize("Data")}}</th>
<th>{{'modal_edit_job_table_start_time' | localize("Ora inizio")}}</th>
@@ -124,39 +127,10 @@
</div>
<div class="modal-edit-job-footer">
<div class="group-btn">
<button class="btn">Annulla</button>
<button class="btn btn-success">Carica</button>
<button class="btn" @click="close()">{{'modal_edit_job_btn_cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="confirm()">{{'modal_edit_job_btn_load' | localize("Carica")}}</button>
</div>
</div>
</modal>
</template>
<script>
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
import { tool } from "src/modules/base-components/cards";
import { inputBox } from "src/modules/base-components/cards";
export default {
components:{
modal: Modal, tool, inputBox
},
data: function(){
return {
selectedTab: "ParBase",
selectedNumber: 3
}
},
methods:{
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
},
selectTab(value){
this.selectedTab = value;
},
selectNumber(value){
this.selectedNumber = value;
}
}
};
</script>
<script src="./modal-edit-job.ts" lang="ts"></script>
@@ -0,0 +1,34 @@
<template>
<modal type="modal-image" :title="title">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<img id="imagecontainer" :src="this.content" />
<!-- <img :src="content" /> -->
</modal>
</template>
<script>
import Modal from "./modal.vue";
import { ModalHelper } from "./ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
export default {
components: { modal: Modal },
data: function(){
return{
content: "",
title: ""
}
},
mounted(){
this.content = ModalHelper.modalImage.content;
this.title = ModalHelper.modalImage.title;
},
methods:{
close(){
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
}
};
</script>
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->
@@ -0,0 +1,55 @@
import Vue from "vue";
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper";
import { Factory, MessageService } from '../../_base';
import Component from "vue-class-component";
import { Deferred } from "src/services/Deferred";
import { Prop } from "vue-property-decorator";
@Component({
components: {
modal: Modal
}
})
export default class ModalJobAddParameter extends Vue {
@Prop()
deferred: Deferred<{ name: string, Type: string, selectionList: Array<any> }>
@Prop()
value: any;
selectionList = [];
parameter: any = {
Type: "string",
name: null
};
mounted() {
if (this.value)
this.parameter = this.value;
}
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
addElementList() {
this.selectionList.push({ name: null });
}
removeItemFromList(item) {
var idx = this.selectionList.indexOf(item);
if (idx >= 0)
this.selectionList.splice(idx, 1);
}
confirm(param, selectionList) {
this.parameter.selectionList = selectionList;
if (this.deferred)
this.deferred.resolve(param);
this.close();
}
}
@@ -4,68 +4,55 @@
<div class="job-add-parameter-body">
<div class="box">
<div class="box-title">
<label>Nome parametro</label>
<label>{{'modal_job_add_parameter_title_name_parameter' | localize('Nome parametro')}}</label>
</div>
<div class="control">
<input type="text" />
<input type="text" v-model="parameter.Name" />
</div>
</div>
<div class="box">
<div class="box-title">
<label>Tipo di controllo</label>
<label>{{'modal_job_add_parameter_type_control' | localize('Tipo di controllo')}}</label>
</div>
<div class="control">
<select>
<option>ON/OFF</option>
<option>Lista di elementi</option>
<select v-model="parameter.Type">
<option value="string">{{'modal_job_add_parameter_type_text' | localize('Testo')}}</option>
<option value="int">{{'modal_job_add_parameter_type_number' | localize('Numeri')}}</option>
<option value="boolean">{{'modal_job_add_parameter_type_on_off' | localize('ON/OFF')}}</option>
<option value="select">{{'modal_job_add_parameter_type_select' | localize('Lista di elementi')}}</option>
</select>
</div>
</div>
<div class="items-list">
<div class="items-list" v-if="parameter.Type == 'select'">
<div class="title">
<label>Elementi della lista</label>
<label>{{'modal_job_add_parameter_list_items' | localize('Elementi della lista')}}</label>
</div>
<div class="group-item">
<div class="item">
<div class="number">
1
</div>
<div class="input-text-box">
<input type="text">
</div>
<div class="group-button">
<button class="btn" v-if="true"><i class="fa fa-pencil-square-o"></i></button>
<button class="btn" v-if="false"><i class="fa fa-check"></i></button>
<button class="btn" style="padding: 0 15px;"><i class="fa fa-trash"></i></button>
<div class="items">
<div class="group-item" v-for="(t,k) in selectionList" :key="k">
<div class="item">
<div class="number">
{{k}}
</div>
<div class="input-text-box">
<input type="text" v-model="t.name">
</div>
<div class="group-button">
<button class="btn" style="padding: 0 15px;" @click="removeItemFromList(t)"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
</div>
<div class="add-item">
<button class="btn"><i class="fa fa-plus"></i></button>
<button class="btn" @click="addElementList()"><i class="fa fa-plus"></i></button>
</div>
</div>
</div>
<div class="job-add-parameter-footer">
<div class="job-add-param-button">
<button class="btn">Annulla</button>
<button class="btn btn-success">Conferma</button>
<button class="btn" @click="close()">{{'modal_job_add_parameter_btn_cancel' | localize('Annulla')}}</button>
<button class="btn btn-success" @click="confirm(parameter, selectionList)">{{'modal_job_add_parameter_btn_confirm' | localize('Conferma')}}</button>
</div>
</div>
</modal>
</template>
<script>
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
export default {
components:{
modal: Modal
},
methods:{
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
},
}
};
</script>
<script src="./modal-job-add-parameter.ts" lang="ts"></script>
@@ -2,7 +2,7 @@ import Vue from "vue";
import Component from "vue-class-component";
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper";
import { Factory, MessageService,awaiter } from "../../_base";
import { Factory, MessageService, awaiter } from "../../_base";
// import { MaintenanceService } from "../services/maintenanceService";
// import { store } from "src/store";
// import { maintenanceActions } from "../store/maintenance.store";
@@ -31,6 +31,7 @@ interface FileInfo {
LastModDate: string;
Content: Array<any>;
PreviewBase64: any;
IsJob: boolean;
}
@Component({
@@ -121,24 +122,24 @@ export default class ModalLoadProgram extends Vue {
async getFilesForPath(absolutePath: string, path: string, local: boolean): Promise<Array<any>> {
this.isLocalNavigation = local;
var result = null;
console.log(path);
if (local) result = JSON.parse(cmsClient.getFileList(absolutePath));
else result = await awaiter(fileService.getFiles(path));
else result = await awaiter(fileService.getFiles(path));
return this.toUpperCaseModel(result).sort(this.compareDirectoriesFirst);
}
private compareDirectoriesFirst(x,y){
return (x.IsDirectory === y.IsDirectory)? 0 : x.IsDirectory? -1 : 1;
private compareDirectoriesFirst(x, y) {
return (x.IsDirectory === y.IsDirectory) ? 0 : x.IsDirectory ? -1 : 1;
}
toUpperCaseModel(data: Array<any>): Array<PathInfo> {
console.log(data)
return data.map(i => {
return {
Name: i.name || i.Name,
AbsolutePath: i.absolutePath || i.AbsolutePath,
Path: i.path || i.Path,
IsDirectory: (i.isDirectory != null && i.isDirectory) || (i.IsDirectory != null && i.IsDirectory)
IsDirectory: (i.isDirectory != null && i.isDirectory) || (i.IsDirectory != null && i.IsDirectory)
};
});
}
@@ -146,10 +147,11 @@ export default class ModalLoadProgram extends Vue {
calcBreadCrumb(path: string) {
this.breadcrumbs.splice(0, this.breadcrumbs.length);
if (path.startsWith("\\\\")) {
this.breadcrumbs.push({
name: "CN",
path: "\\\\"
});}
this.breadcrumbs.push({
name: "CN",
path: "\\\\"
});
}
if (path) {
var fragments = path.split("\\");
var __p = "";
@@ -176,7 +178,8 @@ export default class ModalLoadProgram extends Vue {
CreationDate: data.creationDate || data.CreationDate,
LastModDate: data.lastModDate || data.LastModDate,
Name: data.name || data.Name,
PreviewBase64: data.previewBase64 || data.PreviewBase64
PreviewBase64: data.previewBase64 || data.PreviewBase64,
IsJob: data.isJob || data.IsJob
} as FileInfo;
}
@@ -184,7 +187,7 @@ export default class ModalLoadProgram extends Vue {
this.lastClickPath = str;
if (fromdepth == 1)
this.secondColumnData.splice(0, this.secondColumnData.length);
debugger
if (this.isLocalNavigation && typeof cmsClient != "undefined")
this.selectedFile = this.toUpperCaseFileModel(
JSON.parse(cmsClient.getProgramInfo(str))
@@ -206,10 +209,18 @@ export default class ModalLoadProgram extends Vue {
return moment(date).format("L");
}
async load(item: FileInfo) {
debugger
if (item.IsJob)
this.loadJob(item.AbsolutePath);
else
this.loadProgram(item.AbsolutePath);
}
async loadProgram(path: string) {
if (this.isLocalNavigation && typeof cmsClient != "undefined") {
var resp = cmsClient.uploadAndActivateProgram(path);
if(resp != "")
if (resp != "")
(iziToast as any).error({
title: resp.split(";")[0],
message: resp.split(";")[1],
@@ -227,4 +238,12 @@ export default class ModalLoadProgram extends Vue {
this.close();
}
}
async loadJob(path: string) {
var jobMetadata = cmsClient.readJobMetadata(path);
// var result = await ModalHelper.ShowModalAsync(, jobMetadata);
}
}
@@ -57,7 +57,7 @@
<i class="fa fa-2x fa-search"></i>
</div>
<div class="label-folder-empty" v-if="secondColumnData.length ==0">
<label>Cartella vuota</label>
<label>{{'modal_load_program_empty_folder' | localize("Cartella vuota")}}</label>
</div>
<div class="content scrollable" v-if="secondColumnData.length >0">
<card-folder-path v-for="val in (this.secondColumnData.filter(t => t.Name.toLowerCase().indexOf(currentFilterSecond.toLowerCase()) >=0))"
@@ -76,7 +76,7 @@
<div class="selected-item-header">
<div>
<label class="selected-item-title">{{selectedFile.Name}}</label>
<div class="subtitle">
<label class="title">{{'modal_load_program_creation_date' | localize("Creation Date:")}}</label>
<label class="text">{{getDate(selectedFile.CreationDate)}}</label>
@@ -113,13 +113,13 @@
<button class="btn btn-success"
:disabled="!selectedFile || !isCnReady()"
v-if="!this.isLocalNavigation"
@click="loadProgram(selectedFile.AbsolutePath)">
@click="load(selectedFile)">
{{'modal_load_program_btn_load_program' | localize('Attiva programma')}}
</button>
<button class="btn btn-success"
:disabled="!selectedFile || !isCnReady()"
v-if="this.isLocalNavigation"
@click="loadProgram(selectedFile.AbsolutePath)">
@click="load(selectedFile)">
{{'modal_load_program_btn_upload_program' | localize('Carica e attiva programma')}}
</button>
</div>
@@ -0,0 +1,41 @@
import Vue from "vue";
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components";
import { Factory, MessageService } from '../../_base';
import missingTool from "src/modules/base-components/cards/missing-tool.vue";
import Component from "vue-class-component";
import { Deferred } from "../../services/Deferred";
import { Prop } from "vue-property-decorator";
import { relativeTimeThreshold } from "moment";
@Component({
components: {
modal: Modal, missingTool
}
})
export default class ModalMissingTools extends Vue {
@Prop()
deferred: Deferred<any>;
get avaiableTools() { return ModalHelper.avaiableTools; }
get currentJob() { return ModalHelper.job; }
selectedTool: any = null;
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
};
selectTool(tool) {
this.selectedTool = tool;
};
async loadToJob(tool) {
if (this.deferred) this.deferred.resolve(tool);
this.close();
}
};
@@ -4,42 +4,21 @@
<div class="modal-missing-tools-body scrollable">
<div class="modal-missing-tools-box">
<div class="title">
<label>Magazzini</label>
<span>I seguenti utensili necessari per la lavorazione non sono presenti in macchina</span>
<label>{{'modal_missing_tools_depot' | localize('Magazzini')}}</label>
<span>{{'modal_missing_tools_description_depot' | localize('I seguenti utensili necessari per la lavorazione non sono presenti in macchina')}}</span>
</div>
<div class="box-missing-tools">
<missing-tool></missing-tool>
<missing-tool></missing-tool>
<missing-tool :class="{'selected': selectedTool == t}" v-for="(t,k) in avaiableTools" :key="k" :code="'jobeditor_tool_abbreviation' | localize('T%d',t.id)" :title="t.familyId" @click.native="selectTool(t)"></missing-tool>
</div>
</div>
</div>
<div class="modal-missing-tools-footer">
<div class="group-btn">
<button class="btn">Ignora</button>
<button class="btn btn-success">Carica</button>
<button class="btn" @click="close()">{{'modal_missing_tools_cancel' | localize('Ignora')}}</button>
<button class="btn btn-success" @click="loadToJob(selectedTool)">{{'modal_missing_tools_load' | localize('Carica')}}</button>
</div>
</div>
</modal>
</template>
<script>
import Modal from "src/modules/base-components/modal.vue";
import { ModalHelper } from "src/modules/base-components/ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
import missingTool from "src/modules/base-components/cards/missing-tool.vue";
export default {
components:{
modal: Modal, missingTool
},
data: function(){
return {
}
},
methods:{
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
}
};
</script>
<script src="./modal-missing-tools.ts" lang="ts">
</script>
+1 -1
View File
@@ -7,7 +7,7 @@
<i class="fa fa-refresh fa-spin" v-if="isActive"></i>
</span>
<span class="process" :title="'heads_tooltip_process' | localize('Nc-Process Owner')">
P{{process}}
{{'heads_tooltip_process_letter_p' | localize('P')}}{{process}}
</span>
</header>
<div>
+2 -2
View File
@@ -66,11 +66,11 @@
</section>
<div class="box-select" v-if="enableSelected">
<div class="count-selected">
<label>{{countSelected}} elementi/o selezionati/o</label>
<label>{{countSelected}} {{'plc_softkeys_item_selected' | localize("elementi/o selezionati/o")}}</label>
</div>
<div class="group-btn">
<!-- <button v-if="!enableSelected" class="btn" @click="enableSelect()">Abilita selezione</button> -->
<button v-if="enableSelected" class="btn" @click="addItemsToFavorites()">Termina selezione</button>
<button v-if="enableSelected" class="btn" @click="addItemsToFavorites()">{{'plc_softkeys_close_selection' | localize("Termina selezione")}}</button>
</div>
</div>
</div>
+11
View File
@@ -0,0 +1,11 @@
export class Deferred<T> {
resolve: Function;
reject: Function;
promise: Promise<T>;
constructor() {
this.promise = new Promise<T>((res, rej) => {
this.resolve = res;
this.reject = rej;
});
}
}
+21 -11
View File
@@ -12,7 +12,17 @@ export class FileService extends baseRestService {
}
async getFileInfo(path: string) {
var result = await this.Get<any>(this.BASE_URL + "file/info", true, {
var result = await this.Get<any>(this.BASE_URL + "file/info", true, {
filePath: path
});
result.AbsolutePath = path;
return result;
}
async getActiveFileInfo(path: string) {
var result = await this.Get<any>(this.BASE_URL + "file/active/info", true, {
filePath: path
});
@@ -29,37 +39,37 @@ export class FileService extends baseRestService {
return await this.Put<any>(this.BASE_URL + "file/deactivate", null);
}
async deleteQueue(processId){
async deleteQueue(processId) {
var result = await this.Delete<any>(this.BASE_URL + "queue/" + processId + "/empty", true);
productionActions.deletePartPrograms(store);
return result;
}
async deleteItemQueue(processId, model){
async deleteItemQueue(processId, model) {
var result = await this.Delete<any>(this.BASE_URL + "queue/" + processId + "/remove/" + model.id, true);
productionActions.deletePartProgram(store,model);
productionActions.deletePartProgram(store, model);
return result;
}
async moveItemsQueue(processId, position, model){
async moveItemsQueue(processId, position, model) {
productionActions.movePartProgram(store, { model, position });
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/move", position, true);
model = result;
productionActions.movePartProgram(store,{model,position});
// productionActions.movePartProgram(store, { model: result, position });
return result;
}
async startQueue(processId){
async startQueue(processId) {
var result = await this.Post<any>(this.BASE_URL + "queue/start?processId=" + processId, null);
return result;
}
async stopQueue(processId){
async stopQueue(processId) {
var result = await this.Post<any>(this.BASE_URL + "queue/stop?processId=" + processId, null);
return result;
}
async changeReps(processId,model){
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/edit/" + model.id, {reps: model.reps});
async changeReps(processId, model) {
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/edit/" + model.id, { reps: model.reps });
productionActions.updatePartProgram(store, result);
return result;
}

Some files were not shown because too many files have changed in this diff Show More