Example #1
0
 /// <summary>
 /// ToString() override
 /// </summary>
 /// <returns>
 /// A <see cref="System.String"/>
 /// </returns>
 public override string ToString()
 {
     return(string.Format("FrameControl {0}, InnerFrame {1}, FrameCheckSequence {2}",
                          FrameControl.ToString(),
                          InnerFrame.ToString(),
                          FrameCheckSequence));
 }
Example #2
0
        void WritefcTL(FrameControl data)
        {
            var startPosition = BeginChunk(FrameControl.Size, ChunkName.fcTL);

            Write(data);
            EndChunk(startPosition);
        }
    public void ChangeToFrame(Collider2D collider)
    {
        for (int i = 0; i < frameConfiner.Length; i++)
        {
            frameConfiner[i].InvalidatePathCache();
            frameConfiner[i].m_BoundingShape2D = collider;
        }
        //disabling all other frames.
        for (int i = 0; i < _frames.Length; i++)
        {
            FrameControl currentFrame = collider.GetComponent <FrameControl>();

            if (currentFrame.id == i)
            {
                for (int j = 0; j < _frames[i].transform.childCount; j++)
                {
                    _frames[i].transform.GetChild(j).gameObject.active = true;
                }
            }
            else if (_frames[i].transform.GetChild(0).gameObject.active)
            {
                for (int j = 0; j < _frames[i].transform.childCount; j++)
                {
                    _frames[i].transform.GetChild(j).gameObject.active = false;
                }
            }
        }
    }
    public void populateFrames(TIME.Animation anim)
    {
        currentAnim = anim;

        foreach (Transform child in frameGroup.transform)
        {
            Destroy(child.gameObject);
        }

        for (int i = 0; i < anim.frames.Count; i++)
        {
            GameObject preview = Instantiate <GameObject>(framePrefab);
            preview.transform.SetParent(frameGroup.transform, false);
            RectTransform rt = preview.GetComponent <RectTransform>();
            rt.anchoredPosition = new Vector2((120 * (i % 6) + 50), -20 - (160 * (i / 6)));

            GameObject frameImage = preview.transform.FindChild("FrameImage").gameObject;
            GameObject durationGO = preview.transform.Find("Duration").gameObject;
            frameImage.GetComponent <RawImage>().texture = currentAnim.frames[i].texture;
            durationGO.GetComponent <InputField>().text  = currentAnim.frames[i].duration.ToString();
            FrameControl fc = durationGO.GetComponent <FrameControl>();
            fc.frameID        = i;
            fc.animEditScreen = this;
        }

        RectTransform rectTransform = newFrameBtn.GetComponent <RectTransform>();

        rectTransform.anchoredPosition = new Vector2((120 * (currentAnim.frames.Count % 6) + 50), -20 - (160 * (anim.frames.Count / 6)));

        animPreview.anim = currentAnim;
    }
Example #5
0
 public WinFrameControlDecorator(View view, FrameControl frameControl, IAdditionalViewControlsRule controlsRule)
     : base(view, frameControl, controlsRule)
 {
     _frameControl          = frameControl;
     frameControl.Disposed += hintPanel_Disposed;
     UpdateText();
 }
 public WinFrameControlDecorator(View view, FrameControl frameControl, IAdditionalViewControlsRule controlsRule)
     : base(view, frameControl, controlsRule)
 {
     _frameControl = frameControl;
     frameControl.Disposed += hintPanel_Disposed;
     UpdateText();
 }
Example #7
0
 /// <summary>
 /// ToString() override
 /// </summary>
 /// <returns>
 /// A <see cref="System.String"/>
 /// </returns>
 public override String ToString()
 {
     return(string.Format("802.11 MacFrame: [{0}], {1} FCS {2}",
                          FrameControl.ToString(),
                          GetAddressString(),
                          FrameCheckSequence));
 }
Example #8
0
 void Write(FrameControl data)
 {
     WriteSwapped(data.sequence);
     WriteSwapped(data.width);
     WriteSwapped(data.height);
     WriteSwapped(data.xOffset);
     WriteSwapped(data.yOffset);
     WriteSwapped(data.delayNum);
     WriteSwapped(data.delayDen);
     writer.Write(data.disposeOp);
     writer.Write(data.blendOp);
 }
    private void Start()
    {
        _frames = GameObject.FindGameObjectsWithTag("Frame");

        //setting id for every frame.
        for (int i = 0; i < _frames.Length; i++)
        {
            FrameControl currentFrame = _frames[i].GetComponent <FrameControl>();

            currentFrame.id = i;
        }
    }
Example #10
0
 // Use this for initialization
 void Start()
 {
     fC = GameObject.Find ("GameLogic").GetComponent<FrameControl> ();
     shaderInvert = GameObject.Find ("ShaderInvert");
     invertTerrains = GameObject.Find ("InvertTerrains");
     invertDisableTerrains = GameObject.Find ("InvertDisableTerrains");
     //		Debug.Log (shaderInvert);
     if (shaderInvert != null)
         shaderInvert.SetActive (false);
     if (invertTerrains != null)
         invertTerrains.SetActive (false);
     if (invertDisableTerrains != null)
         invertDisableTerrains.SetActive (true);
 }
Example #11
0
        // APNG
        public static PNGWriter CreateIndexed8(int width, int height, int depth, byte[] colors, Color[] palette, Vector4[] materials)
        {
            var result = new PNGWriter {
                stream       = new MemoryStream(),
                width        = width,
                height       = height,
                bitsPerPixel = 8,
                ColorType    = ColorType.Indexed,
            };

            result.writer = new BinaryWriter(result.stream);
            var frameSize = width * height;

            result.WriteSignature();
            result.WriteIHDR();
            if (palette != null)
            {
                result.WritePLTE(palette);
                result.WritetRNS(palette);
                //result.WritesPLT_RGBA(palette);
            }
            if (materials != null)
            {
                result.WritesPLT_MATL(materials);
            }
            result.WriteacTL((uint)depth);
            uint sequence     = 0;
            var  frameControl = new FrameControl {
                width    = (uint)width,
                height   = (uint)height,
                delayNum = 1,
                delayDen = 60,
            };

            frameControl.sequence = sequence++;
            result.WritefcTL(frameControl);
            if (depth > 0)
            {
                result.WriteIDAT(colors, 0, frameSize);
            }
            for (int f = 1; f < depth; f++)
            {
                frameControl.sequence = sequence++;
                result.WritefcTL(frameControl);
                result.WritefdAT(sequence++, colors, f * frameSize, frameSize);
            }
            result.WriteIEND();
            return(result);
        }
Example #12
0
 public TrekAddPage(FrameControl q)
 {
     this.frc = q;
 }
Example #13
0
 public Menu()
 {
     this.InitializeComponent();
     PrincipalFrame.Navigate(typeof(homeMap));
     FrameControl.Navigate(typeof(WelcomePage));
 }
Example #14
0
 public void Mode3()
 {
     fctrl.Hide();
     fctrl = frameSets[2];
     fctrl.SetFrame(facing);
 }
Example #15
0
 private void PaginaPrincipal_Click(object sender, RoutedEventArgs e)
 {
     FrameControl.Navigate(typeof(WelcomePage));
 }
Example #16
0
        internal IEEE_802_11Packet(Frame parentFrame, int packetStartIndex, int packetEndIndex)
            : base(parentFrame, packetStartIndex, packetEndIndex, "IEEE 802.11")
        {
            this.frameControl = new FrameControl(parentFrame.Data[packetStartIndex], parentFrame.Data[packetStartIndex + 1]);
            if (!this.ParentFrame.QuickParse)
            {
                this.Attributes.Add("Protocol version", this.frameControl.ProtocolVersion.ToString());
                this.Attributes.Add("Type", this.frameControl.Type.ToString());
                this.Attributes.Add("SubType", this.frameControl.SubType.ToString());
                this.Attributes.Add("WEP", this.frameControl.WEP.ToString());
            }

            this.duration = Utils.ByteConverter.ToUInt16(parentFrame.Data, packetStartIndex + 2, true);
            if (!this.ParentFrame.QuickParse)
            {
                this.Attributes.Add("Duration", duration.ToString());
            }

            int index = PacketStartIndex + 4;

            byte[][] addresses = new byte[4][];

            /*
             * addresses[0]=The imediate (closest) recipient
             * addresses[1]=The station who is physically transmitting the message
             * addresses[2]=Original source address or final destination address
             * addresses[3]=Null or original source address
             *
             * */

            for (int i = 0; i < 4; i++)
            {
                addresses[i] = new byte[6];
                if (i < 3)
                {
                    if (index < packetEndIndex - 4)
                    {
                        Array.Copy(parentFrame.Data, index, addresses[i], 0, addresses[i].Length);
                        index += 6;
                    }
                    else//there is no such address
                    {
                        addresses[i] = null;
                    }
                }
            }
            if (this.frameControl.Type == 0 || this.frameControl.Type == 2)//management or data frame
            //http://wifi.cs.st-andrews.ac.uk/animations/wifi%20frame.swf
            {
                this.fragmentNibble = (byte)(parentFrame.Data[index] & 0x0f);                                     //I want the last 4 bits only
                this.sequenceNumber = (ushort)(Utils.ByteConverter.ToUInt16(parentFrame.Data, index, true) >> 4); //crop out the last 4 bits
                index += 2;

                //see if there is a 4th address
                if (frameControl.FromDistributionSystem && frameControl.ToDistributionSystem)
                {
                    Array.Copy(parentFrame.Data, index, addresses[3], 0, addresses[3].Length);
                    index += 6;
                }
            }
            //now check to see if there is an 802.11e QoS part of this packet that need to be skipped
            //http://standards.ieee.org/getieee802/download/802.11e-2005.pdf
            if (frameControl.Type == 2 && frameControl.SubType >= 8)//data+QoS
            //The QoS Control field is a 16-bit field that identifies the TC or TS to which the frame belongs and various
            //other QoS-related information about the frame that varies by frame type and subtype.
            {
                index += 2;// 16/8=2
            }

            this.dataOffsetByteCount = index - PacketStartIndex;

            if (this.frameControl.Type == 0 || this.frameControl.Type == 2)                         //management or data frame
            {
                if (!frameControl.ToDistributionSystem && !frameControl.FromDistributionSystem)     //0,0
                {
                    this.destinationMAC     = new PhysicalAddress(addresses[0]);                    //DA
                    this.sourceMAC          = new PhysicalAddress(addresses[1]);                    //SA
                    this.basicServiceSetMAC = new PhysicalAddress(addresses[2]);                    //BSSID
                    this.recipientMAC       = null;                                                 //RA
                    this.transmitterMAC     = null;                                                 //TA
                }
                else if (!frameControl.ToDistributionSystem && frameControl.FromDistributionSystem) //0,1
                {
                    this.destinationMAC     = new PhysicalAddress(addresses[0]);
                    this.basicServiceSetMAC = new PhysicalAddress(addresses[1]);
                    this.sourceMAC          = new PhysicalAddress(addresses[2]);
                    this.recipientMAC       = null;
                    this.transmitterMAC     = null;
                }
                else if (frameControl.ToDistributionSystem && !frameControl.FromDistributionSystem) //0,1
                {
                    this.basicServiceSetMAC = new PhysicalAddress(addresses[0]);
                    this.sourceMAC          = new PhysicalAddress(addresses[1]);
                    this.destinationMAC     = new PhysicalAddress(addresses[2]);
                    this.recipientMAC       = null;
                    this.transmitterMAC     = null;
                }
                else if (frameControl.ToDistributionSystem && !frameControl.FromDistributionSystem) //1,1
                {
                    this.recipientMAC       = new PhysicalAddress(addresses[0]);                    //RA
                    this.transmitterMAC     = new PhysicalAddress(addresses[1]);
                    this.destinationMAC     = new PhysicalAddress(addresses[2]);
                    this.sourceMAC          = new PhysicalAddress(addresses[3]);
                    this.basicServiceSetMAC = null;//message is sent between two different base stations!
                }
            }
            else if (this.frameControl.Type == 1)//control frame
            {
                if (addresses[0] != null)
                {
                    this.recipientMAC = new PhysicalAddress(addresses[0]);
                }
                else
                {
                    this.recipientMAC = null;
                }
                if (addresses[1] != null)
                {
                    this.transmitterMAC = new PhysicalAddress(addresses[1]);
                }
                else
                {
                    this.transmitterMAC = null;
                }
                this.destinationMAC     = null;
                this.sourceMAC          = null;
                this.basicServiceSetMAC = null;
            }

            if (!this.ParentFrame.QuickParse)
            {
                if (sourceMAC != null)
                {
                    this.Attributes.Add("Source MAC", sourceMAC.ToString());
                }
                if (destinationMAC != null)
                {
                    this.Attributes.Add("Destination MAC", destinationMAC.ToString());
                }
                if (transmitterMAC != null)
                {
                    this.Attributes.Add("Transmitter MAC", transmitterMAC.ToString());
                }
                if (recipientMAC != null)
                {
                    this.Attributes.Add("Recipient MAC", recipientMAC.ToString());
                }
                if (basicServiceSetMAC != null)
                {
                    this.Attributes.Add("BSSID", basicServiceSetMAC.ToString());
                }
            }
        }
Example #17
0
 private void Luz_Click(object sender, RoutedEventArgs e)
 {
     FrameControl.Navigate(typeof(Luz));
 }
 // Use this for initialization
 void Start()
 {
     fC = GameObject.Find ("GameLogic").GetComponent<FrameControl> ();
     p = GetComponent<PlayerControl> ();
 }
Example #19
0
 public TrekConstructorPage(FrameControl q)
 {
     this.frc = q;
 }
Example #20
0
 public TrekMainPage(FrameControl q)
 {
     this.frc = q;
 }
Example #21
0
 public void Mode3()
 {
     fctrl.Hide();
     fctrl = frameSets[2];
     fctrl.SetFrame(facing);
 }