public void RunFullVersion() { MatrixColumns matrixBlocks = new MatrixColumns(); MatrixRain matrixRain = new MatrixRain(); MatrixQuotes matrixSpeech = new MatrixQuotes(); KeyboardHandler matrixKeyboard = new KeyboardHandler(); while (true) { if (SkipIntro) { matrixRain.RunMatrixRain(); matrixSpeech.ShowRandomQuote(); matrixKeyboard.WaitPressedKey(); } else { matrixSpeech.ShowIntroQuote(3); matrixBlocks.RunDigitalColumns(); matrixBlocks.RunSymbolColumns(); matrixBlocks.ShowTextAscii(TextASCII); SkipIntro = true; } } }
public override void WriteTo(XmlWriter xmlWriter) { SetUpCells(); SetUpColumnsGroupings(); SetUpRowGroupings(); xmlWriter.WriteStartElement("Matrix"); { xmlWriter.WriteAttributeString("Name", Name); if (Corner != null) { Corner.WriteTo(xmlWriter); } ColumnGroupings.WriteTo(xmlWriter); RowGroupings.WriteTo(xmlWriter); MatrixColumns.WriteTo(xmlWriter); MatrixRows.WriteTo(xmlWriter); base.WriteTo(xmlWriter); } xmlWriter.WriteEndElement(); }
public void RunMatrixColumns() { MatrixColumns matrixBlocks = new MatrixColumns(); while (true) { matrixBlocks.RunDigitalColumns(); matrixBlocks.ShowTextAscii(TextASCII); matrixBlocks.RunSymbolColumns(); } }
public Matrix(Space source, Space target, double[,] elements) { if (elements.GetLength(0) != target.Dimension || elements.GetLength(1) != source.Dimension) { throw new ArgumentException("The length of elements has to be m×n, where m is the dimension of target and n the dimension of source."); } _SourceSpace = source; _TargetSpace = target; _Elements = elements; Rows = new MatrixRows(this); Columns = new MatrixColumns(this); }
// called just after MatrixStart public void MatrixColumns(Matrix m, MatrixColumns mc) { }
public void MatrixColumns(Matrix m, MatrixColumns mc) // called just after MatrixStart { }
public Matrix(ReportDefn r, ReportLink p, XmlNode xNode):base(r,p,xNode) { _Corner=null; _ColumnGroupings=null; _RowGroupings=null; _MatrixRows=null; _MatrixColumns=null; _LayoutDirection=MatrixLayoutDirectionEnum.LTR; _GroupsBeforeRowHeaders=0; _CellDataElementName=null; _CellDataElementOutput=MatrixCellDataElementOutputEnum.Output; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Corner": _Corner = new Corner(r, this, xNodeLoop); break; case "ColumnGroupings": _ColumnGroupings = new ColumnGroupings(r, this, xNodeLoop); break; case "RowGroupings": _RowGroupings = new RowGroupings(r, this, xNodeLoop); break; case "MatrixRows": _MatrixRows = new MatrixRows(r, this, xNodeLoop); break; case "MatrixColumns": _MatrixColumns = new MatrixColumns(r, this, xNodeLoop); break; case "LayoutDirection": _LayoutDirection = MatrixLayoutDirection.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "GroupsBeforeRowHeaders": _GroupsBeforeRowHeaders = XmlUtil.Integer(xNodeLoop.InnerText); break; case "CellDataElementName": _CellDataElementName = xNodeLoop.InnerText; break; case "CellDataElementOutput": _CellDataElementOutput = MatrixCellDataElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Matrix element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_ColumnGroupings == null) OwnerReport.rl.LogError(8, "Matrix element ColumnGroupings not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); if (_RowGroupings == null) OwnerReport.rl.LogError(8, "Matrix element RowGroupings not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); if (_MatrixRows == null) OwnerReport.rl.LogError(8, "Matrix element MatrixRows not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); if (_MatrixColumns == null) OwnerReport.rl.LogError(8, "Matrix element MatrixColumns not specified for " + (this.Name == null? "'name not specified'": this.Name.Nm)); // MatrixCells count must be the same as the number of StaticColumns. // If there are no StaticColumns it must be 1 if (OwnerReport.rl.MaxSeverity > 4) return; // don't perform this check if we've already go errors int mc = _MatrixRows.CellCount; // MatrixCells int sc = Math.Max(1, _ColumnGroupings.StaticCount); if (mc != sc) { OwnerReport.rl.LogError(8, "The count of MatrixCells must be 1 or equal to the number of StaticColumns if there are any. Matrix " + (this.Name == null? "unknown.": this.Name.Nm)); } // matrix columns must also equal the static count (or 1 if no static columns) mc = this.CountMatrixColumns; if (mc != sc) { OwnerReport.rl.LogError(8, "The count of MatrixColumns must be 1 or equal to the number of StaticColumns if there are any. Matrix " + (this.Name == null? "unknown.": this.Name.Nm)); } // matrix rows must also equal the static count (or 1 if no static rows) int mr = this.CountMatrixRows; int sr = Math.Max(1, _RowGroupings.StaticCount); if (mr != sr) { OwnerReport.rl.LogError(8, "The count of MatrixRows must be 1 or equal to the number of StaticRows if there are any. Matrix " + (this.Name == null? "unknown.": this.Name.Nm)); } }
private void SetUpCells() { #region MatrixColumns { MatrixColumns.Clear(); double sumColWidthInMillimeters = 0; foreach (ReportColumn reportColumn in ReportDataColumns) { if (reportColumn is ReportDataColumn) { ReportDataColumn reportDataColumn = reportColumn as ReportDataColumn; Unit _widthOfColumn = reportDataColumn.HeaderStyle.Width; RMatrixColumn matrixColumn = new RMatrixColumn(); matrixColumn.Width = _widthOfColumn; MatrixColumns.Add(matrixColumn); sumColWidthInMillimeters += MeasureTools.UnitToMillimeters(_widthOfColumn); } else if (reportColumn is ReportHyperlinkColumn) { } } Item.Width = new Unit(sumColWidthInMillimeters, UnitType.Mm); } #endregion #region MatrixRows this.MatrixRows.Clear(); RMatrixRow matrixRow1 = new RMatrixRow(); { matrixRow1.Height = new Unit(0.25, UnitType.Inch); RMatrixCell mCell; foreach (DataColumn dataColumn in SourceDataTable.Columns) { mCell = new RMatrixCell(); ReportControlItem rDataTableItem; int columnIndex = SourceDataTable.Columns.IndexOf(dataColumn); int reportItemZIndex = columnIndex + 1; ReportColumn reportColumn = reportDataColumns[columnIndex]; if (reportColumn is ReportDataColumn) { ReportDataColumn reportDataColumn = reportColumn as ReportDataColumn; if (this.reportTableGroups.ContainsColumn(reportColumn)) { rDataTableItem = new RTextBox(string.Empty); } else { rDataTableItem = GetReportCellControlItem(reportDataColumn); //if (rDataTableItem is RTextBox) //{ // (rDataTableItem as RTextBox).Value = // string.Format("=CDbl(Fields!{0}.Value)", reportDataColumn.Name); //} //=Sum(CDbl(Fields!Sales.Value)) } mCell.ReportItem = rDataTableItem; matrixRow1.MatrixCells.Add(mCell); } else if (reportColumn is ReportHyperlinkColumn) { } } } this.MatrixRows.Add(matrixRow1); #endregion }