Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_step into develop
This commit is contained in:
Binary file not shown.
@@ -51,7 +51,7 @@ namespace Step.Model.DTOModels.ToolModels
|
||||
public bool InChangeTool { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool IsInUse { get; set; }
|
||||
public bool InUse { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool PreAlarm { get; set; }
|
||||
@@ -68,7 +68,7 @@ namespace Step.Model.DTOModels.ToolModels
|
||||
IsEnabled = dtoModel.IsEnabled,
|
||||
IsActive = dtoModel.IsActive,
|
||||
IsInhibited = dtoModel.IsInhibited,
|
||||
IsInUse = dtoModel.IsInUse,
|
||||
IsInUse = dtoModel.InUse,
|
||||
IsMeasured = dtoModel.IsMeasured,
|
||||
InChangeTool = dtoModel.InChangeTool,
|
||||
InFixedPlace = dtoModel.InFixedPlace,
|
||||
@@ -86,7 +86,7 @@ namespace Step.Model.DTOModels.ToolModels
|
||||
public class DTOMagazinesPositionsModel
|
||||
{
|
||||
[Required()]
|
||||
public int Type { get; set; }
|
||||
public bool Disabled { get; set; }
|
||||
}
|
||||
|
||||
public class DTOFamilyModel
|
||||
|
||||
+24
-8
@@ -669,9 +669,9 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_RFamilyData(ref families);
|
||||
}
|
||||
|
||||
public CmsError GetMagazinesPositionsData(out List<PositionsModel> magazinesPositions)
|
||||
public CmsError GetMagazinesPositionsData(out List<PositionModel> magazinesPositions)
|
||||
{
|
||||
magazinesPositions = new List<PositionsModel>();
|
||||
magazinesPositions = new List<PositionModel>();
|
||||
return numericalControl.TOOLS_RMagazinePositions(ref magazinesPositions);
|
||||
}
|
||||
#endregion Read Data
|
||||
@@ -773,9 +773,9 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_WUpdateFamilyData(oldName, newName);
|
||||
}
|
||||
|
||||
public CmsError UpdateMagazinePosition(PositionsModel magazinePosition)
|
||||
public CmsError UpdateMagazinePosition(PositionModel magazinePosition)
|
||||
{
|
||||
return numericalControl.TOOLS_WUpdatePositions(magazinePosition);
|
||||
return numericalControl.TOOLS_WUpdatePosition(magazinePosition);
|
||||
}
|
||||
|
||||
public CmsError DeleteTool(int id)
|
||||
@@ -808,9 +808,9 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_WDeleteEdge(toolId, edgeId);
|
||||
}
|
||||
|
||||
public CmsError GetMagazinePositionsAndTools(int magazineId, out List<MagazineAndToolModel> magazinePos)
|
||||
public CmsError GetMagazinePositionsAndTools(int magazineId, out List<PositionModel> magazinePos)
|
||||
{
|
||||
magazinePos = new List<MagazineAndToolModel>();
|
||||
magazinePos = new List<PositionModel>();
|
||||
return numericalControl.TOOLS_RMagazineTools(magazineId, ref magazinePos);
|
||||
}
|
||||
|
||||
@@ -821,10 +821,26 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_RAvailableTools(ref multiTools, ref tools);
|
||||
}
|
||||
|
||||
public CmsError UpdateMagazine(int magazineId, List<NewToolInMagazineModel> newMag)
|
||||
public CmsError LoadToolInMagazine(int magazineId, NewToolInMagazineModel newMag)
|
||||
{
|
||||
return numericalControl.TOOLS_WUpdateMagazineTools(magazineId, newMag);
|
||||
return numericalControl.TOOLS_WLoadToolInMagazine(magazineId, newMag);
|
||||
}
|
||||
|
||||
public CmsError UnloadToolInMagazine(int magazineId, int positionId)
|
||||
{
|
||||
return numericalControl.TOOLS_WUnloadToolInMagazine(magazineId, positionId);
|
||||
}
|
||||
|
||||
public CmsError LoadTooolFromShank(int shankId, int positionId, int toolId)
|
||||
{
|
||||
return numericalControl.TOOLS_WLoadToolIntoShank(shankId, positionId, toolId);
|
||||
}
|
||||
|
||||
public CmsError UnloadTooolFromShank(int shankId, int positionId, int toolId)
|
||||
{
|
||||
return numericalControl.TOOLS_WUnloadToolFromShank(shankId, positionId, toolId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Write data
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Step.Controllers.WebApi
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
CmsError libraryError = ncHandler.GetMagazinesPositionsData(out List<PositionsModel> magazines);
|
||||
CmsError libraryError = ncHandler.GetMagazinesPositionsData(out List<PositionModel> magazines);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
@@ -201,11 +201,11 @@ namespace Step.Controllers.WebApi
|
||||
ncHandler.Connect();
|
||||
|
||||
// Create Library model
|
||||
PositionsModel pos = new PositionsModel()
|
||||
PositionModel pos = new PositionModel()
|
||||
{
|
||||
Id = positionId,
|
||||
PositionId = positionId,
|
||||
MagazineId = magazineId,
|
||||
Type = Convert.ToInt32(magazinesPos.Type)
|
||||
Disabled = magazinesPos.Disabled
|
||||
};
|
||||
// Update
|
||||
CmsError libraryError = ncHandler.UpdateMagazinePosition(pos);
|
||||
@@ -357,7 +357,7 @@ namespace Step.Controllers.WebApi
|
||||
{
|
||||
ncHandler.Connect();
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.GetMagazinePositionsAndTools(magazineId, out List<MagazineAndToolModel> magazinePos);
|
||||
CmsError libraryError = ncHandler.GetMagazinePositionsAndTools(magazineId, out List<PositionModel> magazinePos);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
@@ -386,8 +386,8 @@ namespace Step.Controllers.WebApi
|
||||
}
|
||||
}
|
||||
|
||||
[Route("magazine/{magazineId:int}"), HttpPut]
|
||||
public IHttpActionResult GetAvailableTools(int magazineId, [FromBody][Required] List<DTOUpdateMagazineModel> newMag)
|
||||
[Route("magazine/{magazineId:int}/load"), HttpPut]
|
||||
public IHttpActionResult LoadToolInToMagazine(int magazineId, [FromBody][Required] DTOUpdateMagazineModel newMag)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(ModelState);
|
||||
@@ -396,9 +396,9 @@ namespace Step.Controllers.WebApi
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
List<NewToolInMagazineModel> libraryMag = newMag.Select(x => new NewToolInMagazineModel { PositionId = x.PositionId, ToolId = x.ToolId }).ToList();
|
||||
NewToolInMagazineModel libraryMag = new NewToolInMagazineModel { PositionId = newMag.PositionId, ToolId = newMag.ToolId };
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.UpdateMagazine(magazineId, libraryMag);
|
||||
CmsError libraryError = ncHandler.LoadToolInMagazine(magazineId, libraryMag);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
@@ -406,5 +406,63 @@ namespace Step.Controllers.WebApi
|
||||
return Ok(newMag);
|
||||
}
|
||||
}
|
||||
|
||||
[Route("magazine/{magazineId:int}/unload/{positionId:int}"), HttpPut]
|
||||
public IHttpActionResult UnloadToolFromMagazine(int magazineId, int positionId)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(ModelState);
|
||||
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.UnloadToolInMagazine(magazineId, positionId);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("shank/{shankId:int}/load/{positionId:int}/tool/{toolId:int}"), HttpPut]
|
||||
public IHttpActionResult LoadToolFromShank(int shankId, int positionId, int toolId)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(ModelState);
|
||||
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError libraryError = ncHandler.LoadTooolFromShank(shankId, positionId, toolId);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("shank/{shankId:int}/unload/{positionId:int}/{toolId:int}"), HttpPut]
|
||||
public IHttpActionResult UnloadToolFromShank(int shankId, int positionId, int toolId)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(ModelState);
|
||||
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError libraryError = ncHandler.UnloadTooolFromShank(shankId, positionId, toolId);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -120,7 +120,7 @@ declare module server {
|
||||
}
|
||||
|
||||
export interface MagazinesPositions {
|
||||
id: number,
|
||||
positionId: number,
|
||||
magazineId: number,
|
||||
type: number
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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 && selectedTool.id == m.id && selectedTool.magazineId == m.magazineId}"
|
||||
<equipment v-for="(m,k) in magpos" :key="k" :code="'Magazzino' + ' ' + m.magazineId" :title="'Manina' + ' ' + m.positionId"
|
||||
:class="{selected: selectedTool && selectedTool.positionId == m.positionId && selectedTool.magazineId == m.magazineId }"
|
||||
:img-source="'../assets/images/list-mag-pos.PNG'"
|
||||
@click="selectTool(m)"></equipment>
|
||||
</div>
|
||||
|
||||
@@ -168,7 +168,7 @@ export class ToolingService extends baseRestService {
|
||||
return response;
|
||||
}
|
||||
async UpdateMagPos(model: server.MagazinesPositions){
|
||||
var response = await this.Put<server.MagazinesPositions>("/api/tool_table/magazine/" + model.magazineId + "/position/" + model.id, model);
|
||||
var response = await this.Put<server.MagazinesPositions>("/api/tool_table/magazine/" + model.magazineId + "/position/" + model.positionId, model);
|
||||
toolingActions.updateMagazinePosition(store, model);
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export const toolingStore = {
|
||||
store.shanks = Array.from(store._shanks.values());
|
||||
},
|
||||
UpdateMagazinePosition(store, model: server.MagazinesPositions) {
|
||||
store._magazinesPositions.set(model.id + "-" + model.magazineId, model);
|
||||
store._magazinesPositions.set(model.positionId + "-" + model.magazineId, model);
|
||||
store.magazinesPositions = Array.from(store._magazinesPositions.values());
|
||||
},
|
||||
UpdateToolsConfiguration(store, model: server.ToolsConfiguration) {
|
||||
|
||||
Reference in New Issue
Block a user