Merge branch 'develop' into User_Manager

This commit is contained in:
Nicola Carminati
2019-03-20 16:28:19 +01:00
23 changed files with 168 additions and 57 deletions
+5 -5
View File
@@ -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.
+5 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<toolManagerConfig>
<familyOpt>false</familyOpt>
<familyOpt>true</familyOpt>
<shankOpt>false</shankOpt>
<magPositionOpt>true</magPositionOpt>
<offsetOpt>false</offsetOpt>
@@ -52,13 +52,15 @@
<magazineNames>
<magazine>
<id>1</id>
<localizedNames>
<assistedTooling>true</assistedTooling>
<localizedNames>
<lang langKey="en">Magazine 1</lang>
<lang langKey="it">Magazzino 1</lang>
</localizedNames>
</magazine>
<magazine>
<id>2</id>
<assistedTooling>true</assistedTooling>
<localizedNames>
<lang langKey="en">Magazine 2</lang>
<lang langKey="it">Magazzino 2</lang>
@@ -66,6 +68,7 @@
</magazine>
<magazine>
<id>3</id>
<assistedTooling>true</assistedTooling>
<localizedNames>
<lang langKey="en">Magazine 3</lang>
<lang langKey="it">Magazzino 3</lang>
@@ -110,6 +110,7 @@
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:int"/>
<xs:element name="assistedTooling" type="xs:boolean"/>
<xs:element name="localizedNames">
<xs:complexType>
<xs:sequence>
@@ -118,7 +119,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:all>
</xs:complexType>
</xs:element>
@@ -484,7 +484,7 @@ namespace Step.Database.Controllers
dbCtx.Shanks.Attach(shank);
// Set ids with new positions
shank.MagazineId = magazineId;
shank.PositionId = positionId;
//shank.PositionId = positionId;
// Set original Ids
shank.OriginMagazineId = magazineId;
shank.OriginPositionId = positionId;
@@ -520,7 +520,7 @@ namespace Step.Database.Controllers
return GetShank(shankId);
}
public DTONcShankModel UnloadToolFromShank(DbNcToolModel tool)
public DTONcShankModel UnloadToolFromShank(DbNcToolModel tool)
{
dbCtx.Tools.Attach(tool);
int? shankId = tool.ShankId;
@@ -10,6 +10,8 @@ namespace Step.Model.ConfigModels
{
public int MagazineId { get; set; }
public bool AssistedTooling { get; set; }
public Dictionary<string, string> LocalizedNames { get; set; }
}
}
+11 -1
View File
@@ -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);
}
+16 -3
View File
@@ -150,7 +150,7 @@ namespace Step.NC
else
{
string name = "";
cmsError = numericalControl.PROC_RSelectedPPName(selectedProcess, ref name);
cmsError = numericalControl.PROC_RSelectedPPName(selectedProcess, ref name);
if (cmsError.IsError())
return cmsError;
@@ -1339,6 +1339,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,
@@ -1520,13 +1522,23 @@ namespace Step.NC
CmsError cmsError = numericalControl.TOOLS_RConfiguration(ref config);
if (cmsError.IsError())
return cmsError;
// Set magazine assisted tooling from config
foreach(var magConfig in ToolManagerConfig.MagazineNames)
{
var mag = config.Magazines.FirstOrDefault(x => magConfig.MagazineId == x.Id);
if (mag != null)
mag.AssistedToolingIsActive = magConfig.AssistedTooling;
}
if (NcConfig.NcVendor != NC_VENDOR.SIEMENS && NcConfig.NcVendor != NC_VENDOR.DEMO)
{
// Setup options
config.FamilyOptionActive = true;
config.MultitoolOptionActive = true;
config.OffsetOptionActive = true;
// Add categories to be removed
List<string> categories = new List<string>();
if (!ToolManagerConfig.ShankOpt)
{
@@ -1583,6 +1595,7 @@ namespace Step.NC
if (!ToolManagerConfig.ReviveOpt)
categories.Add("revive");
// Remove category from configurations
config.ToolsConfiguration = config.ToolsConfiguration.Where(x => !categories.Contains(x.Category)).ToList();
// Remove categories from familyConfig
@@ -2490,9 +2503,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)
@@ -342,6 +342,7 @@ namespace Step.Controllers.WebApi
if (!File.Exists(MAINTENANCE_ATTACHMENT_PATH + attachment.LocalFileName))
return NotFound();
return new FileResult(MAINTENANCE_ATTACHMENT_PATH + attachment.LocalFileName);
}
}
+1 -1
View File
@@ -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;
@@ -195,6 +195,7 @@ namespace Step.Controllers.WebApi
}
else
{
defaultFamily.Id = toolId;
// Add new family
DbNcFamilyModel dbFam = toolsManager.AddFamily(defaultFamily);
@@ -881,9 +882,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();
}
+1
View File
@@ -80,6 +80,7 @@ declare module server {
type: number,
name: string,
loadingIsActive: boolean,
assistedToolingIsActive: boolean
// signalRLoadingIsActive: boolean
}
@@ -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>
@@ -16,7 +16,8 @@ export default {
positionId: null,
magazineId: null,
magInfo: null,
fitInPosition: true
fitInPosition: true,
action: "LOAD"
}
},
computed: {
@@ -40,6 +41,7 @@ export default {
this.magazineId = ModalHelper.loadDepotModal.magazineId;
this.positionId = ModalHelper.loadDepotModal.positionId;
this.action = ModalHelper.loadDepotModal.action;
if(this.magazineId)
this.magInfo = (this.$store.state as AppModel).tooling.magazines.find(d => d.id == this.magazineId);
@@ -66,11 +68,24 @@ export default {
});
}
else{
new DepotService().AddToolToDepotNc(this.magazineId, this.positionId, { shankId: this.toolSelected.id }).then(response => {
Factory.Get(MessageService).deleteChannel("esc_pressed");
toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depotNc);
ModalHelper.HideModal();
});
if (this.action == "LOAD") {
new DepotService().AddToolToDepotNc(this.magazineId, this.positionId, { shankId: this.toolSelected.id }).then(response => {
Factory.Get(MessageService).deleteChannel("esc_pressed");
toolingActions.updateBusyStatusPositions(store,this.magInfo.type,(this.$store.state as AppModel).depot.depotNc);
ModalHelper.HideModal();
})
}
else {
let act = 2; // Unload
if (this.action == "EXCHANGE")
act = 1;
new DepotService().StartAssistedToolingProcedure(this.toolSelected.id, this.magazineId, this.positionId, act).then(response => {
Factory.Get(MessageService).deleteChannel("esc_pressed");
toolingActions.updateBusyStatusPositions(store, this.magInfo.type, (this.$store.state as AppModel).depot.depotNc);
ModalHelper.HideModal();
})
}
}
},
calcItemName(shank) {
@@ -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,13 @@ export default class depot extends Vue {
toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc);
this.onLoading = false;
// Set assistedTooling procedure
if(this.magazines){
var mag = this.magazines.find(x => x.id == this.depotId)
if(mag)
this.assistedToolingIsActive = mag.assistedToolingIsActive
}
}
@@ -587,11 +595,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 == "UNLOAD") { // Unload case
// Call assisted unload api
const tool = this.ncToolAtPosition(positionId)
new DepotService().StartAssistedToolingProcedure(tool.id, Number(this.depotId), positionId, 2).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
@@ -12,6 +12,7 @@
<button class="btn" v-if="false" @click="StartToolingWizard()" >{{'depot_button_assistedtooling' | localize("Attrezzaggio automatico")}}</button>
</div>
</div>
<!-- SIEMENS -->
<div class="depot-boxbody" v-if="isSiemens">
<div class="list-left" v-if="editable">
<span class="depot-search-label">{{'depot_label_search' | localize("Seleziona un utensile e trascinalo nel magazzino corrispondente:")}}</span>
@@ -44,6 +45,7 @@
</div>
</div>
<!-- SIEMENS -->
<div class="box-right">
<div class="single-depot">
<div class="sd-header">
@@ -55,7 +57,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 +172,7 @@
</div>
</div>
<!-- OSAI FANUC -->
<div class="box-right">
<div class="single-depot">
<div class="sd-header">
@@ -167,7 +182,17 @@
</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"
:toolMounted="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()"
@@ -184,7 +209,7 @@
@click="removeToolsToDepot(pos.positionId, ncToolAtPosition(pos.positionId))"
@clickinfo="openInfoShank(ncToolAtPosition(pos.positionId).id)">
</card-tool-depot>
<card-busy-depot v-if="!ncToolAtPosition(pos.positionId)" :type=pos.busyStatus></card-busy-depot>
<card-busy-depot v-if="!ncToolAtPosition(pos.positionId)" :type="pos.busyStatus"></card-busy-depot>
</detail-card>
</div>
<div ref="squarecontainer" class="square-container-fixed">
@@ -250,14 +275,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 +293,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> = [];
@@ -1,36 +1,42 @@
<template>
<!-- <div class="test-container"> -->
<div class="detail-card">
<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('LOAD')"><i class="fa fa-plus"></i></button>
<!-- Assisted tooling buttons -->
<button v-if="assistedTooling && !magposOccupied" :disabled="magposOccupied || disabled" class="btn" @click="onClick('EXCHANGE')"><i class="fa fa-plus"></i></button>
<button v-if="assistedTooling && magposOccupied && toolMounted" :disabled="disabled" class="btn" @click="onClick('EXCHANGE')"><i class="fa fa-exchange fa-rotate-90"></i></button>
<button v-if="assistedTooling && magposOccupied && toolMounted" :disabled="disabled" class="btn" @click="onClick('UNLOAD')"><i class="fa fa-arrow-down"></i></button>
</header>
<section :class="{'disabled':disabled}">
<slot></slot>
</section>
</div>
<!-- </div> -->
</template>
<script>
export default {
props:{
number:{default:0},
posId:{default:0},
label:{default:""},
physicalType:{default:1},
type:{default:1},
magposOccupied:{ default: false },
toolMounted:{ 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);
+5
View File
@@ -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";
+1 -1
View File
@@ -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')">
+2
View File
@@ -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, action){
let result = await this.Post<any>(this.BASE_URL + "nc/assisted_tooling", {toolId, magazineId, positionId, action})
return result
}
}