Esempio n. 1
0
        /// <summary>
        /// This method is used to get the tool tip of the selected temporary geometry.
        /// </summary>
        /// <param name="gTDisplayService"></param>
        /// <param name="strTempGeoDisplayPath"></param>
        /// <param name="strTempGeoDisplayName"></param>
        /// <param name="strTempGeoToolTip"></param>
        /// <returns></returns>
        private string GetToolTipOfTemporaryGeometry(IGTDisplayService gTDisplayService, out string strTempGeoDisplayPath, out string strTempGeoDisplayName, string strTempGeoToolTip)
        {
            strTempGeoDisplayPath = gTDisplayService.SelectedDisplayControlNode.DisplayPathName;
            strTempGeoDisplayName = gTDisplayService.SelectedDisplayControlNode.DisplayName;

            if (!string.IsNullOrEmpty(strTempGeoDisplayPath) && !string.IsNullOrEmpty(strTempGeoDisplayName))
            {
                IGTPoint         ptTempGeo = gTDisplayService.GetRange(strTempGeoDisplayPath, strTempGeoDisplayName).BottomLeft;
                IGTDDCKeyObjects gTDDCTempGeoKeyObjects = assetHistoryModel.m_Application.ActiveMapWindow.LocateService.Locate(ptTempGeo, 5, -1, GTSelectionTypeConstants.gtmwstSelectAll);

                if (gTDDCTempGeoKeyObjects.Count > 0)
                {
                    foreach (IGTDDCKeyObject ddcKey in gTDDCTempGeoKeyObjects)
                    {
                        if (ddcKey.FNO == 400)
                        {
                            strTempGeoToolTip = Convert.ToString(gTDDCTempGeoKeyObjects[0].Recordset.Fields["G3E_TOOLTIP"].Value);
                            break;
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(strTempGeoToolTip))
            {
                strTempGeoToolTip = gTDisplayService.SelectedDisplayControlNode.DisplayName;
            }

            return(strTempGeoToolTip);
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="application">The current G/Technology application object.</param>
 /// <param name="currentWorkPointAttributeComponentRecord">Current Recordset of the Workpoint feature record</param>//This Recordset needs to be passed for the Workpoint attribute component that is under transaction and is not yet commited to the DB. In the cases where FI uses this shared component, the Workpoint attribute component recordset that fired the FI needs to be passed, and in all other cases this can be null
 /// <param name="IsDeleteOperation">This parameter is needs to be passed when FI uses this component. In case when FI is fired for addition, pass false and if FI is fired during the delete operation, pass it as true.</param>
 public CommonWorkPointDisplayQuery(IGTApplication application, Recordset currentWorkPointAttributeComponentRecord, bool IsDeleteOperation)
 {
     m_gtApplication            = application;
     m_gtWorkPtQueryDisplayName = "WR" + m_gtApplication.DataContext.ActiveJob;
     m_gtDisplayService         = m_gtApplication.ActiveMapWindow.DisplayService;
     m_gtRecordset   = currentWorkPointAttributeComponentRecord;
     m_bDeleteAction = IsDeleteOperation;
 }
Esempio n. 3
0
        private static Boolean bDisplayConstRedLineFile(string pPathAndFile)
        {
            Boolean           tmpRetVal  = false;
            IGTDisplayService tmpDispSvr = null;

            try
            {
                tmpDispSvr = gCurrActMapWind.DisplayService;
                tmpDispSvr.AppendRedlines("Constructions Redlines", pPathAndFile);

                gApp.RefreshWindows();

                tmpRetVal = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "Error: gGetRedLineFilesfromSp",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                tmpRetVal = false;
            }
            return(tmpRetVal);
        }
Esempio n. 4
0
        private void InitializeAppResources()
        {
            try
            {
                this.oApp = GTClassFactory.Create <IGTApplication>();

                if (this.oApp == null)
                {
                    CommandUtilities.LogMessage(oDiag, "GTAssetTracker.InitializeResources", "IGTApplicationError", "Cannot initialize IGTApplication.");
                    DoExit();
                }

                SetStatusBarText("Initializing...");

                this.oMap = oApp.ActiveMapWindow;
                if (this.oMap == null)
                {
                    CommandUtilities.LogMessage(oDiag, "GTAssetTracker.InitializeResources", "MapWindowError", "There is no active map window.");
                    throw new Exception("IGTMapWindow");
                }

                oDisplay = oMap.DisplayService;
                if (oDisplay == null)
                {
                    CommandUtilities.LogMessage(oDiag, "GTAssetTracker.InitializeResources", "DisplayService", "No display service for the active map window.");
                    throw new Exception("IGTDisplayService");
                }

                this.oDC = oApp.DataContext;
                if (this.oDC == null)
                {
                    CommandUtilities.LogMessage(oDiag, "GTAssetTracker.InitializeResources", "DataContextError", "No data context was obtained from IGTApplication.");
                    throw new Exception("IGTDataContext");
                }

                this.oLocate = this.oMap.LocateService;
                if (this.oLocate == null)
                {
                    CommandUtilities.LogMessage(oDiag, "GTAssetTracker.InitializeResources", "IGTLocateService", "No IGTLocateService was obtained from IGTMapWindow.");
                    throw new Exception("IGTLocateService");
                }

                this.oRelationService             = GTClassFactory.Create <IGTRelationshipService>();
                this.oRelationService.DataContext = this.oDC;

                this.oGenParams = new GTSysGenParam();
                if (!CommandUtilities.GetSysGeneralParameters(this.oDC, this.oDiag, ref this.oGenParams))
                {
                    throw new Exception("No General Parameters have been defined.");
                }

                this.oActiveList          = new List <GTActiveStreetLight>();
                this.oActiveStructureList = new List <GTActiveStructure>();

                SetStatusBarText("Initialized.");
            }
            catch (Exception ex)
            {
                CommandUtilities.LogException(oDiag, "GTAssetTracker.InitializeResources", ex);
                throw ex;
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="application">The current G/Technology application object.</param>
 public CommonWorkPointDisplayQuery(IGTApplication application)
 {
     m_gtApplication            = application;
     m_gtWorkPtQueryDisplayName = "WR" + m_gtApplication.DataContext.ActiveJob;
     m_gtDisplayService         = m_gtApplication.ActiveMapWindow.DisplayService;
 }
Esempio n. 6
0
        /// <summary>
        /// Adds the results of the trace to the legend.
        /// </summary>
        /// <param name="displayRS">The trace recordset to display</param>
        /// <param name="displayPathName">Node on the legend that contains the trace entry</param>
        /// <param name="displayName">Name of the trace entry on the legend</param>
        /// <param name="symbology">Symbology overrides for the trace</param>
        /// <param name="overrideStyle">True if style should be overridden</param>
        /// <param name="primaryGraphicsOnly">True if only the primary graphic should be displayed</param>
        /// <param name="activeWindowOnly">True if the results should only be displayed in the active window</param>
        /// <param name="removeItem">True if the existing item should be removed from the legend</param>
        /// <returns>Boolean indicating status</returns>
        public bool DisplayResults(Recordset displayRS, string displayPathName, string displayName, IGTSymbology symbology,
                                   bool overrideStyle, bool primaryGraphicsOnly, bool activeWindowOnly, bool removeItem)
        {
            IGTMapWindow      gtMapWindow      = default(IGTMapWindow);
            IGTMapWindows     gtMapWindows     = default(IGTMapWindows);
            IGTDisplayService gtDisplayService = default(IGTDisplayService);

            bool returnValue = false;

            try
            {
                if (removeItem)
                {
                    // Remove existing item from the Display Control window
                    try
                    {
                        if (activeWindowOnly)
                        {
                            gtMapWindow = m_Application.ActiveMapWindow;
                            gtMapWindow.DisplayService.Remove(displayPathName, displayName);
                        }
                        else
                        {
                            gtMapWindows = m_Application.GetMapWindows(GTMapWindowTypeConstants.gtapmtGeographic);

                            foreach (IGTMapWindow mapWindow in gtMapWindows)
                            {
                                mapWindow.DisplayService.Remove(displayPathName, displayName);
                            }
                        }
                    }
                    catch
                    {
                        // Ignore error if item is not on the legend
                    }
                }

                if (displayRS.RecordCount > 0)
                {
                    if (activeWindowOnly)
                    {
                        gtMapWindow      = m_Application.ActiveMapWindow;
                        gtDisplayService = gtMapWindow.DisplayService;

                        if (overrideStyle)
                        {
                            gtDisplayService.AppendQuery(displayPathName, displayName, displayRS, symbology, primaryGraphicsOnly);
                        }
                        else
                        {
                            gtDisplayService.AppendQuery(displayPathName, displayName, displayRS);
                        }
                    }
                    else
                    {
                        gtMapWindows = m_Application.GetMapWindows(GTMapWindowTypeConstants.gtapmtAll);
                        foreach (IGTMapWindow mapWindow in gtMapWindows)
                        {
                            gtDisplayService = mapWindow.DisplayService;

                            if (overrideStyle)
                            {
                                gtDisplayService.AppendQuery(displayPathName, displayName, displayRS, symbology, primaryGraphicsOnly);
                            }
                            else
                            {
                                gtDisplayService.AppendQuery(displayPathName, displayName, displayRS);
                            }
                        }
                    }
                }

                m_Application.RefreshWindows();

                returnValue = true;
            }
            catch
            {
                returnValue = false;
            }
            finally
            {
                gtMapWindow      = null;
                gtMapWindows     = null;
                gtDisplayService = null;
            }

            return(returnValue);
        }