File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ export class NodeClass {
178178 this . pwmBaseMap = pwmBaseMap
179179 this . someipMap = someipMap
180180 this . testers = testers
181+ this . pool ?. buildServiceMap ( testers )
181182 for ( const c of nodeItem . channel ) {
182183 const baseItem = this . canBaseMap . get ( c )
183184 if ( baseItem ) {
Original file line number Diff line number Diff line change @@ -106,13 +106,7 @@ export default class UdsTester {
106106 }
107107 ) {
108108 if ( testers ) {
109- for ( const tester of Object . values ( testers ) ) {
110- for ( const [ _name , serviceList ] of Object . entries ( tester . allServiceList ) ) {
111- for ( const service of serviceList ) {
112- this . serviceMap [ `${ tester . name } .${ service . name } ` ] = service
113- }
114- }
115- }
109+ this . buildServiceMap ( testers )
116110 }
117111 this . log = log
118112 const execArgv = [ '--enable-source-maps' ]
@@ -211,6 +205,17 @@ export default class UdsTester {
211205 this . varCb = this . varHandle . bind ( this )
212206 globalThis . varEvent ?. on ( 'update' , this . varCb )
213207 }
208+ buildServiceMap ( testers ?: Record < string , TesterInfo > ) {
209+ if ( testers ) {
210+ for ( const tester of Object . values ( testers ) ) {
211+ for ( const [ _name , serviceList ] of Object . entries ( tester . allServiceList ) ) {
212+ for ( const service of serviceList ) {
213+ this . serviceMap [ `${ tester . name } .${ service . name } ` ] = service
214+ }
215+ }
216+ }
217+ }
218+ }
214219 async getTestInfo ( ) {
215220 return new Promise < TestEvent [ ] > ( ( resolve , reject ) => {
216221 if ( this . env . MODE != 'test' ) {
You can’t perform that action at this time.
0 commit comments