当前位置: 首页>>代码示例>>C#>>正文


C# DataFrame类代码示例

本文整理汇总了C#中DataFrame的典型用法代码示例。如果您正苦于以下问题:C# DataFrame类的具体用法?C# DataFrame怎么用?C# DataFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataFrame类属于命名空间,在下文中一共展示了DataFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Write

 /// <summary>
 /// Sinks data until receives null then closes adapter
 /// </summary>
 /// <param name="data"></param>
 public override void Write(DataFrame data)
 {
     if (data == null)
     {
         _exitEvent.Set();
     }
 }
开发者ID:michyer,项目名称:canape,代码行数:11,代码来源:NullDataAdapter.cs

示例2: ParseFrames

        public static IEnumerable<DataFrame> ParseFrames(IEnumerable<DataFrame> frames, string selectionPath, ScriptContainer container, string classname)
        {
            BasePipelineNode input;
            ParseWithPipelineNode output;
            IEnumerable<DataFrame> ret = new DataFrame[0];
            NetGraph graph = BuildGraph(container, classname, selectionPath, out input, out output);

            try
            {
                foreach (DataFrame frame in frames)
                {
                    input.Input(frame);
                }
                input.Shutdown(null);

                output.EventFlag.WaitOne(500);

                ret = output.Frames;
            }
            finally
            {
                ((IDisposable)graph).Dispose();
            }

            return ret;
        }
开发者ID:michyer,项目名称:canape,代码行数:26,代码来源:ParseWithUtils.cs

示例3: ReceiveAsync

        public void ReceiveAsync(Action<string> callback, DataFrame frame = null)
        {
            var buffer = new byte[256];
            if (frame == null)
                frame = new DataFrame();

            Socket.AsyncReceive(buffer, frame, (sizeOfReceivedData, df) =>
            {
                var dataframe = (DataFrame)df;

                if (sizeOfReceivedData > 0)
                {
                    dataframe.Append(buffer);

                    if (dataframe.IsComplete)
                    {
                        var data = dataframe.ToString();

                        callback(data);

                    }
                    else // end is not is this buffer
                    {
                        ReceiveAsync(callback, dataframe); // continue to read
                    }
                }
            });
        }
开发者ID:viktorblondal,项目名称:Nugget,代码行数:28,代码来源:ClientSocket.cs

示例4: Write

 /// <summary>
 /// Write a frame to the adapter
 /// </summary>
 /// <param name="frame">The frame</param>
 public override void Write(DataFrame frame)
 {
     if (frame != null)
     {
         _listener.Write(frame.ToArray(), _ep);
     }
 }
开发者ID:michyer,项目名称:canape,代码行数:11,代码来源:UdpServerDataAdapter.cs

示例5: DataCell

        /// <summary>
        /// Creates a new <see cref="DataCell"/> from specified parameters.
        /// </summary>
        /// <param name="parent">The reference to parent <see cref="DataFrame"/> of this <see cref="DataCell"/>.</param>
        /// <param name="configurationCell">The <see cref="ConfigurationCell"/> associated with this <see cref="DataCell"/>.</param>
        /// <param name="addEmptyValues">If <c>true</c>, adds empty values for each defined configuration cell definition.</param>
        public DataCell(DataFrame parent, ConfigurationCell configurationCell, bool addEmptyValues)
            : this(parent, configurationCell)
        {
            if (addEmptyValues)
            {
                int x;

                // Define needed phasor values
                for (x = 0; x < configurationCell.PhasorDefinitions.Count; x++)
                {
                    PhasorValues.Add(new PhasorValue(this, configurationCell.PhasorDefinitions[x]));
                }

                // Define a frequency and df/dt
                FrequencyValue = new FrequencyValue(this, configurationCell.FrequencyDefinition);

                // Define any analog values
                for (x = 0; x < configurationCell.AnalogDefinitions.Count; x++)
                {
                    AnalogValues.Add(new AnalogValue(this, configurationCell.AnalogDefinitions[x]));
                }

                // Define any digital values
                for (x = 0; x < configurationCell.DigitalDefinitions.Count; x++)
                {
                    DigitalValues.Add(new DigitalValue(this, configurationCell.DigitalDefinitions[x]));
                }
            }
        }
开发者ID:avs009,项目名称:gsf,代码行数:35,代码来源:DataCell.cs

示例6: IncomingTCPClientPacket

        /// <summary>
        /// Constructs a new incoming packet received by a TCP connector.
        /// Use this class to receive data from a server.
        /// This is an incoming message that will remain in the client's thread pool
        /// as a job for the thread pool workers.
        /// </summary>
        /// <param name="connector">The TCP Connector where this message belongs to.</param>
        /// <param name="data">DataFrame class.</param>
        /// <param name="previousPacket">The previous incoming message of the TCP Connector.</param>
        public IncomingTCPClientPacket(TCPConnector connector, DataFrame data, IncomingTCPClientPacket previousPacket)
        {
            fConnector = connector;
            fData = data;
            fPreviousPacket = previousPacket;

            ThreadPool.QueueUserWorkItem(new WaitCallback(ReadData));
        }
开发者ID:thiagonego,项目名称:extasys,代码行数:17,代码来源:IncomingTCPClientPacket.cs

示例7: can_get_index_of_non_existant_column

        public void can_get_index_of_non_existant_column()
        {
            var dataFrame = new DataFrame(
                new IntColumn("Column1"),
                new StringColumn("Column2")
            );

            Assert.Equal(-1, dataFrame.GetColumnIndex("non-existant-column"));
        }
开发者ID:data-forge,项目名称:data-forge-cs,代码行数:9,代码来源:DataFrameTests.cs

示例8: EditPacketEventArgs

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="frame">The data frame to edit</param>
 /// <param name="selectPath">Path to select a node to edit</param>
 /// <param name="sender">The sending node</param>
 /// <param name="color">The colour to show in an edit window</param>
 /// <param name="tag">The textual tag to show in an edit window</param>
 public EditPacketEventArgs(DataFrame frame, string selectPath, BasePipelineNode sender, ColorValue color, string tag)
     : base()
 {
     Frame = frame;
     SelectPath = selectPath;
     Sender = sender;
     Color = color;
     Tag = tag;
 }
开发者ID:michyer,项目名称:canape,代码行数:17,代码来源:EditPacketPipelineNode.cs

示例9: OnInput

        /// <summary>
        /// Called when a new frame arrives (just forwards)
        /// </summary>
        /// <param name="frame"></param>
        protected override void OnInput(DataFrame frame)
        {
            if (PacketDelayMs > 0)
            {
                Thread.Sleep(PacketDelayMs);
            }

            WriteOutput(frame);
        }
开发者ID:michyer,项目名称:canape,代码行数:13,代码来源:DelayPipelineNode.cs

示例10: LogPacketEventArgs

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tag">The log tag</param>
 /// <param name="netId">The log network ID</param>
 /// <param name="frame">The log frame</param>
 /// <param name="color">The log colour</param>
 /// <param name="networkDescription">The log description</param>
 public LogPacketEventArgs(string tag, Guid netId, DataFrame frame, ColorValue color, string networkDescription)
 {
     Tag = tag;
     NetId = netId;
     Frame = frame;
     Color = color;
     NetworkDescription = networkDescription;
     Timestamp = DateTime.Now;
 }
开发者ID:michyer,项目名称:canape,代码行数:17,代码来源:LogPacketPipelineNode.cs

示例11: ConvertBinaryPacketToString

        /// <summary>
        /// Convert a packet to a hex string format
        /// </summary>
        /// <param name="p">The packet to convert</param>
        /// <returns>The converted string</returns>
        public static string ConvertBinaryPacketToString(DataFrame p)
        {
            using (TextWriter writer = new StringWriter())
            {
                writer.WriteLine(GeneralUtils.BuildHexDump(16, p.ToArray()));
                writer.WriteLine();

                return writer.ToString();
            }
        }
开发者ID:michyer,项目名称:canape,代码行数:15,代码来源:ConsoleUtils.cs

示例12: can_get_column_index

        public void can_get_column_index()
        {
            var dataFrame = new DataFrame(
                new IntColumn("Column1"),
                new StringColumn("Column2")
            );

            Assert.Equal(0, dataFrame.GetColumnIndex("Column1"));
            Assert.Equal(1, dataFrame.GetColumnIndex("Column2"));
        }
开发者ID:data-forge,项目名称:data-forge-cs,代码行数:10,代码来源:DataFrameTests.cs

示例13: can_get_columns

        public void can_get_columns()
        {
            var dataFrame = new DataFrame(
                new IntColumn("Column1"),
                new StringColumn("Column2")
            );

            var columnNames = new string[] { "Column1", "Column2" };
            Assert.Equal(columnNames, dataFrame.GetColumnNames());
        }
开发者ID:data-forge,项目名称:data-forge-cs,代码行数:10,代码来源:DataFrameTests.cs

示例14: MDNS_Packet

 public MDNS_Packet(DataFrame DataFrame)
 {
     byte[] Payload = DataFrame.Payload;
     this.TransactionId = BitConverter.ToUInt16(Payload, 0);
     this.Response = (MDNS_Response)BitConverter.ToUInt16(Payload, 2);
     this.Questions = BitConverter.ToUInt16(Payload, 4);
     this.AnswerRRs = BitConverter.ToUInt16(Payload, 6);
     this.AuthorityRRs = BitConverter.ToUInt16(Payload, 8);
     this.AdditionalRRs = BitConverter.ToUInt16(Payload, 10);
 }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:10,代码来源:MDNS_Packet.cs

示例15: LogPacket

 /// <summary>
 /// Private Constructor
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="netid"></param>
 /// <param name="uuid"></param>
 /// <param name="network"></param>
 /// <param name="frame"></param>
 /// <param name="color"></param>
 /// <param name="timestamp"></param>
 public LogPacket(string tag, Guid netid, Guid uuid, string network, DataFrame frame, ColorValue color, DateTime timestamp)
 {
     Tag = tag;
     NetId = netid;
     Uuid = uuid;
     Network = network;
     Frame = frame;
     Color = color;
     Timestamp = timestamp;
 }
开发者ID:michyer,项目名称:canape,代码行数:20,代码来源:LogPacket.cs


注:本文中的DataFrame类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。