コード例 #1
0
        private void buttonSegmentNetwork_Click(object sender, EventArgs e)
        {
            m_bEditSegmentation = false;
            // Close Segmentation related forms
            FormManager.CloseFormSegmentationCriteria(m_strNetworkID);
            FormManager.CloseFormSegmentedConstruction(m_strNetworkID);
            FormManager.CloseFormRollup(m_strNetworkID);

            // Start the segmentation process
            Global.WriteOutput("Segmentation Started: " + DateTime.Now.ToString());
            this.Cursor = Cursors.WaitCursor;
            SaveNetworkTree();
            DynamicSegmentation.DynamicSegmentation dynamic = new DynamicSegmentation.DynamicSegmentation();
            dynamic.DoSegmentation(m_strNetwork);
            if (SegmentationMessaging.GetProgressList().Count == 0)
            {
                LoadSegmentationResults();
                Global.WriteOutput("Segmentation Completed: " + DateTime.Now.ToString());
            }
            else
            {
                foreach (String str in SegmentationMessaging.GetProgressList())
                {
                    Global.WriteOutput(str);
                }
            }
            this.Cursor = Cursors.Default;
            SegmentationMessaging.GetProgressList().Clear();
        }
コード例 #2
0
        private bool CreateDynamicSegmentation(List <RollupSegmentObject> listRollupSegment)
        {
            //Delete all information for a given network.
            try
            {
                GlobalDatabaseOperations.DeleteCriteriaSegmentForNetwork(Network.NetworkID);
            }
            catch (Exception except)
            {
                OutputWindow.WriteOutput("Error: Deleting CRITERIA_SEGMENT. " + except.Message);
                return(false);
            }

            foreach (RollupSegmentObject rollupSegment in listRollupSegment)
            {
                if (rollupSegment.SegmentMethod != "-")
                {
                    try
                    {
                        GlobalDatabaseOperations.SaveCriteriaSegmentForNetwork(Network.NetworkID, rollupSegment);
                    }
                    catch (Exception except)
                    {
                        OutputWindow.WriteOutput("Error: Saving CRITERIA_SEGMENT. " + except.Message);
                    }
                }
            }

            // Start the segmentation process
            Global.WriteOutput("Segmentation Started: " + DateTime.Now.ToString());
            this.Cursor = Cursors.WaitCursor;
            DynamicSegmentation.DynamicSegmentation dynamic = new DynamicSegmentation.DynamicSegmentation();
            dynamic.DoSegmentation(Network.Network);
            if (SegmentationMessaging.GetProgressList().Count == 0)
            {
                OutputWindow.WriteOutput("Segmentation Completed: " + DateTime.Now.ToString());
            }
            else
            {
                foreach (String str in SegmentationMessaging.GetProgressList())
                {
                    OutputWindow.WriteOutput(str);
                }
            }
            this.Cursor = Cursors.Default;
            SegmentationMessaging.GetProgressList().Clear();
            return(true);
        }