268 lines
17 KiB
C#
268 lines
17 KiB
C#
using CMS_CORE_Library.Demo.Models;
|
|
using CMS_CORE_Library.Models;
|
|
using System.Collections.Generic;
|
|
using System.ServiceModel;
|
|
using System.ServiceModel.Web;
|
|
using static CMS_CORE_Library.Models.DataStructures;
|
|
|
|
namespace Nc_Demo_Application.Server.Service
|
|
{
|
|
[ServiceContract]
|
|
internal interface ILibraryService
|
|
{
|
|
[OperationContract]
|
|
|
|
#region Nc Data API
|
|
|
|
[WebGet(UriTemplate = "cn/name/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetName(out string name);
|
|
|
|
[WebGet(UriTemplate = "cn/language/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetLanguage(out string language);
|
|
|
|
[WebGet(UriTemplate = "cn/serial_number/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetSerialNumber(out string serialNumber);
|
|
|
|
[WebGet(UriTemplate = "cn/software_version/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetSoftwareVersion(out string softwareVersion);
|
|
|
|
[WebGet(UriTemplate = "cn/model/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetModel(out string model);
|
|
|
|
[WebGet(UriTemplate = "cn/date_time/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetDateTime(out string dateTime);
|
|
|
|
[WebGet(UriTemplate = "cn/machine_number/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetMachineNumber(out string machineNumber);
|
|
|
|
[WebGet(UriTemplate = "cn/process_number/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessNumber(out ushort processNumber);
|
|
|
|
[WebGet(UriTemplate = "nc/alarms", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void NcAlarms(out List<NcAlarmModel> alarms);
|
|
|
|
[WebGet(UriTemplate = "plc/alarms", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void PlcAlarms(out List<NcAlarmModel> alarms);
|
|
|
|
#endregion Nc Data API
|
|
|
|
|
|
|
|
#region Process API
|
|
|
|
[WebGet(UriTemplate = "process/{id}/status/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessStatus(string id, out int status);
|
|
|
|
[WebGet(UriTemplate = "process/{id}/part_program_name/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessPartProgram(string id, out string partProgramName);
|
|
|
|
[WebGet(UriTemplate = "process/{id}/mode/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessMode(string id, out int mode);
|
|
|
|
[WebGet(UriTemplate = "process/{id}/alarms/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessAlarms(string id, out List<NcAlarmModel> alarms);
|
|
|
|
[WebGet(UriTemplate = "processes/alarms/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetProcessesAlarms(out List<NcAlarmModel> alarms);
|
|
|
|
#endregion Process API
|
|
|
|
#region Process Axes API
|
|
|
|
[WebGet(UriTemplate = "process/{id}/axes/", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetAxesPosition(string id, out List<NcAxisModel> axes);
|
|
|
|
#endregion Process Axes API
|
|
|
|
#region Binary Memory
|
|
|
|
[WebGet(UriTemplate = "binary_memory/byte/{index}/{bit}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetBoolean(string index, string bit, out bool value);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/byte/{index}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetByte(string index, out byte value);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/word/{index}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetWord(string index, out ushort value);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/short/{index}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetShort(string index, out short value);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/dword/{index}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetDWord(string index, out uint value);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/integer/{index}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetInteger(string index, out int value);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/boolean/{index}/{bit}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutBoolean(string index, string bit, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/byte/{index}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutByte(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/word/{index}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutWord(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/short/{index}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutShort(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/integer/{index}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutInteger(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/dword/{index}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
|
void PutDWord(string index, BinaryMemoryModel body);
|
|
|
|
#endregion Binary Memory
|
|
|
|
#region Binary Memory List
|
|
|
|
[WebGet(UriTemplate = "binary_memory/byte/{index}/list/{number}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetByteList(string index, string number, out List<byte> byteList);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/word/{index}/list/{number}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetWordList(string index, string number, out List<ushort> byteList);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/short/{index}/list/{number}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetShortList(string index, string number, out List<short> byteList);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/integer/{index}/list/{number}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetIntegerList(string index, string number, out List<int> byteList);
|
|
|
|
[WebGet(UriTemplate = "binary_memory/{index}/list/{number}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetDWordList(string index, string number, out List<uint> byteList);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/byte/{index}/list", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
|
|
void PutByteList(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/word/{index}/list", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
|
|
void PutWordList(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/short/{index}/list", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
|
|
void PutShortList(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/integer/{index}/list", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
|
|
void PutIntegerList(string index, BinaryMemoryModel body);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "binary_memory/dword/{index}/list", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
|
|
void PutDWordList(string index, BinaryMemoryModel body);
|
|
|
|
#endregion Binary Memory List
|
|
|
|
#region File Management
|
|
|
|
[WebGet(UriTemplate = "files/?filePath={filePath}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetFileList(string filePath, out List<PreviewFileModel> fileList);
|
|
|
|
[WebGet(UriTemplate = "file/info/?filePath={filePath}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetFileInfo(string filePath, out InfoFile fileInfo);
|
|
|
|
[WebGet(UriTemplate = "file/active/{processId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetActiveProgramData(string processId, out ActiveProgramDataModel programData);
|
|
|
|
[WebGet(UriTemplate = "file/deactive/{processId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void RemoveActiveProgram(string processId, out ActiveProgramDataModel programData);
|
|
|
|
[WebGet(UriTemplate = "file/active?processId={processId}&filePath={filePath}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void SetActiveProgramData(int processId, string filePath, out ActiveProgramDataModel programData);
|
|
|
|
[WebGet(UriTemplate = "file/{fileName}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetFile(string fileName, out string fileContent);
|
|
|
|
[WebInvoke(Method = "POST", UriTemplate = "file", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PostFile(TransferFileModel file);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "file", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void CopyFile(TransferFileModel file);
|
|
|
|
[WebInvoke(Method = "DELETE", UriTemplate = "file/{fileName}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void DeleteFile(string fileName);
|
|
|
|
[WebGet(UriTemplate = "translation/{language}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetTranslations(string language, out Dictionary<int, string> fileContent);
|
|
|
|
#endregion File Management
|
|
|
|
#region Family
|
|
|
|
[WebGet(UriTemplate = "tool_table/families", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetFamilies(out List<DemoFamilyModel> families);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/family/{oldName}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutFamily(string oldName, ref DemoFamilyModel family);
|
|
|
|
[WebInvoke(Method = "POST", UriTemplate = "tool_table/family", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void AddFamily(ref FamilyModel family);
|
|
|
|
[WebInvoke(Method = "DELETE", UriTemplate = "tool_table/family/{name}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void DeleteFamily(string name);
|
|
|
|
#endregion Family
|
|
|
|
#region Tools
|
|
|
|
[WebGet(UriTemplate = "tool_table", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetTools(out List<DemoToolsDataModel> toolsData);
|
|
|
|
[WebInvoke(Method = "POST", UriTemplate = "tool_table/tool", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void AddTool(ref SiemensToolModel tool);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/tool", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutTool(ref SiemensToolModel tool);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/shank/{shankId}/positionId/{positionId}/tool/{toolId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void UpdateToolShank(string shankId, string positionId, string toolId);
|
|
|
|
[WebInvoke(Method = "DELETE", UriTemplate = "tool_table/tool/{id}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void DeleteTool(string id);
|
|
|
|
[WebInvoke(Method = "POST", UriTemplate = "tool_table/edge/{toolId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void AddEdge(string toolId, ref EdgeModel edge);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/edge/{toolId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutEdge(string toolId, ref EdgeModel edge);
|
|
|
|
[WebInvoke(Method = "DELETE", UriTemplate = "tool_table/edge/{toolId}/{edgeId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void DeleteEdge(string toolId, string edgeId);
|
|
|
|
[WebGet(UriTemplate = "tool_table/shanks", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetShanks(out List<ShankModel> shanksData);
|
|
|
|
[WebInvoke(Method = "POST", UriTemplate = "tool_table/shank", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void AddShank(ref ShankModel shankData);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/shank", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutShank(ref ShankModel shankData);
|
|
|
|
[WebInvoke(Method = "DELETE", UriTemplate = "tool_table/shank/{id}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void DeleteShank(string id);
|
|
|
|
[WebGet(UriTemplate = "tool_table/positions", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetPositions(out List<PositionModel> positionsData);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/position", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutPosition(ref PositionModel position);
|
|
|
|
[WebGet(UriTemplate = "tool_table/magazine/{magazineId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetMagazinePositionsWithTools(string magazineId, out List<DemoMagPosDataModel> positionsData);
|
|
|
|
[WebGet(UriTemplate = "tool_table/magazine/tools", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetToolsAndMultiTools(out List<ShankModel> shanks, out List<SiemensToolModel> tools);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/magazine/{magazineId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void UpdateMagazine(string magazineId, List<NewToolInMagazineModel> magazine);
|
|
|
|
[WebGet(UriTemplate = "tool_table/magazines_action", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetMagazinesAction(out MagazineActionModel magazinesAction);
|
|
|
|
[WebGet(UriTemplate = "tool_table/config", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetToolManagerConfiguration(out DemoToolManagerConfig config);
|
|
|
|
[WebGet(UriTemplate = "tool_table/offset", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
|
|
void GetOffsets(out List<OffsetModel> offsetData);
|
|
|
|
[WebInvoke(Method = "PUT", UriTemplate = "tool_table/offset", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
|
|
void PutOffset(ref OffsetModel offsetData);
|
|
|
|
#endregion Tools
|
|
}
|
|
} |