@@ -162,7 +162,7 @@ export class SelectSlaveComponent extends SessionStorage implements OnInit {
162162 //slavesFormArray: FormArray<FormGroup>
163163 slaveNewForm : FormGroup = this . _formBuilder . group ( {
164164 slaveId : [ null ] ,
165- detectSpec : [ true ] ,
165+ detectSpec : [ false ] ,
166166 } ) ;
167167 paramsSubscription : Subscription ;
168168 errorStateMatcher = new M2mErrorStateMatcher ( ) ;
@@ -347,19 +347,23 @@ export class SelectSlaveComponent extends SessionStorage implements OnInit {
347347 }
348348 getSpecsForConfiguredSlave ( uiSlave :IuiSlave ) :Observable < IidentificationSpecification [ ] > {
349349 let rc = new Subject < IidentificationSpecification [ ] > ( )
350- this . entityApiService . getModbusSpecification ( this . bus . busId , uiSlave . slave . slaveid , uiSlave . slave . specificationid ) . subscribe ( v => {
350+ let fct = ( specModbus : ImodbusSpecification | undefined ) => {
351351 let rci :IidentificationSpecification [ ] = [ ]
352352 this . preparedSpecs . forEach ( spec => {
353- console . log ( "v" + v . filename + " spec" + spec . filename )
354- let name = getSpecificationI18nName ( spec , this . config . mqttdiscoverylanguage )
353+ let name = getSpecificationI18nName ( spec , this . config . mqttdiscoverylanguage )
355354 rci . push ( {
356355 name : name ,
357- identified : spec . filename == v . filename ?v . identified :IdentifiedStates . unknown ,
356+ identified : specModbus && spec . filename == specModbus . filename ?specModbus . identified :IdentifiedStates . unknown ,
358357 filename : spec . filename ,
359358 } as IidentificationSpecification ) ;
360359 rc . next ( rci )
361360 } )
362- } )
361+ }
362+ if ( uiSlave . slave . specificationid )
363+ this . entityApiService . getModbusSpecification ( this . bus . busId , uiSlave . slave . slaveid , uiSlave . slave . specificationid , true ) . subscribe ( fct )
364+ else
365+ fct ( undefined )
366+
363367 return rc ;
364368 }
365369 getUiSlave ( slave : Islave , detectSpec : boolean | undefined ) : IuiSlave {
@@ -369,7 +373,8 @@ export class SelectSlaveComponent extends SessionStorage implements OnInit {
369373 label : this . getSlaveName ( slave ) ,
370374 slaveForm : fg ,
371375 } as any ;
372- rc . specsObservable = ( slave . specificationid == undefined ? this . getDetectedSpecs ( rc , detectSpec ) :this . getSpecsForConfiguredSlave ( rc ) )
376+
377+ rc . specsObservable = this . getSpecsForConfiguredSlave ( rc ) // getDetectedSpecs is disabled, because of performance issues
373378 this . addSpecificationToUiSlave ( rc ) ;
374379 ( rc . selectedEntitites = this . getSelectedEntites ( slave ) ) ,
375380 this . fillCommandTopics ( rc ) ;
0 commit comments