Fix tool table

Added field  to scada images ("clickEnabled")
This commit is contained in:
Lucio Maranta
2019-04-01 17:58:54 +02:00
parent 0ad395bebf
commit 3750987db0
12 changed files with 96 additions and 57 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ namespace Step.Config
Buttons = x.Buttons.Select(y => { y.Id = i++; return y; }).ToArray(),
Images = x.Images.Select(y => {
y.Id = i++;
y.Path = GetImageBase64String(SCADA_DIRECTORY + y.Path, schema.BackgroundImage);
y.Name = GetImageBase64String(SCADA_DIRECTORY + name, y.Name);
return y;
})
.ToArray(),
+10 -6
View File
@@ -68,8 +68,8 @@ namespace Step.Model.DTOModels.Scada
//[XmlElement("id")]
public int Id { get; set; }
[XmlElement("imagePath")]
public string Path { get; set; }
[XmlElement("imageName")]
public string Name { get; set; }
[XmlElement("label")]
public ScadaSchemaLabelDataModel Label { get; set; }
@@ -159,17 +159,17 @@ namespace Step.Model.DTOModels.Scada
public class ScadaSchemaPositionModel
{
[XmlElement("x")]
[XmlAttribute("x")]
public int X { get; set; }
[XmlElement("y")]
[XmlAttribute("y")]
public int Y { get; set; }
}
public class ScadaSchemaSizeModel
{
[XmlElement("x")]
[XmlAttribute("x")]
public int X { get; set; }
[XmlElement("y")]
[XmlAttribute("y")]
public int Y { get; set; }
}
@@ -196,6 +196,10 @@ namespace Step.Model.DTOModels.Scada
[XmlAttribute("negate")]
public bool Negate { get; set; }
[XmlAttribute("clickEnabled")]
public bool ClickEnabled { get; set; }
[XmlElement("memVisibleIndex")]
public string MemVisibleIndex { get; set; }
@@ -7,7 +7,7 @@
<img @dragstart="pauseEvent"
v-for="(item, idx) in images(layer)"
:key="'img_' + idx"
:src="item.path"
:src="item.name"
@click="sendImageClick(item.id)"
:style="{ top: `${item.position.y}px`,
left: `${item.position.x}px`,
@@ -64,8 +64,9 @@ export default class Scada extends Vue {
return this.items(layerid).filter(i => i.type == "labelControl");
}
async sendImageClick(itemId: number) {
await scadaService.SendImageValue(this.currentScadaId, itemId);
async sendImageClick(itemId: number, canClick: boolean) {
if(canClick)
await scadaService.SendImageValue(this.currentScadaId, itemId);
}
async sendButtonClick(itemId: number) {
@@ -24,8 +24,8 @@
<img @dragstart="pauseEvent"
v-for="(item, idx) in images(layer)"
:key="'img_' + idx"
:src="item.path"
@click="sendImageClick(item.id)"
:src="item.name"
@click="sendImageClick(item.id, item.status.clickEnabled)"
:style="{ top: `${item.position.y}px`,
left: `${item.position.x}px`,
width: `${item.size.x}px`,
@@ -93,7 +93,7 @@ export default {
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);
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', shank.childsTools[0].id) + " - " + this.calcFamilyName(shank.childsTools[0].familyId);
},
familyNameFromId(id) {
var found = this.$store.state.tooling.ncFamilies.find(k => k.id == id);
@@ -16,8 +16,6 @@
{{calcItemName(s)}}
</option>
</input-box>
<!-- <select>
</select> -->
</div>
<div v-if="toolSelected && !fitInPosition" class="error">
{{'load_depot_error_fit' | localize('Spazio troppo piccolo per caricare questo utensile')}}
@@ -304,6 +304,10 @@ export default class depot extends Vue {
this.onLoading = false;
this.setAssistedTooling()
}
private setAssistedTooling(){
// Set assistedTooling procedure
if(this.magazines && !this.isSiemens){
var mag = this.magazines.find(x => x.id == this.depotId)
@@ -312,7 +316,6 @@ export default class depot extends Vue {
}
}
async loadData() {
if (this.isSiemens) {
return Promise.all([
@@ -494,12 +497,14 @@ export default class depot extends Vue {
new ToolingService().GetNcTools()
]));
}
if(this.isSiemens)
toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depot);
else
toolingActions.updateBusyStatusPositions(store,this.magazineType,this.depotNc);
this.onLoading = false;
this.setAssistedTooling()
}
public dataForOpenInfoShank(id) {
@@ -428,7 +428,6 @@ export default class toolingEquipment extends Vue {
}
public cancel = function () {
console.log("CANCEL", this.selectedTool, this.copySelectedTool)
if(this.isSiemens){
if (this.copySelectedTool) {
this.selectedTool = Object.assign({},this.copySelectedTool);
@@ -441,11 +440,11 @@ export default class toolingEquipment extends Vue {
toolingActions.updateNcTool(store, this.copySelectedTool);
}
}
if (!this.selectedTool || !this.selectedTool.id) {
this.selectedTool = null;
} else {
// If select tool exist populate edgesData field
for (let l in this.selectedTool.edgesData) {
if (this.selectedTool.edgesData[l].id <= 0) {
this.selectedTool.edgesData.splice(l, 1);
@@ -831,6 +830,11 @@ public isEquipmentSelected(offset){
return;
}
if(this.newToolId <= 0){
this.canAddNewTool = false;
return;
}
var tool = this.ncTools.find(k => k.id == this.newToolId);
if(tool)
@@ -136,20 +136,21 @@ export default class toolingFamilies extends Vue {
public addFamily() {
let newFam = {};
this.familyConfiguration = [];
//this.familyConfiguration = [];
for (let f in (this.$store.state as AppModel).tooling.familyConfiguration) {
let element = (this.$store.state as AppModel).tooling.familyConfiguration[f];
if (!element.readOnly) {
this.familyConfiguration.push(element);
}
newFam[element.name] = element.minValue;
if(element.name == "name"){
newFam[element.name] = "";
}
}
// for (let f in (this.$store.state as AppModel).tooling.familyConfiguration) {
// let element = (this.$store.state as AppModel).tooling.familyConfiguration[f];
// if (!element.readOnly) {
// this.familyConfiguration.push(element);
// }
// newFam[element.name] = element.minValue;
// if(element.name == "name"){
// newFam[element.name] = "";
// }
// }
this.selectedTool = Object.assign({}, newFam);
this.copySelectedFamily = Object.assign({}, newFam);
this.disableList = true;
this.enableModify = false;
@@ -179,18 +180,20 @@ export default class toolingFamilies extends Vue {
}
public cancel = function () {
if (this.selectedTool.id == null || this.selectedTool.id == 0) {
if (!this.selectedTool || !this.selectedTool.id) {
this.selectedTool = null;
}
// Copy backup family data into selectedFamily
if (this.copySelectedFamily) {
if (this.copySelectedFamily.id) {
this.selectedTool = Object.assign({},this.copySelectedFamily);
toolingActions.updateNcTool(store, this.copySelectedFamily);
}
this.disableList = false;
this.enableModify = false;
this.enableFamilyCreation = false;
}
// public cancelNewFamily = function(){
@@ -349,11 +352,16 @@ export default class toolingFamilies extends Vue {
@Watch("newFamilyId")
public canAddTool(){
var familiy = this.ncFamilies.find(k => k.id == this.newFamilyId);
if(this.newFamilyId <= 0){
this.canAddNewFamily = false;
}
else {
var familiy = this.ncFamilies.find(k => k.id == this.newFamilyId);
if(familiy)
this.canAddNewFamily = false;
else
this.canAddNewFamily = true;
if(familiy)
this.canAddNewFamily = false;
else
this.canAddNewFamily = true;
}
}
}
@@ -151,7 +151,7 @@
</div>
</div>
<div class="box-right-body" v-if="enableFamilyCreation && !isSiemens">
<div class="box-right-label-header">{{'tooling_equipment_newlabel' | localize("Creazione Nuova Famiglia")}}</div>
<div class="box-right-label-header">{{'tooling_families_boxright_newlabel' | localize("Creazione Nuova Famiglia")}}</div>
<div class="list-skill-equipment scrollable">
<div class="list-skill-equipment-category">
<div class="skill-equipment-category">
+38 -19
View File
@@ -189,27 +189,46 @@ export const toolingStore = {
return null
}
},
positionCompatible : (state) => (id,posType) : boolean =>{
if(!posType || posType==0)
return true;
let tool = state.tools.find(t => t.id === id);
if(tool){
if(tool.magazinePositionType == posType)
positionCompatible : (state) => (id, posType) : boolean =>{
var isSiemens = machineInfoStore.state.isSiemens;
if(isSiemens) {
if(!posType || posType==0)
return true;
else
// Find tool
let tool = state.tools.find(t => t.id === id);
if(tool) {
if(tool.magazinePositionType == posType) // Check tool position
return true;
else
return false;
}
else {
// If tool not exist check shank positionType
let shank = state.shanks.find(t => t.id === id);
if(!shank)
return false;
if(shank.magazinePositionType == posType)
return true;
else
return false;
}
}
else {
// Find tool
let tool = state.ncTools.find(t => t.id === id);
if(tool) {
// Find tool family
let fam = state.ncFamilies.find(f => f.id == tool.familyId)
if(fam && fam.toolType == posType) // Check type
return true;
else
return false;
}
return false;
}
else{
let shank = state.shanks.find(t => t.id === id);
if(shank.magazinePositionType == posType)
return true;
else
return false;
}
}
}
},
mutations: {