本文整理汇总了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();
}
}
示例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;
}
示例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
}
}
});
}
示例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);
}
}
示例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]));
}
}
}
示例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));
}
示例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"));
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
}
示例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"));
}
示例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());
}
示例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);
}
示例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;
}