@@ -16,26 +16,86 @@ public class BHSExampleBuilder
1616 /// </summary>
1717 public IAssetDataLayer AssetDataLayer { get ; set ; }
1818
19+ /// <summary>
20+ /// The constant for the ATR category name.
21+ /// </summary>
22+ private const string AtrCategoryName = "ATR" ;
23+
24+ /// <summary>
25+ /// The constant for the bag room category name.
26+ /// </summary>
27+ private const string BagRoomCategoryName = "Bag Room" ;
28+
29+ /// <summary>
30+ /// The constant for the belt category name.
31+ /// </summary>
32+ private const string BeltCategoryName = "Belt" ;
33+
34+ /// <summary>
35+ /// The constant for the conveyor category name.
36+ /// </summary>
37+ private const string ConveyorCategoryName = "Conveyor" ;
38+
39+ /// <summary>
40+ /// The constant for the diverter category name.
41+ /// </summary>
42+ private const string DiverterCategoryName = "Diverter" ;
43+
44+ /// <summary>
45+ /// The constant for the electrical contact category name.
46+ /// </summary>
47+ private const string ElectricalContactCategoryName = "Electrical Contact" ;
48+
1949 /// <summary>
2050 /// The constant for the main part storage area asset name.
2151 /// </summary>
2252 public const string MainPartStorageAreaAssetName = "Main Part Storage" ;
2353
54+ /// <summary>
55+ /// The constant for the conveyor length for the main sortation subsystem.
56+ /// </summary>
57+ private const int MainSortationConveyorLength = 15 ;
58+
59+ /// <summary>
60+ /// The constant for the conveyor length for the makeup unit subsystem.
61+ /// </summary>
62+ private const int MakeupUnitConveyorLength = 6 ;
63+
64+ /// <summary>
65+ /// The constant for the motor category name.
66+ /// </summary>
67+ private const string MotorCategoryName = "Motor" ;
68+
2469 /// <summary>
2570 /// The property gets/sets the data layer used to interact with parts.
2671 /// </summary>
2772 public IPartDataLayer PartDataLayer { get ; set ; }
2873
74+ /// <summary>
75+ /// The constant for the photoeye category name.
76+ /// </summary>
77+ private const string PhotoeyeCategoryName = "Photoeye" ;
78+
2979 /// <summary>
3080 /// The property gets/sets the data layer used to interact with part stock.
3181 /// </summary>
3282 public IStockDataLayer StockDataLayer { get ; set ; }
3383
84+ /// <summary>
85+ /// The constant for the storage category name.
86+ /// </summary>
87+ private const string StorageCategoryName = "Storage" ;
88+
3489 /// <summary>
3590 /// The property gets/sets the data layer used to interact with asset storage locations.
3691 /// </summary>
3792 public IStorageLocationDataLayer StorageLocationDataLayer { get ; set ; }
3893
94+ /// <summary>
95+ /// The constant for the subsystem category name.
96+ /// </summary>
97+ private const string SubSystemCategoryName = "SubSystem" ;
98+
3999 /// <summary>
40100 /// The default constructor.
41101 /// </summary>
@@ -65,15 +125,15 @@ private void BuildAssets()
65125 {
66126 Asset bagRoomAsset = AssetDataLayer . CreateAsync ( new Asset ( )
67127 {
68- Category = "Bag Room" ,
128+ Category = BagRoomCategoryName ,
69129 Description = "The main bag room for the BHS." ,
70- Name = "Main Bag Room" ,
130+ Name = $ "Main Bag Room",
71131 Type = AssetType . Group ,
72132 } ) . Result ;
73133
74134 Asset asset = AssetDataLayer . CreateAsync ( new Asset ( )
75135 {
76- Category = "SubSystem" ,
136+ Category = SubSystemCategoryName ,
77137 Description = "The main sortation line for the bag room." ,
78138 Name = "MS1" ,
79139 ParentID = bagRoomAsset . Integer64ID ,
@@ -82,19 +142,19 @@ private void BuildAssets()
82142
83143 _ = AssetDataLayer . CreateAsync ( new Asset ( )
84144 {
85- Category = "ATR" ,
145+ Category = AtrCategoryName ,
86146 Description = "The scanner array for reading bags on the main sortation line." ,
87147 Name = "MS1-ATR" ,
88148 ParentID = asset . Integer64ID ,
89149 Priority = Priority . High ,
90150 Type = AssetType . Equipment ,
91151 } ) ;
92152
93- for ( int index = 1 ; index <= 15 ; index ++ )
153+ for ( int index = 1 ; index <= MainSortationConveyorLength ; index ++ )
94154 {
95155 _ = AssetDataLayer . CreateAsync ( new Asset ( )
96156 {
97- Category = "Conveyor" ,
157+ Category = ConveyorCategoryName ,
98158 Description = "The conveyor which makes up the main sortation line." ,
99159 Name = $ "MS1-{ index : 00} ",
100160 ParentID = asset . Integer64ID ,
@@ -105,7 +165,7 @@ private void BuildAssets()
105165
106166 asset = AssetDataLayer . CreateAsync ( new Asset ( )
107167 {
108- Category = "SubSystem" ,
168+ Category = SubSystemCategoryName ,
109169 Description = "The one of the destination lines for the bag room." ,
110170 Name = "MU1" ,
111171 ParentID = bagRoomAsset . Integer64ID ,
@@ -114,19 +174,19 @@ private void BuildAssets()
114174
115175 _ = AssetDataLayer . CreateAsync ( new Asset ( )
116176 {
117- Category = "Diverter" ,
177+ Category = DiverterCategoryName ,
118178 Description = "The diverter which pushes bags onto the MU1 destination line." ,
119179 Name = "MU1-DIV" ,
120180 ParentID = asset . Integer64ID ,
121181 Priority = Priority . High ,
122182 Type = AssetType . Equipment ,
123183 } ) ;
124184
125- for ( int index = 1 ; index <= 6 ; index ++ )
185+ for ( int index = 1 ; index <= MakeupUnitConveyorLength ; index ++ )
126186 {
127187 _ = AssetDataLayer . CreateAsync ( new Asset ( )
128188 {
129- Category = "Conveyor" ,
189+ Category = ConveyorCategoryName ,
130190 Description = "The conveyor which makes up the MU1 destination line." ,
131191 Name = $ "MU1-{ index : 00} ",
132192 ParentID = asset . Integer64ID ,
@@ -137,7 +197,7 @@ private void BuildAssets()
137197
138198 asset = AssetDataLayer . CreateAsync ( new Asset ( )
139199 {
140- Category = "SubSystem" ,
200+ Category = SubSystemCategoryName ,
141201 Description = "The one of the destination lines for the bag room." ,
142202 Name = "MU2" ,
143203 ParentID = bagRoomAsset . Integer64ID ,
@@ -146,19 +206,19 @@ private void BuildAssets()
146206
147207 _ = AssetDataLayer . CreateAsync ( new Asset ( )
148208 {
149- Category = "Diverter" ,
209+ Category = DiverterCategoryName ,
150210 Description = "The diverter which pushes bags onto the MU2 destination line." ,
151211 Name = "MU2-DIV" ,
152212 ParentID = asset . Integer64ID ,
153213 Priority = Priority . High ,
154214 Type = AssetType . Equipment ,
155215 } ) ;
156216
157- for ( int index = 1 ; index <= 6 ; index ++ )
217+ for ( int index = 1 ; index <= MakeupUnitConveyorLength ; index ++ )
158218 {
159219 _ = AssetDataLayer . CreateAsync ( new Asset ( )
160220 {
161- Category = "Conveyor" ,
221+ Category = ConveyorCategoryName ,
162222 Description = "The conveyor which makes up the MU2 destination line." ,
163223 Name = $ "MU2-{ index : 00} ",
164224 ParentID = asset . Integer64ID ,
@@ -169,18 +229,18 @@ private void BuildAssets()
169229
170230 asset = AssetDataLayer . CreateAsync ( new Asset ( )
171231 {
172- Category = "SubSystem" ,
232+ Category = SubSystemCategoryName ,
173233 Description = "The runout line for the bag room." ,
174234 Name = "MU3" ,
175235 ParentID = bagRoomAsset . Integer64ID ,
176236 Type = AssetType . Group ,
177237 } ) . Result ;
178238
179- for ( int index = 1 ; index <= 6 ; index ++ )
239+ for ( int index = 1 ; index <= MakeupUnitConveyorLength ; index ++ )
180240 {
181241 _ = AssetDataLayer . CreateAsync ( new Asset ( )
182242 {
183- Category = "Conveyor" ,
243+ Category = ConveyorCategoryName ,
184244 Description = "The conveyor which makes up the MU3 destination line." ,
185245 Name = $ "MU3-{ index : 00} ",
186246 ParentID = asset . Integer64ID ,
@@ -197,22 +257,22 @@ private void BuildParts()
197257 {
198258 _ = PartDataLayer . CreateAsync ( new Part ( )
199259 {
200- Category = "Belt" ,
260+ Category = BeltCategoryName ,
201261 Name = "Power Turn Belt" ,
202262 } ) ;
203263 _ = PartDataLayer . CreateAsync ( new Part ( )
204264 {
205- Category = "Contact" ,
265+ Category = ElectricalContactCategoryName ,
206266 Name = "Motor Contactor" ,
207267 } ) ;
208268 _ = PartDataLayer . CreateAsync ( new Part ( )
209269 {
210- Category = "Motor" ,
270+ Category = MotorCategoryName ,
211271 Name = "Motor 1HP Drive" ,
212272 } ) ;
213273 _ = PartDataLayer . CreateAsync ( new Part ( )
214274 {
215- Category = "Photoeye" ,
275+ Category = PhotoeyeCategoryName ,
216276 Name = "Photoeye, Polarized Retro Reflective" ,
217277 } ) ;
218278 }
@@ -232,7 +292,6 @@ private void BuildStock()
232292 _ = StockDataLayer . CreateAsync ( new Stock ( )
233293 {
234294 Amount = 5 * ( index + 1 ) ,
235- Name = "A Name" ,
236295 OwnerInteger64ID = parts [ index ] . Integer64ID ,
237296 StorageLocationID = storageLocations [ index ] . Integer64ID ,
238297 StorageLocationName = storageLocations [ index ] . FriendlyName ,
@@ -248,13 +307,13 @@ private void BuildStorageLocations()
248307 {
249308 Asset asset = AssetDataLayer . CreateAsync ( new Asset ( )
250309 {
251- Category = "Storage" ,
310+ Category = StorageCategoryName ,
252311 Description = "The main part storage for the BHS." ,
253312 Name = MainPartStorageAreaAssetName ,
254313 Type = AssetType . Area ,
255314 } ) . Result ;
256315
257- StorageLocation storageLocation = new StorageLocation ( )
316+ StorageLocation storageLocation = new ( )
258317 {
259318 LocationA = "A1" ,
260319 LocationB = "R1" ,
0 commit comments