Skip to content

Commit

Permalink
Improve table parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Feb 20, 2024
1 parent 0296e88 commit fa91e65
Show file tree
Hide file tree
Showing 5 changed files with 1,084 additions and 971 deletions.
6 changes: 3 additions & 3 deletions lib/models/ini_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,9 @@ class Table {
final String label;
final int page;
String? topicHelp;
List<String> xBins = [];
List<String> yBins = [];
List<String> zBins = [];
TableBins xBins = TableBins(constant: '');
TableBins yBins = TableBins(constant: '');
TableBins zBins = TableBins(constant: '');
List<String> xyLabels = [];
double? gridHeight;
List<double> gridOrient = [];
Expand Down
18 changes: 15 additions & 3 deletions lib/sections/table_editor_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,23 @@ class TableEditorParser {
case 'topicHelp':
_currentTable!.topicHelp = result[1];
case 'xBins':
_currentTable!.xBins = result.sublist(1);
final parts = result.sublist(1);
_currentTable!.xBins = TableBins(
constant: parts[0],
channel: parts.length > 1 ? parts[1] : null,
);
case 'yBins':
_currentTable!.yBins = result.sublist(1);
final parts = result.sublist(1);
_currentTable!.yBins = TableBins(
constant: parts[0],
channel: parts.length > 1 ? parts[1] : null,
);
case 'zBins':
_currentTable!.zBins = result.sublist(1);
final parts = result.sublist(1);
_currentTable!.zBins = TableBins(
constant: parts[0],
channel: parts.length > 1 ? parts[1] : null,
);
case 'xyLabels':
_currentTable!.xyLabels = result.sublist(1);
case 'gridHeight':
Expand Down
Loading

0 comments on commit fa91e65

Please sign in to comment.