public DPDefaultWindow(DistributedPowerInterface dpi, CabViewControl control) : base(dpi, 640, 240) { var param = (control as CVCScreen).CustomParameters; if (param.ContainsKey("fulltable")) { bool.TryParse(param["fulltable"], out FullTable); } if (param.ContainsKey("loadunits")) { string sUnits = param["loadunits"].ToUpper(); sUnits = sUnits.Replace('/', '_'); CABViewControlUnits.TryParse(sUnits, out LoadUnits); } DPITable = new DPITable(FullTable, LoadUnits, fullScreen: true, dpi: dpi); AddToLayout(DPITable, new Point(0, 0)); }
protected void ParseUnits(STFReader stf) { stf.MustMatch("("); try { string sUnits = stf.ReadItem(); // sUnits = sUnits.Replace('/', '?'); sUnits = sUnits.Replace('/', '_'); Units = (CABViewControlUnits)Enum.Parse(typeof(CABViewControlUnits), sUnits); } catch (ArgumentException) { stf.StepBackOneItem(); STFException.TraceInformation(stf, "Skipped unknown ControlStyle " + stf.ReadItem()); Units = CABViewControlUnits.NONE; } stf.SkipRestOfBlock(); }
public DPITable(bool fullTable, CABViewControlUnits loadUnits, bool fullScreen, DistributedPowerInterface dpi) : base(dpi, 640, fullTable? 230 : 162) { DPI = dpi; FullScreen = fullScreen; FullTable = fullTable; LoadUnits = loadUnits; BackgroundColor = DPI.BlackWhiteTheme ? Color.Black : ColorBackground; SetFont(); string text = ""; for (int iRow = 0; iRow < (fullTable ? NumberOfRowsFull : NumberOfRowsPartial); iRow++) { for (int iCol = 0; iCol < NumberOfColumns; iCol++) { // text = iCol.ToString() + "--" + iRow.ToString(); TableText[iRow, iCol] = new TextPrimitive(new Point(20 + ColLength * iCol, (iRow) * (FontHeightTableText + 8)), Color.White, text, TableTextFont); TableSymbol[iRow, iCol] = new TextPrimitive(new Point(10 + ColLength * iCol, (iRow) * (FontHeightTableText + 8)), Color.Green, text, TableSymbolFont); } } }