Example #1
0
        /// <summary>
        /// 开始入板
        /// </summary>
        /// <param name="currentRoller"></param>
        /// <param name="product"></param>
        private void start(RollerDesignerItemViewModel currentRoller, ProductBase product)
        {
            if (product == null)
            {
                return;
            }

            RunningProductVo runningProduct = new RunningProductVo {
                Product = product
            };

            lock (_lockRunningProducts)
                _runningProducts.Add(runningProduct);

            var beginRoller = _runningRollers.FirstOrDefault(a => a.RollerKey == currentRoller.Key);

            if (beginRoller == null)
            {
                throw new Exception($"起点({currentRoller.Key})不在运行时中");
            }
            beginRoller.BandProduct = runningProduct;

            // 获取默认路径
            runningProduct.TargetNode = getAutoTargetNode(currentRoller.Key);
            if (string.IsNullOrWhiteSpace(runningProduct.TargetNode))
            {
                throw new Exception($"{currentRoller.Key}目标路径路由信息为空!");
            }
            runningProduct.TargetPath = findPath(runningProduct.CurrentRollerKey, runningProduct.TargetNode);
        }
Example #2
0
        /// <summary>
        ///     获取路径规划的下一节滚筒
        /// </summary>
        /// <param name="currentRoller"></param>
        /// <returns></returns>
        private RollerDesignerItemViewModel getNextRoller(RollerDesignerItemViewModel currentRoller, string targetRollerKey)
        {
            return(getNextRollerByTargetRollerKey(currentRoller.Key, targetRollerKey));

            /*   // 目标滚筒不为空
             * if (false == string.IsNullOrWhiteSpace(targetRollerKey))
             * {
             *     return getNextRollerByTargetRollerKey(currentRoller.Key, targetRollerKey);
             * }
             *
             * //
             * var sourceConnector =
             *     _connectors.FirstOrDefault(a => a.SourceConnectorInfo.DataItem != null
             *                                     && (a.SourceConnectorInfo.DataItem as RollerDesignerItemViewModel)
             *                                     .Key == currentRoller.Key
             *                                     && a.SinkConnectorInfo is FullyCreatedConnectorInfo);
             * if (sourceConnector == null) return null;
             * return (sourceConnector.SinkConnectorInfo as FullyCreatedConnectorInfo)?.DataItem as
             *     RollerDesignerItemViewModel;*/
        }
Example #3
0
        /// <summary>
        /// 开始入板
        /// </summary>
        /// <param name="currentRoller"></param>
        private void start(RollerDesignerItemViewModel currentRoller)
        {
            var product = getReadyProduct();

            if (product == null)
            {
                return;
            }
            RunningProductVo runningProduct = new RunningProductVo {
                Product = product
            };

            _runningProducts.Add(runningProduct);
            var beginRoller = _runningRollers.FirstOrDefault(a => a.RollerKey == currentRoller.Key);

            if (beginRoller == null)
            {
                throw new Exception($"起点({currentRoller.Key})不在运行时中");
            }
            beginRoller.BandProduct = runningProduct;
        }
Example #4
0
 /// <summary>
 ///     获取路径规划的下一节滚筒
 /// </summary>
 /// <param name="currentRoller"></param>
 /// <param name="targetRollerKey"></param>
 /// <returns></returns>
 private RollerDesignerItemViewModel getNextRoller(RollerDesignerItemViewModel currentRoller, string targetRollerKey)
 {
     return(getNextRollerByTargetRollerKey(currentRoller.Key, targetRollerKey));
 }