Fix siemens tool

Osai fix
This commit is contained in:
Lucio Maranta
2019-04-08 17:25:57 +02:00
parent f475cff913
commit 5fb8e1b4e9
5 changed files with 20 additions and 11 deletions
+4 -5
View File
@@ -703,14 +703,14 @@ public static class ThreadsFunctions
// Try connection
CmsError libraryError = ncHandler.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncHandler.numericalControl.NC_IsConnected())
if (ncHandler.numericalControl.NC_IsConnected())
{
// Read data
libraryError = ncHandler.UpdateQueue();
@@ -877,7 +877,7 @@ public static class ThreadsFunctions
if (m154.Parameters[0] == "MTC")
{
// Convert tag string in Pascal Case and add to result string
switch (m154.Parameters[1].ToLower())
switch (m154.Parameters[1].ToLower())
{
case "currprog":
stringVal += "CurrProg";
@@ -902,7 +902,7 @@ public static class ThreadsFunctions
string outputFileName = ServerStartupConfig.MTCFolderPath + "\\DATA\\CmsGeneralStatus.mtc";
// Create file if not exits
if (!File.Exists(outputFileName))
using (var f = File.Create(outputFileName)) { };
using (var f = File.Create(outputFileName)) { };
// Read file
List<string> fileLines = File.ReadAllLines(outputFileName).ToList();
string[] parametersInLine;
@@ -931,7 +931,6 @@ public static class ThreadsFunctions
}
}
}
}
else
RestoreConnection();
+1 -1
View File
@@ -242,7 +242,7 @@ namespace Step.Controllers.WebApi
}
}
[Route("queue/{processId:int}/edit/{itemId:int}"), HttpPut]
[Route("queue/{processId:int}/edit/{itemId:int}"), HttpPut]
public IHttpActionResult EditQueueItem(int processId, int itemId, RepsModel reps)
{
using (NcFileHandler ncHandler = new NcFileHandler())
@@ -323,6 +323,7 @@ export default class toolingEquipment extends Vue {
else {
this.fieldTool(newTool);
this.selectedTool = Object.assign({}, newTool)
this.copySelectedTool = null
this.enableToolModify = true
this.enableOffsets = false
this.enableParameters = true
@@ -428,10 +429,13 @@ export default class toolingEquipment extends Vue {
}
public cancel = function () {
debugger
if(this.isSiemens){
if (this.copySelectedTool) {
this.selectedTool = Object.assign({},this.copySelectedTool);
toolingActions.updateTool(store, this.copySelectedTool);
} else {
this.selectedTool = null;
}
}
else{
@@ -440,7 +444,7 @@ export default class toolingEquipment extends Vue {
toolingActions.updateNcTool(store, this.copySelectedTool);
}
}
if (!this.selectedTool || !this.selectedTool.id) {
this.selectedTool = null;
} else {
@@ -473,6 +477,8 @@ public isEquipmentSelected(offset){
}
public cancelOffsetTab = function () {
console.log("OFFSET")
debugger
if(this.copySelectedTool && this.selectedTool.id > 0){ // Useless?
this.selectedTool = Object.assign({},this.copySelectedTool);
toolingActions.updateNcTool(store, this.selectedTool);
@@ -740,6 +746,7 @@ public isEquipmentSelected(offset){
}
async buttonSave(tool: any, edge: any) {
console.log("ENTRO QUI", tool)
if (tool.id) {
if (edge && edge.id > 0) {
this.modifyEdge(tool, edge);
@@ -751,6 +758,9 @@ public isEquipmentSelected(offset){
this.modifyTool(tool);
}
}
else {
this.save(tool)
}
}
async deleteTool(model) {
@@ -320,10 +320,10 @@ export default class toolingFamilies extends Vue {
public getToolMagPositionByFamily = function (family) {
if(family.childTools){
// Loop througth childs
for(let j = 0; j < family.childTools.length; j++) {
var SH = this.ncShanks.filter(t => String(t.id).indexOf(family.childTools[j].shankId) >=0);
if(SH.length > 0)
var SH = this.ncShanks.filter(t => String(t.id).indexOf(family.childTools[j].shankId) >= 0);
if(SH.length > 0 && SH[0].magazineId)
return SH[0].magazineId;
}
}
+1 -1
View File
@@ -9,4 +9,4 @@ export const DEBUG_CONFIGURATION = CONFIGURATION_OSAI;
// stabilisce se leggere la configurazione dal server o
// se utilizzare la configurazione locale
export const USE_RUNTIME_CONFIGURATION = false;
export const USE_RUNTIME_CONFIGURATION = true;