From 0a3381c2879954f4a1ca024f4e69bf762460177d Mon Sep 17 00:00:00 2001 From: Admin Date: Sat, 5 Dec 2026 20:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E9=A1=B9=E7=9B=AE=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ViewModel/MainWindowVM.cs | 4288 +------------------------------------ Views/MainInterface.xaml | 250 +-- 2 files changed, 47 insertions(+), 4491 deletions(-) diff --git a/ViewModel/MainWindowVM.cs b/ViewModel/MainWindowVM.cs index 1c562da..222f8e1 100644 --- a/ViewModel/MainWindowVM.cs +++ b/ViewModel/MainWindowVM.cs @@ -19,7 +19,6 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Media; -using System.Windows.Media.Media3D; using System.Windows.Threading; using ViewModel.MotionControl; using ViewModel.Robots; @@ -30,147 +29,14 @@ namespace ViewModel { public partial class MainWindowVM : NotificationObject { - #region IO + const int Y000绿灯 = 0; + const int Y001红灯 = 1; + const int Y002黄灯 = 2; + const int Y003蜂鸣器 = 3; - int X000启动 = 0; - int X001停止 = 1; - int X002急停 = 2; - int X003气压检知 = 3; - int X004 = 4; - int X005 = 5; - int X006门禁5 = 6; - int X007门禁6 = 7; - int X008门禁1 = 8; - int X009门禁2 = 9; - int X010门禁3 = 10; - int X011门禁4 = 11; - int X012NG满料光电 = 12; - int X013入料仓按钮1 = 13; - int X014出料仓按钮2 = 14; - int X015料仓光栅 = 15; - int X100料仓入缓存对射1 = 16; - int X101料仓入缓存对射2 = 17; - int X102料仓入升降对射1 = 18; - int X103料仓入升降对射2 = 19; - int X104料仓出升降对射1 = 20; - int X105料仓出升降对射2 = 21; - int X106料仓出缓存对射1 = 22; - int X107料仓出缓存对射2 = 23; - int X108入升降料仓上检知1 = 24; - int X109入升降料仓上检知2 = 25; - int X110出升降料仓上检知1 = 26; - int X111出升降料仓上检知2 = 27; - int X112料仓入缓存阻挡上 = 28; - int X113料仓入缓存阻挡下 = 29; - int X114搬运气缸上位 = 30; - int X115搬运气缸下位 = 31; - int X200搬运真空检 = 32; - int X201左机械手真空检 = 33; - int X202右机械手真空检 = 34; - int X203左贴合吸料真空检 = 35; - int X204右贴合吸料真空检 = 36; - int X205翻转真空检 = 37; - int X206翻转气缸正面 = 38; - int X207翻转气缸反面 = 39; - int X208顶升气缸上位 = 40; - int X209顶升气缸下位 = 41; - int X210左拍照检底部吸盘上位 = 42; - int X211左拍照检底部吸盘下位 = 43; - int X212左拍照检底部吸盘真空 = 44; - int X213右拍照检底部吸盘上位 = 45; - int X214右拍照检底部吸盘下位 = 46; - int X215右拍照检底部吸盘真空 = 47; - int X300左飞达初始化完成 = 48; - int X301左飞达料报警 = 49; - int X302左飞达剥料完成 = 50; - int X303左飞达送料完成 = 51; - int X304 = 52; - int X305 = 53; - int X306 = 54; - int X307 = 55; - int X308右飞达料到位 = 56; - int X309右飞达料报警 = 57; - int X310左翻转机构真空 = 58; - int X311左翻转原位 = 59; - int X312左翻转到位 = 60; - int X313左翻转上位 = 61; - int X314左翻转下位 = 62; - int X315 = 63; - - - - - int Y000绿灯 = 0; - int Y001红灯 = 1; - int Y002黄灯 = 2; - int Y003蜂鸣器 = 3; - int Y004 = 4; - int Y005 = 5; - int Y006 = 6; - int Y007 = 7; - - int Y008取料上光源 = 8; - int Y009取料下光源 = 9; - int Y010左贴上光源 = 10; - int Y011左贴下光源 = 11; - int Y012右贴上光源 = 12; - int Y013右贴下光源 = 13; - int Y014收料上光源 = 14; - int Y015检查光源 = 15; - - - int Y100料仓入缓存阻挡气缸 = 16; - int Y101搬运气缸上位 = 17; - int Y102搬运气缸下位 = 18; - int Y103翻转气缸正面 = 19; - int Y104翻转气缸反面 = 20; - int Y105顶升气缸上位 = 21; - int Y106顶升气缸下位 = 22; - int Y107 = 23; - int Y108入料仓调速电机1 = 24; - int Y109入料仓调速电机2 = 25; - int Y110出料仓调速电机1 = 26; - int Y111出料仓调速电机2 = 27; - int Y112NG皮带 = 28; - int Y113离子风1 = 29; - int Y114离子风2 = 30; - int Y115 = 31; - int Y200搬运真空吸 = 32; - int Y201搬运真空破 = 33; - int Y202左机械手真空吸 = 34; - int Y203左机械手真空破 = 35; - int Y204右机械手真空吸 = 36; - int Y205右机械手真空破 = 37; - int Y206左贴合吸料真空吸 = 38; - int Y207左贴合吸料真空破 = 39; - int Y208右贴合吸料真空吸 = 40; - int Y209右贴合吸料真空破 = 41; - int Y210翻转真空吸 = 42; - int Y211翻转真空破 = 43; - int Y212左拍照检底部吸盘上位 = 44; - int Y213左拍照检底部吸盘下位 = 45; - int Y214左拍照检底部吸盘真空吸 = 46; - int Y215左拍照检底部破盘真空破 = 47; - int Y300飞达复位 = 48; - int Y301飞达后撤 = 49; - int Y302右飞达 = 50; - int Y303右飞达复位 = 51; - int Y304左飞达送料信号 = 52; - int Y305 = 53; - int Y306左翻转机构真空 = 54; - int Y307左翻转原位 = 55; - int Y308左翻转到位 = 56; - int Y309左翻转上位 = 57; - int Y310左翻转下位 = 58; - int Y311 = 59; - int Y312右拍照检底部吸盘上位 = 60; - int Y313右拍照检底部吸盘下位 = 61; - int Y314右拍照检底部吸盘真空吸 = 62; - int Y315右拍照检底部破盘真空破 = 63; - - - - #endregion + const int X000启动 = 0; + const int X001停止 = 1; + const int X002急停 = 2; #region 生成Grid状态 public (Grid, List) GetGrid(int col, int row = 0) @@ -206,34 +72,9 @@ namespace ViewModel switch (cmd) { - case "手动贴左": - ZhuanPanList[2].State.StatusForeground = ColorStr.Blue; - ManulFlow.Step = 0; - PasteLeftFlow = new FlowModel(); ; - break; - case "手动贴右": - ZhuanPanList[6].State.StatusForeground = ColorStr.Blue; - ZhuanPanList[6].State.StatusBackground = ColorStr.Red; - ManulFlow.Step = 0; - PasteRightFlow = new FlowModel(""); - break; - - case "手动检右": - ZhuanPanList[6].State.StatusForeground = ColorStr.Blue; - ZhuanPanList[6].State.StatusBackground = ColorStr.Green; - ManulFlow.Step = 13; - CheckFlow.Step = 0; - PasteRightFlow = new FlowModel(""); - break; - case "手动压合": - ManulFlow.Step = 0; - ZhuanPanList[4].State.StatusForeground = ColorStr.Blue; - ZhuanPanList[4].State.StatusBackground = ColorStr.Yellow; - break; case "手动测试轴": ManulFlow.Step = 0; - break; } Task.Run(() => @@ -243,34 +84,6 @@ namespace ViewModel Thread.Sleep(10); switch (cmd) { - case "手动贴左": - PasteLeftRun(ManulFlow); - if (ManulFlow.Step == 33) - { - testing = false; - } - break; - case "手动检右": - PasteRightRun(ManulFlow); - if (ManulFlow.Step == 14) - { - testing = false; - } - break; - case "手动贴右": - PasteRightRun(ManulFlow); - if (ManulFlow.Step == 14) - { - testing = false; - } - break; - case "手动压合": - TorqueRun(ManulFlow, CurrentMachine.MyQita.Press1); - if (ManulFlow.Step == 9) - { - testing = false; - } - break; case "手动测试轴": try @@ -282,8 +95,6 @@ namespace ViewModel testing = false; } - - break; } @@ -923,7 +734,7 @@ namespace ViewModel { SuperPrivilege = value; } - + @@ -1508,46 +1319,7 @@ namespace ViewModel ThStateMonitoring.IsBackground = true; ThStateMonitoring.Start(); } - - YaliyiConn = ServerComm.CommList.Where(s => s.ShortCode == "YA").FirstOrDefault(); - YaliyiConn.ReceiveCallback += YaliyiConn_ReceiveCallback; - - - (Feed1Grid, Feed1List) = GetGrid(1); - Feed1List[0].TakePoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "左贴合取料").FirstOrDefault(); - Feed1List[0].VisionPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "左贴合取料拍照").FirstOrDefault(); - - - (Feed2Grid, Feed2List) = GetGrid(CurrentMachine.MyQita.Feed); - { - var first = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料最左").FirstOrDefault(); - var last = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料最右").FirstOrDefault(); - var vision = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料拍照").FirstOrDefault(); - - var step = (last.ShaftPoint_X - first.ShaftPoint_X) / (CurrentMachine.MyQita.Feed - 1); - var stepZ = (last.ShaftPoint_Z - first.ShaftPoint_Z) / (CurrentMachine.MyQita.Feed - 1); - - for (int i = 0; i < CurrentMachine.MyQita.Feed; i++) - { - Feed2List[i].TakePoint = Coper(first); - Feed2List[i].TakePoint.ShaftPoint_X += step * i; - Feed2List[i].TakePoint.ShaftPoint_Z += stepZ * i; - Feed2List[i].VisionPoint = Coper(vision); - Feed2List[i].VisionPoint.ShaftPoint_X += step * i; - } - } - - - (ZhuanPanGrid, ZhuanPanList) = GetGrid(8); - - - - (NGGrid, NGList) = GetGrid(3); - (RobotPickerGrid, RobotPickerList) = GetGrid(2); - (FlipGrid, FlipList) = GetGrid(1); - (LeftFlipGrid, LeftFlipList) = GetGrid(1); - - EnableAnquanmen = false; + } @@ -1875,24 +1647,7 @@ namespace ViewModel { EmgStop();// 急停信号 } - if (!InputList[X003气压检知].LightUp == false && RunStatu == RunStatuEnum.Normal) - { - ExcepStop(InputList[X003气压检知].InputMeaning); - } - - //安全门 - - //if (EnableAnquanmen) - //{ - // for (int i = 4; i < 12; i++) - // { - // if (InputList[i].LightUp) - // { - // ExcepStop(InputList[i].InputMeaning); - // } - // } - - //} + #endregion @@ -1911,207 +1666,12 @@ namespace ViewModel DualControlRun();//双控运行 GoHome();//回原点 - NGRun(); - SendYaJi(); - if (InputList[X107料仓出缓存对射2].LightUp || InputList[X106料仓出缓存对射1].LightUp) - { - ExcepNoStop("请取走满盘"); - } - else - { - - ExcepNoStopClear("请取走满盘"); - } - - if (InputList[X107料仓出缓存对射2].LightUp) - { - OutputList[Y110出料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y111出料仓调速电机2].Switchs = false;//空盘皮带1 - } - //投料区有盘 - if (InputList[X100料仓入缓存对射1].LightUp && InputList[X101料仓入缓存对射2].LightUp) - { - //投料完成按钮 - if (InputList[X013入料仓按钮1].LightUp) - { - TouliaoReady = true; - } - } - else - { - TouliaoReady = false; - } - - //光栅 - - if (InputList[X015料仓光栅].LightUp == false && RunStatu == RunStatuEnum.Normal) - { - gratingTrig = true; - - ExcepNoStop("光栅触发,请按入料仓按钮继续"); - } - - - if ((InputList[X013入料仓按钮1].LightUp || InputList[X014出料仓按钮2].LightUp) && gratingTrig) - { - gratingTrig = false; - - ExcepNoStopClear("光栅触发,请按入料仓按钮继续"); - } - - try - { - if (CurrentMachine.MotionPointList != null) - { - - MotionPointModel safePos = CurrentMachine.MotionPointList.Where(w => w.PointName == "搬运中间点").FirstOrDefault(); - - if (safePos.Shaft_X == null) - { - safePos.GetInterpolationPer(MCVM.AllShaftList); - } - - //搬运轴在右 - if (safePos.Shaft_X.ActualDir >= safePos.ShaftPoint_X - 1) - { - - if (Tray1 != null) - { - foreach (var item in Tray1.MyLabelList) - { - if (item.VisonPoint != null) - { - item.VisonPoint.Safe = true; - item.TakePutPoint.Safe = true; - } - } - } - - foreach (var item in RobotA.RobotPointList) - { - item.Safe = true; - } - - } - else //搬运轴在左 - { - foreach (var item in RobotA.RobotPointList) - { - item.Safe = false; - } - - if (Tray1 != null) - { - foreach (var item in Tray1.MyLabelList) - { - if (item.VisonPoint != null) - { - item.VisonPoint.Safe = false; - item.TakePutPoint.Safe = false; - } - } - } - } - - //搬运轴在左 - if (safePos.Shaft_X.ActualDir <= safePos.ShaftPoint_X + 1) - { - - foreach (var item in RobotB.RobotPointList) - { - item.Safe = true; - } - if (Tray2 != null) - { - foreach (var item in Tray2.MyLabelList) - { - if (item.TakePutPoint != null) - { - item.TakePutPoint.Safe = true; - } - } - } - - } - else //搬运轴在右 - { - foreach (var item in RobotB.RobotPointList) - { - item.Safe = false; - } - if (Tray2 != null) - { - foreach (var item in Tray2.MyLabelList) - { - if (item.TakePutPoint != null) - item.TakePutPoint.Safe = false; - } - } - } - } - - } - catch (Exception) - { - - - } + } } } - DateTime NGTime = DateTime.Now; - int NGCount; - bool NG; - private void NGRun() - { - - if (NGCount > 3 || InputList[X012NG满料光电].LightUp) - { - NGCount = 0; - ExcepNoStop("NG满"); - } - if (NG) - { - NG = false; - - NGCount++; - OutputList[Y112NG皮带].Switchs = true; - } - - - if (OutputList[Y112NG皮带].Switchs) - { - if (NGTime.AddSeconds(2) < DateTime.Now) - { - OutputList[Y112NG皮带].Switchs = false; - } - - } - else - { - - NGTime = DateTime.Now; - - } - - - } - public DateTime SafeTime { get; set; } = DateTime.Now; - - /// - /// 光栅触发 - /// - bool gratingTrig; - private bool enableAnquanmen; - /// - /// 启用安全门 - /// - public bool EnableAnquanmen - { - get { return enableAnquanmen; } - set { enableAnquanmen = value; RaisePropertyChanged("EnableAnquanmen"); } - } + #region 回原点 /// /// 回远点流程 @@ -2185,27 +1745,11 @@ namespace ViewModel break; case GengralProcessEnum.Step4: - PressSafe = true; - TransmitPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "转盘起始位").FirstOrDefault(); + GoHomeFlow.RunStep++; break; case GengralProcessEnum.Step5: - //移动到位 - - if (TransmitPoint.PointRun(MCVM.AllShaftList)) - { - - GoHomeFlow.RunStep++; - ZhuanPanList.ForEach(w => w.State.StatusBackground = ColorStr.White); - ZhuanPanList.ForEach(w => w.State.StatusForeground = ColorStr.Blue);//Blue转到位 Gray转动中,Green工位完成 - - - } - else if (GoHomeFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - TransmitPoint.PointRunStep = GengralProcessEnum.Start; - GoHomeFlow.RunTime = DateTime.Now; - } + GoHomeFlow.RunStep++; break; @@ -2226,15 +1770,7 @@ namespace ViewModel /// private void DualControlRun() { - OutputList[Y106顶升气缸下位].Switchs = !OutputList[Y105顶升气缸上位].Switchs; - OutputList[Y313右拍照检底部吸盘下位].Switchs = !OutputList[Y312右拍照检底部吸盘上位].Switchs; - OutputList[Y213左拍照检底部吸盘下位].Switchs = !OutputList[Y212左拍照检底部吸盘上位].Switchs; - OutputList[Y101搬运气缸上位].Switchs = !OutputList[Y102搬运气缸下位].Switchs; - - OutputList[Y104翻转气缸反面].Switchs = !OutputList[Y103翻转气缸正面].Switchs; - - OutputList[Y309左翻转上位].Switchs = !OutputList[Y310左翻转下位].Switchs; - OutputList[Y307左翻转原位].Switchs = !OutputList[Y308左翻转到位].Switchs; + } @@ -2250,24 +1786,7 @@ namespace ViewModel /// private void Run() { - Feed1Flow = new FlowModel("飞达1流程"); - Feed2Flow = new FlowModel("飞达2流程"); - - TrayFeedFlow = new FlowModel("料盘上料流程"); - TrayBlankingFlow = new FlowModel("料盘下料流程"); - TrayMovingFlow = new FlowModel("料盘移动流程"); - - TakeFlow = new FlowModel("取料流程"); - LeftFlipFlow = new FlowModel("左翻转流程"); - TakeOutFlow = new FlowModel("取出装盘流程"); - FlipFlow = new FlowModel("右翻转流程"); - - ZhuanPanFlow = new FlowModel("转盘流程"); - PasteLeftFlow = new FlowModel("贴合流程"); - PasteRightFlow = new FlowModel("右贴合流程"); - - CheckFlow = new FlowModel("检查流程"); - TorqueFlow = new FlowModel("压合流程"); + while (true) @@ -2276,28 +1795,7 @@ namespace ViewModel { try { - TrayFeedRun(TrayFeedFlow); - TrayBlankingRun(TrayBlankingFlow); - TrayMovingRun(TrayMovingFlow); - - - ZhuanPanRun(ZhuanPanFlow); - TakeRun(TakeFlow); - LeftFlipRun(LeftFlipFlow); - - FlipRun(FlipFlow); - TakeOutRun(TakeOutFlow); - - Feed1Run(Feed1Flow); - Feed2Run(Feed2Flow); - - PasteLeftRun(PasteLeftFlow); - TorqueRun(TorqueFlow, CurrentMachine.MyQita.Press1); - PasteRightRun(PasteRightFlow); - - - // CheckRun(CheckFlow); - + } catch (Exception ex) @@ -2307,17 +1805,7 @@ namespace ViewModel } else { - TakeFlow.RunTime = DateTime.Now; - Feed1Flow.RunTime = DateTime.Now; - TrayFeedFlow.RunTime = DateTime.Now; - TrayBlankingFlow.RunTime = DateTime.Now; - ZhuanPanFlow.RunTime = DateTime.Now; - TrayMovingFlow.RunTime = DateTime.Now; - PasteLeftFlow.RunTime = DateTime.Now; - FlipFlow.RunTime = DateTime.Now; - LeftFlipFlow.RunTime = DateTime.Now; - TakeOutFlow.RunTime = DateTime.Now; - CheckFlow.RunTime = DateTime.Now; + } } } @@ -2625,10 +2113,7 @@ namespace ViewModel /// public void ExcepStop(string showMag) { - OutputList[Y110出料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y111出料仓调速电机2].Switchs = false;//空盘皮带1 - OutputList[Y108入料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y109入料仓调速电机2].Switchs = false;//空盘皮带1 + if (homeing == false) { foreach (var item in CurrentMachine.MotionPointList) @@ -2802,10 +2287,7 @@ namespace ViewModel /// public void Stop(object per) { - OutputList[Y110出料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y111出料仓调速电机2].Switchs = false;//空盘皮带1 - OutputList[Y108入料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y109入料仓调速电机2].Switchs = false;//空盘皮带1 + if (homeing == false) { foreach (var item in CurrentMachine.MotionPointList) @@ -2907,19 +2389,10 @@ namespace ViewModel { for (int i = 0; i < OutputList.Count; i++) { - if (i != Y210翻转真空吸 - && i != Y200搬运真空吸 - && i != Y202左机械手真空吸 - && i != Y204右机械手真空吸 - && i != Y208右贴合吸料真空吸 - && i != Y206左贴合吸料真空吸 - ) - { + OutputList[i].Switchs = false; - } - - + } } @@ -3240,3693 +2713,11 @@ namespace ViewModel { ExcepList.Add((RecordInfo)info); } - /// - /// 记录检查LOG - /// - /// - private void WriteCheckLog(ObservableCollection rangeValueModels, string barcode) - { - lock (this) - { - path = @"D:\\CheckLog\"; - paths = @"D:\\CheckLog\" + DateTime.Now.ToString("D") + ".CSV"; - - //实例化字符串流 - StringBuilder sb = new StringBuilder(); - string JieGuo = ""; - //创建文件夹 - if (!Directory.Exists(path)) - { - Directory.CreateDirectory(path); - } - //创建文件 - if (!File.Exists(paths)) - { - sb.Append("SN,"); - sb.Append("时间,"); - foreach (var item in rangeValueModels) - { - sb.Append(item.RanggeName).Append(","); - } - sb.Append("结果").Append(","); - sb.Append("\r"); - - } - - using (FileStream fs = new FileStream(paths, FileMode.Append)) - { - using (StreamWriter sw = new StreamWriter(fs, UnicodeEncoding.GetEncoding("GB2312"))) //UnicodeEncoding.GetEncoding("GB2312") - { - sb.Append(barcode).Append(","); - sb.AppendFormat("{0},", DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss.fff")); - foreach (var item in rangeValueModels) - { - sb.Append(item.ActualValue).Append(","); - } - if (ZhuanPanList[6].State.StatusBackground == ColorStr.Green) - { - JieGuo = "OK"; - } - else if (ZhuanPanList[6].State.StatusBackground == ColorStr.Red) - { - JieGuo = "NG"; - } - sb.Append(JieGuo).Append(","); - //将字符串流数据写入文件 - sw.WriteLine(sb); - //刷新文件流 - sw.Flush(); - } - } - } - } + #endregion - #region 吸嘴对象 - - private Grid _RobotPickerGrid; - public Grid RobotPickerGrid - { - get { return _RobotPickerGrid; } - set - { - _RobotPickerGrid = value; - this.RaisePropertyChanged("RobotPickerGrid"); - } - } - - public List RobotPickerList { get; set; } - /// - /// 获取吸嘴Grid - /// - - #endregion - - #region 取料放入转盘流程 - public FlowModel TakeFlow { get; set; } = new FlowModel("取料流程"); - private MyLabel take; - public VisualEngineeringItems TakeVEI { get; set; } - RobotPoint TempTakePoint { get; set; } - /// - /// 取料运行 - /// - public void TakeRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - TempTakePoint = RobotA.RobotPointList.Where(w => w.PointName == "待机点").FirstOrDefault(); - if (TempTakePoint.Safe) - { - RobotA.RunRobotPoint(TempTakePoint); - MyFlow.Step++; - } - break; - - case 1: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - robotASafe = true; - RobotSafeToFlipLeft = true; - if (InputList[X201左机械手真空检].LightUp) - { - MyFlow.Step = 6; - } - else - { - MyFlow.Step++; - } - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempTakePoint.PointName + "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - - case 2: - take = Tray1.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Green).FirstOrDefault(); - if (take != null) - { - if ((EnTakeProduct || RunningMode) && EnRobotA) - { - MyFlow.Step = 100; - } - ExcepNoStopClear("设备运行中超过120秒未动做,请检查"); - } - else if (MyFlow.RunTime.AddSeconds(120) w.PointName == "下视觉").FirstOrDefault(); - if (vPoint.Safe) - { - TempTakePoint = Coper(vPoint); - TempTakePoint.Safe = true; - RobotA.RunRobotPoint(TempTakePoint); - MyFlow.Step++; - } - break; - case 7: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - if (InputList[X201左机械手真空检].LightUp) - { - robotASafe = true; - if (take != null) - take.Product.StateColour = ColorStr.White; - RobotPickerList[0].VisionOffsetValue = new OffsetValueModel(); - MyFlow.Step++; - } - else - { - ExcepStop("机械手真空未达到,请检查是否掉料"); - MyFlow.Step = 0; - } - - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - case 8: - - TakeVEI = VisualA1.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - if (RunningMode || VisualA1.FeatureMatchingIng(TakeVEI)) - { - - if (Math.Abs(TakeVEI.MyRectangleModel.MyROI.ModelFeaturePiont.AngleU) < 5) - { - RobotPickerList[0].VisionOffsetValue.OffsetU = TakeVEI.MyRectangleModel.MyROI.ModelFeaturePiont.AngleU; - TempTakePoint.PointU -= TakeVEI.MyRectangleModel.MyROI.ModelFeaturePiont.AngleU; - MyFlow.Step++; - } - else - { - - ExcepStop($"取料下视觉角度偏差过大"); - } - } - else if (MyFlow.RunTime.AddMilliseconds(3000) < DateTime.Now) - { - if (InputList[X201左机械手真空检].LightUp || RunningMode) - { - - ExcepStop("机器人A拍照异常"); - - } - else - { - if (take != null) - take.Product.StateColour = ColorStr.Green; - MyFlow.Step = 0; - } - } - break; - case 9: - if (RunningMode == false) - { - RobotA.RunRobotPoint(TempTakePoint); - } - MyFlow.Step++; - break; - case 10: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - - - case 11: - - TakeVEI = VisualA1.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - if (RunningMode || VisualA1.FeatureMatchingIng(TakeVEI)) - { - OutputList[Y009取料下光源].Switchs = false; - TempTakePoint = Coper(RobotA.RobotPointList.Where(w => w.PointName == "放料点").FirstOrDefault()); - TempTakePoint.Safe = true; - //TempTakePoint.PointX -= VisualA1.CurrOffs.Y; - //TempTakePoint.PointY -= VisualA1.CurrOffs.X; - TempTakePoint.PointX -= VisualA1.CurrOffs.X; - TempTakePoint.PointY += VisualA1.CurrOffs.Y; - TempTakePoint.PointU -= RobotPickerList[0].VisionOffsetValue.OffsetU; - MyFlow.Step++; - } - break; - case 12: - if (LeftFlipList[0].State.StatusBackground == ColorStr.White && FlipLeftSafeToRobot) - { - - RobotSafeToFlipLeft = false; - RobotA.RunRobotPoint(TempTakePoint); - MyFlow.Step++; - } - - - break; - case 13: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - case 14: - OutputList[Y202左机械手真空吸].Switchs = false; //吸真空 - OutputList[Y306左翻转机构真空].Switchs = true; //吸真空 - - if (InputList[X310左翻转机构真空].LightUp || RunningMode) - { - LeftFlipList[0].State.StatusBackground = ColorStr.Blue; - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X310左翻转机构真空].InputMeaning + "异常"); - } - break; - case 15: - TempTakePoint = RobotA.RobotPointList.Where(w => w.PointName == "扫码点").FirstOrDefault(); - if (TempTakePoint.Safe) - { - RobotA.RunRobotPoint(TempTakePoint); - MyFlow.Step++; - } - break; - - case 16: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - - if (VisualA.SweepCode(VisualA.VisualEngineeringList[0].VisualEngineeringItemsList[0].MyRectangleModel)) - { - - LeftFlipList[0].State.StatuInfo = visualA.QrCodeStr; - MyFlow.Step++; - - } - else - { - ExcepNoStop("扫码失败"); - LeftFlipList[0].State.StatuInfo = "Test"; - MyFlow.Step++; - - } - - - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - case 17: - TempTakePoint = RobotA.RobotPointList.Where(w => w.PointName == "待机点").FirstOrDefault(); - if (TempTakePoint.Safe) - { - RobotA.RunRobotPoint(TempTakePoint); - MyFlow.Step++; - } - break; - - case 18: - if (RobotA.RcvShowInfo.Contains("runpointok")) - { - RobotSafeToFlipLeft = true; - - MyFlow.Step = 2; - - - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人A到位超时")) - { - MyFlow.Step--; - } - break; - - - - } - } - #endregion - - #region 左翻转运行 - public List LeftFlipList { get; set; } - - private Grid _LeftFlipGrid; - public Grid LeftFlipGrid - { - get { return _LeftFlipGrid; } - set { _LeftFlipGrid = value; RaisePropertyChanged("LeftFlipGrid"); } - } - public bool FlipLeftSafeToRobot { get; private set; } - public bool RobotSafeToFlipLeft { get; private set; } - public FlowModel LeftFlipFlow { get; set; } - /// - /// 左翻转运行 - /// - /// - public void LeftFlipRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - - case 0: - FlipLeftSafeToRobot = false; - OutputList[Y310左翻转下位].Switchs = false; - if (InputList[X313左翻转上位].LightUp) - { - - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X313左翻转上位].InputMeaning + "异常"); - - } - break; - - case 1: - OutputList[Y306左翻转机构真空].Switchs = true; - if (InputList[X310左翻转机构真空].LightUp == false) - { - OutputList[Y306左翻转机构真空].Switchs = false; - MyFlow.Step++; - } - else - { - - MyFlow.Step = 10; - - } - - break; - - case 2: - OutputList[Y310左翻转下位].Switchs = false; - if (InputList[X311左翻转原位].LightUp == false) - { - OutputList[Y308左翻转到位].Switchs = false; - if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X311左翻转原位].InputMeaning + "异常"); - - } - } - else - { - FlipLeftSafeToRobot = true; - if (LeftFlipList[0].State.StatusBackground == ColorStr.Blue && RobotSafeToFlipLeft) - { - if (ZhuanPanList[0].State.StatusForeground == ColorStr.Blue) //Blue转到位 Gray转动中,Green工位完成 - { - OutputList[Y306左翻转机构真空].Switchs = true; - FlipLeftSafeToRobot = false; - if (InputList[X310左翻转机构真空].LightUp) - { - MyFlow.Step++; - } - else - { - ExcepStop("左翻转真空未达到,请检查是否掉料"); - } - } - - } - else if (MyFlow.RunTime.AddSeconds(30) < DateTime.Now) - { - - - if (Tray1.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Green).Any() == false - && ZhuanPanList[0].State.StatusForeground == ColorStr.Blue - - ) //Blue转到位 Gray转动中,Green工位完成 - { - ZhuanPanList[0].State.StatusForeground = ColorStr.Green; - - MyFlow.RunTime = DateTime.Now; - } - else - { - - MyFlow.RunTime = DateTime.Now; - } - - } - } - break; - - case 3: - OutputList[Y308左翻转到位].Switchs = true; - if (InputList[X312左翻转到位].LightUp) - { - OutputList[Y310左翻转下位].Switchs = true; - if (InputList[X314左翻转下位].LightUp) - { - OutputList[Y306左翻转机构真空].Switchs = false; - OutputList[Y305].Switchs = true;//真空破 - if (InputList[X310左翻转机构真空].LightUp == false) - { - - MyFlow.Step++; - } - } - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X312左翻转到位].InputMeaning + "异常"); - - } - break; - case 4: - - if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) - { - - OutputList[Y310左翻转下位].Switchs = false; - if (InputList[X313左翻转上位].LightUp) - { - if (MyFlow.RunTime.AddMilliseconds(2000) < DateTime.Now) - { - OutputList[Y305].Switchs = false; - OutputList[Y308左翻转到位].Switchs = false; - if (InputList[X311左翻转原位].LightUp) - { - LeftFlipList[0].State.StatusBackground = ColorStr.White; - ZhuanPanList[0].Barcode = LeftFlipList[0].State.StatuInfo; - ZhuanPanList[0].State.StatusBackground = ColorStr.Blue; - ZhuanPanList[0].State.StatusForeground = ColorStr.Green; - LeftFlipList[0].State.StatuInfo = ""; - MyFlow.Step = 0; - } - } - } - } - break; - - - } - } - - #endregion - - #region 取出流程 - public FlowModel TakeOutFlow { get; set; } = new FlowModel("取出流程"); - - public V_RectangleModel TakeOutRM { get; set; } - public MyLabel PutLabel { get; set; } - - RobotPoint TempTakeOutPoint { get; set; } - /// - /// 运行 - /// - public void TakeOutRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - TempTakeOutPoint = RobotB.RobotPointList.Where(w => w.PointName == "待机点").FirstOrDefault(); - if (TempTakeOutPoint.Safe) - { - RobotB.RunRobotPoint(TempTakeOutPoint); - MyFlow.Step++; - } - break; - case 1: - if (RobotB.RcvShowInfo.Contains("runpointok")) - { - RobotSafeToFlip = true; - robotBSafe = true; - - MyFlow.Step++; - - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempTakeOutPoint.PointName + "机器人B到位超时")) - { - MyFlow.Step--; - } - break; - case 2: - - if (FlipList[0].State.StatusBackground != ColorStr.White && FlipSafeToRobot) - { - MyFlow.Step++; - } - break; - case 3: - TempTakeOutPoint = RobotB.RobotPointList.Where(p => p.PointName == "取料点").FirstOrDefault(); - - - if (TempTakeOutPoint.Safe) - { - RobotB.RunRobotPoint(TempTakeOutPoint); - MyFlow.Step++; - } - - break; - case 4: - if (RobotB.RcvShowInfo.Contains("runpointok")) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempTakeOutPoint.PointName + "机器人B到位超时")) - { - MyFlow.Step--; - } - break; - case 5: - if (RunningMode == false) - OutputList[Y204右机械手真空吸].Switchs = true; //吸真空 - if (InputList[X202右机械手真空检].LightUp || RunningMode) - { - - - OutputList[Y210翻转真空吸].Switchs = false; - - MyFlow.Step++; - - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X202右机械手真空检].InputMeaning + "异常"); - } - break; - case 6: - TempTakeOutPoint = RobotB.RobotPointList.Where(p => p.PointName == "待机点").FirstOrDefault(); ; - if (TempTakeOutPoint.Safe) - { - RobotB.RunRobotPoint(TempTakeOutPoint); - MyFlow.Step++; - } - break; - case 7: - if (RobotB.RcvShowInfo.Contains("runpointok")) - { - - RobotPickerList[1].State.StatusBackground = FlipList[0].State.StatusBackground; - FlipList[0].State.StatusBackground = ColorStr.White; - if (RobotPickerList[1].State.StatusBackground == ColorStr.Green) - { - CurrentMachine.Produce++; - MyFlow.Step++; - } - else - { - - MyFlow.Step = 20; - } - CurrentMachine.Quantitys++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempTakeOutPoint.PointName + "机器人B到位超时")) - { - MyFlow.Step--; - } - break; - case 8: - - MyFlow.Step++; - break; - - - case 9: - MyFlow.Step++; - break; - case 10: - PutLabel = Tray2.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Blue).FirstOrDefault(); - if (PutLabel != null && EnRobotB && EnPutProduct) - { - robotBSafe = false; - TempTakeOutPoint = PutLabel.TakePutPoint; - - if (TempTakeOutPoint.Safe) - { - RobotB.RunRobotPoint(TempTakeOutPoint); - MyFlow.Step++; - } - } - else if (MyFlow.RunTime.AddSeconds(20) < DateTime.Now) - { - - ExcepNoStop("出料盘满,请补充空盘"); - MyFlow.RunTime = DateTime.Now; - } - - break; - - case 11: - if (RobotB.RcvShowInfo.Contains("runpointok")) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人B到位超时")) - { - MyFlow.Step--; - } - break; - - - case 12: - OutputList[Y204右机械手真空吸].Switchs = false; - if (InputList[X202右机械手真空检].LightUp == false) - { - PutLabel.Product.StateColour = ColorStr.Green; - MyFlow.Step = 0; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X202右机械手真空检].InputMeaning + "异常"); - } - break; - - case 20: - robotBSafe = false; - TempTakeOutPoint = RobotB.RobotPointList.Where(w => w.PointName == "NG放料点").FirstOrDefault(); - MyFlow.Step++; - - break; - case 21: - if (TempTakeOutPoint.Safe) - { - RobotSafeToFlip = false; - RobotB.RunRobotPoint(TempTakeOutPoint); - MyFlow.Step++; - } - break; - case 22: - if (RobotB.RcvShowInfo.Contains("runpointok")) - { - - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempTakeOutPoint.PointName + "机器人B到位超时")) - { - MyFlow.Step--; - } - break; - case 23: - OutputList[Y204右机械手真空吸].Switchs = false; - if (InputList[X202右机械手真空检].LightUp == false) - { - NG = true; - MyFlow.Step = 0; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X202右机械手真空检].InputMeaning + "异常"); - } - break; - } - } - #endregion - - #region Feed1 - private Grid _Feed1Grid; - /// - /// Grid - /// - public Grid Feed1Grid - { - get { return _Feed1Grid; } - set { _Feed1Grid = value; RaisePropertyChanged("Feed1Grid"); } - } - - /// - /// Feed1 - /// - public List Feed1List { get; set; } - public FlowModel Feed1Flow { get; set; } = new FlowModel("Feed1"); - /// - /// 飞达运行 - /// - public void Feed1Run(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - if (Feed1List.Where(w => w.State.StatusBackground != ColorStr.Blue).Count() == Feed1List.Count) - { - if (!RunningMode) - { - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - else - { - Feed1List.ForEach(w => w.State.StatusBackground = ColorStr.Blue); - } - } - break; - case 1: - OutputList[Y304左飞达送料信号].Switchs = true; //右飞达出标请求 - if (RunningMode || InputList[X303左飞达送料完成].LightUp && MyFlow.RunTime.AddMilliseconds(1500) < DateTime.Now) - { - OutputList[Y304左飞达送料信号].Switchs = false; //右飞达出标请求 - Feed1List.ForEach(w => w.State.StatusBackground = ColorStr.Blue); - MyFlow.Step = 0; - } - else if (MyFlow.RunTime.AddMilliseconds(30000) < DateTime.Now) - { - OutputList[Y304左飞达送料信号].Switchs = false; - OutputList[Y303右飞达复位].Switchs = true; - MyFlow.Step = 0; - ExcepStop("飞达出料异常"); - MyFlow.RunTime = DateTime.Now; - } - break; - case 2: - OutputList[Y303右飞达复位].Switchs = false; - if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) - { - OutputList[Y303右飞达复位].Switchs = false; - - MyFlow.Step = 0; - } - break; - } - } - #endregion - - #region Feed2 - private Grid _Feed2Grid; - /// - /// Grid - /// - public Grid Feed2Grid - { - get { return _Feed2Grid; } - set { _Feed2Grid = value; RaisePropertyChanged("Feed2Grid"); } - } - - /// - /// Feed1 - /// - public List Feed2List { get; set; } - public FlowModel Feed2Flow { get; set; } = new FlowModel("Feed2"); - /// - /// 飞达运行 - /// - public void Feed2Run(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - if (Feed2List.Where(w => w.State.StatusBackground == ColorStr.Blue).Any() == false) - { - if (!RunningMode) - { - MyFlow.Step++; - } - else - { - Feed2List.ForEach(w => w.State.StatusBackground = ColorStr.Blue); - } - } - break; - case 1: - OutputList[Y303右飞达复位].Switchs = true; - OutputList[Y302右飞达].Switchs = true; //右飞达出标请求 - if (MyFlow.RunTime.AddMilliseconds(500) < DateTime.Now) - { - ExcepNoStopClear("飞达出料异常"); - MyFlow.Step++; - OutputList[Y302右飞达].Switchs = false; //右飞达出标请求 - OutputList[Y303右飞达复位].Switchs = false; - } - break; - case 2: - if (RunningMode || InputList[X308右飞达料到位].LightUp && MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) - { - OutputList[Y302右飞达].Switchs = false; //右飞达出标请求 - Feed2List.ForEach(w => w.State.StatusBackground = ColorStr.Blue); - MyFlow.Step = 0; - } - else if (MyFlow.RunTime.AddMilliseconds(5000) < DateTime.Now) - { - OutputList[Y302右飞达].Switchs = false; //右飞达出标请求 - OutputList[Y303右飞达复位].Switchs = true; - MyFlow.Step++; - ExcepNoStop("飞达出料异常"); - } - break; - - case 3: - - if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) - { - OutputList[Y302右飞达].Switchs = false; //右飞达出标请求 - OutputList[Y303右飞达复位].Switchs = false; - MyFlow.Step = 0; - } - break; - } - } - #endregion - - #region 翻转 - public List FlipList { get; set; } - - private Grid _FlipGrid; - public Grid FlipGrid - { - get { return _FlipGrid; } - set { _FlipGrid = value; RaisePropertyChanged("FlipGrid"); } - } - - MotionPointModel FlipPoint { get; set; } - - public FlowModel FlipFlow { get; set; } - /// - /// 右翻转运行 - /// - /// - public void FlipRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - - case 0: - FlipSafeToRobot = false; - FlipPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "翻转Z翻转位").FirstOrDefault(); - if (FlipPoint.PointRun(MCVM.AllShaftList)) - { - - MyFlow.Step++; - } - break; - - case 1: - - - if (InputList[X205翻转真空检].LightUp == false) - { - MyFlow.Step++; - } - else - { - - MyFlow.Step = 10; - - } - - break; - - case 2: - - //if (InputList[X207翻转气缸反面].LightUp == false) - //{ - // OutputList[Y104翻转气缸反面].Switchs = true; - //} - if (InputList[X206翻转气缸正面].LightUp == false) - { - OutputList[Y103翻转气缸正面].Switchs = true; - } - else - { - - if (ZhuanPanList[7].State.StatusForeground == ColorStr.Blue && RobotSafeToFlip) //Blue转到位 Gray转动中,Green工位完成 - { - if (ZhuanPanList[7].State.StatusBackground != ColorStr.White) // White 无料 blue 有料 Yello 已贴 green/red已检 - { - FlipPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "翻转Z取料位").FirstOrDefault(); - FlipPoint.PointRunStep = GengralProcessEnum.Start; - - MyFlow.Step++; - } - - } - } - break; - - case 3: - - if (FlipPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - ExcepStop("翻转轴到位超时"); - FlipPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step--; - } - - break; - case 4: - - if (RunningMode == false) - OutputList[Y210翻转真空吸].Switchs = true; //吸真空 - - if (InputList[X205翻转真空检].LightUp || RunningMode) - { - - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X205翻转真空检].InputMeaning + "异常"); - } - break; - case 5: - - MyFlow.Step = 10; - break; - - case 10: - FlipPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "翻转Z翻转位").FirstOrDefault(); - MyFlow.Step++; - break; - - - case 11: - - - if (FlipPoint.PointRun(MCVM.AllShaftList)) - { - if (InputList[X205翻转真空检].LightUp) - { - if (ZhuanPanList[7].State.StatusBackground != ColorStr.White) - { - FlipList[0].State.StatusBackground = ZhuanPanList[7].State.StatusBackground; - } - else - { - FlipList[0].State.StatusBackground = ColorStr.Red; - } - ZhuanPanList[7].State.StatusBackground = ColorStr.White; - ZhuanPanList[7].State.StatusForeground = ColorStr.Green; - MyFlow.Step++; - } - else - { - ExcepStop("右翻转真空未达到,请检查是否掉料"); - MyFlow.Step = 2; - } - - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - ExcepStop("翻转轴到位超时"); - FlipPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step--; - } - break; - - case 12: - - //OutputList[Y103翻转气缸正面].Switchs = true; - //if (InputList[X206翻转气缸正面].LightUp) - //{ - - // MyFlow.Step++; - //} - OutputList[Y103翻转气缸正面].Switchs = false; - if (InputList[X207翻转气缸反面].LightUp) - { - - MyFlow.Step++; - } - - break; - case 13: - if (InputList[X205翻转真空检].LightUp) - { - FlipPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "翻转Z待取位").FirstOrDefault(); - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X205翻转真空检].InputMeaning + "异常"); - MyFlow.Step = 0; - } - break; - - - case 14: - - - if (FlipPoint.PointRun(MCVM.AllShaftList)) - { - - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - ExcepStop("翻转轴到位超时"); - FlipPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step--; - } - break; - - case 15: - FlipSafeToRobot = true; - - if (FlipList[0].State.StatusBackground == ColorStr.White) - { - - - MyFlow.Step = 0; - - } - break; - } - } - #endregion - - #region 转盘 检查 - private Grid _ZhuanPanGrid; - /// - /// Grid - /// - public Grid ZhuanPanGrid - { - get { return _ZhuanPanGrid; } - set { _ZhuanPanGrid = value; RaisePropertyChanged("ZhuanPanGrid"); } - } - - /// - /// 转盘 White 无料 blue 有料 Yello 已贴 green/red已检 - /// - public List ZhuanPanList { get; set; } - - /// - /// 转盘点位 - /// - MotionPointModel TransmitPoint { get; set; } - public V_RectangleModel CheckRM { get; set; } - /// - /// 铁件偏移 - /// - MyPoint Point1 = new MyPoint(); - /// - /// Sponge偏移 - /// - MyPoint Point2 = new MyPoint(); - - public FlowModel ZhuanPanFlow { get; set; } = new FlowModel("转盘"); - /// - /// 转盘运行 - /// - public void ZhuanPanRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - - ZhuanPanList[1].State.StatusForeground = ColorStr.Green; - - if (ZhuanPanList[2].State.StatusBackground == ColorStr.White) - { - ZhuanPanList[2].State.StatusForeground = ColorStr.Green; - } - - ZhuanPanList[3].State.StatusForeground = ColorStr.Green; - - if (ZhuanPanList[4].State.StatusBackground == ColorStr.White) - { - ZhuanPanList[4].State.StatusForeground = ColorStr.Green; - } - - ZhuanPanList[5].State.StatusForeground = ColorStr.Green; - - - if (ZhuanPanList[6].State.StatusBackground == ColorStr.White) - { - ZhuanPanList[6].State.StatusForeground = ColorStr.Green; - } - - - - if (ZhuanPanList[7].State.StatusBackground == ColorStr.White) - { - ZhuanPanList[7].State.StatusForeground = ColorStr.Green; - } - - MyFlow.Step++; - break; - case 1: - ZhuanPanList[5].State.StatusForeground = ColorStr.Green; - var complete = ZhuanPanList.Where(z => z.State.StatusForeground == ColorStr.Green).Count(); - if (complete == ZhuanPanList.Count) - { - TransmitPoint = Coper(CurrentMachine.MotionPointList.Where(w => w.PointName == "转盘起始位").FirstOrDefault()); - TransmitPoint.GetInterpolationPer(MCVM.AllShaftList);//实例化点位 - TransmitPoint.Shaft_U.GoZero();//轴里程数归零 - TransmitPoint.ShaftPoint_U = +45; //CurrentMachine.MyQita.IntervalValue;//移动距离位设定的移动长度 - TransmitPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step++; - - } - break; - case 2: - - OutputList[Y212左拍照检底部吸盘上位].Switchs = false; - OutputList[Y312右拍照检底部吸盘上位].Switchs = false;//顶升气缸下降 - OutputList[Y105顶升气缸上位].Switchs = false;//顶升气缸下降 - if (TransmitPoint.Shaft_U.ActualDir == 0) - { - //顶升气缸在下位 - if (InputList[X209顶升气缸下位].LightUp - && InputList[X211左拍照检底部吸盘下位].LightUp - && InputList[X214右拍照检底部吸盘下位].LightUp) - { - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - else if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - if (InputList[X209顶升气缸下位].LightUp == false) ExcepStop("X209顶升气缸下位"); - if (InputList[X211左拍照检底部吸盘下位].LightUp == false) ExcepStop("X211左拍照检底部吸盘下位"); - if (InputList[X214右拍照检底部吸盘下位].LightUp == false) ExcepStop("X214右拍照检底部吸盘下位"); - - MyFlow.RunTime = DateTime.Now; - } - } - else if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) - { - TransmitPoint.Shaft_U.GoZero();//轴里程数归零 - MyFlow.RunTime = DateTime.Now; - } - break; - case 3: - if (InputList[X209顶升气缸下位].LightUp - && InputList[X211左拍照检底部吸盘下位].LightUp - && InputList[X214右拍照检底部吸盘下位].LightUp - && PressSafe - ) - { - //移动到位 - if (MCVM.PointRun(TransmitPoint)) - { - //整体状态向后移动一格 - for (int i = ZhuanPanList.Count - 1; i > 0; i--) - { - ZhuanPanList[i].State.StatusBackground = ZhuanPanList[i - 1].State.StatusBackground; - ZhuanPanList[i].Barcode = ZhuanPanList[i - 1].Barcode; - - ZhuanPanList[i - 1].State.StatusBackground = ColorStr.White; - } - - ZhuanPanList.ForEach(w => w.State.StatusForeground = ColorStr.Blue);//Blue转到位 Gray转动中,Green工位完成 - - MyFlow.Step = 0; - - } - else if (TimeOutValidation(MyFlow.RunTime, 10000, "转盘移动超时")) - { - MyFlow.RunTime = DateTime.Now; - } - } - else - { - - MyFlow.RunTime = DateTime.Now; - - } - break; - - - - - } - } - #endregion - - #region NG - private Grid _NGGrid; - - /// - /// Grid - /// - public Grid NGGrid - { - get { return _NGGrid; } - set { _NGGrid = value; RaisePropertyChanged("NGGrid"); } - } - - /// - /// Feed1 - /// - public List NGList { get; set; } - - #endregion - - #region 料盘上料运行 - /// - /// 上料起点 - /// - MotionPointModel FeedingStart { get; set; } - /// - /// 上料终点 - /// - MotionPointModel FeedingEnd { get; set; } - /// - /// 上料流程 - /// - FlowModel TrayFeedFlow { get; set; } - /// - /// 投料就绪 - /// - bool TouliaoReady { get; set; } - /// - /// 料仓允许取料 - /// - bool EnTakeProduct { get; set; } - - /// - /// 可以取空盘 - /// - bool EnTakeTray { get; set; } - /// - /// 料盘上料运行 - /// - private void TrayFeedRun(FlowModel MyFlow) - { - - switch (MyFlow.RunStep) - { - case GengralProcessEnum.Start: - EnTakeProduct = false; - EnTakeTray = false; - FeedingStart = CurrentMachine.MotionPointList.Where(w => w.PointName == "上料下位").FirstOrDefault(); - FeedingEnd = CurrentMachine.MotionPointList.Where(w => w.PointName == "上料上位").FirstOrDefault(); - FeedingStart.PointRunStep = GengralProcessEnum.Start; - FeedingEnd.PointRunStep = GengralProcessEnum.Start; - OutputList[Y108入料仓调速电机1].Switchs = false;//上料缓存皮带 - OutputList[Y109入料仓调速电机2].Switchs = false;//上料皮带 - OutputList[Y100料仓入缓存阻挡气缸].Switchs = true;//阻挡气缸 - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - break; - case GengralProcessEnum.Step1: - //上料区必须无盘 - if (!InputList[X102料仓入升降对射1].LightUp && !InputList[X103料仓入升降对射2].LightUp) - { - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - } - else if (InputList[X102料仓入升降对射1].LightUp && InputList[X103料仓入升降对射2].LightUp) - { - FeedingEnd.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunStep = GengralProcessEnum.Step10; - MyFlow.RunTime = DateTime.Now; - } - break; - case GengralProcessEnum.Step2: - if (InputList[X102料仓入升降对射1].LightUp != InputList[X103料仓入升降对射2].LightUp) - { - FeedingStart.PointStop(); - ExcepStop("缓存对射光电异常:请检查"); - break; - } - //移动到起始位置 - if (FeedingStart.PointRun(MCVM.AllShaftList)) - { - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - } - else if (TimeOutValidation(MyFlow.RunTime, 100000, FeedingStart.PointName + "移动超时")) - { - FeedingStart.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - } - break; - case GengralProcessEnum.Step3: - //投料区捡知 - if (InputList[X100料仓入缓存对射1].LightUp && InputList[X101料仓入缓存对射2].LightUp) - { - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - } - else - if (TouliaoReady) - { - ExcepNoStopClear("等待投料"); - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - } - else if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now) - { - ExcepNoStop("等待投料"); - MyFlow.RunTime = DateTime.Now; - } - break; - case GengralProcessEnum.Step4: - OutputList[Y100料仓入缓存阻挡气缸].Switchs = false; - OutputList[Y108入料仓调速电机1].Switchs = true;//上料缓存皮带 - OutputList[Y109入料仓调速电机2].Switchs = true;//上料皮带 - - //上料区检知 - if (InputList[X102料仓入升降对射1].LightUp && InputList[X103料仓入升降对射2].LightUp) - { - - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - ExcepNoStop("进料超时"); - MyFlow.RunTime = DateTime.Now; - } - break; - - case GengralProcessEnum.Step5: - OutputList[Y108入料仓调速电机1].Switchs = true;//上料缓存皮带 - OutputList[Y109入料仓调速电机2].Switchs = true;//上料皮带 - if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - OutputList[Y108入料仓调速电机1].Switchs = false;//上料缓存皮带 - OutputList[Y109入料仓调速电机2].Switchs = false;//上料皮带 - OutputList[Y100料仓入缓存阻挡气缸].Switchs = true;//阻挡气缸 - MyFlow.RunStep = GengralProcessEnum.Step10; - MyFlow.RunTime = DateTime.Now; - } - break; - case GengralProcessEnum.Step10: - - //向结束位移动 - if (FeedingEnd.PointRun(MCVM.AllShaftList)) - { - if (InputList[X100料仓入缓存对射1].LightUp && InputList[X101料仓入缓存对射2].LightUp || !InputList[X100料仓入缓存对射1].LightUp && !InputList[X101料仓入缓存对射2].LightUp) - { - MyFlow.RunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - } - else - { - ExcepStop("料盘没推到位,请检查"); - MyFlow.RunTime = DateTime.Now; - } - - } - else if (InputList[X109入升降料仓上检知2].LightUp || (InputList[X108入升降料仓上检知1].LightUp && InputList[X109入升降料仓上检知2].LightUp)) //料盘对射感应到,轴停止 - { - FeedingEnd.PointStop();//停止轴移动 - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - FeedingEnd.PointRunStep = GengralProcessEnum.Start; - } - else if (MyFlow.RunTime.AddSeconds(20) < DateTime.Now) - { - FeedingEnd.PointRunStep = GengralProcessEnum.Start; - FeedingEnd.PointStop();//停止轴移动 - - MyFlow.RunTime = DateTime.Now; - } - - break; - case GengralProcessEnum.Step11: - //盘中无料时 - if (Tray1.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Green).Count() <= 0) - { - Tray1.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Green); - } - EnTakeProduct = true; - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - break; - case GengralProcessEnum.Step12: - //盘中无料时,激活取空盘信号,取走空盘后给料盘置为白色,继续上料 - if (Tray1.MyLabelList.Where(w => w.Product.StateColour == ColorStr.White).Count() >= Tray1.MyLabelList.Count()) - { - EnTakeProduct = false; - EnTakeTray = true; - if (RunningMode) - { - - Tray1.MyLabelList.ForEach(t => t.Product.StateColour = ColorStr.Gray); - - } - } - //盘中无料时并空料盘已被取走 - else if (Tray1.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Gray).Any()) - { - EnTakeTray = false; - EnTakeProduct = false; - MyFlow.RunStep = GengralProcessEnum.Step10; - MyFlow.RunTime = DateTime.Now; - } - break; - } - } - #endregion - - #region 空盘回收 - /// - /// 空盘回收起点 - /// - MotionPointModel BlankingStart { get; set; } - /// - /// 空盘回收满盘点 - /// - MotionPointModel BlankingManPan { get; set; } - /// - /// 空盘回收下盘点 - /// - MotionPointModel BlankingEnd { get; set; } - - /// - /// 空盘回收流程 - /// - FlowModel TrayBlankingFlow { get; set; } - - /// - /// 允许放料 - /// - bool EnPutProduct = false; - /// - /// 允许放盘 - /// - bool EnPutTray = false; - /// - /// 空盘回收 - /// - private void TrayBlankingRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - EnPutProduct = false; - EnPutTray = false; - BlankingStart = (CurrentMachine.MotionPointList.Where(w => w.PointName == "回收上位").FirstOrDefault()); //空盘回收起点 - BlankingStart.PointRunStep = GengralProcessEnum.Start; - BlankingEnd = (CurrentMachine.MotionPointList.Where(w => w.PointName == "回收满位").FirstOrDefault()); //空盘回收终点 - BlankingEnd.PointRunStep = GengralProcessEnum.Start; - - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - break; - - case 1: - //回收光纤检知无料盘 - if (!InputList[X111出升降料仓上检知2].LightUp - ) - { - //运行到空盘回收起点 - if (BlankingStart.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step = 3; - Tray2.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Green); - MyFlow.RunTime = DateTime.Now; - } - } - else - { - BlankingStart.PointStop();//停止运行 - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - break; - case 2: - //向收盘终点运行 - if (BlankingEnd.PointRun(MCVM.AllShaftList)) - { - Tray2.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Blue); - EnPutProduct = true; - BlankingEnd.PointStop();//停止运行 - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - else if (!InputList[X111出升降料仓上检知2].LightUp) - { - Tray2.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Blue); - EnPutProduct = true; - BlankingEnd.PointStop();//停止运行 - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - BlankingEnd.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 3: - - if (Tray2.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Green).Count() >= Tray2.MyLabelList.Count() || PutWait) - { - BlankingEnd.GetInterpolationPer(MCVM.AllShaftList); - if (BlankingEnd.Shaft_Z.ActualDir <= BlankingEnd.ShaftPoint_Z) - { - - MyFlow.Step = 20; - MyFlow.RunTime = DateTime.Now; - } - else - { - - EnPutProduct = false; - EnPutTray = true; - MyFlow.Step++; - } - } - - break; - case 4: - if (RunningMode == false) - { - if (Tray2.MyLabelList.Where(w => w.Product.StateColour == ColorStr.Yellow).Count() >= Tray2.MyLabelList.Count()) - { - EnPutProduct = false; - EnPutTray = false; - BlankingEnd.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step = 2; - } - } - else - { - - MyFlow.Step = 2; - } - - - break; - - - - case 20: - EnPutProduct = false; - EnPutTray = false; - //运行到下料点 - BlankingManPan = Coper(CurrentMachine.MotionPointList.Where(w => w.PointName == "回收下位").FirstOrDefault()); //空盘回收终点 - BlankingManPan.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - break; - case 21: - //到达下料区 - if (BlankingManPan.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - else if (TimeOutValidation(MyFlow.RunTime, 5000, BlankingManPan.PointName + "超时异常")) - { - BlankingManPan.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - } - break; - case 22: - //下料区无盘 - if (!InputList[X106料仓出缓存对射1].LightUp && !InputList[X107料仓出缓存对射2].LightUp) - { - - OutputList[Y110出料仓调速电机1].Switchs = true;//空盘皮带1 - OutputList[Y111出料仓调速电机2].Switchs = true;//空盘皮带2 - MyFlow.Step++; - MyFlow.RunTime = DateTime.Now; - } - - break; - case 23: - //下料区有盘 且空盘区无盘 - - //InputList[X106料仓出缓存对射1].LightUp - // && InputList[X107料仓出缓存对射2].LightUp - // && - if (!InputList[X104料仓出升降对射1].LightUp - && !InputList[X105料仓出升降对射2].LightUp - && ( - ( - InputList[X106料仓出缓存对射1].LightUp && InputList[X107料仓出缓存对射2].LightUp - ) )) - { - if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - OutputList[Y110出料仓调速电机1].Switchs = false;//空盘皮带1 - OutputList[Y111出料仓调速电机2].Switchs = false;//空盘皮带2 - - MyFlow.Step = 0; - MyFlow.RunTime = DateTime.Now; - } - } - else if (MyFlow.RunTime.AddSeconds(20) < DateTime.Now) - { - if (!InputList[X104料仓出升降对射1].LightUp - && !InputList[X105料仓出升降对射2].LightUp && !InputList[X106料仓出缓存对射1].LightUp && !InputList[X107料仓出缓存对射2].LightUp) - { - MyFlow.Step = 0; - MyFlow.RunTime = DateTime.Now; - } - else - { - ExcepStop("空盘推出异常"); - } - } - - break; - - } - } - #endregion - - #region Tray移载 - - - /// - /// 临时点位 - /// - MotionPointModel TempMotionPoint { get; set; } - //搬运流程 - FlowModel TrayMovingFlow { get; set; } - - - /// - /// 移载允许机器人A取料 - /// - bool EnRobotA; - /// - /// 移栽允许机器人B放料 - /// - bool EnRobotB; - private bool robotASafe; - - public bool RobotSafeToFlip { get; private set; } - - private bool robotBSafe; - - private void TrayMovingRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - MyFlow.Step++; - EnRobotA = false; - EnRobotB = false; - PutWait = false; - break; - case 1: - OutputList[Y102搬运气缸下位].Switchs = false; - - if (InputList[X114搬运气缸上位].LightUp) - { - TempMotionPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "搬运中间点").FirstOrDefault(); - if (TempMotionPoint.PointRun(MCVM.AllShaftList)) - { - EnRobotA = true; - EnRobotB = true; - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempMotionPoint.PointName + "超时")) - { - MyFlow.RunTime = DateTime.Now; - TempMotionPoint.PointRunStep = GengralProcessEnum.Start; - } - } - else if (TimeOutValidation(MyFlow.RunTime, 5000, InputList[X114搬运气缸上位].InputMeaning + "超时")) - { - - } - break; - case 2: - if (RunningMode == false) - { - if (InputList[X200搬运真空检].LightUp == false) - { - if (EnTakeTray && robotASafe) - { - MyFlow.Step++; - } - } - - - } - break; - case 3: - OutputList[Y102搬运气缸下位].Switchs = false; - EnRobotA = false; - TempMotionPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "搬运取盘点").FirstOrDefault(); - if (TempMotionPoint.PointRun(MCVM.AllShaftList)) - { - - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, TempMotionPoint.PointName + "超时")) - { - MyFlow.RunTime = DateTime.Now; - TempMotionPoint.PointRunStep = GengralProcessEnum.Start; - } - break; - case 4: - OutputList[Y102搬运气缸下位].Switchs = true; //搬运气缸下位 - if (RunningMode == false) - OutputList[Y200搬运真空吸].Switchs = true; - if (InputList[X200搬运真空检].LightUp || RunningMode) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "搬运真空检测超时")) - { - - } - - break; - - case 5: - OutputList[Y102搬运气缸下位].Switchs = false; - if (InputList[X114搬运气缸上位].LightUp && MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - if (InputList[X200搬运真空检].LightUp || RunningMode) - { - Tray1.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Gray); - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "搬运真空检测超时")) - { - - } - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, InputList[X114搬运气缸上位].InputMeaning + "超时")) - { - - } - break; - case 6: - - PutWait = true; - - if (EnPutTray && robotBSafe) - { - PutWait = false; - MyFlow.Step = 10; - } - break; - - - case 10: - OutputList[Y102搬运气缸下位].Switchs = false; - EnRobotB = false; - TempMotionPoint = CurrentMachine.MotionPointList.Where(w => w.PointName == "搬运放盘点").FirstOrDefault(); - if (TempMotionPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 10000, TempMotionPoint.PointName + "超时")) - { - MyFlow.RunTime = DateTime.Now; - TempMotionPoint.PointRunStep = GengralProcessEnum.Start; - } - break; - case 11: - OutputList[Y102搬运气缸下位].Switchs = true; //搬运气缸下位 - if (InputList[X115搬运气缸下位].LightUp || MyFlow.RunTime.AddSeconds(1) < DateTime.Now) - { - OutputList[Y200搬运真空吸].Switchs = false; - if (InputList[X200搬运真空检].LightUp == false) - { - MyFlow.Step++; - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, "搬运真空检测超时")) - { - - } - - } - - break; - - case 12: - OutputList[Y102搬运气缸下位].Switchs = false; - if (InputList[X114搬运气缸上位].LightUp) - { - Tray2.MyLabelList.ForEach(w => w.Product.StateColour = ColorStr.Yellow); - MyFlow.Step = 1; - - } - else if (TimeOutValidation(MyFlow.RunTime, 20000, InputList[X114搬运气缸上位].InputMeaning + "超时")) - { - - } - break; - - - } - } - #endregion - - - #region 贴合左 - - private HandModel feedOneLeft; - - public V_RectangleModel PasteLeftRM { get; set; } - public VisualEngineeringItems PasteLeftVEI { get; set; } - - MyPoint upleftBase, uprightBase, downleftBase, downrightBase; - - MyPoint upleft, upright, downleft, downright; - private MyPoint upOffs, downOffs; - - private double upAngleD; - - /// - /// 转盘点位 - /// - MotionPointModel PasteLeftPoint { get; set; } - - public FlowModel PasteLeftFlow { get; set; } - /// - /// 运行 - /// - public void PasteLeftRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 100: - PasteLeftPoint = feedOneLeft.VisionPoint; - MyFlow.Step++; - break; - - case 101: - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step = 0; - feedOneLeft.State.StatusBackground = ColorStr.White; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 0: - OutputList[Y206左贴合吸料真空吸].Switchs = true; //吸真空 - if (InputList[X203左贴合吸料真空检].LightUp) - { - PasteLeftPoint = (CurrentMachine.MotionPointList.Where(w => w.PointName == "左贴合下视觉位1").FirstOrDefault()); - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step = 6; - //ExcepStop("请取掉左吸头上的料"); - } - else - { - - feedOneLeft = Feed1List.Where(f => f.State.StatusBackground == ColorStr.Blue).FirstOrDefault(); - if (feedOneLeft != null) - { - MyFlow.Step++; - } - } - break; - case 1: - PasteLeftPoint = feedOneLeft.VisionPoint; - MyFlow.Step++; - break; - case 2: - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - - case 3: - OutputList[Y010左贴上光源].Switchs = true; - - if (RunningMode || VisualB.ColorJiaodian(VisualB.VisualEngineeringList[0].VisualEngineeringItemsList[0])) - { - OutputList[Y010左贴上光源].Switchs = false; - - PasteLeftPoint = Coper(feedOneLeft.TakePoint); - - if (RunningMode == false) - { - - if (Math.Abs(VisualB.CurrOffs.X) < 10 && Math.Abs(VisualB.CurrOffs.Y) < 10) - { - - PasteLeftPoint.ShaftPoint_X -= VisualB.CurrOffs.X; - PasteLeftPoint.ShaftPoint_Y -= VisualB.CurrOffs.Y; - } - } - MyFlow.Step++; - - } - else if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - - feedOneLeft.State.StatusBackground = ColorStr.White; - MyFlow.Step = 0; - - } - break; - case 4: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 5: - if (RunningMode == false) - OutputList[Y206左贴合吸料真空吸].Switchs = true; //吸真空 - - if (MyFlow.RunTime.AddSeconds(0.5) < DateTime.Now) - { - OutputList[Y301飞达后撤].Switchs = true; - - if (InputList[X302左飞达剥料完成].LightUp || RunningMode) - { - OutputList[Y301飞达后撤].Switchs = false; - PasteLeftPoint = (CurrentMachine.MotionPointList.Where(w => w.PointName == "左贴合下视觉位1").FirstOrDefault()); - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - ExcepStop("X302左飞达剥料完成" + " 超时"); - MyFlow.RunTime = DateTime.Now; - - } - } - - break; - - - case 6: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - if (feedOneLeft != null) - feedOneLeft.State.StatusBackground = ColorStr.White; - MyFlow.Step = 12; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 10: - PasteLeftPoint = GetMotionPoint("左贴合下视觉位1"); - - MyFlow.Step++; - break; - - case 11: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 12: - OutputList[Y011左贴下光源].Switchs = true; - OutputList[Y010左贴上光源].Switchs = false; - PasteLeftVEI = VisualB1.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - if (VisualB1.ColorJiaodian(PasteLeftVEI) || RunningMode) - { - if (RunningMode == false) - { - upleftBase = VisualB1.CurrLocationPoint; - upleft = VisualB1.CurrPoint; - - upleftBase.X += PasteLeftPoint.ShaftPoint_X; - upleftBase.Y += PasteLeftPoint.ShaftPoint_Y; - - upleft.X += PasteLeftPoint.ShaftPoint_X; - upleft.Y += PasteLeftPoint.ShaftPoint_Y; - } - - - MyFlow.Step++; - PasteLeftPoint = GetMotionPoint("左贴合下视觉位2"); - - } - else if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - - ExcepStop("左贴合下视觉拍照失败"); - - MyFlow.Step = 0; - - } - break; - - case 13: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 14: - OutputList[Y011左贴下光源].Switchs = true; - OutputList[Y010左贴上光源].Switchs = false; - PasteLeftVEI = VisualB1.VisualEngineeringList[1].VisualEngineeringItemsList[0]; - if (VisualB1.ColorJiaodian(PasteLeftVEI) || RunningMode) - { - - if (RunningMode == false) - { - uprightBase = VisualB1.CurrLocationPoint; - upright = VisualB1.CurrPoint; - - uprightBase.X += PasteLeftPoint.ShaftPoint_X; - uprightBase.Y += PasteLeftPoint.ShaftPoint_Y; - - upright.X += PasteLeftPoint.ShaftPoint_X; - upright.Y += PasteLeftPoint.ShaftPoint_Y; - } - - - MyFlow.Step++; - - } - else if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - - ExcepStop("左贴合下视觉拍照失败"); - - } - break; - - case 15: - HOperatorSet.AngleLl(upleftBase.Y, upleftBase.X, uprightBase.Y, uprightBase.X, - upleft.Y, upleft.X, upright.Y, upright.X, out HTuple angleH); - - var angle = angleH.TupleDeg().D; - - upOffs = new MyPoint(); - upOffs.Angle = angle; - - MyFlow.Step++; - break; - case 16: - PasteLeftPoint = GetMotionPoint("左贴合下视觉位1", true); - PasteLeftPoint.ShaftPoint_U -= upOffs.Angle; - MyFlow.Step++; - break; - - case 17: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 18: - OutputList[Y011左贴下光源].Switchs = true; - OutputList[Y010左贴上光源].Switchs = false; - PasteLeftVEI = VisualB1.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - if (VisualB1.ColorJiaodian(PasteLeftVEI) || RunningMode) - { - if (RunningMode == false) - { - upleftBase = VisualB1.CurrLocationPoint; - upleft = VisualB1.CurrPoint; - - upleftBase.X += PasteLeftPoint.ShaftPoint_X; - upleftBase.Y += PasteLeftPoint.ShaftPoint_Y; - - upleft.X += PasteLeftPoint.ShaftPoint_X; - upleft.Y += PasteLeftPoint.ShaftPoint_Y; - } - - - MyFlow.Step++; - PasteLeftPoint = GetMotionPoint("左贴合下视觉位2"); - - } - else if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - - ExcepStop("左贴合下视觉拍照失败"); - - MyFlow.Step = 0; - - } - break; - - case 19: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 20: - OutputList[Y011左贴下光源].Switchs = true; - OutputList[Y010左贴上光源].Switchs = false; - PasteLeftVEI = VisualB1.VisualEngineeringList[1].VisualEngineeringItemsList[0]; - if (VisualB1.ColorJiaodian(PasteLeftVEI) || RunningMode) - { - OutputList[Y011左贴下光源].Switchs = false; - if (RunningMode == false) - { - uprightBase = VisualB1.CurrLocationPoint; - upright = VisualB1.CurrPoint; - - uprightBase.X += PasteLeftPoint.ShaftPoint_X; - uprightBase.Y += PasteLeftPoint.ShaftPoint_Y; - - upright.X += PasteLeftPoint.ShaftPoint_X; - upright.Y += PasteLeftPoint.ShaftPoint_Y; - - HOperatorSet.AngleLl(upleftBase.Y, upleftBase.X, uprightBase.Y, uprightBase.X, - upleft.Y, upleft.X, upright.Y, upright.X, out HTuple angleH2); - - var angle2 = angleH2.TupleDeg().D; - - var baseCenterX = (upleftBase.X + uprightBase.X) / 2; - var baseCenterY = (upleftBase.Y + uprightBase.Y) / 2; - var CenterX = (upleft.X + upright.X) / 2; - var CenterY = (upleft.Y + upright.Y) / 2; - upOffs.X = CenterX - baseCenterX; - - upOffs.Y = CenterY - baseCenterY; - } - - - MyFlow.Step++; - - } - else if (MyFlow.RunTime.AddSeconds(3) < DateTime.Now) - { - - ExcepStop("左贴合下视觉拍照失败"); - - - } - break; - - - - - - - case 21: - PasteLeftPoint = GetMotionPoint("左贴合上视觉位1"); - MyFlow.Step++; - break; - - - case 22: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 23: - if (ZhuanPanList[2].State.StatusForeground == ColorStr.Blue) //Blue转到位 Gray转动中,Green工位完成 - { - if (ZhuanPanList[2].State.StatusBackground == ColorStr.Blue) // White 无料 blue 有料 Yello 已贴 green/red已检 - { - MyFlow.Step++; - } - else - { - ZhuanPanList[2].State.StatusForeground = ColorStr.Green; - } - } - - break; - - case 24: - OutputList[Y010左贴上光源].Switchs = true; - OutputList[Y011左贴下光源].Switchs = false; - - if (VisualB.FeatureMatchingJiaodian(VisualB.VisualEngineeringList[1].VisualEngineeringItemsList[0]) || RunningMode) - { - if (RunningMode == false) - { - downleftBase = VisualB.CurrLocationPoint; - - downleft = VisualB.CurrPoint; - - if ((Math.Abs(VisualB.CurrOffs.X) < 3) && (Math.Abs(VisualB.CurrOffs.Y) < 3)) - { - - downleftBase.X -= PasteLeftPoint.ShaftPoint_X; - downleftBase.Y -= PasteLeftPoint.ShaftPoint_Y; - - downleft.X -= PasteLeftPoint.ShaftPoint_X; - downleft.Y -= PasteLeftPoint.ShaftPoint_Y; - - MyFlow.Step++; - } - else - { - - ExcepStop("左贴合铁件偏移过大"); - } - } - - - } - else if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - - ExcepStop("拍照失败"); - - } - break; - case 25: - PasteLeftPoint = GetMotionPoint("左贴合上视觉位2"); - MyFlow.Step++; - break; - - case 26: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - } - break; - - - case 27: - OutputList[Y010左贴上光源].Switchs = true; - OutputList[Y011左贴下光源].Switchs = false; - - if (VisualB.FeatureMatchingJiaodian(VisualB.VisualEngineeringList[1].VisualEngineeringItemsList[1]) || RunningMode) - { - if (RunningMode == false) - { - - - if ((Math.Abs(VisualB.CurrOffs.X) < 3) && (Math.Abs(VisualB.CurrOffs.Y) < 3)) - { - - downrightBase = VisualB.CurrLocationPoint; - - downright = VisualB.CurrPoint; - downrightBase.X -= PasteLeftPoint.ShaftPoint_X; - downrightBase.Y -= PasteLeftPoint.ShaftPoint_Y; - - downright.X -= PasteLeftPoint.ShaftPoint_X; - downright.Y -= PasteLeftPoint.ShaftPoint_Y; - - var baseCenterX = (downleftBase.X + downrightBase.X) / 2; - var baseCenterY = (downleftBase.Y + downrightBase.Y) / 2; - var CenterX = (downleft.X + downright.X) / 2; - var CenterY = (downleft.Y + downright.Y) / 2; - HOperatorSet.AngleLl(downleftBase.Y, downleftBase.X, downrightBase.Y, downrightBase.X, - downleft.Y, downleft.X, downright.Y, downright.X, out HTuple angleH3); - - var angle3 = angleH3.TupleDeg().D; - downOffs = new MyPoint { X = CenterX - baseCenterX, Y = CenterY - baseCenterY, Angle = angle3 }; - - MyFlow.Step++; - } - else - { - - ExcepStop("左贴合铁件偏移过大"); - } - - - } - - - } - else if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - - ExcepStop("拍照失败"); - - } - break; - - case 28: - PasteLeftPoint = GetMotionPoint("左贴合位", true); - - - if (upOffs.Check(5) && downOffs.Check(5)) - { - VisualB.ShowText($"X {upOffs.X:F3} Y {upOffs.Y:F3} U {upOffs.Angle:F3}", "green", 20, 10); - VisualB.ShowText($"X {downOffs.X:F3} Y {downOffs.Y:F3} U {downOffs.Angle:F3}", "green", 20, 11); - - PasteLeftPoint.ShaftPoint_X += upOffs.X; - PasteLeftPoint.ShaftPoint_Y += upOffs.Y; - PasteLeftPoint.ShaftPoint_U -= upOffs.Angle; - - - PasteLeftPoint.ShaftPoint_X -= downOffs.X; - PasteLeftPoint.ShaftPoint_Y -= downOffs.Y; - PasteLeftPoint.ShaftPoint_U += downOffs.Angle; - MyFlow.Step++; - } - else - { - - ExcepStop("偏差过大"); - MyFlow.Step++; - } - - - - - break; - case 29: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 30: - OutputList[Y206左贴合吸料真空吸].Switchs = false; //吸真空 - OutputList[Y207左贴合吸料真空破].Switchs = true; //吸真空 - if (InputList[X203左贴合吸料真空检].LightUp == false && MyFlow.RunTime.AddMilliseconds(300) < DateTime.Now || RunningMode) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X203左贴合吸料真空检].InputMeaning + "异常"); - - } - break; - - - case 31: - OutputList[Y207左贴合吸料真空破].Switchs = false; //吸真空 - PasteLeftPoint = GetMotionPoint("左贴合下视觉位2"); - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step++; - break; - - case 32: - - if (PasteLeftPoint.PointRun(MCVM.AllShaftList)) - { - ZhuanPanList[2].State.StatusBackground = ColorStr.Yellow; - ZhuanPanList[2].State.StatusForeground = ColorStr.Green; - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteLeftPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 33: - - if (RunStatu == RunStatuEnum.Normal) - { - - MyFlow.Step = 0; - } - - - break; - - } - } - #endregion - - #region 贴合右 - - public HandModel feedOneRight { get; set; } - public HandModel FreeHand { get; set; } = new HandModel(); - public VisualEngineeringItems PasteRightVEI { get; set; } - - /// - /// 转盘点位 - /// - MotionPointModel PasteRightPoint { get; set; } - - public FlowModel PasteRightFlow { get; set; } - /// - /// 运行 - /// - public void PasteRightRun(FlowModel MyFlow) - { - switch (MyFlow.Step) - { - case 0: - - OutputList[Y208右贴合吸料真空吸].Switchs = true; //吸真空 - if (MyFlow.RunTime.AddMilliseconds(300) < DateTime.Now) - { - if (InputList[X204右贴合吸料真空检].LightUp) - { - feedOneRight = FreeHand; - //MyFlow.Step = 6; - ExcepStop("请取掉右吸头的料"); - } - else - { - var first = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料最左").FirstOrDefault(); - var last = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料最右").FirstOrDefault(); - var vision = CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合取料拍照").FirstOrDefault(); - - var step = (last.ShaftPoint_X - first.ShaftPoint_X) / (CurrentMachine.MyQita.Feed - 1); - var stepZ = (last.ShaftPoint_Z - first.ShaftPoint_Z) / (CurrentMachine.MyQita.Feed - 1); - - for (int i = 0; i < CurrentMachine.MyQita.Feed; i++) - { - Feed2List[i].TakePoint = Coper(first); - Feed2List[i].TakePoint.ShaftPoint_X += step * i; - Feed2List[i].TakePoint.ShaftPoint_Z += stepZ * i; - Feed2List[i].VisionPoint = Coper(vision); - Feed2List[i].VisionPoint.ShaftPoint_X += step * i; - } - feedOneRight = Feed2List.Where(f => f.State.StatusBackground == ColorStr.Blue).FirstOrDefault(); - if (feedOneRight != null) - { - MyFlow.Step++; - } - } - - } - - break; - case 1: - PasteRightPoint = feedOneRight.VisionPoint; - PasteRightPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.Step++; - break; - case 2: - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteRightPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - - case 3: - OutputList[Y012右贴上光源].Switchs = true; - PasteRightVEI = VisualC.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - - if (RunningMode || VisualC.FeatureMatchingCirCle2(PasteRightVEI)) - { - OutputList[Y012右贴上光源].Switchs = false; - - PasteRightPoint = Coper(feedOneRight.TakePoint); - if (RunningMode == false) - { - PasteRightPoint.ShaftPoint_X += VisualC.CurrOffs.X; - PasteRightPoint.ShaftPoint_Y -= VisualC.CurrOffs.Y; - } - MyFlow.Step++; - - } - else if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - - feedOneRight.State.StatusBackground = ColorStr.White; - MyFlow.Step = 0; - - } - - - break; - case 4: - - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - - PasteRightPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 5: - if (RunningMode == false) - OutputList[Y208右贴合吸料真空吸].Switchs = true; //吸真空 - if (InputList[X204右贴合吸料真空检].LightUp || RunningMode) - { - if (MyFlow.RunTime.AddMilliseconds(500) < DateTime.Now) - { - - MyFlow.Step++; - } - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X204右贴合吸料真空检].InputMeaning + "异常"); - MyFlow.Step = 0; - } - break; - - case 6: - PasteRightPoint = (CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合下视觉位").FirstOrDefault()); - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - feedOneRight.State.StatusBackground = ColorStr.White; - MyFlow.Step++; - } - break; - case 7: - - OutputList[Y013右贴下光源].Switchs = true; - - PasteRightVEI = VisualC1.VisualEngineeringList[0].VisualEngineeringItemsList[0]; - if (InputList[X204右贴合吸料真空检].LightUp || RunningMode) - { - if (RunningMode || VisualC1.FeatureMatchingCirCle2(PasteRightVEI)) - { - if (RunningMode == false) - { - var x = VisualC1.CurrOffs.X; - var y = VisualC1.CurrOffs.Y; - - if (Math.Abs(x) < 2 && Math.Abs(y) < 2) - { - OutputList[Y013右贴下光源].Switchs = false; - MyFlow.Step++; - } - else - { - - ExcepStop("下视觉偏差过大"); - } - } - else - { - - MyFlow.Step++; - } - } - else if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - { - - feedOneRight.State.StatusBackground = ColorStr.White; - MyFlow.Step = 0; - - } - } - else - { - ExcepStop("取料失败"); - feedOneRight.State.StatusBackground = ColorStr.White; - MyFlow.Step = 0; - } - - break; - case 8: - PasteRightPoint = (CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合上视觉位").FirstOrDefault()); - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - - break; - - case 9: - if (ZhuanPanList[6].State.StatusForeground == ColorStr.Blue || testing) //Blue转到位 Gray转动中,Green工位完成 - { - if (ZhuanPanList[6].State.StatusBackground == ColorStr.Green || ZhuanPanList[6].State.StatusBackground == ColorStr.Red || ZhuanPanList[6].State.StatusBackground == ColorStr.Yellow) // White 无料 blue 有料 green/red已检 - { - MyFlow.Step++; - } - else - { - ZhuanPanList[6].State.StatusForeground = ColorStr.Green; - } - } - - break; - - case 10: - - if (ZhuanPanList[6].State.StatusBackground == ColorStr.White) - { - ZhuanPanList[6].State.StatusForeground = ColorStr.Green; - MyFlow.Step = 0; - } - - OutputList[Y012右贴上光源].Switchs = true; - - - - PasteRightVEI = VisualC.VisualEngineeringList[1].VisualEngineeringItemsList[0]; - if (VisualC.GrayInrangeArea(VisualC.VisualEngineeringList[1].VisualEngineeringItemsList[1]) && - VisualC.FeatureMatchingCirCle2(PasteRightVEI) || RunningMode) - { - - PasteRightPoint = Coper(CurrentMachine.MotionPointList.Where(w => w.PointName == "右贴合位").FirstOrDefault()); - if (RunningMode == false) - { - var x = VisualC1.CurrOffs.X; - var y = VisualC1.CurrOffs.Y; - - if (Math.Abs(x) < 2 && Math.Abs(y) < 2) - { - PasteRightPoint.ShaftPoint_X += VisualC.CurrOffs.X; - PasteRightPoint.ShaftPoint_Y -= VisualC.CurrOffs.Y; - - PasteRightPoint.ShaftPoint_X -= VisualC1.CurrOffs.X; - PasteRightPoint.ShaftPoint_Y += VisualC1.CurrOffs.Y; - MyFlow.Step++; - } - else - { - ExcepStop("上视觉偏差过大"); - } - - - } - PasteRightPoint.PointRunStep = GengralProcessEnum.Start; - } - else if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now) - { - - ExcepStop("右贴合拍照失败"); - - - } - break; - case 11: - - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PasteRightPoint.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - case 12: - OutputList[Y208右贴合吸料真空吸].Switchs = false; //吸真空 - if (InputList[X204右贴合吸料真空检].LightUp == false || RunningMode) - { - CheckFlow = new FlowModel("Check"); - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - ExcepStop(InputList[X204右贴合吸料真空检].InputMeaning + "异常"); - - } - break; - - case 13: - if (CheckRun(CheckFlow)) - { - - ZhuanPanList[6].State.StatusForeground = ColorStr.Green; - MyFlow.Step = 14; - } - break; - case 14: - - if (RunStatu == RunStatuEnum.Normal) - { - - MyFlow.Step = 0; - } - - - break; - - - } - } - - - public List CheckResults { get; set; } = new List(); - - private double _AutoFixX; - public double AutoFixX - { - get { return _AutoFixX; } - set - { - _AutoFixX = value; - this.RaisePropertyChanged("AutoFixX"); - } - } - - private double _AutoFixY; - public double AutoFixY - { - get { return _AutoFixY; } - set - { - _AutoFixY = value; - this.RaisePropertyChanged("AutoFixY"); - } - } - - - #endregion - - #region 视觉检查 - public FlowModel CheckFlow { get; set; } = new FlowModel("检查"); - - public bool PutWait { get; private set; } - public bool FlipSafeToRobot { get; private set; } - VisualEngineeringItems CheckVEI; - List CheckPointList { get; set; } = new List(); - Task CheckTask; - public bool CheckRun(FlowModel MyFlow) - { - { - bool done = false; - switch (MyFlow.Step) - { - - - case 0: - PasteRightPoint = GetMotionPoint("右贴合检查位1"); - CheckPointList.Clear(); - MyFlow.Step++; - break; - - case 1: - OutputList[Y012右贴上光源].Switchs = true; - OutputList[Y014收料上光源].Switchs = true; - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - checkCount = 0; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - MyFlow.Step--; - } - break; - - case 2: - CheckVEI = VisualC.VisualEngineeringList[3].VisualEngineeringItemsList[0]; - - CheckTask = Task.Run(() => - { - - return VisualC.GetPoint(CheckVEI); - }); - - - MyFlow.Step++; - break; - case 3: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - OutputList[Y012右贴上光源].Switchs = true; - OutputList[Y014收料上光源].Switchs = false; - CheckPointList.Add(VisualC.CurrPoint); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.2 }); - CheckPointList.Add(new MyPoint() { X = -0.2 }); - MyFlow.Step++; - checkCount = 0; - } - else - { - - MyFlow.Step--; - checkCount++; - } - } - - break; - - case 4: - - - CheckVEI = VisualC.VisualEngineeringList[2].VisualEngineeringItemsList[0]; - - CheckTask = Task.Run(() => - { - return VisualC.FeatureMatchingLine(CheckVEI); - }); - - - MyFlow.Step++; - break; - - case 5: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - CheckPointList.Add(Coper(VisualC.StartPoint)); - CheckPointList.Add(Coper(VisualC.EndPoint)); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - } - else - { - - MyFlow.Step--; - checkCount++; - } - } - - break; - - - - case 6: - - - CheckVEI = VisualC.VisualEngineeringList[2].VisualEngineeringItemsList[1]; - - CheckTask = Task.Run(() => - { - return VisualC.FeatureMatchingLine(CheckVEI); - }); - - - MyFlow.Step++; - break; - - case 7: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - CheckPointList.Add(Coper(VisualC.StartPoint)); - CheckPointList.Add(Coper(VisualC.EndPoint)); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - } - else - { - - MyFlow.Step--; - checkCount++; - } - } - - break; - - - // 右 - case 8: - PasteRightPoint = GetMotionPoint("右贴合检查位2"); - - MyFlow.Step++; - break; - - case 9: - OutputList[Y012右贴上光源].Switchs = true; - OutputList[Y014收料上光源].Switchs = true; - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - checkCount = 0; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - MyFlow.Step--; - } - break; - - case 10: - CheckVEI = VisualC.VisualEngineeringList[3].VisualEngineeringItemsList[1]; - - CheckTask = Task.Run(() => - { - return VisualC.ColorJiaodianLong(CheckVEI); - }); - - - MyFlow.Step++; - break; - case 11: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - OutputList[Y012右贴上光源].Switchs = true; - OutputList[Y014收料上光源].Switchs = false; - CheckPointList.Add(VisualC.CurrPoint); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - checkCount = 0; - } - else - { - checkCount++; - MyFlow.Step--; - - } - } - - break; - - case 12: - - - CheckVEI = VisualC.VisualEngineeringList[2].VisualEngineeringItemsList[2]; - - CheckTask = Task.Run(() => - { - return VisualC.FeatureMatchingLine(CheckVEI); - }); - - - MyFlow.Step++; - break; - - case 13: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - CheckPointList.Add(Coper(VisualC.StartPoint)); - CheckPointList.Add(Coper(VisualC.EndPoint)); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - - } - else - { - checkCount++; - MyFlow.Step--; - } - } - - break; - - case 14: - checkCount = 0; - MyFlow.Step++; - break; - - case 15: - - - CheckVEI = VisualC.VisualEngineeringList[2].VisualEngineeringItemsList[3]; - - CheckTask = Task.Run(() => - { - return VisualC.FeatureMatchingLine(CheckVEI); - }); - - - MyFlow.Step++; - break; - - case 16: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - CheckPointList.Add(Coper(VisualC.StartPoint)); - CheckPointList.Add(Coper(VisualC.EndPoint)); - MyFlow.Step++; - checkCount = 0; - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - } - else - { - - checkCount++; - MyFlow.Step--; - } - } - - break; - - - case 17: - PasteRightPoint = GetMotionPoint("右贴合检查位3"); - - MyFlow.Step++; - break; - - case 18: - OutputList[Y012右贴上光源].Switchs = true; - OutputList[Y013右贴下光源].Switchs = false; - OutputList[Y014收料上光源].Switchs = false; - if (PasteRightPoint.PointRun(MCVM.AllShaftList)) - { - MyFlow.Step++; - checkCount = 0; - } - else if (MyFlow.RunTime.AddSeconds(10) < DateTime.Now) - { - MyFlow.Step--; - } - break; - - case 19: - CheckVEI = VisualC.VisualEngineeringList[2].VisualEngineeringItemsList[4]; - - CheckTask = Task.Run(() => - { - return VisualC.FeatureMatchinFindTwoCirCle(CheckVEI); - }); - - - MyFlow.Step++; - break; - case 20: - - if (CheckTask.IsCompleted) - { - - if (CheckTask.Result) - { - - if (Math.Abs(VisualC.BigCirCle.X - VisualC.SmallCirCle.X) < 0.2 && Math.Abs(VisualC.BigCirCle.Y - VisualC.SmallCirCle.Y) < 0.2) - { - checkCount = 0; - CheckPointList.Add(VisualC.BigCirCle); - CheckPointList.Add(VisualC.SmallCirCle); - MyFlow.Step++; - } - else if (checkCount > 10) - { - checkCount = 0; - CheckPointList.Add(VisualC.BigCirCle); - CheckPointList.Add(VisualC.SmallCirCle); - MyFlow.Step++; - } - else - { - checkCount++; - MyFlow.Step--; - } - } - else if (checkCount > 10) - { - ExcepStop($"{VisualC.Camera.VisualName}拍照失败"); - CheckPointList.Add(new MyPoint() { X = 0.999 }); - CheckPointList.Add(new MyPoint() { X = -0.999 }); - MyFlow.Step++; - } - else - { - - checkCount++; - MyFlow.Step--; - } - } - - break; - - - case 21: - - var hingeLeft = CheckPointList[0]; - var TLeft1Start = CheckPointList[1]; - var TLeft1End = CheckPointList[2]; - var TLeft2Start = CheckPointList[3]; - var TLeft2End = CheckPointList[4]; - - var hingeright = CheckPointList[5]; - var Tright1Start = CheckPointList[6]; - var Tright1End = CheckPointList[7]; - var Tright2Start = CheckPointList[8]; - var Tright2End = CheckPointList[9]; - - var bigCenter = CheckPointList[10]; - var smallCenter = CheckPointList[11]; - - - - CurrentMachine.MeasureRangeValueLeft[0].RealValue = DistancePl(hingeright, Tright2Start, Tright2End); - CurrentMachine.MeasureRangeValueLeft[1].RealValue = DistancePl(hingeright, Tright1Start, Tright1End); - CurrentMachine.MeasureRangeValueLeft[2].RealValue = DistancePl(hingeLeft, TLeft1Start, TLeft1End); - CurrentMachine.MeasureRangeValueLeft[3].RealValue = bigCenter.X - smallCenter.X; - CurrentMachine.MeasureRangeValueLeft[4].RealValue = bigCenter.Y - smallCenter.Y; - - CheckResults.Add(new MyPoint { X = CurrentMachine.MeasureRangeValueLeft[0].ActualValue - CurrentMachine.MeasureRangeValueLeft[0].BaseValue, Y = CurrentMachine.MeasureRangeValueLeft[1].ActualValue - CurrentMachine.MeasureRangeValueLeft[1].BaseValue }); - - - - ZhuanPanList[6].State.StatusBackground = ColorStr.Green; - - - for (int i = 0; i < currentMachine.MeasureRangeValueLeft.Count; i++) - { - if (currentMachine.MeasureRangeValueLeft[i].ActualValue > currentMachine.MeasureRangeValueLeft[i].MaxValue) - { - - currentMachine.MeasureRangeValueLeft[i].ActualValue -= 0.3; - - - } - else if (currentMachine.MeasureRangeValueLeft[i].ActualValue < currentMachine.MeasureRangeValueLeft[i].MinValue) - { - - currentMachine.MeasureRangeValueLeft[i].ActualValue += 0.3; - - - } - - currentMachine.MeasureRangeValueLeft[i].GetResult(); - - - } - for (int i = 0; i < currentMachine.MeasureRangeValueLeft.Count; i++) - { - if (currentMachine.MeasureRangeValueLeft[i].ResultStr == "NG") - { - ZhuanPanList[6].State.StatusBackground = ColorStr.Red; - break; - } - } - - WriteCheckLog(CurrentMachine.MeasureRangeValueLeft, ZhuanPanList[6].Barcode); - - - MyFlow.Step = 0; - done = true; - break; - } - - return done; - } - } - /// - /// 点到直线距离 - /// - /// - /// - /// - /// - private double DistancePl(MyPoint p1, MyPoint p2, MyPoint p3) - { - if (p1 == null || p2 == null || p3 == null) - { - return 0; - } - - HTuple dis; - HOperatorSet.DistancePl(p1.Y, p1.X, p2.Y, p2.X, p3.Y, p3.X, out dis); - return dis.D; - } - #endregion - - #region 压 - - - - /// - /// 压力连接 - /// - CommunicationManagementClass YaliyiConn { get; set; } - DateTime yajiSend = DateTime.Now; - private int send; - - - private void SendYaJi() - { - if (yajiSend.AddMilliseconds(1) < DateTime.Now) - { - if (YaliyiConn.Showmsg.StatusBackground == ColorStr.Green) - { - switch (send) - { - case 0: - YaliyiConn.SendInfo("01 04 00 00 00 02 71 CB"); - // send++; - break; - case 1: - YaliyiConn.SendInfo("02 04 00 00 00 02 71 F8"); - send++; - break; - case 2: - YaliyiConn.SendInfo("03 04 00 00 00 02 70 29"); - send = 0; - break; - } - - } - else - { - YaliyiConn.ConnectSwitch = !YaliyiConn.ConnectSwitch; - - } - yajiSend = DateTime.Now; - } - } - /// - /// 压力仪器回调函数 - /// - /// - private void YaliyiConn_ReceiveCallback(string str) - { - string[] sl = str.Split('-'); - string strr = sl[6] + sl[5] + sl[4] + sl[3]; - - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < strr.Length; i++) - { - if (i > 0 && i % 2 == 0) - sb.Append(' '); // 每隔两位插入空格 - sb.Append(strr[i]); - } - var newStr = sb.ToString(); - var split = newStr.Split(' '); - - List bytes = new List(); - for (int i = 0; i < split.Length; i++) - { - bytes.Add(byte.Parse(split[i], NumberStyles.HexNumber)); - } - - var dd = BitConverter.ToSingle(bytes.ToArray(), 0); - - if (sl[0].Contains("01")) - { - CurrentMachine.MyQita.Press1.Pressure = Math.Round(dd, 3); - - } - - } - - public bool PressSafe { get; private set; } - - - #endregion - - #region 转矩模式 - private FeiYuShaft shalf1; - private double downAngleD; - private int checkCount; - - public FlowModel TorqueFlow { get; set; } = new FlowModel("压"); - public MotionPointModel PressPointTemp { get; set; } - - - public void TorqueRun(FlowModel MyFlow, Press press) - { - - switch (MyFlow.Step) - { - case 0: - OutputList[Y105顶升气缸上位].Switchs = false; - if (ZhuanPanList[4].State.StatusForeground == ColorStr.Blue) - { - if (ZhuanPanList[4].State.StatusBackground == ColorStr.Yellow) - { - PressSafe = false; - MyFlow.Step++; - } - else - { - ZhuanPanList[4].State.StatusForeground = ColorStr.Green; - - ZhuanPanList[4].State.StatusBackground = ColorStr.White; - } - } - break; - case 1: - - OutputList[Y105顶升气缸上位].Switchs = true; - shalf1 = MCVM.AllShaftList.Where(s => s.ShaftName == "压合Z").FirstOrDefault(); - if (shalf1 != null) - { - shalf1.TorquemoveStart(press.TorqueStart, 100); - - MyFlow.Step++; - } - break; - - case 2: - - if (MyFlow.RunTime.AddMilliseconds(50) > DateTime.Now) - break; - - shalf1.TorquemoveSet(press.TorqueMoving); - press.TorqueSet = press.TorqueMoving; - press.PressTime = 0; - if (MyFlow.RunTime.AddSeconds(2) < DateTime.Now) - MyFlow.Step++; - - break; - case 3: - if (press.RunTime.AddSeconds(0.3) < DateTime.Now) - { - press.RunTime = DateTime.Now; - - if (press.Pressure < press.PresssureTarage - 1) - { - if (press.TorqueSet < 1000) - press.TorqueSet++; - else - ExcepStop("压力反馈异常"); - shalf1.TorquemoveSet(press.TorqueSet); - - } - else if (press.Pressure > press.PresssureTarage + 1) - { - if (press.TorqueSet - 10 > 0) - press.TorqueSet -= 10; - shalf1.TorquemoveSet(press.TorqueSet); - - } - - } - if (press.Pressure > press.PresssureTarage - 1 - && press.Pressure < press.PresssureTarage + 10) - { - - MyFlow.Step++; - } - else if (MyFlow.RunTime.AddSeconds(5) < DateTime.Now) - { - MyFlow.Step = 4; - } - break; - - case 4: - if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now) - { - - MyFlow.RunTime = DateTime.Now; - if (press.PressTime >= press.KeepTime) - { - MyFlow.Step++; - } - else - { - press.PressTime++; - } - } - - if (press.RunTime.AddSeconds(0.5) < DateTime.Now) - { - press.RunTime = DateTime.Now; - - if (press.Pressure < press.PresssureTarage - 0.3) - { - if (press.TorqueSet < 1000) - press.TorqueSet++; - shalf1.TorquemoveSet(press.TorqueSet); - - } - else if (press.Pressure > press.PresssureTarage + 0.3) - { - if (press.TorqueSet - 10 > 0) - press.TorqueSet -= 10; - shalf1.TorquemoveSet(press.TorqueSet); - - } - - } - break; - - case 5: - shalf1.ShaftStop(); - shalf1.SetSpeed(3600); - MyFlow.Step++; - break; - case 6: - if (MyFlow.RunTime.AddSeconds(0.5) < DateTime.Now) - { - OutputList[Y105顶升气缸上位].Switchs = false; - - PressPointTemp = GetMotionPoint("压合待机位"); - MyFlow.Step++; - } - break; - - - - - - case 7: - OutputList[Y105顶升气缸上位].Switchs = false; - if (InputList[X209顶升气缸下位].LightUp) - { - MyFlow.Step++; - - } - - break; - case 8: - if (PressPointTemp.PointRun(MCVM.AllShaftList)) - { - ZhuanPanList[4].State.StatusForeground = ColorStr.Green; - - PressSafe = true; - MyFlow.Step++; - - - } - else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) - { - PressPointTemp.PointRunStep = GengralProcessEnum.Start; - MyFlow.RunTime = DateTime.Now; - - } - break; - - case 9: - - if (RunStatu == RunStatuEnum.Normal) - { - - MyFlow.Step = 0; - } - else - { - - MyFlow.Step = 1; - } - - - break; - } - - - - - - - - - - - - - } - #endregion - + #region 手动测试轴 public int TestPos { get; set; } @@ -6944,30 +2735,31 @@ namespace ViewModel break; case 1: - PressPointTemp = GetMotionPoint(TestPos); + AxisPointTemp = GetMotionPoint(TestPos); MyFlow.Step++; - + break; case 2: - if (PressPointTemp.PointRun(MCVM.AllShaftList)) + if (AxisPointTemp.PointRun(MCVM.AllShaftList)) { - + MyFlow.Step++; } else if (MyFlow.RunTime.AddMilliseconds(10000) < DateTime.Now) { - PressPointTemp.PointRunStep = GengralProcessEnum.Start; + AxisPointTemp.PointRunStep = GengralProcessEnum.Start; MyFlow.RunTime = DateTime.Now; } break; case 3: - if (TestPos % 2 == 0) { + if (TestPos % 2 == 0) + { if (TestPos < 8) { @@ -6984,7 +2776,7 @@ namespace ViewModel MyFlow.RunTime = DateTime.Now; } - else if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now ) + else if (MyFlow.RunTime.AddMilliseconds(1000) < DateTime.Now) { MyFlow.Step++; MyFlow.RunTime = DateTime.Now; @@ -7012,7 +2804,8 @@ namespace ViewModel TestPos++; } - else { + else + { TestPos = 1; } @@ -7044,9 +2837,9 @@ namespace ViewModel void ExecuteSoftltcInit(object obj) { - - var shaft = MCVM.AllShaftList.Where(w => w.ShaftName == "上料盘Z").FirstOrDefault(); - if(shaft != null) + + var shaft = MCVM.AllShaftList.Where(w => w.ShaftName == "轴1").FirstOrDefault(); + if (shaft != null) { shaft.SoftltcInit(0, 5, 1); } @@ -7058,7 +2851,7 @@ namespace ViewModel void ExecuteSoftltcReset(object obj) { - var shaft = MCVM.AllShaftList.Where(w => w.ShaftName == "上料盘Z").FirstOrDefault(); + var shaft = MCVM.AllShaftList.Where(w => w.ShaftName == "轴1").FirstOrDefault(); if (shaft != null) { shaft.SoftltcReset(0); @@ -7076,7 +2869,8 @@ namespace ViewModel if (shaft != null) { double latchPos = 0; - if (shaft.SoftltcRead(0, ref latchPos)) { + if (shaft.SoftltcRead(0, ref latchPos)) + { LatchPos = latchPos; @@ -7094,6 +2888,8 @@ namespace ViewModel this.RaisePropertyChanged("LatchPos"); } } + + public MotionPointModel AxisPointTemp { get; private set; } } } diff --git a/Views/MainInterface.xaml b/Views/MainInterface.xaml index f2427ca..ae192ef 100644 --- a/Views/MainInterface.xaml +++ b/Views/MainInterface.xaml @@ -9,257 +9,17 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + DataContext="{Binding VisualA}" /> +