Skip to content

Commit

Permalink
PM - include replacement name in generated description
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmajh committed Nov 13, 2023
1 parent 7398898 commit e9a07d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/admin/parse_template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class ParsedTemplate {
String? pmAsset; // the parent asset specified for the PM
String? suggestedPmNumber;
String? suggestedPmName;
String? replacement;

ParsedTemplate({
List<String>? assets,
Expand All @@ -124,6 +125,7 @@ class ParsedTemplate {
this.pmPackageNumber,
this.routeCode,
this.routeName,
this.replacement,
this.suggestedPmName,
this.pmAsset,
this.suggestedPmNumber,
Expand Down Expand Up @@ -283,6 +285,7 @@ class ParsedTemplate {
readCraft = true;
readMaterials = false;
readService = false;
pmTemplates[filename][pmNumber].replacement = row[3];
continue;
}

Expand Down
10 changes: 9 additions & 1 deletion lib/admin/pm_name_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ Future<PMName> generateName(
replaceable[0] = '${replaceable[0]}LC!!!';
replaceable[1] = '${replaceable[1]} - LC-!!!';
// properly assign letter after number has been determined
// TODO add the replaced component to the end of the name
if (pmdetails.replacement != null) {
replaceable[1] = '${replaceable[1]} ${pmdetails.replacement}';
}
}
// add craft
if (pmdetails.crafts.isEmpty) {
Expand All @@ -112,10 +114,16 @@ Future<PMName> generateName(
number =
'${number.substring(0, number.length - 2)}${counter + 1}${number.substring(number.length - 1)}';
name = '$name${numberToLetter(counter)}';
if (pmdetails.replacement != null) {
name = '$name ${pmdetails.replacement}';
}
}
} else {
if (wotype == 'LIF') {
name = '${name}A';
if (pmdetails.replacement != null) {
name = '$name ${pmdetails.replacement}';
}
}
}

Expand Down
1 change: 0 additions & 1 deletion lib/criticality/system_criticality.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class _SystemCriticalityPageState extends State<SystemCriticalityPage> {
readOnly: true,
hide: true,
),
// TODO implement site selection for systems
PlutoColumn(
width: 150,
title: 'Production Line',
Expand Down

0 comments on commit e9a07d8

Please sign in to comment.