From 1e38f44af86775a341e4d0e4411d24ad35e417d3 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期五, 28 六月 2024 07:49:36 +0800 Subject: [PATCH] 调整平面图调用接口时间 --- 代码管理/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs | 96 +++++++++-------------------------------------- 1 files changed, 19 insertions(+), 77 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" index 4d94346..084430e 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Jobs/equipment/PipelineJob.cs" @@ -1,17 +1,29 @@ -锘縰sing Quartz; +锘縰sing HslCommunication; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Quartz; using System; using System.Collections.Generic; using System.Linq; +using System.Net; +using System.Reflection; using System.Text; using System.Threading.Tasks; +using System.Xml.Linq; using WIDESEA_Comm; +using WIDESEA_Comm.LogInfo; +using WIDESEA_Comm.TaskNo; using WIDESEA_Core.BaseProvider; using WIDESEA_Core.EFDbContext; -using WIDESEA_Core.FreeDB; +using WIDESEA_Core.Extensions; +using WIDESEA_Entity.DomainModels; using WIDESEA_WCS.IRepositories; using WIDESEA_WCS.Jobs; +using WIDESEA_WCS.JobsPart.Common; using WIDESEA_WCS.Repositories; using WIDESEA_WCS.WCSClient; +using WIDESEA_WMS.IRepositories; +using WIDESEA_WMS.Repositories; using static System.Collections.Specialized.BitVector32; namespace WIDESEA_WCS @@ -26,20 +38,6 @@ { try { - var client = context.JobDetail.JobDataMap.Get("JobParams") as PLCClient; - if (client == null) - { - return Task.CompletedTask; - } - - //鑷姩閲嶈繛 - if (!client.IsConnected) - { - client.Connect(); - return Task.CompletedTask; - } - - //DoAction(client); ExecuteJob(context, DoAction); } catch { } @@ -55,67 +53,11 @@ client.Connect(); return; } - Loadinglevel(client); - } - /// <summary> - /// 涓婃枡鍖� - /// </summary> - /// <param name="client"></param> - private void Loadinglevel(PLCClient client, string number = "涓婃枡鍖�") - { - VOLContext Context = new VOLContext(); - Idt_plcinfoheadRepository repository = new dt_plcinfoheadRepository(Context); - Idt_plcinfodetailRepository plcRepository = new dt_plcinfodetailRepository(Context); - Idt_geometry_dataRepository dataRepository = new dt_geometry_dataRepository(Context); - Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(Context); - var plc = repository.FindFirst(x => x.plcinfo_name == client.PLCName); - var Gantry_client = PLCClient.Clients.FirstOrDefault(t => t.PLCName == "妗佹灦"); - if (!Gantry_client.IsConnected) return; - var Gantryplc = repository.FindFirst(x => x.plcinfo_name == Gantry_client.PLCName); - List<string> names = new List<string>() { "S01001001", "S01001002" }; - foreach (string name in names) - { - var station = stationinfoRepository.FindFirst(x => x.stationCode == name && x.enable && x.location_state == LocationStateEnum.Stroge.ToString()); - if (station == null) - { - Gantry_client.WriteByOrder("W_RequestUnload", false, number);//淇″彿涓篺alse妗佹灦鍋滄杩涘叆 - continue; - } - var details = plcRepository.Find(x => x.plcdetail_iotype == plc.plcinfo_iotyep && x.plcdetail_number == name).ToList(); - var PalletSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_PalletSignal").First(), client);//璇诲彇鎵樼洏淇″彿:1:鏈�,2鏃� - var MaterialSignal = (Int16)DBExtension.Read(details.Where(x => x.plcdetail_name == "R_MaterialSignal").First(), client);//璇诲彇璐х墿淇″彿:1:鏈�,2鏃� - if (PalletSignal == 1 && MaterialSignal == 1) - { - Gantry_client.WriteByOrder("W_AreaNr", (Int16)1, number);//鍖哄煙璐т綅鍙� - Gantry_client.WriteByOrder("W_IndexNr", (Int16)1, number);//鎵樼洏涓婄殑绗嚑涓溅杞� - Gantry_client.WriteByOrder("W_Storage_Type", (Int16)1, number); //鎵樼洏绫诲瀷1-妯斁;2-绔栨斁 - Gantry_client.WriteByOrder("W_Wheel_Type", (Int16)1, number);//杞﹁疆绫诲瀷 - Gantry_client.WriteByOrder("W_Wheel_id", "", number);//杞﹁疆SN鍙� - Gantry_client.WriteByOrder("W_RequestUnload", true, number); - } - else - { - Gantry_client.WriteByOrder("W_RequestUnload", false, number); - } - var Gantrydetails = plcRepository.Find(x => x.plcdetail_iotype == Gantryplc.plcinfo_iotyep && x.plcdetail_number == number).ToList(); - var Gantry_Out_of_Area = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Gantry_Out_of_Area").First(), Gantry_client);//妗佹灦鏄惁鍦ㄥ尯鍩熷唴 - - var QueryDate = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_QueryDate").First(), Gantry_client);//淇℃伅鏌ヨ - if (QueryDate) - { - var Date_Vaild = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Date_Vaild").First(), Gantry_client);//淇℃伅纭 - if (!Date_Vaild)//淇℃伅鏈夎锛岃褰曟棩蹇� - { - - } - } - var finished = (bool)DBExtension.Read(Gantrydetails.Where(x => x.plcdetail_name == "R_Unlod_finished").First(), Gantry_client);//澶瑰彇瀹屾垚 - if (finished) - { - - Gantry_client.WriteByOrder("W_Storage_update", true, number);//璐т綅鐘舵�佹洿鏂� - } - } + client.WriteByOrder("W_Palpitate", client.ReadByOrder<bool>("R_Palpitate", "蹇冭烦")); + Pipeline pipeline = new Pipeline(); + pipeline.Loadinglevel(client); + pipeline.AutoEmptyTray(client); + pipeline.StationState(client); } } } -- Gitblit v1.9.3