-
Notifications
You must be signed in to change notification settings - Fork 2
/
HeadProcessing.cs
45 lines (40 loc) · 1.52 KB
/
HeadProcessing.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Linq;
using BaseLibS.Graph;
using BaseLibS.Param;
using PerseusApi.Document;
using PerseusApi.Generic;
using PerseusApi.Matrix;
namespace PluginTutorial
{
public class HeadProcessing : IMatrixProcessing
{
public bool HasButton => false;
public Bitmap2 DisplayImage => null;
public string Description => "Extract the first few rows from the matrix.";
public string HelpOutput => "Top of the input matrix.";
public string[] HelpSupplTables => new string[0];
public int NumSupplTables => 0;
public string Name => "Head";
public string Heading => "Filter rows";
public bool IsActive => true;
public float DisplayRank => 100;
public string[] HelpDocuments => new string[0];
public int NumDocuments => 0;
public int GetMaxThreads(Parameters parameters)
{
return 1;
}
public string Url => "https://github.com/jdrudolph/PluginTutorial";
public void ProcessData(IMatrixData mdata, Parameters param, ref IMatrixData[] supplTables,
ref IDocumentData[] documents, ProcessInfo processInfo)
{
var numberOfRows = param.GetParam<int>("Number of rows").Value;
var indices = Enumerable.Range(0, numberOfRows).ToArray();
mdata.ExtractRows(indices);
}
public Parameters GetParameters(IMatrixData mdata, ref string errorString)
{
return new Parameters(new IntParam("Number of rows", 10));
}
}
}