Beispiel #1
0
        private void manipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            Debug.WriteLine("complete manipulating");

            mode          = EventMode.NONE;
            initTappedPos = new Point(0, 0);
        }
Beispiel #2
0
 public override void Read(PackFileDeserializer des, BinaryReaderEx br)
 {
     base.Read(des, br);
     m_worldUpWS        = des.ReadVector4(br);
     m_stringData       = des.ReadClassPointer <hkbProjectStringData>(br);
     m_defaultEventMode = (EventMode)br.ReadSByte();
     br.ReadUInt32();
     br.ReadUInt16();
     br.ReadByte();
 }
Beispiel #3
0
        private void OnImagePressed(object sender, PointerRoutedEventArgs e)
        {
            var currentPos = e.GetCurrentPoint(containerGrid).Position;

            initTappedPos = currentPos;
            mode          = EventMode.DRAW;

            border.Width  = 0;
            border.Height = 0;
            border.Margin = new Thickness(currentPos.X, currentPos.Y, 0, 0);
        }
 public override void Read(PackFileDeserializer des, BinaryReaderEx br)
 {
     base.Read(des, br);
     m_selfTransitionMode = (SelfTransitionMode)br.ReadSByte();
     m_eventMode          = (EventMode)br.ReadSByte();
     br.ReadUInt64();
     br.ReadUInt64();
     br.ReadUInt64();
     br.ReadUInt32();
     br.ReadUInt16();
 }
Beispiel #5
0
        private void imgView_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
        {
            var currentPos = calPointRelativeToContainerGrid(e.Position, sender);

            initTappedPos = currentPos;
            mode          = EventMode.DRAW;

            border.Width  = 0;
            border.Height = 0;
            border.Margin = new Thickness(currentPos.X, currentPos.Y, 0, 0);
        }
Beispiel #6
0
        public void RemoveListering(Enum eventKey, UnityAction <object> listener)
        {
            if (instance == null)
            {
                return;
            }
            EventMode tempEvent = null;

            if (m_eventDictionary.TryGetValue(eventKey, out tempEvent))
            {
                tempEvent.RemoveListener(listener);
            }
        }
Beispiel #7
0
 public void SetCarAISetting(CarAISetting setting)
 {
     carAISetting   = setting;
     transform.name = carAISetting.Name;
     posInit        = TestConfig.ParseV3(carAISetting.PosInit);
     posStart       = TestConfig.ParseV3(carAISetting.PosStart);
     posAim         = TestConfig.ParseV3(carAISetting.PosEnd);
     speed1         = carAISetting.Speed1;
     speed2         = carAISetting.Speed2;
     timeEvent      = carAISetting.TimeEvent;
     disEvent       = carAISetting.DisEvent;
     eventMode      = (EventMode)carAISetting.ModeEvent;
     CarInit();
 }
Beispiel #8
0
        private void border_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
        {
            var imgViewW = imgView.RenderSize.Width;
            var imgViewH = imgView.RenderSize.Height;

            var deviationW = (containerGrid.RenderSize.Width - imgViewW) / 2;
            var deviationH = (containerGrid.RenderSize.Height - imgViewH) / 2;

            // the side value relative to the container
            double leftSide   = border.Margin.Left;
            double rightSide  = leftSide + border.Width;
            double topSide    = border.Margin.Top;
            double bottomSide = topSide + border.Height;

            var currentPos = calPointRelativeToContainerGrid(e.Position, sender);

            // whether the current tapped position is close to the sides
            bool closeLeft   = currentPos.X - leftSide < sensitiveRadius;
            bool closeRight  = rightSide - currentPos.X < sensitiveRadius;
            bool closeTop    = currentPos.Y - topSide < sensitiveRadius;
            bool closeBottom = bottomSide - currentPos.Y < sensitiveRadius;

            if (closeLeft && closeTop)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(rightSide, bottomSide);
            }
            else if (closeLeft && closeBottom)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(rightSide, topSide);
            }
            else if (closeRight && closeTop)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(leftSide, bottomSide);
            }
            else if (closeRight && closeBottom)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(leftSide, topSide);
            }
            else // not in 4 corner, move the rect without resizing
            {
                mode          = EventMode.MOVE;
                initTappedPos = currentPos;
                initRectPos   = new Point(leftSide, topSide);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 添加监听者
        /// </summary>
        /// <param name="eventKey"></param>
        /// <param name="listener"></param>
        public void Register(Enum eventKey, UnityAction <object> listener)
        {
            EventMode tempEvent = null;

            if (m_eventDictionary.TryGetValue(eventKey, out tempEvent))
            {
                tempEvent.AddListener(listener);
            }
            else
            {
                tempEvent = new EventMode();
                tempEvent.AddListener(listener);
                m_eventDictionary.Add(eventKey, tempEvent);
            }
        }
Beispiel #10
0
 public void CarInit()
 {
     speedCurrent   = 0;
     speedObjTarget = carAISetting.Speed1;
     transform.name = carAISetting.Name;
     if (laneFirst == null)
     {
         laneFirst = MapManager.Instance.SearchNearestPos2Lane(out indexLaneFiset, posStart);
     }
     laneCurrent        = laneFirst;
     posAim             = laneCurrent.list_Pos[indexLaneFiset + 1];
     transform.position = posInit;
     indexLane          = indexLaneFiset;
     eventMode          = (EventMode)carAISetting.ModeEvent;
     isCarDrive         = true;
 }
Beispiel #11
0
        private void OnRectPressed(object sender, PointerRoutedEventArgs e)
        {
            // the side value relative to the container
            double leftSide   = border.Margin.Left;
            double rightSide  = leftSide + border.Width;
            double topSide    = border.Margin.Top;
            double bottomSide = topSide + border.Height;

            var currentPos = e.GetCurrentPoint(containerGrid).Position;

            // whether the current tapped position is close to the sides
            bool closeLeft   = currentPos.X - leftSide < sensitiveRadius;
            bool closeRight  = rightSide - currentPos.X < sensitiveRadius;
            bool closeTop    = currentPos.Y - topSide < sensitiveRadius;
            bool closeBottom = bottomSide - currentPos.Y < sensitiveRadius;

            if (closeLeft && closeTop)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(rightSide, bottomSide);
            }
            else if (closeLeft && closeBottom)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(rightSide, topSide);
            }
            else if (closeRight && closeTop)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(leftSide, bottomSide);
            }
            else if (closeRight && closeBottom)
            {
                mode          = EventMode.DRAW;
                initTappedPos = new Point(leftSide, topSide);
            }
            else // not in 4 corner, move the rect without resizing
            {
                mode          = EventMode.MOVE;
                initTappedPos = currentPos;
                initRectPos   = new Point(leftSide, topSide);
            }
        }
Beispiel #12
0
        private void UnRegisterEvent(EventMode events, params Control[] ctrs)
        {
            foreach (Control ctr in ctrs)
            {
                if ((events & EventMode.Click) == EventMode.Click)
                {
                    ctr.Click -= OnLayerClick;
                }
                if ((events & EventMode.DragEnter) == EventMode.DragEnter)
                {
                    ctr.DragEnter -= OnLayerDragEnter;
                }
                if ((events & EventMode.DragDrop) == EventMode.DragDrop)
                {
                    ctr.DragDrop -= OnLayerDragDrop;
                }
                if ((events & EventMode.MouseMove) == EventMode.MouseMove)
                {
                    ctr.MouseMove -= OnLayerMouseMove;
                }
                if ((events & EventMode.MouseDown) == EventMode.MouseDown)
                {
                    ctr.MouseDown -= OnLayerMouseDown;
                }
                if ((events & EventMode.MouseUp) == EventMode.MouseUp)
                {
                    ctr.MouseUp -= OnLayerMouseUp;
                }
                if ((events & EventMode.MouseHover) == EventMode.MouseHover)
                {
                    ctr.MouseHover -= OnLayerMouseHover;
                }
                if ((events & EventMode.MouseLeave) == EventMode.MouseLeave)
                {
                    ctr.MouseLeave -= OnLayerMouseLeave;
                }

                if ((events & EventMode.KeyUp) == EventMode.KeyUp)
                {
                    ctr.KeyUp -= OnLayerKeyUp;
                }
            }
        }
Beispiel #13
0
        /// <summary>
        /// Set the mode for the application
        /// </summary>
        /// <param name="modeType">the mode to set the service in</param>
        /// <param name="eventType">set the event types and call backs</param>
        /// <param name="needRequestId">true if you want a confirmation, by default, yes</param>
        /// <param name="cancelAfterSeconds">Cancel waiting for the answer after the seconds defined. By default, it will wait indefinitely</param>
        /// <returns>Response object</returns>
        public Response EventMode(ModeType modeType, EventType[] eventType, bool needRequestId = true, int cancelAfterSeconds = -1)
        {
            var  eventMode = new EventMode();
            Guid reqId;

            if (needRequestId)
            {
                reqId = Guid.NewGuid();
                _LastRequestId.Add(reqId.ToString(), null);
                eventMode.RequestId = reqId.ToString();
            }

            eventMode.Events = eventType;
            eventMode.Mode   = modeType;
            var ser = JsonConvert.SerializeObject(eventMode);

            ser = ser.ToLower();
            return(SendMessageProcessResponse(ser, reqId, cancelAfterSeconds));
        }
Beispiel #14
0
        public WWorld()
        {
            m_dtStopwatch     = new System.Diagnostics.Stopwatch();
            m_persistentLines = new WLineBatcher();
            m_persistentQuads = new WQuadBatcher();

            m_undoStack = new WUndoStack();

            m_ActorMode     = new ActorMode(this);
            m_CollisionMode = new CollisionMode(this);
            m_EventMode     = new EventMode(this);

            CurrentMode = m_ActorMode;

            m_sceneViews = new List <WSceneView>();

            WSceneView perspectiveView = new WSceneView();

            m_sceneViews.AddRange(new[] { perspectiveView });
        }
Beispiel #15
0
 public JamEvent(long eventid,JamRange jamrange,EventMode mode)
     : base(eventid,mode)
 {
     this.jamRange = jamrange;
 }
 void IDatabase.Update(Counter update, ushort index, EventMode mode)
 {
     counters.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #17
0
 public extern static int XAllowEvents(IntPtr display, EventMode event_mode, Time time);
Beispiel #18
0
 void IDatabase.Update(AnalogOutputStatus update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "AnalogOutputStatus");
 }
 void IDatabase.Update(FrozenCounter update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "FrozenCounter");
 }
 void IDatabase.Update(DoubleBitBinary update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "DoubleBitBinary");
 }
Beispiel #21
0
 public void Update(OctetString update, ushort index, EventMode mode = EventMode.Detect)
 {
     updates.Add((IDatabase db) => db.Update(update, index, mode));
 }
 void IDatabase.Update(DoubleBitBinary update, ushort index, EventMode mode)
 {
     doubleBinaries.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
 void IDatabase.Update(BinaryOutputStatus update, ushort index, EventMode mode)
 {
     binaryOutputStatii.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #24
0
 void IDatabase.Update(DoubleBitBinary update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "DoubleBitBinary");
 }
Beispiel #25
0
 void IDatabase.Update(FrozenCounter update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "FrozenCounter");
 }
Beispiel #26
0
 public static int XAllowEvents(IntPtr display, EventMode event_mode, IntPtr time);
Beispiel #27
0
 public void Update(DoubleBitBinary update, ushort index, EventMode mode = EventMode.Detect)
 {
     updates.Add((IDatabase db) => db.Update(update, index, mode));
 }
Beispiel #28
0
 public void Update(AnalogOutputStatus update, ushort index, EventMode mode = EventMode.Detect)
 {
     updates.Add((IDatabase db) => db.Update(update, index, mode));
 }
Beispiel #29
0
 public extern static int XAllowEvents(IntPtr display, EventMode event_mode, Time time);
Beispiel #30
0
 public static int XAllowEvents(IntPtr display, EventMode event_mode, IntPtr time);
Beispiel #31
0
 private void OnReleased(object sender, PointerRoutedEventArgs e)
 {
     mode          = EventMode.NONE;
     initTappedPos = new Point(0, 0);
 }
Beispiel #32
0
 void IDatabase.Update(BinaryOutputStatus update, ushort index, EventMode mode)
 {
     binaryOutputStatii.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
 void IDatabase.Update(AnalogOutputStatus update, ushort index, EventMode mode)
 {
     this.Add(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED), "AnalogOutputStatus");
 }
 void IDatabase.Update(Analog update, ushort index, EventMode mode)
 {
     analogs.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #35
0
 void IDatabase.Update(DoubleBitBinary update, ushort index, EventMode mode)
 {
     doubleBinaries.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #36
0
 void IDatabase.Update(Analog update, ushort index, EventMode mode)
 {
     analogs.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #37
0
 public void Update(FrozenCounter update, ushort index, EventMode mode = EventMode.Detect)
 {
     updates.Add((IDatabase db) => db.Update(update, index, mode));
 }
Beispiel #38
0
 void IDatabase.Update(Counter update, ushort index, EventMode mode)
 {
     counters.Update(update.ToMeasurement(index, TimestampMode.SYNCHRONIZED));
 }
Beispiel #39
0
        private static bool IsAllowStatus(EventMode mode, EventStatus oldstatus, EventStatus newstatus)
        {
            if (newstatus == EventStatus.Abort || newstatus == EventStatus.Closed)
                        return false;

            switch (mode)
            {

                default:
                    if (oldstatus >= newstatus)
                        return false;
                    else
                        return true;

                   // break;
            }
        }
Beispiel #40
0
 public void FreezeCounter(ushort index, bool clear, EventMode mode = EventMode.Detect)
 {
     updates.Add((IDatabase db) => db.FreezeCounter(index, clear, mode));
 }