Skip to content

Commit

Permalink
fix(plc4go): fixed compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Aug 5, 2022
1 parent e72a5ff commit a57705d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 29 deletions.
28 changes: 0 additions & 28 deletions plc4go/internal/spi/model/DefaultBrowseRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ type DefaultPlcBrowseRequest struct {
browser spi.PlcBrowser
}

func NewDefaultPlcBrowseResponse(request model.PlcBrowseRequest, results map[string][]model.PlcBrowseQueryResult) DefaultPlcBrowseResponse {
return DefaultPlcBrowseResponse{
request: request,
results: results,
}
}

func (d DefaultPlcBrowseRequest) GetQueryNames() []string {
var queryNames []string
for queryName := range d.queries {
Expand All @@ -81,24 +74,3 @@ func (d DefaultPlcBrowseRequest) Execute() <-chan model.PlcBrowseRequestResult {
func (d DefaultPlcBrowseRequest) ExecuteWithInterceptor(interceptor func(result model.PlcBrowseEvent) bool) <-chan model.PlcBrowseRequestResult {
return d.browser.BrowseWithInterceptor(d, interceptor)
}

type DefaultPlcBrowseResponse struct {
request model.PlcBrowseRequest
results map[string][]model.PlcBrowseQueryResult
}

func (d DefaultPlcBrowseResponse) GetRequest() model.PlcBrowseRequest {
return d.request
}

func (d DefaultPlcBrowseResponse) GetQueryNames() []string {
var queryNames []string
for queryName := range d.results {
queryNames = append(queryNames, queryName)
}
return queryNames
}

func (d DefaultPlcBrowseResponse) GetQueryResults(queryName string) []model.PlcBrowseQueryResult {
return d.results[queryName]
}
51 changes: 51 additions & 0 deletions plc4go/internal/spi/model/DefaultPlcBrowseResponse.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package model

import "github.com/apache/plc4x/plc4go/pkg/api/model"

type DefaultPlcBrowseResponse struct {
DefaultResponse
request model.PlcBrowseRequest
results map[string][]model.PlcBrowseQueryResult
}

func NewDefaultPlcBrowseResponse(request model.PlcBrowseRequest, results map[string][]model.PlcBrowseQueryResult) DefaultPlcBrowseResponse {
return DefaultPlcBrowseResponse{
request: request,
results: results,
}
}

func (d DefaultPlcBrowseResponse) GetRequest() model.PlcBrowseRequest {
return d.request
}

func (d DefaultPlcBrowseResponse) GetQueryNames() []string {
var queryNames []string
for queryName := range d.results {
queryNames = append(queryNames, queryName)
}
return queryNames
}

func (d DefaultPlcBrowseResponse) GetQueryResults(queryName string) []model.PlcBrowseQueryResult {
return d.results[queryName]
}
2 changes: 1 addition & 1 deletion plc4go/tools/plc4xbrowser/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func initSubsystem() {
outputCommandHistory()

for _, driver := range config.AutoRegisterDrivers {
log.Info().Msgf("Auto register driver %s")
log.Info().Msgf("Auto register driver %s", driver)
if err := validateDriverParam(driver); err != nil {
log.Err(err).Msgf("Invalid configuration")
continue
Expand Down

0 comments on commit a57705d

Please sign in to comment.