Пример #1
0
 public Schema(SchemaColumn col, SchemaRow row, bool bBinaryValues, int nCellSize)
 {
     m_col           = col;
     m_row           = row;
     m_bBinaryValues = bBinaryValues;
     m_nCellSize     = nCellSize;
 }
Пример #2
0
        Schema loadSchema(DataConfigSettingCollection col)
        {
            string       strTagCol        = getConfigVal(col, "Tag Col");
            string       strDateCol       = getConfigVal(col, "Date Col");
            string       strDataStartCol  = getConfigVal(col, "Data Start Col");
            string       strDataEndCol    = getConfigVal(col, "Data End Col");
            string       strLabelStartCol = getConfigVal(col, "Label Start Col");
            string       strLabelEndCol   = getConfigVal(col, "Label End Col");
            string       strExtraStartCol = getConfigVal(col, "Extra Start Col");
            string       strExtraEndCol   = getConfigVal(col, "Extra End Col");
            int          nTagCol          = SchemaColumn.ConvertCol(strTagCol);
            int          nDateCol         = SchemaColumn.ConvertCol(strDateCol);
            int          nDataStartCol    = SchemaColumn.ConvertCol(strDataStartCol);
            int          nDataEndCol      = SchemaColumn.ConvertCol(strDataEndCol);
            int          nLabelStartCol   = SchemaColumn.ConvertCol(strLabelStartCol);
            int          nLabelEndCol     = SchemaColumn.ConvertCol(strLabelEndCol);
            int          nExtraStartCol   = SchemaColumn.ConvertCol(strExtraStartCol);
            int          nExtraEndCol     = SchemaColumn.ConvertCol(strExtraEndCol);
            SchemaColumn colS             = new SchemaColumn(nTagCol, nDateCol, nDataStartCol, nDataEndCol, nLabelStartCol, nLabelEndCol, nExtraStartCol, nExtraEndCol);

            int       nDataDescRow   = getConfigValAsInt(col, "Data Desc Row");
            int       nLabelStartRow = getConfigValAsInt(col, "Label Start Row");
            int       nLabelEndRow   = getConfigValAsInt(col, "Label End Row");
            int       nDataStartRow  = getConfigValAsInt(col, "Data Start Row");
            SchemaRow rowS           = new SchemaRow(nDataDescRow, nLabelStartRow, nLabelEndRow, nDataStartRow);

            DataConfigSetting s = col.Find("Use Binary Values");
            bool bBinaryValues  = ((int)s.Value == 0) ? false : true;

            s = col.Find("Cell Size");
            int nCellSize = (int)s.Value;

            Properties.Settings.Default.TagCol        = strTagCol;
            Properties.Settings.Default.DateCol       = strDateCol;
            Properties.Settings.Default.DataStartCol  = strDataStartCol;
            Properties.Settings.Default.DataEndCol    = strDataEndCol;
            Properties.Settings.Default.LabelStartCol = strLabelStartCol;
            Properties.Settings.Default.LabelEndCol   = strLabelEndCol;
            Properties.Settings.Default.ExtraStartCol = strExtraStartCol;
            Properties.Settings.Default.ExtraEndCol   = strExtraEndCol;
            Properties.Settings.Default.DataDescRow   = nDataDescRow + 1;
            Properties.Settings.Default.LabelStartRow = nLabelStartRow + 1;
            Properties.Settings.Default.LabelEndRow   = nLabelEndRow + 1;
            Properties.Settings.Default.DataStartRow  = nDataStartRow + 1;
            Properties.Settings.Default.UseBinary     = bBinaryValues;
            Properties.Settings.Default.CellSize      = nCellSize;
            Properties.Settings.Default.Save();

            return(new Schema(colS, rowS, bBinaryValues, nCellSize));
        }