Skip to content

Commit

Permalink
adding extended models, #106 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
JayHuLBL committed Mar 26, 2020
1 parent 77751d7 commit faf5ca5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/jsonquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ function simplifyModelicaJSON (model, parseMode) {
if (connections) {
addConnectorTargets(connections, allModels, parseMode)
}
console.log(model)
var commentText = getComment(model)
var data = {
'modelicaFile': model.modelicaFile,
Expand Down Expand Up @@ -668,17 +667,24 @@ function orderConnections (data) {
allModels = data[index].public.models.concat(data[index].extends)
} else if (haveProtected && haveExtends && !havePublic) {
allModels = data[index].protected.models.concat(data[index].extends)
} else if (havePublic) {
} else if (havePublic && !haveProtected && !haveExtends) {
allModels = data[index].public.models
} else if (haveProtected) {
} else if (haveProtected && !havePublic && !haveExtends) {
allModels = data[index].protected.models
} else if (haveExtends) {
} else if (haveExtends && !havePublic && !haveProtected) {
allModels = data[index].extends
}
// Instance that contains this connector
const instance = allModels.find(item => {
console.log(item)
const connectorClass = removeTrailingArray(connector.instance.trim())
return item.name.trim() === connectorClass
var itemName = item.name
if (itemName === undefined) {
logger.warn('extends from class ' + item.className)
return false
} else {
return itemName.trim() === connectorClass
}
})
// Check if this connector is an output
if (instance.outputs) {
Expand Down

0 comments on commit faf5ca5

Please sign in to comment.