| | |
| | | } |
| | | |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | axios.defaults.baseURL = 'http://192.168.20.253:9291/'; |
| | | axios.defaults.baseURL = 'http://192.168.76.251:9291/'; |
| | | } |
| | | if (!axios.defaults.baseURL.endsWith('/')) { |
| | | axios.defaults.baseURL+="/"; |
| | |
| | | å·¥ä½ç¶æï¼{{ Stacker.data.stackerCraneWorkStatusDes }} |
| | | </li> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | èµ·ç¹ï¼{{ Stacker.data.SourceAddress || 'ææ ä»»å¡' }} |
| | | èµ·ç¹ï¼{{ Stacker.data.sourceAddress || 'ææ ä»»å¡' }} |
| | | </li> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | ç»ç¹ï¼{{ Stacker.data.TargetAddress || 'ææ ä»»å¡' }} |
| | | ç»ç¹ï¼{{ Stacker.data.targetAddress || 'ææ ä»»å¡' }} |
| | | </li> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | å½ä»¤æ¹å¼ï¼{{ Stacker.data.Command==1? 'åæ¾ç©æä½ä¸': 'ç§»å¨å°æå®ä½ç½®' }} |
| | | å½ä»¤æ¹å¼ï¼{{ Stacker.data.command==1? 'åæ¾ç©æä½ä¸': 'ç§»å¨å°æå®ä½ç½®' }} |
| | | </li> |
| | | <li class="list-group-item list-group-item-secondary"> |
| | | AGVçµéï¼{{ Stacker.data.electricity+'%' }} |
| | |
| | | }); |
| | | |
| | | connection.on("StackerData", (data) => { |
| | | console.log(data) |
| | | eventBus.emit("stackerData", data); |
| | | }); |
| | | connection.on("LineData", (data) => { |
| | |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | const searchFormFields = ref({"BeginDate":"","Url":"","LogType":[],"Success":[],"UserIP":"","ServiceIP":"","Role_Id":""}); |
| | | const searchFormOptions = ref([[{"title":"请æ±å°å","field":"Url","type":"text"},{"title":"ç¨æ·IP","field":"UserIP","type":"text"},{"title":"æå¡å¨IP","field":"ServiceIP","type":"text"}],[{"title":"å¼å§æ¶é´","field":"BeginDate","type":"datetime"},{"dataKey":"restatus","data":[],"title":"ååºç¶æ","field":"Success","type":"selectList"},{"dataKey":"roles","data":[],"title":"è§è²ID","field":"Role_Id","type":"select"}],[{"dataKey":"log","data":[],"title":"æ¥å¿ç±»å","field":"LogType","colSize":12,"type":"checkbox"}]]); |
| | | const columns = ref([{field:'Id',title:'Id',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'}, |
| | | {field:'BeginDate',title:'å¼å§æ¶é´',type:'datetime',width:140,align:'left',sortable:true}, |
| | | {field:'UserName',title:'ç¨æ·åç§°',type:'string',width:90,align:'left'}, |
| | | {field:'Url',title:'请æ±å°å',type:'string',width:110,align:'left'}, |
| | | {field:'LogType',title:'æ¥å¿ç±»å',type:'string',bind:{ key:'log',data:[]},width:80,align:'left'}, |
| | | {field:'Success',title:'ååºç¶æ',type:'int',bind:{ key:'restatus',data:[]},width:80,align:'left'}, |
| | | {field:'ElapsedTime',title:'æ¶é¿',type:'int',width:60,align:'left'}, |
| | | {field:'RequestParameter',title:'请æ±åæ°',type:'string',width:70,align:'left'}, |
| | | {field:'ResponseParameter',title:'ååºåæ°',type:'string',width:70,align:'left'}, |
| | | {field:'ExceptionInfo',title:'å¼å¸¸ä¿¡æ¯',type:'string',width:70,align:'left'}, |
| | | {field:'UserIP',title:'ç¨æ·IP',type:'string',width:90,align:'left'}, |
| | | {field:'ServiceIP',title:'æå¡å¨IP',type:'string',width:90,hidden:true,align:'left'}, |
| | | {field:'BrowserType',title:'æµè§å¨ç±»å',type:'string',width:90,align:'left'}, |
| | | {field:'User_Id',title:'ç¨æ·ID',type:'int',width:90,hidden:true,align:'left'}, |
| | | {field:'Role_Id',title:'è§è²ID',type:'int',bind:{ key:'roles',data:[]},width:90,hidden:true,align:'left'}, |
| | | {field:'EndDate',title:'ç»ææ¶é´',type:'datetime',width:150,hidden:true,align:'left',sortable:true}]); |
| | | const searchFormOptions = ref([[{"title":"请æ±å°å","field":"Url","type":"text"},{"title":"ç¨æ·åç§°","field":"userName","type":"text"},{"title":"æå¡å¨IP","field":"ServiceIP","type":"text"}],[{"title":"å¼å§æ¶é´","field":"BeginDate","type":"datetime"},{"dataKey":"restatus","data":[],"title":"ååºç¶æ","field":"Success","type":"selectList"},{"dataKey":"roles","data":[],"title":"è§è²ID","field":"Role_Id","type":"select"}]]); |
| | | const columns = ref([{field:'id',title:'Id',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'}, |
| | | {field:'beginDate',title:'å¼å§æ¶é´',type:'datetime',width:140,align:'left',sortable:true}, |
| | | {field:'userName',title:'ç¨æ·åç§°',type:'string',width:90,align:'left'}, |
| | | {field:'url',title:'请æ±å°å',type:'string',width:110,align:'left'}, |
| | | {field:'logType',title:'æ¥å¿ç±»å',type:'string',bind:{ key:'log',data:[]},width:80,align:'left',hidden:true}, |
| | | {field:'success',title:'ååºç¶æ',type:'int',bind:{ key:'restatus',data:[]},width:80,align:'left'}, |
| | | {field:'elapsedTime',title:'æ¶é¿',type:'int',width:60,align:'left'}, |
| | | {field:'requestParam',title:'请æ±åæ°',type:'string',width:70,align:'left'}, |
| | | {field:'responseParam',title:'ååºåæ°',type:'string',width:70,align:'left'}, |
| | | {field:'exceptionInfo',title:'å¼å¸¸ä¿¡æ¯',type:'string',width:70,align:'left',hidden:true}, |
| | | {field:'userIP',title:'ç¨æ·IP',type:'string',width:90,align:'left'}, |
| | | {field:'serviceIP',title:'æå¡å¨IP',type:'string',width:90,hidden:true,align:'left'}, |
| | | {field:'browserType',title:'æµè§å¨ç±»å',type:'string',width:90,align:'left',hidden:true}, |
| | | {field:'user_Id',title:'ç¨æ·ID',type:'int',width:90,hidden:true,align:'left'}, |
| | | {field:'role_Id',title:'è§è²ID',type:'int',bind:{ key:'roles',data:[]},width:90,hidden:true,align:'left'}, |
| | | {field:'endDate',title:'ç»ææ¶é´',type:'datetime',width:150,hidden:true,align:'left',sortable:true}]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | columns: [], |
| | |
| | | { |
| | | |
| | | } |
| | | public class Station_materialList |
| | | { |
| | | /// <summary> |
| | | /// 䏿ä½-ãã䏿æåæ¾ |
| | | /// </summary> |
| | | public static List<int> BoardLoadList = new List<int>() { (int)AgvStationEnum.BoardLoad, (int)AgvStationEnum.PadUse }; |
| | | |
| | | /// <summary> |
| | | /// 䏿ï¼ä¸æï¼å«æ¿ä½¿ç¨ï¼å«æ¿åæ¶ |
| | | /// </summary> |
| | | public static List<int> UsebitsList = new List<int>() { (int)AgvStationEnum.BoardUnload,(int)AgvStationEnum.PadRecycle}; |
| | | |
| | | |
| | | public static List<string> StationareaList = new List<string>() {"1003","1004" , "1005","1006","1007" }; |
| | | } |
| | | public List<Dt_StationManager> QuerypLatform(string deviceNo,List<string> task) |
| | | { |
| | | return BaseDal.QueryData(x=>x.DeviceCode == deviceNo && x.stationEnable==1 && Station_materialList.UsebitsList.Contains(x.stationMaterial) && !task.Contains(x.stationName)).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> QuerypLatformarer(string deviceNo) |
| | | { |
| | | return BaseDal.QueryData((x => x.DeviceCode == deviceNo && x.stationEnable == 1 && Station_materialList.BoardLoadList.Contains(x.stationMaterial)), x=>x.stationMaterial).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> QuerypLatformmaterial(int Station_Area) |
| | | { |
| | | return BaseDal.QueryData(x => x.stationArea == Station_Area && x.stationEnable == 1 && (x.stationMaterial == (int)AgvStationEnum.BoardStore || x.stationMaterial == (int)AgvStationEnum.PadStore) ).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> QuerypStation_Area(int Station_Area) |
| | | { |
| | | return BaseDal.QueryData(x => x.stationArea == Station_Area && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.PadStore).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> QuerypStation_Area2(string Station_remark) |
| | | { |
| | | return BaseDal.QueryData(x => Station_remark.Contains(x.stationRemark) && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.PadStore).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> GetAllStationByDeviceCode(string DeviceCode) |
| | | { |
| | | return BaseDal.QueryData(x => x.DeviceCode == DeviceCode && x.stationEnable == 1).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StationManager> QueryPlatform(Dt_StationManager station, List<string> tasks) |
| | | { |
| | | if (station.stationArea == 3 && station.stationMaterial == 7) |
| | | { |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.BoardLoad && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).OrderBy(y => y.stationMaterial).ToList(); |
| | | } |
| | | switch (station.stationMaterial) |
| | | { |
| | | case (int)AgvStationEnum.BoardUnload: |
| | | if (station.stationArea == 3) |
| | | { |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && (x.stationMaterial == (int)AgvStationEnum.BlankingBuffer|| x.stationMaterial == (int)AgvStationEnum.BoardLoad) && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).OrderBy(y=>y.stationMaterial).ToList(); |
| | | } |
| | | else |
| | | { |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.BlankingBuffer && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).ToList(); |
| | | } |
| | | case (int)AgvStationEnum.BoardStore: |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.BoardLoad && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).ToList(); |
| | | |
| | | case (int)AgvStationEnum.PadRecycle: |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && (x.stationMaterial == (int)AgvStationEnum.PadStore || x.stationMaterial == (int)AgvStationEnum.PadUse) && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).OrderBy(y=>y.stationMaterial).ToList(); |
| | | |
| | | case (int)AgvStationEnum.PadStore: |
| | | return BaseDal.QueryData(x => x.stationArea == station.stationArea && x.stationEnable == 1 && x.stationMaterial == (int)AgvStationEnum.PadUse && !tasks.Contains(x.stationName) && !station.stationName.Contains(x.stationName)).ToList(); |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | [Description("䏿ä½")] |
| | | BoardUnload = 2, |
| | | /// <summary> |
| | | /// ç¼åä½ |
| | | /// 䏿ç¼åä½ |
| | | /// </summary> |
| | | [Description("ç¼åä½")] |
| | | [Description("䏿ç¼åä½")] |
| | | BoardStore = 3, |
| | | /// <summary> |
| | | /// 嫿¿ä½¿ç¨ä½ |
| | |
| | | /// </summary> |
| | | [Description("嫿¿ç¼åä½")] |
| | | PadStore = 6, |
| | | |
| | | /// <summary> |
| | | /// 䏿ç¼åä½ |
| | | /// </summary> |
| | | [Description("䏿ç¼åä½")] |
| | | BlankingBuffer = 7, |
| | | } |
| | | |
| | | public enum AgvareaEnum |
| | |
| | | { |
| | | public interface IDt_StationManagerService : IService<Dt_StationManager> |
| | | { |
| | | public List<Dt_StationManager> QuerypLatform(string deviceNo, List<string> _Task); |
| | | |
| | | public List<Dt_StationManager> QuerypLatformarer(string deviceNo); |
| | | |
| | | public List<Dt_StationManager> QuerypLatformmaterial(int Station_Area); |
| | | |
| | | public List<Dt_StationManager> QuerypStation_Area(int Station_Area); |
| | | |
| | | public List<Dt_StationManager> QuerypStation_Area2(string Station_remark); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®PLC设å¤è·åå½å设å¤ä¸çææå¯ç¨çç«å° |
| | | /// </summary> |
| | | /// <param name="DeviceCode"></param> |
| | | /// <returns></returns> |
| | | List<Dt_StationManager> GetAllStationByDeviceCode(string DeviceCode); |
| | | |
| | | List<Dt_StationManager> QueryPlatform(Dt_StationManager station, List<string> tasks); |
| | | } |
| | | } |
| | |
| | | /// <param name="deviceNo"></param> |
| | | /// <param name="currentAddress"></param> |
| | | /// <returns></returns> |
| | | List<string> QueryConveyorLineTaskSourceAddress(); |
| | | List<string> QueryConveyorLineTask(); |
| | | |
| | | Dt_Task QueryConveyorLineTask(string stationName); |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¾è¯¥å°åæ¯å¦æèµ·ç¹è´§ç»ç¹ä»»å¡ |
| | |
| | | /// <summary> |
| | | /// 请æ±åæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "请æ±åæ°")] |
| | | [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "请æ±åæ°")] |
| | | public string RequestParam { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååºåæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "ååºåæ°")] |
| | | [SugarColumn(IsNullable = true, Length = int.MaxValue, ColumnDescription = "ååºåæ°")] |
| | | public string ResponseParam { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 请æ±å°å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 2000, ColumnDescription = "请æ±å°å")] |
| | | [SugarColumn(IsNullable = true, Length = 8000, ColumnDescription = "请æ±å°å")] |
| | | public string Url { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨æ·IP |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "ç¨æ·IP")] |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç¨æ·IP")] |
| | | public string UserIP { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¨æ·åç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç¨æ·åç§°")] |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç¨æ·åç§°")] |
| | | public string UserName { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Description("èæº")] |
| | | Automatic = 4, |
| | | |
| | | /// <summary> |
| | | /// æ
é |
| | | /// </summary> |
| | | [Description("æ
é")] |
| | | Fault = 5, |
| | | } |
| | | |
| | | public enum StackerCraneWorkStatus |
| | |
| | | /// æªç¥ |
| | | /// </summary> |
| | | [Description("æªç¥")] |
| | | Unkonw |
| | | Unkonw, |
| | | /// <summary> |
| | | /// æ
é |
| | | /// </summary> |
| | | [Description("æ
é")] |
| | | Fault = 5, |
| | | } |
| | | public enum StackerCraneTaskCompleted |
| | | { |
| | |
| | | { |
| | | tasks.Add(item); |
| | | } |
| | | BaseDal.AddData(tasks); |
| | | BaseDal.AddData(tasks); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(tasks.Select(x => x.TaskNum).ToList(), "æ¥æ¶WMSä»»å¡"); |
| | | content = WebResponseContent.Instance.OK("æå"); |
| | | } |
| | |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public List<string> QueryConveyorLineTaskSourceAddress() |
| | | public List<string> QueryConveyorLineTask() |
| | | { |
| | | return BaseDal.QueryData().Select(task => task.SourceAddress).ToList(); |
| | | var query = BaseDal.QueryData(); |
| | | return query.SelectMany(x => |
| | | new[] { x.SourceAddress, x.TargetAddress } |
| | | .Where(address => !string.IsNullOrEmpty(address))) |
| | | .ToList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¾è¯¥ç«å°æ¯å¦æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryConveyorLineTask(string stationName) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.SourceAddress == stationName||x.TargetAddress==stationName); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public Dt_Task? QuertStackerCraneTask(string deviceNo, TaskTypeGroup? taskTypeGroup = null) |
| | | { |
| | | if(taskTypeGroup == null) |
| | | if (taskTypeGroup == null) |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew), TaskOrderBy); |
| | | if(taskTypeGroup.Value == TaskTypeGroup.InboundGroup) |
| | | if (taskTypeGroup.Value == TaskTypeGroup.InboundGroup) |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.Line_InFinish, TaskOrderBy); |
| | | if(taskTypeGroup.Value == TaskTypeGroup.OutbondGroup) |
| | | if (taskTypeGroup.Value == TaskTypeGroup.OutbondGroup) |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); |
| | | return null; |
| | | } |
| | |
| | | /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡ï¼å¯è½ä¸ºnull</returns> |
| | | public Dt_Task QueryStackerCraneTask(string deviceNo, string currentAddress = "") |
| | | { |
| | | return BaseDal.QueryFirst(x => x.TaskState == (int)TaskOutStatusEnum.OutNew && x.AGVName==deviceNo,TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.TaskState == (int)AGVTaskStatusEnum.AGVNew && x.AGVName == deviceNo, TaskOrderBy); |
| | | } |
| | | |
| | | |
| | |
| | | *----------------------------------------------------------------*/ |
| | | #endregion << ç æ¬ 注 é >> |
| | | |
| | | using AngleSharp.Dom; |
| | | using Autofac.Core; |
| | | using AutoMapper; |
| | | using HslCommunication; |
| | | using Microsoft.CodeAnalysis.CSharp.Syntax; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using Quartz; |
| | | using System.Reflection; |
| | |
| | | #endregion è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | |
| | | // å°äº¤äºä¿¡å·è½¬æ¢ä¸ºå¸å°æ°ç» |
| | | var writeInteractiveSignal = command.InteractiveSignal; |
| | | var structs = BitConverter.GetBytes(writeInteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | // è·å设å¤å议详æ
|
| | | List<DeviceProtocolDetailDTO>? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.Where(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)).ToList(); |
| | | |
| | |
| | | MethodInfo? method = GetType().GetMethod(item.ProtocolDetailType); |
| | | if (method != null) |
| | | { |
| | | method.Invoke(this, new object[] { conveyorLine, station.stationName }); |
| | | method.Invoke(this, new object[] { conveyorLine, station }); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="command">读åç请æ±ä¿¡æ¯</param>Request outbound |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public async Task RequestInbound(CommonConveyorLine conveyorLine, string childDeviceCode) |
| | | public async Task RequestInbound(CommonConveyorLine conveyorLine, Dt_StationManager station) |
| | | { |
| | | try |
| | | { |
| | | // è¾åºä¿¡æ¯ï¼è¡¨ç¤ºç«å°è¯·æ±åè´§ |
| | | var log = $"ã{conveyorLine._deviceName}ãç«å°ã{childDeviceCode}ã请æ±åè´§"; |
| | | ConsoleHelper.WriteWarningLine(log); |
| | | // æ¨ééç¥å°å端SignIR |
| | | await _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "Red" }); |
| | | WriteInfo(conveyorLine.DeviceName, log); |
| | | var log = $"ã{conveyorLine._deviceName}ãç«å°ã{station.stationName}ã请æ±åè´§"; |
| | | await LogAndWarn(conveyorLine.DeviceName, log); |
| | | |
| | | // è·åææä»»å¡æºå°å |
| | | List<string> task = _taskService.QueryConveyorLineTaskSourceAddress(); |
| | | List<string> taskSourceAddress = _taskService.QueryConveyorLineTask(); |
| | | if (_taskService.QueryConveyorLineTask(station.stationName) != null) |
| | | { |
| | | ConveyorLineSendFinish(conveyorLine, station.stationName); |
| | | await LogAndWarn(conveyorLine.DeviceName, $"ã{conveyorLine._deviceName}ãç«å°ã{station.stationName}ãåå¨ä»»å¡"); |
| | | return; |
| | | } |
| | | |
| | | // æ ¹æ®è®¾å¤ç¼å·å任塿ºå°åæ¥è¯¢æææªæ§è¡çä»»å¡ |
| | | List<Dt_StationManager> childDeviceCodes = _stationManagerService.QuerypLatform(conveyorLine.DeviceCode, task); //å¯¹åºæ¯ä¸ªipæ¾å
¨é¨ç䏿ç«ç¹ä¸å«æ¿åæ¶ç¹ç«å°ç¹ |
| | | List<Dt_StationManager> childDeviceCodes = _stationManagerService.QueryPlatform(station, taskSourceAddress); //å¯¹åºæ¯ä¸ªipæ¾å
¨é¨ç䏿ç«ç¹ä¸å«æ¿åæ¶ç¹ç«å°ç¹ |
| | | |
| | | |
| | | if(childDeviceCodes.Count()==0|| childDeviceCodes == null) |
| | | { |
| | | ConveyorLineSendFinish(conveyorLine, station.stationName); |
| | | await LogAndWarn(conveyorLine.DeviceName, $"ã{conveyorLine._deviceName}ãç«å°ã{station.stationName}ãæªæ¾å°å¯åå¾ç«å°"); |
| | | return; |
| | | } |
| | | |
| | | foreach (var item in childDeviceCodes) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item.stationName); |
| | | if (command != null) |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == item.DeviceCode); |
| | | if (device != null) |
| | | { |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | if (structs[1]) |
| | | CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device; |
| | | ConveyorLineTaskCommand command = commonConveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item.stationName); |
| | | if (command != null) |
| | | { |
| | | if (item.stationMaterial == (int)AgvStationEnum.PadRecycle) |
| | | { |
| | | RequestHcdbst(conveyorLine, item.stationArea, item.stationName, item.stationRemark); |
| | | return; |
| | | } |
| | | else |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | if (structs[2]) |
| | | { |
| | | Dt_Task taskDTO = new Dt_Task() |
| | | { |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Grade = 1, |
| | | Roadway = item.stationArea.ToString(), |
| | | SourceAddress = childDeviceCode, |
| | | SourceAddress = station.stationName, |
| | | CurrentAddress= station.stationName, |
| | | TargetAddress = item.stationName, |
| | | NextAddress = item.stationName, |
| | | TaskState = (int)AGVTaskStatusEnum.AGVNew, |
| | | TaskType = item.stationMaterial, |
| | | TaskType = (int)AGVTaskTypeEnum.AGVCarry, |
| | | AGVName = item.stationArea switch |
| | | { |
| | | 1 => "AGV01", |
| | | 4 => "AGV03", |
| | | _ => "AGV02", |
| | | } |
| | | }; |
| | | _taskService.ReceiveWMSTask(new List<Dt_Task> { taskDTO }); |
| | | ConveyorLineSendFinish(conveyorLine,station.stationName); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"ç«å°{item.stationName}ç¶æä¸å¯ç¨{structs[2]}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"éè®¯è¿æ¥é误ï¼{item.stationName}æªæ¾å°è¯»å模åå°å"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®agv䏿任å¡ï¼æææ¾è³ä¸æå£æç¼åä½ |
| | | /// </summary> |
| | | /// <param name="conveyorLine">è¾é线å®ä¾å¯¹è±¡</param> |
| | | /// <param name="childDeviceCode">å设å¤ç¼å·</param> |
| | | public void RequestOutbound(CommonConveyorLine conveyorLine, string childDeviceCode) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_StationManager> station = _stationManagerService.QuerypLatformarer(conveyorLine.DeviceCode); |
| | | foreach (var item in station) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item.stationName); |
| | | if (command != null) |
| | | { |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | if (structs[2]) |
| | | { |
| | | if (item.stationMaterial == (int)AgvStationEnum.BoardLoad) |
| | | else |
| | | { |
| | | //Dt_Task agvstack= _taskService.QueryConveyorLineTaskRoadway(AGVStationitem.stationArea); |
| | | //if(agvstack != null) |
| | | //{ |
| | | // _taskService.UpdateTargetAddress(agvstack.TaskId, AGVStationitem.stationName); |
| | | //} |
| | | //else |
| | | //{ |
| | | // //廿¾ç¼ååºåºå |
| | | // RequestHcst(conveyorLine, AGVStationitem.stationArea, AGVStationitem.stationName, AGVStationitem.stationRemark); |
| | | //} |
| | | await LogAndWarn(conveyorLine.DeviceName, $"ç«å°{item.stationName}ç¶æä¸å¯ç¨{structs[2]}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"ç«å°{item.stationName}ç¶æä¸å¯ç¨{structs[2]}"); |
| | | WriteInfo(conveyorLine.DeviceName, $"éè®¯è¿æ¥é误ï¼{item.stationName}æªæ¾å°è¯»å模åå°å"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var logerror = $"ã{conveyorLine.DeviceName}ãç«å°ï¼ã{item.stationName}ãæªé
置设å¤è¡¨å¤´"; |
| | | await LogAndWarn(conveyorLine.DeviceName, logerror); |
| | | } |
| | | } |
| | | } |
| | |
| | | WriteInfo(conveyorLine.DeviceName, ex.Message); |
| | | } |
| | | } |
| | | |
| | | public void RequestHcst(CommonConveyorLine conveyorLine,int Station_Area,string Station_names,string Station_remark) |
| | | { |
| | | List<Dt_StationManager> AGVStationListdata = _stationManagerService.QuerypLatformmaterial(Station_Area); //æ¥åºç¼åä½ |
| | | if (Station_remark != null) //æ¾å¯»å¯¹åºçæ¾è´§ç«å° |
| | | { |
| | | AGVStationListdata = _stationManagerService.QuerypStation_Area2(Station_remark); |
| | | } |
| | | foreach (var item in AGVStationListdata) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item.stationName); |
| | | if (command != null) |
| | | { |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | if (structs[1]) |
| | | { |
| | | if (_taskService.QueryConveyorLinetaeersuadd(item.stationName)) |
| | | { |
| | | Dt_Task taskDTO = new Dt_Task() |
| | | { |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Grade = 1, |
| | | Roadway = item.stationArea.ToString(), |
| | | SourceAddress = item.stationName, |
| | | CurrentAddress = item.stationName, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskType = (int)item.stationMaterial, |
| | | TargetAddress = Station_names, |
| | | NextAddress = Station_names, |
| | | }; |
| | | _taskService.ReceiveWMSTask(new List<Dt_Task> { taskDTO }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"éè®¯è¿æ¥é误ï¼{item.stationName}æªæ¾å°è¯»å模åå°å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void RequestHcdbst(CommonConveyorLine conveyorLine, int Station_Area, string Station_names,string Station_remark) |
| | | { |
| | | List<Dt_StationManager> AGVStationListdata = _stationManagerService.QuerypStation_Area(Station_Area); //æ¥åºç¼åä½ |
| | | if(Station_remark !=null) //æ¾å¯»å¯¹åºçæ¾è´§ç«å° |
| | | { |
| | | AGVStationListdata= _stationManagerService.QuerypStation_Area2(Station_remark); |
| | | } |
| | | |
| | | foreach (var item in AGVStationListdata) |
| | | { |
| | | ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(item.stationName); |
| | | if (command != null) |
| | | { |
| | | var structs = BitConverter.GetBytes(command.InteractiveSignal).Reverse().ToArray().ToBoolArray(); |
| | | if (structs[1]) |
| | | { |
| | | if (_taskService.QueryConveyorLinetaeersuadd(item.stationName)) |
| | | { |
| | | Dt_Task taskDTO = new Dt_Task() |
| | | { |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Grade = 1, |
| | | Roadway = item.stationArea.ToString(), |
| | | SourceAddress = Station_names, |
| | | CurrentAddress = Station_names, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskType = (int)item.stationMaterial, |
| | | TargetAddress = item.stationName, |
| | | NextAddress = item.stationName, |
| | | }; |
| | | _taskService.ReceiveWMSTask(new List<Dt_Task> { taskDTO }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(conveyorLine.DeviceName, $"è¯»åæ¾è´§ä¿¡å·ä¸ºï¼{structs[2]}"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è¾é线交äºå®æ |
| | | /// </summary> |
| | |
| | | |
| | | conveyorLine.Communicator.Write(devicePro.DeviceProAddress, true); |
| | | } |
| | | |
| | | public async Task LogAndWarn(string deviceName, string log, string color = "red") |
| | | { |
| | | ConsoleHelper.WriteWarningLine(log); |
| | | await _noticeService.Logs(userTokenIds, new { deviceName, log = log, time = DateTime.Now.ToString("G"), color = color }); |
| | | WriteInfo(deviceName, log); |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_Core.HttpContextUser; |
| | | using WIDESEAWCS_DTO.Enum; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_ISystemRepository; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | |
| | | using WIDESEAWCS_QuartzJob.StackerCrane.Enum; |
| | | using WIDESEAWCS_SignalR; |
| | | using WIDESEAWCS_Tasks.StackerCraneJob; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; |
| | | using ICacheService = WIDESEAWCS_Core.Caches.ICacheService; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | |
| | | try |
| | | { |
| | | CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | |
| | | if (commonStackerCrane != null) |
| | | { |
| | | if (!commonStackerCrane.IsEventSubscribed) |
| | |
| | | |
| | | if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Idle) |
| | | { |
| | | GetTask(commonStackerCrane); |
| | | if (commonStackerCrane.GetValue<StackerCraneDBName, float>(StackerCraneDBName.Electricity) > 20) |
| | | { |
| | | GetTask(commonStackerCrane); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | commonStackerCrane.DeviceName, |
| | | commonStackerCrane.CurrentTaskNum, |
| | | commonStackerCrane.LastTaskNum, |
| | | SourceAddress = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.SourceAddress), |
| | | TargetAddress = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.TargetAddress), |
| | | SourceAddress = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.StartAddress), |
| | | TargetAddress = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.EndAddress), |
| | | Command = commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.Command), |
| | | Electricity = commonStackerCrane.GetValue<StackerCraneDBName, float>(StackerCraneDBName.Electricity), |
| | | }; |
| | |
| | | CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; |
| | | if (commonStackerCrane != null) |
| | | { |
| | | |
| | | Console.Out.WriteLine("TaskCompleted" + e.TaskNum); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.TaskCompleted, 1); |
| | | |
| | |
| | | task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | if (task.Roadway == "3") |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | Thread.Sleep(1000); |
| | | if (ReadReceived(commonStackerCrane) == 1) |
| | | if (AGVToSandyEdgeRead(commonStackerCrane)) |
| | | { |
| | | WriteConfirm(commonStackerCrane); |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | WriteAGVTask(task, commonStackerCrane); |
| | | } |
| | | else |
| | | { |
| | | AGVToSandyEdge(commonStackerCrane); |
| | | } |
| | | |
| | | } |
| | | else if (task.Roadway == "2") |
| | | { |
| | | if (AGVToEdgeBandingRead(commonStackerCrane)) |
| | | { |
| | | WriteAGVTask(task, commonStackerCrane); |
| | | } |
| | | else |
| | | { |
| | | AGVToEdgeBanding(commonStackerCrane); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteAGVTask(task, commonStackerCrane); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | //读åAGVç¶æ |
| | | public int ReadAGVstatus(CommonStackerCrane commonStackerCrane) |
| | | public void WriteAGVTask(Dt_Task task, CommonStackerCrane commonStackerCrane) |
| | | { |
| | | var deviceProDTO = commonStackerCrane.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AGVCraneStatus"); |
| | | return deviceProDTO != null ? commonStackerCrane.Communicator.Read<int>(deviceProDTO.DeviceProAddress) : 99; |
| | | } |
| | | //读åAGV工使¨¡å¼ |
| | | public int ReadAGVworkingmode(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | var deviceProDTO = commonStackerCrane.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AGVWorkingmode"); |
| | | return deviceProDTO != null ? commonStackerCrane.Communicator.Read<int>(deviceProDTO.DeviceProAddress) : 99; |
| | | } |
| | | |
| | | //读åä»»å¡å· |
| | | public int Readtasknumber(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | var deviceProDTO = commonStackerCrane.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AGVWorkingmode"); |
| | | return deviceProDTO != null ? commonStackerCrane.Communicator.Read<int>(deviceProDTO.DeviceProAddress) : 99; |
| | | StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task); |
| | | if (stackerCraneTaskCommand != null) |
| | | { |
| | | bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand); |
| | | Thread.Sleep(2000); |
| | | if (ReadReceived(commonStackerCrane) == 1) |
| | | { |
| | | if (Clear(commonStackerCrane)) |
| | | { |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.Received); |
| | | } |
| | | public void WriteConfirm(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WriteConfirm, 1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è°åº¦AGVå»å°è¾¹åºå |
| | |
| | | /// <param name="value"></param> |
| | | public void AGVToEdgeBanding(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | commonStackerCrane.SetValue(StackerCraneDBName.AreaWrite, true); |
| | | DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == "AreaWrite" && x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AreaWrite").OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress, true); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 3); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WriteConfirm, 1); |
| | | Thread.Sleep(1000); |
| | | if (ReadReceived(commonStackerCrane) == 1) |
| | | { |
| | | Clear(commonStackerCrane); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读åAGVæ¯å¦å¨ç è¾¹ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane"></param> |
| | | /// <returns></returns> |
| | | public bool AGVToSandyEdgeRead(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == "AreaRead" && x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AreaRead").OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ãæªæ¾å°é
ç½®è°åº¦AGVåºååè®®ã", ConsoleColor.Magenta); |
| | | return false; |
| | | } |
| | | |
| | | string[] x = devicePro.DeviceProAddress.Split('.'); |
| | | |
| | | x[x.Length - 1] = (int.Parse(x[x.Length - 1]) + 1).ToString(); |
| | | |
| | | string DeviceProAddress = string.Join(".", x); |
| | | bool read = commonStackerCrane.Communicator.Read<bool>(DeviceProAddress); |
| | | |
| | | return read; |
| | | } |
| | | |
| | | public bool Clear(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == "WriteConfirm" && x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "WriteConfirm").OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ãæªæ¾å°é
ç½®è°åº¦AGVåºååè®®ã", ConsoleColor.Magenta); |
| | | return false; |
| | | } |
| | | commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress,Convert.ToInt16(0)); |
| | | |
| | | for (int i = 0; i < 6; i++) |
| | | { |
| | | if (i == 5) |
| | | { |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | int read = commonStackerCrane.Communicator.Read<int>(devicePro.DeviceProAddress); |
| | | if (read == 0) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress, Convert.ToInt16(0)); |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读åAGVæ¯å¦å¨å°è¾¹ |
| | | /// </summary> |
| | | /// <param name="commonStackerCrane"></param> |
| | | /// <returns></returns> |
| | | public bool AGVToEdgeBandingRead(CommonStackerCrane commonStackerCrane) |
| | | { |
| | | DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == "AreaRead" && x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AreaRead").OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ãæªæ¾å°é
ç½®è°åº¦AGVåºååè®®ã", ConsoleColor.Magenta); |
| | | return false; |
| | | } |
| | | return commonStackerCrane.Communicator.Read<bool>(devicePro.DeviceProAddress); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | DeviceProDTO? devicePro = commonStackerCrane.DeviceProDTOs.Where(x => x.DeviceProParamType == "AreaWrite" && x.DeviceChildCode == commonStackerCrane.DeviceCode && x.DeviceProParamName == "AreaWrite").OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if(devicePro == null) |
| | | if (devicePro == null) |
| | | { |
| | | ConsoleHelper.WriteColorLine($"ãæªæ¾å°é
ç½®è°åº¦AGVåºååè®®ã", ConsoleColor.Magenta); |
| | | return; |
| | | } |
| | | var writeBool = commonStackerCrane.Communicator.Read<bool>(devicePro.DeviceProAddress+0.1); |
| | | if (!writeBool) |
| | | |
| | | string[] x = devicePro.DeviceProAddress.Split('.'); |
| | | |
| | | x[x.Length - 1] = (int.Parse(x[x.Length - 1]) + 1).ToString(); |
| | | |
| | | string DeviceProAddress = string.Join(".", x); |
| | | commonStackerCrane.Communicator.Write(DeviceProAddress, true); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 4); |
| | | commonStackerCrane.SetValue(StackerCraneDBName.WriteConfirm, 1); |
| | | Thread.Sleep(1000); |
| | | if (ReadReceived(commonStackerCrane) == 1) |
| | | { |
| | | commonStackerCrane.Communicator.Write(devicePro.DeviceProAddress + 0.1, true); |
| | | Clear(commonStackerCrane); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | stackerCraneTaskCommand.TaskType = 0; |
| | | stackerCraneTaskCommand.WriteConfirm = 1; |
| | | stackerCraneTaskCommand.StartAddress = Convert.ToInt16(SourceAddress.stationCode); |
| | | stackerCraneTaskCommand.EndAddress = Convert.ToInt16(TargetAddress.stationCode); |
| | | |
| | |
| | | /// <summary> |
| | | /// èµ·ç¹ |
| | | /// </summary> |
| | | SourceAddress, |
| | | StartAddress, |
| | | |
| | | /// <summary> |
| | | /// ç»ç¹ |
| | | /// </summary> |
| | | TargetAddress, |
| | | EndAddress, |
| | | |
| | | /// <summary> |
| | | /// AGVæ¶å°ä»»å¡ä¿¡å· |
| | |
| | | /// </summary> |
| | | public short WorkType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public short TaskType { get; set; } |
| | | |
| | | public short WriteConfirm { get; set; } |
| | | |
| | | #endregion <Public Menber> |
| | | } |
| | | } |