This commit is contained in:
Alessandro Francia
2018-05-10 10:01:21 +02:00
26 changed files with 297 additions and 107 deletions
@@ -7,16 +7,16 @@ namespace Step.Model.DTOModels.ToolModels
public class DTOEdgeModel
{
[Required]
public double ResidualLife;
public double ResidualLife { get; set; }
[Required]
public double NominalLife;
public double NominalLife { get; set; }
[Required]
public double PreAlmLife;
public double PreAlmLife { get; set; }
[Required]
public Dictionary<string, double> EdgeAdditionalParams;
public Dictionary<string, double> EdgeAdditionalParams { get; set; }
public static explicit operator EdgeModel(DTOEdgeModel obj)
{
@@ -10,25 +10,25 @@ namespace Step.Model.DTOModels.ToolModels
public int Id;
[Required]
public string Name;
public string Name { get; set; }
[Required]
public bool IsEnabled;
public bool IsEnabled { get; set; }
[Required]
public bool IsInhibited;
public bool IsInhibited { get; set; }
[Required]
public bool InChangeTool;
public bool InChangeTool { get; set; }
[Required]
public bool InFixedPlace;
public bool InFixedPlace { get; set; }
[Required]
public bool InUse;
public bool InUse { get; set; }
[Required]
public int LeftSize;
public int LeftSize { get; set; }
[Required]
public int RightSize;
public int RightSize { get; set; }
[Required]
public int MagazinePositionType;
public int MagazinePositionType { get; set; }
[Required]
public List<DTOShankChildModel> ChildsTools;
public List<DTOShankChildModel> ChildsTools { get; set; }
public static explicit operator ShankModel(DTOShankModel obj)
{
@@ -6,50 +6,63 @@ namespace Step.Model.DTOModels.ToolModels
public class DTOSiemensToolModel
{
[Required]
public string FamilyName;
public string FamilyName { get; set; }
[Required]
public int MagazinePositionType;
public int MagazinePositionType { get; set; }
[Required]
public int ToolType;
public int ToolType { get; set; }
[Required]
public int LeftSize;
public int LeftSize { get; set; }
[Required]
public int RightSize;
public int RightSize { get; set; }
[Required]
public ROTATION Rotation;
public ROTATION Rotation { get; set; }
[Required]
public bool Cooling1;
public bool Cooling1 { get; set; }
[Required]
public bool Cooling2;
public bool Cooling2 { get; set; }
[Required]
public bool IsActive;
public bool IsActive { get; set; }
[Required]
public bool InFixedPlace;
public bool InFixedPlace { get; set; }
[Required]
public bool IsInhibited;
public bool IsInhibited { get; set; }
[Required]
public bool IsMeasured;
public bool IsMeasured { get; set; }
[Required]
public bool InChangeTool;
public bool InChangeTool { get; set; }
[Required]
public bool IsInUse;
public bool IsInUse { get; set; }
[Required]
public bool PreAlarm;
public bool PreAlarm { get; set; }
// public List<Dictionary<string, double>> EdgesData;
}
public class DTOMagazinesPositionsModel
{
[Required()]
public int Type { get; set; }
}
public class DTOFamilyModel
{
[Required]
public string Name { get; set; }
}
}
@@ -5,9 +5,9 @@ namespace Step.Model.DTOModels.ToolModels
public class DTOUpdateMagazineModel
{
[Required]
public int PositionId;
public int PositionId { get; set; }
[Required]
public int ToolId;
public int ToolId { get; set; }
}
}
+33 -28
View File
@@ -46,9 +46,7 @@ namespace Step.Controllers.WebApi
public IHttpActionResult AddTool([FromBody][Required]DTOSiemensToolModel tool)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
using (NcHandler ncHandler = new NcHandler())
{
@@ -69,9 +67,7 @@ namespace Step.Controllers.WebApi
public IHttpActionResult UpdateTool(int id, [FromBody][Required]DTOSiemensToolModel tool)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
using (NcHandler ncHandler = new NcHandler())
{
@@ -147,12 +143,34 @@ namespace Step.Controllers.WebApi
}
[Route("family"), HttpPost]
public IHttpActionResult AddFamily([FromBody] dynamic body)
public IHttpActionResult AddFamily([FromBody] DTOFamilyModel family)
{
if (String.IsNullOrEmpty(family.Name))
return BadRequest();
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError libraryError = ncHandler.AddFamily(body.name.ToString(), out FamilyModel family);
CmsError libraryError = ncHandler.AddFamily(family.Name, out FamilyModel newFamily);
if (libraryError.IsError())
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
return BadRequest(libraryError.message);
return Ok(newFamily);
}
}
[Route("family/{oldName}"), HttpPut]
public IHttpActionResult PutFamily(string oldName, [FromBody]DTOFamilyModel family)
{
if (String.IsNullOrEmpty(family.Name))
return BadRequest();
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError libraryError = ncHandler.UpdateFamilyName(oldName, family.Name);
if (libraryError.IsError())
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
return BadRequest(libraryError.message);
@@ -161,22 +179,6 @@ namespace Step.Controllers.WebApi
}
}
[Route("family/{oldName}"), HttpPut]
public IHttpActionResult PutFamily(string oldName, [FromBody]dynamic body)
{
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError libraryError = ncHandler.UpdateFamilyName(oldName, body.name.ToString());
if (libraryError.IsError())
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
return BadRequest(libraryError.message);
return Ok();
}
}
[Route("family/{name}"), HttpDelete]
public IHttpActionResult DeleteFamily(string name)
{
@@ -208,20 +210,23 @@ namespace Step.Controllers.WebApi
}
}
[Route("magazine/{magazineId}/position/{position}"), HttpPut]
public IHttpActionResult PutMagazinePosition(int magazineId, int position, [FromBody]dynamic body)
[Route("magazine/{magazineId}/position/{positionId}"), HttpPut]
public IHttpActionResult PutMagazinePosition([Required]int magazineId, [Required]int positionId, [FromBody]DTOMagazinesPositionsModel magazinesPos)
{
if (!ModelState.IsValid)
return BadRequest(ModelState);
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
if (magazineId == 0 || position == 0 || body == null || body.type == null)
return BadRequest();
// Create Library model
PositionsModel pos = new PositionsModel()
{
Id = position,
Id = positionId,
MagazineId = magazineId,
Type = Convert.ToInt32(body.type)
Type = Convert.ToInt32(magazinesPos.Type)
};
// Update
CmsError libraryError = ncHandler.UpdateMagazinePosition(pos);
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

@@ -135,6 +135,10 @@ button.square {
margin: 0 8px;
padding: 0 4px;
display: flex;
&.collapsed{
margin: 0;
padding: 0;
}
}
.btn-group {
@@ -168,12 +172,20 @@ button.soft {
font-size: 14px;
border-radius: 2px;
&.icon{
display: flex;
padding: 1px 12px;
align-items: center;
}
&.axes{
width: 54px;
font-size: 1.8em;
display: block;
font-weight: 600;
}
img {
width: 18px;
image-rendering: -webkit-optimize-contrast;
+10 -2
View File
@@ -116,13 +116,20 @@
&.selected{
background-color: rgba(23, 145, 255, 0.75);
color: #fff;
.image{
background-color: #FFF;
}
}
.image{
.image{
display: flex;
align-items: center;
justify-content: center;
margin: 16px 14px 16px 16px;
margin-top: 8px;
margin-left: 14px;
width: 48px;
height: 48px;
background-color: #DDD;
img{
width: 48px;
height: 48px;
@@ -133,6 +140,7 @@
text-align: left;
width:145px;
margin-top: 11px;
margin-left: 14px;
}
}
@@ -370,7 +370,11 @@
flex-flow: row wrap;
width: 512px;
height: 230px;
overflow-x: hidden;
}
.mini{
width: 262px;
}
.heads-container-lt4 {
right: -12px;
@@ -198,7 +198,7 @@
&.command {
}
.menu-container {
width: 360px;
width: 386px;
top: 80px;
position: absolute;
display: flex;
@@ -207,13 +207,13 @@
z-index: 100;
transform: translateZ(0);
&.top {
top: -80px;
top: -88px;
.menu::before {
content: "\f0d7";
color: #4b4b4b;
position: absolute;
left: calc(~"50% - 11px");
top: 47px;
top: 60px;
font-family: 'fontawesome';
font-size: 38px;
}
@@ -224,7 +224,7 @@
justify-content: flex-start;
}
&.right{
left: -176px;
left: -189px;
justify-content: flex-end;
}
&.bottom {
@@ -244,9 +244,9 @@
padding: 7px;
button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
width: 48px;
height: 48px;
margin: 0.5px;
width: 60px;
height: 60px;
margin: 1px;
font-size: 20px;
color: #fff;
border: none;
@@ -404,6 +404,32 @@
}
}
#axes-softkeys-container {
position: absolute;
top: 0;
left: 322px;
width: 258px;
height: 223px;
margin: -4px;
display: flex;
flex-flow: row wrap;
overflow: hidden;
.empty-space {
display: block;
width: 54px;
height: 48px;
margin: 4px;
background-color: #4e585e;
border-radius: 2px;
}
div {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
}
}
.jog-menu,
.auto-menu {
// width: 100%;
@@ -426,9 +452,9 @@
}
.axes-menu-container>.menu>button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
min-width: 48px;
height: 48px;
margin: 0.5px;
min-width: 60px;
height: 60px;
margin: 1px;
font-size: 20px;
color: #fff;
border: none;
@@ -442,10 +468,10 @@
}
.incr-menu-container>.menu>button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
min-width: 48px;
max-width: 48px;
height: 48px;
margin: 0.5px;
min-width: 60px;
max-width: 60px;
height: 60px;
margin: 1px;
font-size: 16px;
color: #fff;
border: none;
@@ -173,9 +173,6 @@
}
.tooling-families-container, .tooling-shanks-container, .tooling-magpos-container{
& img:empty{
display: none;
}
.text-body div + div{
margin-top: 11px;
+62 -20
View File
@@ -394,6 +394,10 @@ button.square:hover {
padding: 0 4px;
display: flex;
}
.btn-spacer.collapsed {
margin: 0;
padding: 0;
}
.btn-group {
margin: 0 8px;
padding: 0;
@@ -429,6 +433,12 @@ button.soft.icon {
padding: 1px 12px;
align-items: center;
}
button.soft.axes {
width: 54px;
font-size: 1.8em;
display: block;
font-weight: 600;
}
button.soft img {
width: 18px;
image-rendering: -webkit-optimize-contrast;
@@ -1666,7 +1676,7 @@ footer .container button.big:before {
height: 42px;
}
.soft-key .menu-container {
width: 360px;
width: 386px;
top: 80px;
position: absolute;
display: flex;
@@ -1676,14 +1686,14 @@ footer .container button.big:before {
transform: translateZ(0);
}
.soft-key .menu-container.top {
top: -80px;
top: -88px;
}
.soft-key .menu-container.top .menu::before {
content: "\f0d7";
color: #4b4b4b;
position: absolute;
left: calc(50% - 11px);
top: 47px;
top: 60px;
font-family: 'fontawesome';
font-size: 38px;
}
@@ -1692,7 +1702,7 @@ footer .container button.big:before {
justify-content: flex-start;
}
.soft-key .menu-container.right {
left: -176px;
left: -189px;
justify-content: flex-end;
}
.soft-key .menu-container.bottom .menu::before {
@@ -1711,9 +1721,9 @@ footer .container button.big:before {
}
.soft-key .menu-container .menu button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
width: 48px;
height: 48px;
margin: 0.5px;
width: 60px;
height: 60px;
margin: 1px;
font-size: 20px;
color: #fff;
border: none;
@@ -1864,6 +1874,31 @@ footer .container button.big:before {
display: flex;
flex-wrap: wrap;
}
#axes-softkeys-container {
position: absolute;
top: 0;
left: 322px;
width: 258px;
height: 223px;
margin: -4px;
display: flex;
flex-flow: row wrap;
overflow: hidden;
}
#axes-softkeys-container .empty-space {
display: block;
width: 54px;
height: 48px;
margin: 4px;
background-color: #4e585e;
border-radius: 2px;
}
#axes-softkeys-container div {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
}
.jog-menu,
.auto-menu {
background-color: #4e585e;
@@ -1887,9 +1922,9 @@ footer .container button.big:before {
.jog-menu .axes-menu-container > .menu > button,
.auto-menu .axes-menu-container > .menu > button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
min-width: 48px;
height: 48px;
margin: 0.5px;
min-width: 60px;
height: 60px;
margin: 1px;
font-size: 20px;
color: #fff;
border: none;
@@ -1906,10 +1941,10 @@ footer .container button.big:before {
.jog-menu .incr-menu-container > .menu > button,
.auto-menu .incr-menu-container > .menu > button {
background-image: linear-gradient(to bottom, #5f676b, #4e585e);
min-width: 48px;
max-width: 48px;
height: 48px;
margin: 0.5px;
min-width: 60px;
max-width: 60px;
height: 60px;
margin: 1px;
font-size: 16px;
color: #fff;
border: none;
@@ -2544,6 +2579,10 @@ footer .container button.big:before {
flex-flow: row wrap;
width: 512px;
height: 230px;
overflow-x: hidden;
}
.mini {
width: 262px;
}
.heads-container-lt4 {
right: -12px;
@@ -2750,11 +2789,18 @@ footer .container button.big:before {
background-color: rgba(23, 145, 255, 0.75);
color: #fff;
}
.equipment.selected .image {
background-color: #FFF;
}
.equipment .image {
display: flex;
align-items: center;
justify-content: center;
margin: 16px 14px 16px 16px;
margin-top: 8px;
margin-left: 14px;
width: 48px;
height: 48px;
background-color: #DDD;
}
.equipment .image img {
width: 48px;
@@ -2764,6 +2810,7 @@ footer .container button.big:before {
text-align: left;
width: 145px;
margin-top: 11px;
margin-left: 14px;
}
.input-box {
width: 100%;
@@ -6656,11 +6703,6 @@ footer .container button.big:before {
font-size: 18px;
font-weight: 600;
}
.tooling-families-container img:empty,
.tooling-shanks-container img:empty,
.tooling-magpos-container img:empty {
display: none;
}
.tooling-families-container .text-body div + div,
.tooling-shanks-container .text-body div + div,
.tooling-magpos-container .text-body div + div {
@@ -74,6 +74,17 @@ export default class toolingEquipment extends Vue {
this.$router.push({ path: path});
}
public getToolIcon = function (id) {
if(id == 9999)
return "../assets/images/list-undefined.PNG"
else if(id == 151 || id == 700 )
return "../assets/images/list-blade.PNG"
else
return "../assets/images/list-tool.PNG"
}
async save(item){
item.name = "";
toolingActions.updateToolsConfiguration(store,item);
@@ -21,7 +21,7 @@
</div>
<div class="list-vertical scrollable">
<equipment v-for="t in tools" :key="t.id" :code="t.id" :title="t.familyName"
img-source="../assets/images/tool.PNG"
:img-source="getToolIcon(t.toolType)"
:class="{selected: selectedTool == t}"
@click="selectTool(t)"></equipment>
</div>
@@ -22,6 +22,7 @@
<div class="list-vertical scrollable">
<equipment v-for="(m,k) in magpos" :key="k" :code="'Magazzino' + ' ' + m.magazineId" :title="'Manina' + ' ' + m.id"
:class="{selected: selectedTool == m}"
:img-source="'../assets/images/list-mag-pos.PNG'"
@click="selectTool(m)"></equipment>
</div>
</div>
@@ -15,6 +15,7 @@
</div>
<div class="keys-area">
<nc-soft-keys></nc-soft-keys>
<axes-soft-keys v-if="showAxisBtn" v-bind:isDisabled="!showJog"></axes-soft-keys>
<mheads></mheads>
<jog-menu v-if="showJog"></jog-menu>
<auto-menu v-if="showAuto"></auto-menu>
@@ -26,6 +27,7 @@
import { appModelActions } from "src/store";
import plcSoftKeys from "src/modules/plc-softkeys.vue";
import ncSoftKeys from "src/modules/nc-softkeys.vue";
import axesSoftKeys from "src/modules/axes-softkeys.vue";
import mheads from "src/modules/mheads.vue";
import jogMenu from "src/modules/under-the-hood/jog-menu.vue";
import autoMenu from "src/modules/under-the-hood/auto-menu.vue";
@@ -36,6 +38,7 @@ export default {
components: {
plcSoftKeys,
ncSoftKeys,
axesSoftKeys,
mheads,
jogMenu,
autoMenu,
@@ -57,6 +60,13 @@ export default {
let mdi = this.$store.getters.getNcSoftKeyStatus(2);
let edit = this.$store.getters.getNcSoftKeyStatus(3);
return this.isCnReady() && ((auto && auto.value) || (mdi && mdi.value) || (edit && edit.value));
},
showAxisBtn: function(){
let headsnum = this.$store.state.machineInfo.heads.length
if(headsnum <= 2)
return true
else
return false;
}
},
methods: {
@@ -0,0 +1,57 @@
<template>
<div id="axes-softkeys-container">
<div >
<button class="soft icon axes"
@click="setAxes(a.id)"
v-for="a in axes"
:key="a.id"
:disabled="isDisabled"
:class="{active: a.id == selectedAxisId}">{{a.name}}</button>
<div class="empty-space" v-for="(item,index) in emptySpaces" :key="'Empty_' + index"></div>
</div>
</div>
</template>
<script>
import { Hub } from "src/services/hub";
export default {
computed: {
axes: function() {
return this.$store.state.process.axes;
},
emptySpaces: function() {
let num = this.$store.state.process.axes.length;
if(num >= this.maxNumVisible)
return 0;
else
return this.maxNumVisible - num;
},
selectedAxisId: function() {
return this.$store.state.process.selectedAxis;
}
},
methods: {
getAxesName() {
let id = this.$store.state.process.selectedAxis;
for (const k in this.$store.state.process.axes) {
let a = this.$store.state.process.axes[k];
if (a.id == id) return a.name;
}
return null;
},
setAxes(id) {
Hub.Current.selectAxis(id);
},
},
props:{
isDisabled: { default: true, type: Boolean }
},
data: function() {
return {
maxNumVisible: 16
};
}
};
</script>
@@ -1,7 +1,7 @@
<template>
<!-- <div class="test-container"> -->
<div class="equipment" @click="onClick">
<div class="image">
<div v-if="imgSource" class="image">
<img :src="imgSource" alt="">
</div>
<div class="text-body">
+2 -5
View File
@@ -1,5 +1,5 @@
<template>
<div class="heads-container scrollable_auto" :class="{'heads-container-lt4':(heads.length <=4)}">
<div class="heads-container scrollable_auto" :class="{'mini':(heads.length <=2) , 'heads-container-lt4':(heads.length <=4)}">
<head-std :title="h.name" v-for="h in heads" :key="h.id"
:rpm="getHeadsProperty(h.id).actualSpeed"
:tool="getHeadsProperty(h.id).mountedTool"
@@ -17,10 +17,7 @@
:isActive="getHeadsProperty(h.id).isActive"
@overridePlus="overridePlus(h.id)" @overrideMinus="overrideMinus(h.id)"
></head-std>
<div class="head-place-holder" v-if="heads.length <4"></div>
<div class="head-place-holder" v-if="heads.length <3"></div>
<div class="head-place-holder" v-if="heads.length <2"></div>
<div class="head-place-holder" v-if="heads.length <1 || (heads.length>4 && heads.length%2)"></div>
<div class="head-place-holder" v-if="heads.length <=1 || (heads.length>2 && heads.length%2)"></div>
<!-- <head-std :percentage="40" :load="55" :tool=1 :rpm=160000 title="head2" process="1"></head-std>
<head-std :percentage="100" :load="65" :tool=2 title="head3" process="1"></head-std>
<head-std title="head4" :load="100" process="1"></head-std>
@@ -1,7 +1,7 @@
<template>
<div class="jog-menu" ref="menu">
<button @click="toggleAxes()" :class="{active:showAxesMenu}" :disabled="axes.length == 0" class="soft">{{"jog_menu_axis" | localize("Asse")}} {{getAxesName()}}</button>
<div class="btn-spacer">
<button v-if="showAxisBtn" @click="toggleAxes()" :class="{active:showAxesMenu}" :disabled="axes.length == 0" class="soft">{{"jog_menu_axis" | localize("Asse")}} {{getAxesName()}}</button>
<div class="btn-spacer" :class="{'collapsed': !showAxisBtn }">
<button @click="ncClick(23)" :disabled="!isKeyActive(23)" :class="{active:isKeySelected(23) , inverted:isReadOnly(23)}" class="soft square"><i class="fa fa-minus"></i></button>
<button v-if="!machineInfo.isSiemens" @click="ncClick(24)" :disabled="!isKeyActive(24)" :class="{active:isKeySelected(24) , inverted:isReadOnly(24)}" class="soft">{{name(24)}}</button>
<button @click="ncClick(22)" :disabled="!isKeyActive(22)" :class="{active:isKeySelected(22) , readonly:isReadOnly(22)}" class="soft square"><i class="fa fa-plus"></i></button>
@@ -60,6 +60,13 @@ export default {
// 180px è la metà della larghezza del contenitore .incr-menu-container configurata da css
// 50px è la metà della larghezza del bottone Inc comprensivo di margini.
return (this.$refs.incbutton.offsetLeft - 180 + 50).toString() + "px";
},
showAxisBtn: function(){
let headsnum = this.$store.state.machineInfo.heads.length
if(headsnum > 2)
return true
else
return false;
}
},