Leaf Charter integration
This commit is contained in:
@@ -10,11 +10,11 @@ namespace LeafWeb.Web.Charter
|
||||
{
|
||||
public static class LeafWebCharter
|
||||
{
|
||||
private static readonly Font TitleFont = new Font("Times New Roman", 10, FontStyle.Bold);
|
||||
private static readonly Font AxisFont = new Font("Times New Roman", 10, FontStyle.Bold);
|
||||
private static readonly Font TitleFont = new Font(new FontFamily("Times New Roman"), 10, FontStyle.Bold);
|
||||
private static readonly Font AxisFont = new Font(new FontFamily("Times New Roman"), 10, FontStyle.Bold);
|
||||
private static readonly Font Font = new Font(new FontFamily("Trebuchet MS"), 9, FontStyle.Bold);
|
||||
private const int ChartWidth = 550;
|
||||
private const int ChartHeight = 400;
|
||||
public const int ChartWidth = 550;
|
||||
public const int ChartHeight = 400;
|
||||
|
||||
// cntrlcomparison
|
||||
public static IEnumerable<Chart> ProduceCharts(CurveData curve)
|
||||
|
||||
@@ -12,19 +12,22 @@ using LeafWeb.Web.Charter;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
public class LeafCharterController : Controller
|
||||
{
|
||||
public ActionResult Index()
|
||||
public class LeafCharterController : ControllerBase
|
||||
{
|
||||
public ActionResult Index(int leafInputFileId)
|
||||
{
|
||||
return View();
|
||||
return View(leafInputFileId);
|
||||
}
|
||||
|
||||
public ActionResult LeafCharts(int number)
|
||||
public ActionResult LeafCharts(int leafInputFileId, int number)
|
||||
{
|
||||
var fileInfo = new FileInfo(@"C:\Users\poprhythm\Documents\code\LeafWeb\Core.Tests\Parsers\LeafOutputData\cntrlcomparison_Wild Capsicum.csv");
|
||||
var leafInputFile = DataService.GetLeafInputFile(leafInputFileId);
|
||||
var leafOutputFile = leafInputFile.LeafOutputFiles.FirstOrDefault(f => f.Filename.StartsWith("cntrlcomparison"));
|
||||
//if (leafOutputFile == null)
|
||||
// return View(); // TODO: break
|
||||
|
||||
CntrlComparison[] cntrlComparison;
|
||||
using (var parser = new CntrlComparisonParser(fileInfo))
|
||||
CntrlComparison[] cntrlComparison;
|
||||
using (var parser = new CntrlComparisonParser(leafOutputFile.Contents))
|
||||
cntrlComparison = parser.Parse();
|
||||
|
||||
var curveData = CurveDataConverter.Convert(cntrlComparison).ToArray();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<img src="@Url.Action("LeafCharts", new {number=0})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=1})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=2})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=3})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=4})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=5})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=6})" alt="image" />
|
||||
<img src="@Url.Action("LeafCharts", new {number=7})" alt="image" />
|
||||
@using LeafWeb.Web.Charter
|
||||
@model int
|
||||
|
||||
@for (int i = 0; i < 8; i++)
|
||||
{
|
||||
<img src="@Url.Action("LeafCharts", new {leafInputFileId = Model, number=@i})" alt="image" height="@LeafWebCharter.ChartHeight" width="@LeafWebCharter.ChartWidth" />
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
var grid = new WebGrid(Model, rowsPerPage: 45);
|
||||
}
|
||||
|
||||
<h1>Results</h1>
|
||||
<h1>Result Status</h1>
|
||||
|
||||
@grid.GetHtml(columns:
|
||||
grid.Columns(
|
||||
@@ -13,7 +13,8 @@
|
||||
grid.Column("LeafInputSiteId", "Site Id"),
|
||||
grid.Column("LeafInputFilename", "Filename"),
|
||||
grid.Column("LeafInputName", "Submitted By"),
|
||||
grid.Column("CurrentStatus", "Status")
|
||||
grid.Column("CurrentStatus", "Status"),
|
||||
grid.Column("Chart", "Chart", item => @Html.ActionLink("Chart", "Index", "LeafCharter", new { leafInputFileId = item.LeafInputFileId}, new {}))
|
||||
),
|
||||
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
|
||||
)
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Leaf Data <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/LeafInput">Leaf Input</a></li>
|
||||
<li><a href="/LeafOutput">Leaf Output</a></li>
|
||||
<li><a href="/LeafCharter">Leaf Charts</a></li>
|
||||
<li><a href="/LeafInput">Submit Data</a></li>
|
||||
<li><a href="/LeafOutput">Result Status</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
Reference in New Issue
Block a user