Added rotation type into heads
WIP Assisted tooling
This commit is contained in:
@@ -34,7 +34,11 @@ namespace CMS_Client.View
|
||||
//Constructor
|
||||
public OpeningForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent();
|
||||
|
||||
//Setup The Browser
|
||||
if (!SetupBrowser())
|
||||
return;
|
||||
|
||||
//Set window Position
|
||||
this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
|
||||
@@ -144,10 +148,6 @@ namespace CMS_Client.View
|
||||
//Set App Opacity
|
||||
setOpacity(1);
|
||||
|
||||
//Setup The Browser
|
||||
if (!SetupBrowser())
|
||||
return;
|
||||
|
||||
//Close the Window
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,6 @@
|
||||
namespace Step.Model.DTOModels
|
||||
using static CMS_CORE_Library.Models.DataStructures;
|
||||
|
||||
namespace Step.Model.DTOModels
|
||||
{
|
||||
public class DTOHeadModel
|
||||
{
|
||||
@@ -62,6 +64,8 @@
|
||||
public int ActualSpeed;
|
||||
public short Load;
|
||||
public ushort MountedTool;
|
||||
public bool Configured;
|
||||
public ROTATION Rotation;
|
||||
public DTOToolInSpindleModel ToolData;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
@@ -82,6 +86,12 @@
|
||||
if (MountedTool != item.MountedTool)
|
||||
return false;
|
||||
|
||||
if (Configured != item.Configured)
|
||||
return false;
|
||||
|
||||
if (Rotation != item.Rotation)
|
||||
return false;
|
||||
|
||||
// Call Parent equals
|
||||
return base.Equals(item);
|
||||
}
|
||||
|
||||
@@ -1329,6 +1329,8 @@ namespace Step.NC
|
||||
IsActive = head.IsActive,
|
||||
IsSelected = head.IsSelected,
|
||||
AbrasiveIsActive = head.AbrasiveIsActive,
|
||||
Configured = head.Configured,
|
||||
Rotation = head.Rotation,
|
||||
ToolData = head.Tool == null ? null : new DTOToolInSpindleModel()
|
||||
{
|
||||
ChildId = head.Tool.ChildId,
|
||||
@@ -2480,9 +2482,9 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_RMagazineStatus(ref status);
|
||||
}
|
||||
|
||||
public CmsError StartAssistedToolingProcedure(ushort toolId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action)
|
||||
public CmsError StartAssistedToolingProcedure(ushort toolId, ushort familyId, ushort shankId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action)
|
||||
{
|
||||
return numericalControl.PLC_WAssistedToolingCmd(toolId, magazineId, positionId, action);
|
||||
return numericalControl.PLC_WAssistedToolingCmd(toolId, familyId, shankId, magazineId, positionId, action);
|
||||
}
|
||||
|
||||
public CmsError ReadAssistedToolingProcedure(out DTOAssistedToolingEndValueModel data)
|
||||
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
|
||||
@@ -881,9 +881,16 @@ namespace Step.Controllers.WebApi
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError cmsError = ncHandler.StartAssistedToolingProcedure(data.ToolId, data.MagazineId, data.PositionId, data.Action);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
using(NcToolManagerController toolsManager = new NcToolManagerController())
|
||||
{
|
||||
var tool = toolsManager.FindTool(data.ToolId);
|
||||
if (tool == null)
|
||||
return BadRequest();
|
||||
|
||||
CmsError cmsError = ncHandler.StartAssistedToolingProcedure(data.ToolId, (ushort)tool.FamilyId, (ushort)tool.ShankId, data.MagazineId, data.PositionId, data.Action);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<header>
|
||||
<div class="title">{{title}}</div>
|
||||
<div>
|
||||
<span class="process">
|
||||
<span class="process" :class="{'fa-flip-vertical': rotation == 2}">
|
||||
<i class="fa fa-refresh fa-spin" v-if="isActive"></i>
|
||||
</span>
|
||||
<span class="process">
|
||||
@@ -84,7 +84,8 @@ export default {
|
||||
abrasiveIsActive: { default: true },
|
||||
isActive: {default:false},
|
||||
isSelected: {default:false},
|
||||
title: { default: "head 1"}
|
||||
title: { default: "head 1"},
|
||||
rotation: { default: 0}
|
||||
},
|
||||
// // data: function(){
|
||||
// // return{
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
:tool="getHeadsProperty(h.id).mountedTool"
|
||||
:toolName="getHeadstoolName(h.id)"
|
||||
:toolDuplo="getHeadstoolChild(h.id)"
|
||||
:rotation="getHeadsProperty(h.id).rotation"
|
||||
:configured="getHeadsProperty(h.id).configured"
|
||||
@click="selectHead(h)"
|
||||
@overridePlus="overridePlus(h.id)" @overrideMinus="overrideMinus(h.id)"></head-production>
|
||||
</div>
|
||||
|
||||
@@ -199,6 +199,7 @@ export default class depot extends Vue {
|
||||
public magazines: server.MagazineModel[] = (this.$store.state as AppModel).tooling.magazines;
|
||||
public enableModify: any = false;
|
||||
public magazineType: any = 0;
|
||||
public assistedToolingIsActive : boolean = false
|
||||
|
||||
public checked: any = true;
|
||||
|
||||
@@ -307,6 +308,7 @@ export default class depot extends Vue {
|
||||
toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc);
|
||||
|
||||
this.onLoading = false;
|
||||
this.assistedToolingIsActive = this.magazineType == 5
|
||||
}
|
||||
|
||||
|
||||
@@ -587,11 +589,23 @@ export default class depot extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
public openModalLoadDepot(positionId, positionType) {
|
||||
ModalHelper.loadDepotModal.positionType = positionType;
|
||||
ModalHelper.loadDepotModal.positionId = positionId;
|
||||
ModalHelper.loadDepotModal.magazineId = this.depotId;
|
||||
ModalHelper.ShowModal(LoadDepot);
|
||||
public openModalLoadDepot(action, positionId, positionType) {
|
||||
console.log("AZIONE", action, positionId, positionType)
|
||||
if(action != "EXCHANGE"){ // Unload case
|
||||
// Call api with unload
|
||||
const tool = this.ncToolAtPosition(positionId)
|
||||
new DepotService().StartAssistedToolingProcedure(tool.id, Number(this.depotId), positionId).then(response => {
|
||||
console.log(response)
|
||||
});
|
||||
}
|
||||
else {
|
||||
// Open moadal in order to select new tool
|
||||
ModalHelper.loadDepotModal.positionType = positionType;
|
||||
ModalHelper.loadDepotModal.positionId = positionId;
|
||||
ModalHelper.loadDepotModal.action = action;
|
||||
ModalHelper.loadDepotModal.magazineId = this.depotId;
|
||||
ModalHelper.ShowModal(LoadDepot);
|
||||
}
|
||||
}
|
||||
|
||||
// SIEMENS
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- SIEMENS -->
|
||||
<div class="box-right">
|
||||
<div class="single-depot">
|
||||
<div class="sd-header">
|
||||
@@ -55,7 +56,19 @@
|
||||
<div class="loading" v-if="onLoading"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="sd-section scrollable" ref="positionslist">
|
||||
|
||||
<detail-card v-for="(pos, idx) in positions" :key="pos.positionId" :physicalType="pos.physicalType" :label="'tooling_magpos_abbreviation' | localize('P%d',pos.positionId)" :number="pos.positionId" class="depot-position" @click="openModalLoadDepot(pos.positionId,pos.type)" :class="{'drop':draggingIn,'selected': currentPosition == idx}" :magpos-occupied="toolAtPosition(pos.positionId) || pos.occupied" :editable="editable" :disabled="pos.disabled">
|
||||
<detail-card v-for="(pos, idx) in positions"
|
||||
class="depot-position"
|
||||
:class="{'drop':draggingIn,'selected': currentPosition == idx}"
|
||||
:key="pos.positionId"
|
||||
:physicalType="pos.physicalType"
|
||||
:label="'tooling_magpos_abbreviation' | localize('P%d',pos.positionId)"
|
||||
:posId="pos.positionId"
|
||||
:assistedTooling="assistedToolingIsActive"
|
||||
:type="pos.type"
|
||||
:magpos-occupied="toolAtPosition(pos.positionId) || pos.occupied"
|
||||
:editable="editable"
|
||||
:disabled="pos.disabled"
|
||||
@click="openModalLoadDepot" >
|
||||
<Container class="target" group-name="tools" orientation="horizontal"
|
||||
:shoud-animate-drop="disableDropAnimation"
|
||||
@drag-enter="onDragEnter(pos.positionId)" @drag-leave="onDragLeave()"
|
||||
@@ -158,6 +171,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- OSAI FANUC -->
|
||||
<div class="box-right">
|
||||
<div class="single-depot">
|
||||
<div class="sd-header">
|
||||
@@ -167,7 +181,16 @@
|
||||
</div>
|
||||
<div class="loading" v-if="onLoading"><i class="fa fa-circle-o-notch fa-spin"></i></div>
|
||||
<div class="sd-section scrollable" ref="positionslist" >
|
||||
<detail-card v-for="(pos, idx) in ncPositions" :key="pos.positionId" :label="'tooling_magpos_abbreviation' | localize('P%d',pos.positionId)" :number="pos.positionId" class="depot-position" @click="openModalLoadDepot(pos.positionId,pos.type)" :class="{'drop':draggingIn,'selected': currentPosition == idx, 'disabled':pos.disabled}" :magpos-occupied="ncToolAtPosition(pos.positionId) || pos.busyStatus != 4" :editable="editable" :disabled="pos.disabled">
|
||||
<detail-card v-for="(pos, idx) in ncPositions" :key="pos.positionId" :label="'tooling_magpos_abbreviation' | localize('P%d',pos.positionId)"
|
||||
:posId="pos.positionId"
|
||||
:type="pos.type"
|
||||
:assistedTooling="assistedToolingIsActive"
|
||||
class="depot-position"
|
||||
:class="{'drop':draggingIn,'selected': currentPosition == idx, 'disabled':pos.disabled}"
|
||||
:magpos-occupied="ncToolAtPosition(pos.positionId) || pos.busyStatus != 4"
|
||||
:editable="editable"
|
||||
:disabled="pos.disabled"
|
||||
@click="openModalLoadDepot" >
|
||||
<Container class="target" group-name="tools"
|
||||
:shoud-animate-drop="disableDropAnimation"
|
||||
@drag-enter="onDragEnter(pos.positionId)" @drag-leave="onDragLeave()"
|
||||
@@ -250,14 +273,9 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div class="depot-footer" v-if="isSiemens">
|
||||
<div class="depot-footer-left">
|
||||
<!-- <div class="depot-checkbox" >
|
||||
<input type="checkbox">
|
||||
<label></label>
|
||||
{{'depot_checkbox_viewstate_equipment' | localize('Visualizza stato utensili')}}
|
||||
</div> -->
|
||||
<div class="depot-checkbox">
|
||||
<input type="checkbox" v-model="checked" @change="viewStateTool()" value="1" id="depotCheckbox" name="" />
|
||||
<label for="depotCheckbox"></label>
|
||||
@@ -273,18 +291,13 @@
|
||||
|
||||
<div class="depot-footer" v-if="!isSiemens">
|
||||
<div class="depot-footer-left">
|
||||
<!-- <div class="depot-checkbox" >
|
||||
<input type="checkbox">
|
||||
<label></label>
|
||||
{{'depot_checkbox_viewstate_equipment' | localize('Visualizza stato utensili')}}
|
||||
</div> -->
|
||||
<div class="depot-checkbox">
|
||||
<input type="checkbox" v-model="checked" @change="viewStateTool()" value="1" id="depotCheckbox" name="" />
|
||||
<label for="depotCheckbox"></label>
|
||||
</div>
|
||||
<label class="depot-checkbox-label">{{'depot_checkbox_viewstate_equipment' | localize('Visualizza stato utensili')}}</label>
|
||||
</div>
|
||||
<div class="depot-footer-right">
|
||||
<div class="depot-footer-right" v-if="!assistedToolingIsActive">
|
||||
<div v-if="magazineLocked" class="lock-icon"><i class="fa fa-lock"></i></div>
|
||||
<button class="btn" v-if="editable" @click="toggleNcEdit()">{{'depot_button_cancel' | localize("Termina modifiche")}}</button>
|
||||
<button class="btn" v-if="!editable" :disabled="magazineLocked || onLoading" @click="toggleNcEdit()">{{'depot_button_modify' | localize("Modifica")}}</button>
|
||||
|
||||
@@ -13,7 +13,8 @@ export class ModalHelper {
|
||||
public static loadDepotModal = {
|
||||
positionId: 0,
|
||||
positionType: 0,
|
||||
magazineId: 0
|
||||
magazineId: 0,
|
||||
action: 0
|
||||
};
|
||||
|
||||
public static avaiableTools: Array<any> = [];
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
<header>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType<2">{{label}}</div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==2"><img src="assets/icons/MagPos/Spindle.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==3 && isOdd(number)"><img src="assets/icons/MagPos/Gripper_dx.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==3 && !isOdd(number)"><img src="assets/icons/MagPos/Gripper_sx.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==3 && isOdd(posId)"><img src="assets/icons/MagPos/Gripper_dx.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==3 && !isOdd(posId)"><img src="assets/icons/MagPos/Gripper_sx.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==4"><img src="assets/icons/MagPos/Loader-Spindle.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==5"><img src="assets/icons/MagPos/Transfer.png" /></div>
|
||||
<div class="title" :class="{'disabled':disabled}" v-if="physicalType==7"><img src="assets/icons/MagPos/Loader-User.png" /></div>
|
||||
<button v-if="editable" :disabled="magposOccupied || disabled" class="btn" @click="onClick()"><i class="fa fa-plus"></i></button>
|
||||
<button v-if="editable && !assistedTooling" :disabled="magposOccupied || disabled" class="btn" @click="onClick('EXCHANGE')"><i class="fa fa-plus"></i></button>
|
||||
|
||||
<button v-if="editable && assistedTooling && magposOccupied " :disabled="disabled" class="btn" @click="onClick('EXCHANGE')"><i class="fa fa-exchange fa-rotate-90"></i></button>
|
||||
<button v-if="editable && assistedTooling && magposOccupied " :disabled="disabled" class="btn" @click="onClick('UNLOAD')"><i class="fa fa-arrow-down"></i></button>
|
||||
</header>
|
||||
<section :class="{'disabled':disabled}">
|
||||
<slot></slot>
|
||||
@@ -21,16 +24,18 @@
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
number:{default:0},
|
||||
posId:{default:0},
|
||||
label:{default:""},
|
||||
physicalType:{default:1},
|
||||
type:{default:1},
|
||||
magposOccupied:{ default: false },
|
||||
editable:{ default: false },
|
||||
disabled:{ default: false }
|
||||
disabled:{ default: false },
|
||||
assistedTooling: {default: false}
|
||||
},
|
||||
methods:{
|
||||
onClick(){
|
||||
this.$emit("click");
|
||||
onClick(action){
|
||||
this.$emit("click", action, this.posId, this.type);
|
||||
},
|
||||
isOdd(num){
|
||||
return (num %2 == 1);
|
||||
|
||||
@@ -65,6 +65,11 @@ export default class head1 extends Vue {
|
||||
@Prop({default:0})
|
||||
public toolDuplo: number;
|
||||
|
||||
@Prop({ default: false })
|
||||
public configurated: boolean;
|
||||
|
||||
@Prop({ default: 0 })
|
||||
public rotation: number;
|
||||
|
||||
public loadStatus(): string {
|
||||
if (this.inAlarm) return "danger";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<section>
|
||||
<header>
|
||||
<span class="title" :title="'heads_tooltip_name' | localize('Head Name')">{{title}}</span>
|
||||
<span class="isRunning" :title="'heads_tooltip_active' | localize('Head Active state')" >
|
||||
<span class="isRunning" :class="{'fa-flip-vertical': rotation == 2}" :title="'heads_tooltip_active' | localize('Head Active state')" >
|
||||
<i class="fa fa-refresh fa-spin" v-if="isActive"></i>
|
||||
</span>
|
||||
<span class="process" :title="'heads_tooltip_process' | localize('Nc-Process Owner')">
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
:abrasiveIsActive="getHeadsProperty(h.id).abrasiveIsActive"
|
||||
:toolName="getHeadstoolName(h.id)"
|
||||
:toolDuplo="getHeadstoolChild(h.id)"
|
||||
:rotation="getHeadsProperty(h.id).rotation"
|
||||
:configured="getHeadsProperty(h.id).configured"
|
||||
@overridePlus="overridePlus(h.id)" @overrideMinus="overrideMinus(h.id)"
|
||||
></head-std>
|
||||
<div class="head-place-holder" v-if="heads.length <=1 || (heads.length>2 && heads.length%2)"></div>
|
||||
|
||||
@@ -85,4 +85,9 @@ export class DepotService extends baseRestService {
|
||||
return result;
|
||||
}
|
||||
|
||||
async StartAssistedToolingProcedure(toolId, magazineId, positionId){
|
||||
let result = await this.Post<any>(this.BASE_URL + "nc/assisted_tooling", {toolId, magazineId, positionId})
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user