Exemplo n.º 1
0
        public ViewExistingDatasetViewModel(Frame theFrame)
        {
            OngoingJobsViewModel vm = new OngoingJobsViewModel();

            GlobalContainer.Instance.Container.RegisterInstance <IJobTracker>(vm);

            Container = GlobalContainer.Instance.Container;

            ValidateConnection.validateConnection();

            SetupCommands();
            GetPatientsForTreeview(null);

            ImageInfo = "Please Select An Image To View Image Information Here.";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Occurs when the application has started.
        /// </summary>
        /// <param name="e">Event information.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            ValidateConnection.validateConnection();

            // Create the window and provide it with the presentation layer.
            IDIPS service        = ServiceHelper.CreateLocalService();
            IProcessingService s = service.Processor;

            IUnityContainer c = GlobalContainer.Instance.Container;

            c.RegisterInstance <IDIPS>(service);
            c.RegisterInstance <IProcessingService>(s);
            c.RegisterInstance <IPipelineManager>(s.PipelineManager);

            FilterTreeView ftv     = new FilterTreeView();
            QueueDialog    qd      = new QueueDialog();
            UIContext      context = new UIContext();
            HandlerFactory f       = new HandlerFactory();

            f.Load(Assembly.GetAssembly(typeof(HandlerFactory)));

            c.RegisterInstance <IHandlerFactory>(f);
            c.RegisterInstance <IUIContext>(context);
            c.RegisterInstance <IFilterTreeView>(ftv);
            c.RegisterInstance <IQueueDialog>(qd);

            MainNavi navWindow = new MainNavi();

            try
            {
                navWindow.ShowDialog();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 3
0
    public static List <NodeBase> CalcPathBetweenNodes(NodeBase nodeStart, NodeBase nodeEnd, ValidateConnection validate = null)
    {
        //Calc distance map
        CalcDistanceBetweenToNodes(nodeStart, nodeEnd, validate);

        //Reverse walk the path
        var path = new List <NodeBase>();

        path.Add(nodeEnd);
        var nodeIter = nodeEnd;

        while (true)
        {
            //Check if complete
            if (nodeIter == nodeStart)
            {
                break;
            }

            //Move down path
            NodeBase minChild = null;
            foreach (var child in nodeIter.getNodes())
            {
                //Validate
                if (validate != null && !validate(child, nodeIter))
                {
                    continue;
                }
                if (child.minDistance >= double.MaxValue)
                {
                    continue;
                }

                //Check for min
                if (minChild == null || child.minDistance < minChild.minDistance)
                {
                    minChild = child;
                }
            }

            //Error
            if (minChild == null)
            {
                return(null);
            }

            //Continue
            nodeIter = minChild;
            path.Add(nodeIter);
        }

        //Reverse to correct order and return
        path.Reverse();
        return(path);
    }
Exemplo n.º 4
0
    //Make sure all nodes are reset before calling any distance calculation method
    public static double CalcDistanceBetweenToNodes(NodeBase nodeStart, NodeBase nodeEnd, ValidateConnection validate = null)
    {
        List <NodeBase> queue = new List <NodeBase>();

        nodeStart.minDistance = 0;
        queue.Add(nodeStart);
        int iterCount = 0;

        while (queue.Count > 0)
        {
            iterCount += 1;

            //Get node
            var node = queue[0];
            if (node == nodeEnd)
            {
                return(node.minDistance);
            }

            //Check children
            var children = node.getNodes();
            foreach (var child in children)
            {
                //Validate
                if (validate != null && !validate(node, child))
                {
                    continue;
                }

                //Check if we should branch down that path
                if (node.minDistance + child.travelDistance < child.minDistance)
                {
                    //Add to queue
                    child.minDistance = node.minDistance + child.travelDistance;
                    queue.Add(child);
                }
            }

            //Remove this node
            queue.RemoveAt(0);
        }

        //Return can not find
        return(-1);
    }