• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataFrame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: XorFrame

    DataFrame XorFrame(DataFrame frame, byte xorValue)
    {
        byte[] data = frame.ToArray();

        for(int i = 0; i < data.Length; ++i)
        {
            data[i] = (byte)(data[i] ^ xorValue);
        }

        return new DataFrame(data);
    }
开发者ID:michyer,项目名称:canape,代码行数:11,代码来源:xorlayer.cs


示例17: Main

	public static int Main ()
	{
		DataFrame df1 = new DataFrame ();
		DataFrame df2 = new DataFrame ();

		if (df1 != null) 
		{
			return 1;
		}

		return 0;
	}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:test-924.cs


示例18: Input

        /// <summary>
        /// Override function called when a packet is input
        /// </summary>
        /// <param name="frame">The input frame</param>
        public override void Input(DataFrame frame)
        {
            EnsureThreadRunning();

            try
            {
                _input.Enqueue(frame);
            }
            catch (InvalidOperationException)
            { }
            catch (OperationCanceledException)
            { }
        }
开发者ID:michyer,项目名称:canape,代码行数:17,代码来源:BaseDecoupledPipelineNode.cs


示例19: Receive

        public string Receive(DataFrame frame = null)
        {
            if (frame == null)
                frame = new DataFrame();

            var buffer = new byte[256];

            int sizeOfReceivedData =  Socket.Receive(buffer);
            frame.Append(buffer);
            if (frame.IsComplete)
                return frame.ToString();
            else
                return Receive(frame);
        }
开发者ID:viktorblondal,项目名称:Nugget,代码行数:14,代码来源:ClientSocket.cs


示例20: Receive

        private void Receive(UserContext context, DataFrame frame)
        {
            var bytes = frame.Payload;
            Assert.AreEqual(MessageSize, bytes.Length);

            for (var i = 0; i < bytes.Length; i++)
            {
                var value = bytes[i];
                var expectedValue = (byte)(i % 256);
                Assert.AreEqual(value, expectedValue);
            }

            countdownEvent.Signal();
        }
开发者ID:rossandon,项目名称:AlchemyWebSockets2,代码行数:14,代码来源:StressTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataGrid类代码示例发布时间:2022-05-24
下一篇:
C# DataFormat类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap