Esempio n. 1
0
        // FdAmb_AttributeOwnershipAssumptionRequested
        public override void FdAmb_AttributeOwnershipAssumptionRequested(object sender, HlaOwnershipManagementEventArgs data)
        {
            // Call the base class handler
            base.FdAmb_AttributeOwnershipAssumptionRequested(sender, data);

            #region User Code
            CTrackHlaObject track = new CTrackHlaObject(Som.TrackOC);
            track.Handle = data.ObjectHandle;
            AttributeOwnershipAcquisition(track, "DivestitureRequestTag");
            #endregion //User Code
        }
Esempio n. 2
0
        public override void FdAmb_ObjectDiscoveredHandler(object sender, HlaObjectEventArgs data)
        {
            // Call the base class handler
            base.FdAmb_ObjectDiscoveredHandler(sender, data);

            #region User Code
            // Check the class type of the discovered object
            if (data.ClassHandle == Som.ShipOC.Handle) // A ship
            {
                // Create and add a new ship to the list
                CShipHlaObject newShip = new CShipHlaObject(data.ObjectInstance);
                newShip.Type = Som.ShipOC;
                Program.ShipObjects.Add(newShip);
                // Create a new track
                CTrackHlaObject track = new CTrackHlaObject(Som.TrackOC);
                track.TrackNo = data.ObjectInstance.Handle;
                Program.MyTracks.Add(track);
                // hook to track event
                track.OutOfZone += HandleTrackOutOfZone;
                // Request Update Values of Attributes
                RequestAttributeValueUpdate(newShip);
                // register the track object
                RegisterHlaObject(track);
            }
            else if (data.ClassHandle == Som.StationOC.Handle) // A station
            {
                // Create and add a new ship to the list
                CStationHlaObject newStation = new CStationHlaObject(data.ObjectInstance);
                newStation.Type = Som.StationOC;
                Program.StationObjects.Add(newStation);

                // Request Update Values of Attributes
                // (1) Request update values of all attributes for a specific object instance
                RequestAttributeValueUpdate(newStation);
            }
            #endregion //User Code
        }