@@ -27,32 +27,6 @@ import '../constants.dart' as constants;
2727import 'oxdna_export.dart' ;
2828import '../app.dart' ;
2929
30- // Helper function to check for unassigned DNA and show warning
31- void _check_and_show_unassigned_dna_warning (List <Strand > strands_to_export) {
32- List <String > strand_names_without_dna = [];
33- for (var strand in strands_to_export) {
34- if (strand.dna_sequence == null || strand.dna_sequence! .contains (constants.DNA_BASE_WILDCARD )) {
35- if (strand.name != null ) {
36- strand_names_without_dna.add (strand.name! );
37- } else {
38- strand_names_without_dna.add (strand.id);
39- }
40- }
41- }
42-
43- if (strand_names_without_dna.isNotEmpty) {
44- var msg =
45- 'The following strands do not have complete DNA sequences assigned: '
46- '${strand_names_without_dna .join (", " )}. '
47- 'These strands will be exported with a default sequence of "T" '
48- 'for each nucleotide whose base is not specified. '
49- 'This can lead to unexpected behavior in oxView. For best results, '
50- 'assign a DNA sequence to each strand before exporting.'
51- '\n\n To silence this warning, uncheck View→Warnings→Unassigned DNA if oxView open.' ;
52- window.alert (msg);
53- }
54- }
55-
5630// This middleware handles sending the new design to the oxview viewer,
5731// as well as updating whether it is shown, since it is wired to the
5832// view outside of React.
@@ -136,3 +110,29 @@ void update_oxview_view(Design design, IFrameElement? frame, bool warn_enabled)
136110
137111 frame.contentWindow? .postMessage (message, constants.OXVIEW_URL );
138112}
113+
114+ // Helper function to check for unassigned DNA and show warning
115+ void _check_and_show_unassigned_dna_warning (List <Strand > strands_to_export) {
116+ List <String > strand_names_without_dna = [];
117+ for (var strand in strands_to_export) {
118+ if (strand.dna_sequence == null || strand.dna_sequence! .contains (constants.DNA_BASE_WILDCARD )) {
119+ if (strand.name != null ) {
120+ strand_names_without_dna.add (strand.name! );
121+ } else {
122+ strand_names_without_dna.add (strand.id);
123+ }
124+ }
125+ }
126+
127+ if (strand_names_without_dna.isNotEmpty) {
128+ var msg =
129+ 'The following strands do not have complete DNA sequences assigned: '
130+ '${strand_names_without_dna .join (", " )}. '
131+ 'These strands will be exported with a default sequence of "T" '
132+ 'for each nucleotide whose base is not specified. '
133+ 'This can lead to unexpected behavior in oxView. For best results, '
134+ 'assign a DNA sequence to each strand before exporting.'
135+ '\n\n To silence this warning, uncheck View→Warnings→Unassigned DNA if oxView open.' ;
136+ window.alert (msg);
137+ }
138+ }
0 commit comments