Example #1
0
        /// <summary>
        /// 工业LED灯的内容
        /// </summary>
        public LED()
        {
            InitializeComponent();
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.UserPaint, true);

            _interactionStyle = InteractionStyle.Indicator;
            this.Cursor       = Cursors.Arrow;
            this.Size         = new Size(60, 60);
            this.Value        = false;

            this.OnColor    = Color.Lime;
            this.OffColor   = Color.Gray;
            this.BlinkColor = Color.Lime;


            _timer.Interval = _blinkInterval;
            _timer.Tick    += delegate(object o, EventArgs args)
            {
                LEDBlink();
            };
        }
Example #2
0
 internal Relationship(Element source, Element destination, string description, string technology, InteractionStyle interactionStyle) :
     this()
 {
     this.Source           = source;
     this.Destination      = destination;
     this.Description      = description;
     this.Technology       = technology;
     this.InteractionStyle = interactionStyle;
 }
Example #3
0
        internal Relationship(Element source, Element destination, string description, string technology, InteractionStyle interactionStyle) :
            this()
        {
            this.Source           = source;
            this.Destination      = destination;
            this.Description      = description;
            this.Technology       = technology;
            this.InteractionStyle = interactionStyle;

            if (interactionStyle == InteractionStyle.Synchronous)
            {
                AddTags(Structurizr.Tags.Synchronous);
            }
            else
            {
                AddTags(Structurizr.Tags.Asynchronous);
            }
        }
Example #4
0
    static Interaction ParseInteract(string[] tokens, InteractionStyle style)
    {
        if (tokens.Length < 2)
        {
            return(null);
        }
        var res = new Interaction();

        res.Style = style;

        if (int.TryParse(tokens[1], out res.TargetID))
        {
            return(res);
        }
        else
        {
            return(null);
        }
    }
Example #5
0
        internal Relationship AddRelationship(Element source, Element destination, string description, string technology, InteractionStyle interactionStyle)
        {
            if (destination == null)
            {
                throw new ArgumentException("The destination must be specified.");
            }

            if (IsChildOf(source, destination) || IsChildOf(destination, source))
            {
                throw new ArgumentException("Relationships cannot be added between parents and children.");
            }

            Relationship relationship = new Relationship(source, destination, description, technology, interactionStyle);

            if (AddRelationship(relationship))
            {
                return(relationship);
            }

            return(null);
        }
Example #6
0
        /// <summary>
        /// Adds a unidirectional relationship between this software system and a person.
        /// </summary>
        /// <param name="destination">the target of the relationship</param>
        /// <param name="description">a description of the relationship (e.g. "sends e-mail to")</param>
        /// <param name="technology">the technology details (e.g. JSON/HTTPS)</param>
        /// <param name="interactionStyle">the interaction style (sync vs async)</param>
        public Relationship Delivers(Person destination, string description, string technology, InteractionStyle interactionStyle)
        {
            Relationship relationship = new Relationship(this, destination, description, technology, interactionStyle);

            Model.AddRelationship(relationship);

            return(relationship);
        }
Example #7
0
        internal Relationship AddRelationship(Element source, Element destination, string description, string technology, InteractionStyle interactionStyle)
        {
            if (destination == null)
            {
                throw new ArgumentException("The destination must be specified.");
            }

            Relationship relationship = new Relationship(source, destination, description, technology, interactionStyle);

            if (AddRelationship(relationship))
            {
                return(relationship);
            }

            return(null);
        }
Example #8
0
 /// <summary>
 /// Adds a relationship between this and another deployment element (deployment node, infrastructure node, or container instance).
 /// </summary>
 /// <param name="destination">the destination DeploymentElement</param>
 /// <param name="description">a short description of the relationship</param>
 /// <param name="technology">the technology</param>
 /// <param name="interactionStyle">the interaction style (Synchronous vs Asynchronous)</param>
 /// <returns>a Relationship object</returns>
 public Relationship Uses(DeploymentElement destination, string description, string technology, InteractionStyle interactionStyle)
 {
     return(Model.AddRelationship(this, destination, description, technology, interactionStyle));
 }
Example #9
0
 public new Relationship Delivers(Person destination, string description, string technology, InteractionStyle interactionStyle)
 {
     throw new InvalidOperationException();
 }
Example #10
0
        public virtual void PreInitialize(NVRPlayer player)
        {
            Player = player;

            IsRight = Player.RightHand == this;
            IsLeft  = Player.LeftHand == this;

            CurrentInteractionStyle = Player.InteractionStyle;

            CurrentlyHoveringOver = new Dictionary <NVRInteractable, Dictionary <Collider, float> >();

            LastPositions         = new Vector3[EstimationSamples];
            LastRotations         = new Quaternion[EstimationSamples];
            LastDeltas            = new float[EstimationSamples];
            EstimationSampleIndex = 0;

            VisibilityLocked = false;

            Inputs = new Dictionary <NVRButtons, NVRButtonInputs>(new NVRButtonsComparer());
            for (int buttonIndex = 0; buttonIndex < NVRButtonsHelper.Array.Length; buttonIndex++)
            {
                if (Inputs.ContainsKey(NVRButtonsHelper.Array[buttonIndex]) == false)
                {
                    Inputs.Add(NVRButtonsHelper.Array[buttonIndex], new NVRButtonInputs());
                }
            }

            if (Player.CurrentIntegrationType == NVRSDKIntegrations.Oculus)
            {
                InputDevice = this.gameObject.AddComponent <NVROculusInputDevice>();

                if (Player.OverrideOculus == true)
                {
                    if (IsLeft)
                    {
                        CustomModel             = Player.OverrideOculusLeftHand;
                        CustomPhysicalColliders = Player.OverrideOculusLeftHandPhysicalColliders;
                    }
                    else if (IsRight)
                    {
                        CustomModel             = Player.OverrideOculusRightHand;
                        CustomPhysicalColliders = Player.OverrideOculusRightHandPhysicalColliders;
                    }
                    else
                    {
                        Debug.LogError("[NewtonVR] Error: Unknown hand for oculus model override.");
                    }
                }
            }
            else if (Player.CurrentIntegrationType == NVRSDKIntegrations.SteamVR)
            {
                InputDevice = this.gameObject.AddComponent <NVRSteamVRInputDevice>();

                if (Player.OverrideSteamVR == true)
                {
                    if (IsLeft)
                    {
                        CustomModel             = Player.OverrideSteamVRLeftHand;
                        CustomPhysicalColliders = Player.OverrideSteamVRLeftHandPhysicalColliders;
                    }
                    else if (IsRight)
                    {
                        CustomModel             = Player.OverrideSteamVRRightHand;
                        CustomPhysicalColliders = Player.OverrideSteamVRRightHandPhysicalColliders;
                    }
                    else
                    {
                        Debug.LogError("[NewtonVR] Error: Unknown hand for SteamVR model override.");
                    }
                }
            }
            else
            {
                //Debug.LogError("[NewtonVR] Critical Error: NVRPlayer.CurrentIntegration not setup.");
                return;
            }

            if (Player.OverrideAll)
            {
                if (IsLeft)
                {
                    CustomModel             = Player.OverrideAllLeftHand;
                    CustomPhysicalColliders = Player.OverrideAllLeftHandPhysicalColliders;
                }
                else if (IsRight)
                {
                    CustomModel             = Player.OverrideAllRightHand;
                    CustomPhysicalColliders = Player.OverrideAllRightHandPhysicalColliders;
                }
                else
                {
                    Debug.LogError("[NewtonVR] Error: Unknown hand for SteamVR model override.");
                    return;
                }
            }


            InputDevice.Initialize(this);
            InitializeRenderModel();

            OnBeginInteraction.AddListener(SendBeginInteraction);
            OnEndInteraction.AddListener(SendEndInteraction);
        }
Example #11
0
        /// <summary>
        /// Adds a unidirectional "uses" style relationship between this element and a component (within a container).
        /// </summary>
        /// <param name="destination">the target of the relationship</param>
        /// <param name="description">a description of the relationship (e.g. "uses", "gets data from", "sends data to")</param>
        /// <param name="technology">the technology details (e.g. JSON/HTTPS)</param>
        /// <param name="interactionStyle">the interaction style (sync vs async)</param>
        public Relationship Uses(Component destination, string description, string technology, InteractionStyle interactionStyle)
        {
            Relationship relationship = new Relationship(this, destination, description, technology, interactionStyle);

            Model.AddRelationship(relationship);

            return(relationship);
        }
Example #12
0
 /// <summary>
 /// Adds a unidirectional "uses" style relationship between this element and a container.
 /// </summary>
 /// <param name="destination">the target of the relationship</param>
 /// <param name="description">a description of the relationship (e.g. "uses", "gets data from", "sends data to")</param>
 /// <param name="technology">the technology details (e.g. JSON/HTTPS)</param>
 /// <param name="interactionStyle">the interaction style (Synchronous or Asynchronous)</param>
 public Relationship Uses(Container destination, string description, string technology, InteractionStyle interactionStyle)
 {
     return(Model.AddRelationship(this, destination, description, technology, interactionStyle));
 }
Example #13
0
 /// <summary>
 /// Adds a unidirectional "uses" style relationship between this element and another.
 /// </summary>
 /// <param name="destination"> the target of the relationship</param>
 /// <param name="description">a description of the relationship (e.g. "uses", "gets data from", "sends data to")</param>
 /// <param name="technology">the technology details (e.g. JSON/HTTPS)</param>
 /// <param name="interactionStyle">the interaction style (sync vs async)</param>
 public Relationship Uses(SoftwareSystem destination, string description, string technology, InteractionStyle interactionStyle)
 {
     return(Model.AddRelationship(this, destination, description, technology, interactionStyle));
 }
Example #14
0
 public Relationship InteractsWith(Person destination, string description, string technology, InteractionStyle interactionStyle)
 {
     return(Model.AddRelationship(this, destination, description, technology, interactionStyle));
 }
Example #15
0
        /// <summary>
        /// Adds a unidirectional "uses" style relationship between this element and another.
        /// </summary>
        /// <param name="destination"> the target of the relationship</param>
        /// <param name="description">a description of the relationship (e.g. "uses", "gets data from", "sends data to")</param>
        /// <param name="technology">the technology details (e.g. JSON/HTTPS)</param>
        /// <param name="interactionStyle">the interaction style (sync vs async)</param>
        public Relationship Uses(SoftwareSystem destination, String description, String technology, InteractionStyle interactionStyle)
        {
            Relationship relationship = new Relationship(this, destination, description, technology, interactionStyle);

            Model.AddRelationship(relationship);

            return(relationship);
        }