WIP assisisted tooling
This commit is contained in:
Binary file not shown.
@@ -664,6 +664,12 @@ public static class ThreadsFunctions
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
MessageServices.Current.Publish(NC_MAGAZINE_IS_ACTIVE, null, status);
|
||||
|
||||
libraryError = ncHandler.ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data);
|
||||
if (libraryError.IsError())
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
MessageServices.Current.Publish(ASSISTED_TOOLING_DATA, null, status);
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
@@ -775,7 +781,7 @@ public static class ThreadsFunctions
|
||||
// Try connection
|
||||
CmsError libraryError = ncHandler.Connect();
|
||||
if (libraryError.errorCode != 0)
|
||||
ManageLibraryError(libraryError);
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -856,7 +862,7 @@ public static class ThreadsFunctions
|
||||
}
|
||||
else //MTC
|
||||
{
|
||||
string stringVal = "Path_" + m154.Process + "_";
|
||||
string stringVal = "Path_0" + m154.Process + "_";
|
||||
string val = "";
|
||||
|
||||
// Check if command is MTC
|
||||
|
||||
@@ -197,6 +197,7 @@ namespace Step.Model
|
||||
public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA";
|
||||
public const string SEND_M155_DATA = "SEND_M155_DATA";
|
||||
public const string SEND_SCADA_DATA = "SEND_SCADA_DATA";
|
||||
public const string ASSISTED_TOOLING_DATA = "ASSISTED_TOOLING_DATA";
|
||||
|
||||
public const string BROADCAST_DATA = "BROADCAST_DATA";
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
public class DTOSpindleModel : DTOHeadModel
|
||||
{
|
||||
public int ActualSpeed;
|
||||
public ushort Load;
|
||||
public short Load;
|
||||
public ushort MountedTool;
|
||||
public DTOToolInSpindleModel ToolData;
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
using static CMS_CORE_Library.Models.DataStructures;
|
||||
|
||||
namespace Step.Model.DTOModels.ToolModels
|
||||
{
|
||||
public class DTOAssistedToolingModel
|
||||
{
|
||||
public ushort ToolId { get; set; }
|
||||
public ushort MagazineId { get; set; }
|
||||
public ushort PositionId { get; set; }
|
||||
public ASSISTED_TOOLING_ACTION Action { get; set; }
|
||||
}
|
||||
|
||||
public class DTOAssistedToolingEndValueModel : AssistedToolingModel
|
||||
{
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var item = obj as DTOAssistedToolingEndValueModel;
|
||||
|
||||
if (IsActive != item.IsActive)
|
||||
return false;
|
||||
|
||||
if (ToolId != item.ToolId)
|
||||
return false;
|
||||
|
||||
if (MagazineId != item.MagazineId)
|
||||
return false;
|
||||
|
||||
if (PositionId != item.PositionId)
|
||||
return false;
|
||||
|
||||
if (Action != item.Action)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,6 +112,7 @@
|
||||
<Compile Include="DTOModels\JobModels\DTOMetadataModel.cs" />
|
||||
<Compile Include="DTOModels\Scada\DTOScadaModel.cs" />
|
||||
<Compile Include="DTOModels\Scada\ScadaSchemaModel.cs" />
|
||||
<Compile Include="DTOModels\ToolModels\DTOAssistedToolingModel.cs" />
|
||||
<Compile Include="DTOModels\ToolModels\DTONewToolDataModel.cs" />
|
||||
<Compile Include="DTOModels\MaintenanceModels\DTOExpiredMaintenanceModel.cs" />
|
||||
<Compile Include="DTOModels\DTOHeadModel.cs" />
|
||||
|
||||
+22
-4
@@ -1350,7 +1350,7 @@ namespace Step.NC
|
||||
inAlarm = vacumValue >= configuredHead.AlarmLimit,
|
||||
OverrideEditable = head.OverrideEditable,
|
||||
ActualPressure = head.ActualSpeed_Pressure,
|
||||
Abrasive = head.Load_Abrasive,
|
||||
Abrasive = Convert.ToUInt16(head.Load_Abrasive),
|
||||
Vacum = vacumValue,
|
||||
Override = head.Override,
|
||||
IsActive = head.IsActive,
|
||||
@@ -1405,7 +1405,7 @@ namespace Step.NC
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public CmsError GetM154Data(out List<M154DataModel> data, out bool MTCStatus)
|
||||
public CmsError GetM154Data(out List<M154DataModel> data, out bool MTCStatus)
|
||||
{
|
||||
MTCStatus = false;
|
||||
data = new List<M154DataModel>();
|
||||
@@ -1511,7 +1511,7 @@ namespace Step.NC
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
if (NcConfig.NcVendor != NC_VENDOR.SIEMENS)
|
||||
if (NcConfig.NcVendor != NC_VENDOR.SIEMENS && NcConfig.NcVendor != NC_VENDOR.DEMO)
|
||||
{
|
||||
config.FamilyOptionActive = true;
|
||||
config.MultitoolOptionActive = true;
|
||||
@@ -2481,8 +2481,26 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_RMagazineStatus(ref status);
|
||||
}
|
||||
|
||||
public CmsError StartAssistedToolingProcedure(ushort toolId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action)
|
||||
{
|
||||
return numericalControl.PLC_WAssistedToolingCmd(toolId, magazineId, positionId, action);
|
||||
}
|
||||
|
||||
public CmsError ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data)
|
||||
{
|
||||
data = new DTOAssistedToolingEndValueModel();
|
||||
AssistedToolingModel tmpData = new AssistedToolingModel();
|
||||
CmsError cmsError = numericalControl.PLC_RAssistedToolingData(ref tmpData);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
data = tmpData as DTOAssistedToolingEndValueModel;
|
||||
|
||||
return cmsError;
|
||||
}
|
||||
|
||||
#endregion Osai/Fanuc Tools
|
||||
|
||||
|
||||
public CmsError ReadScadasData(List<ScadaSchemaModel> schemasToRead, out List<DTOScadaModel> scadas)
|
||||
{
|
||||
CmsError cmsError = NO_ERROR;
|
||||
|
||||
@@ -874,6 +874,20 @@ namespace Step.Controllers.WebApi
|
||||
}
|
||||
}
|
||||
|
||||
[Route("assisted_tooling/"), HttpPost]
|
||||
public IHttpActionResult StartAssistedTooling(DTOAssistedToolingModel data)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError cmsError = ncHandler.StartAssistedToolingProcedure(data.ToolId, data.MagazineId, data.PositionId, data.Action);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
private bool ToolIsInSpindle(int toolId)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using Step.Model.DTOModels.ToolModels;
|
||||
using Step.NC;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static CMS_CORE_Library.Models.DataStructures;
|
||||
using static Step.Listeners.SignalRStaticObjects;
|
||||
using static Step.Model.Constants;
|
||||
|
||||
@@ -222,5 +223,15 @@ namespace Step.Listeners.Database
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ManageAssisedToolingProcedure(object assTool)
|
||||
{
|
||||
AssistedToolingModel assToolingData = assTool as AssistedToolingModel;
|
||||
if(assToolingData != null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,9 +271,7 @@ export default class toolingEquipment extends Vue {
|
||||
this.enableAddEdge = true;
|
||||
}
|
||||
}
|
||||
// else{
|
||||
// this.enableAddOffset();
|
||||
// }
|
||||
|
||||
history.pushState(null,"","/index.html#/tooling-equipment");
|
||||
}
|
||||
|
||||
@@ -301,16 +299,26 @@ export default class toolingEquipment extends Vue {
|
||||
|
||||
public addTool() {
|
||||
let newTool = {};
|
||||
this.selectedTool = Object.assign({}, newTool)
|
||||
this.enableToolCreation = true;
|
||||
console.log("entro")
|
||||
|
||||
this.enableToolModify = false
|
||||
this.enableOffsets = false
|
||||
this.enableParameters = false
|
||||
this.disableList = true
|
||||
|
||||
this.newToolId = 1
|
||||
this.newFamilyId = 0
|
||||
if(!this.isSiemens){
|
||||
this.selectedTool = Object.assign({}, newTool)
|
||||
this.enableToolCreation = true;
|
||||
this.enableToolModify = false
|
||||
this.enableOffsets = false
|
||||
this.enableParameters = false
|
||||
this.disableList = true
|
||||
this.newToolId = 1
|
||||
this.newFamilyId = 0
|
||||
}
|
||||
else {
|
||||
this.fieldTool(newTool);
|
||||
this.selectedTool = Object.assign({}, newTool)
|
||||
this.enableToolModify = true
|
||||
this.enableOffsets = false
|
||||
this.enableParameters = true
|
||||
this.disableList = true
|
||||
}
|
||||
}
|
||||
|
||||
public getDynamicFields(tooltype: string): Array<string> {
|
||||
|
||||
@@ -20,12 +20,27 @@
|
||||
<!-- <button class="btn square"><i class="fa fa-filter"></i></button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- Left list -->
|
||||
<div class="list-vertical scrollable" ref="toolList" v-if="isSiemens">
|
||||
<equipment v-for="t in tools.filter(t => t.familyName.toLowerCase().indexOf(currentFilter) >=0)" :key="t.id" :title="'tooling_tool_abbreviation' | localize('DP%d',t.childId)" :code="t.familyName" :img-source="getToolIcon(t.toolType)" :class="{selected: isToolSelected(t)}" :magPosition="t.magazineId" :shankPosition="t.multitoolId" @click="selectTool(t)">
|
||||
<equipment v-for="t in tools.filter(t => t.familyName.toLowerCase().indexOf(currentFilter) >=0)"
|
||||
:key="t.id" :title="'tooling_tool_abbreviation' | localize('DP%d',t.childId)"
|
||||
:code="t.familyName"
|
||||
:img-source="getToolIcon(t.toolType)"
|
||||
:class="{selected: isToolSelected(t)}"
|
||||
:magPosition="t.magazineId"
|
||||
:shankPosition="t.multitoolId"
|
||||
@click="selectTool(t)">
|
||||
</equipment>
|
||||
</div>
|
||||
<div class="list-vertical scrollable" ref="toolList" v-if="!isSiemens">
|
||||
<equipment v-for="t in ncTools.filter(t => String(t.id).indexOf(currentFilter) >=0)" :key="t.id" :code="'tooling_tool_abbreviation' | localize('T%d',t.id)" :title="calcFamilyName(t)" :img-source="getToolIcon(t.toolType)" :class="{selected: isToolSelected(t)}" :magPosition="getToolMagPosition(t.shankId)" :shankPosition="getToolShankPosition(t.shankId)" @click="selectTool(t)">
|
||||
<equipment v-for="t in ncTools.filter(t => String(t.id).indexOf(currentFilter) >=0)"
|
||||
:key="t.id" :code="'tooling_tool_abbreviation' | localize('T%d',t.id)"
|
||||
:title="calcFamilyName(t)"
|
||||
:img-source="getToolIcon(t.toolType)"
|
||||
:class="{selected: isToolSelected(t)}"
|
||||
:magPosition="getToolMagPosition(t.shankId)"
|
||||
:shankPosition="getToolShankPosition(t.shankId)"
|
||||
@click="selectTool(t)">
|
||||
</equipment>
|
||||
</div>
|
||||
<div class="footer">
|
||||
@@ -62,7 +77,7 @@
|
||||
<button class="btn deleteElement" v-if="selectedTool.id" :disabled="toolIsInSpindle" @click="deleteTool(selectedTool)"><i class="fa fa-trash"></i></button>
|
||||
<div class="box-right-label-header" v-if="selectedTool.id && isSiemens">{{'tooling_equipment_editlabel' | localize("Modifica utensile %d", selectedTool.id,selectedTool.familyName)}}</div>
|
||||
<div class="box-right-label-header" v-if="selectedTool.id && !isSiemens">{{'tooling_equipment_editlabel' | localize("Modifica utensile %d", selectedTool.id)}}</div>
|
||||
<!---<div class="box-right-label-header" v-if="!selectedTool.id" >{{'tooling_equipment_newlabel' | localize("Creazione Nuovo Utensile")}}</div>-->
|
||||
<div class="box-right-label-header" v-if="isSiemens && !selectedTool.id" >{{'tooling_equipment_newlabel' | localize("Creazione Nuovo Utensile")}}</div>
|
||||
<div class="list-skill-equipment scrollable">
|
||||
<form>
|
||||
<div class="list-skill-equipment-category" v-for="c in categories" :key="c">
|
||||
@@ -97,7 +112,7 @@
|
||||
<button class="btn" v-if="!enableToolModify" :disabled="toolIsInSpindle" @click="modify()">{{'tooling_equipment_button_modify' | localize("Modifica")}}</button>
|
||||
<button class="btn" v-if="enableToolModify" @click="cancel()">{{'tooling_equipment_button_cancel' | localize("Annulla")}}</button>
|
||||
<button class="btn blue-reverse" :disabled="!isValid" v-if="enableToolModify && selectedTool.id" @click="buttonSave(selectedTool, selectedEquipment)">{{'tooling_equipment_button_save' | localize("Salva")}}</button>
|
||||
<!-- <button class="btn blue-reverse" :disabled="!isValid" v-if="enableToolModify && !selectedTool.id" @click="buttonSave(selectedTool, selectedEquipment)">{{'tooling_equipment_button_add' | localize("Aggiungi")}}</button>-->
|
||||
<button class="btn blue-reverse" :disabled="!isValid" v-if="isSiemens && enableToolModify && !selectedTool.id" @click="buttonSave(selectedTool, selectedEquipment)">{{'tooling_equipment_button_add' | localize("Aggiungi")}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Siemens-->
|
||||
|
||||
Reference in New Issue
Block a user