外观
lib-finNHaystackExt 库参考
原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34793914561/FIN+5.3.1+lib-finNHaystackExt 中文整理基于 FIN 5.3.1
导读: 本页为
lib-finNHaystackExt的 API / 标签 / 函数参考文档。
以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。
目录(导读)
- lib
- meta
- funcs
- def
- finAddFloorToEquipCommit(items, floor, suffix)
- supertypes
- src
- finCommitNHaystackApplyBatchTags(items, tags)
- finFormNHaystackApplyBatchTags(id, selectedDicts)
- finFormNHaystackMapPointsToEquip(id, selectedDicts)
- finNHaystackAddEquips(conn, targetFilter, siteName, ids: [,])
- finNHaystackAddFloorToEquip(id, selectedDicts)
- finNHaystackAddHaystackSlots(conn, targetFilter, ids: [,])
- finNHaystackAdvancedApplyBatchTagsCommit(connId, targetFilter, tags, searchTag, searchFunction, searchValue)
- finNHaystackApplyAddEquips(id, targetFilter, siteName, ids: [])
- finNHaystackApplyBatchTags(conn, targetFilter, tags, ids: [,], returnResultRows: false)
- finNHaystackApplyFolioFilter(conn, filter)
- finNHaystackCopyEquipTags(conn, fromEquip, targetFilter, toEquips: [,])
- finNHaystackDelete(conn, ids)
- finNHaystackDeleteHaystackSlot(conn, ids)
- finNHaystackFindDuplicatePoints(conn)
- finNHaystackFormAddEquips(id, selectedDicts: null)
- finNHaystackFormAddHaystackSlots(id, selectedDicts: null)
- finNHaystackFormAdvancedApplyBatchTags(id, selectedDicts: null)
- finNHaystackFormApplyBatchTags(id, selectedDicts: null)
- finNHaystackFormCopyEquipTags(id, selectedDicts: null)
- finNHaystackFormDelete(id, selectedDicts: null)
- finNHaystackFormDeleteHaystackSlot(id, selectedDicts: null)
- finNHaystackFormPriorityArray(id)
- finNHaystackFormRebuildCache(id)
- finNHaystackFormSyncEquips(id)
- finNHaystackInvoke(id, action, args: null)
- finNHaystackMapPointsToEquip(conn, siteNavName, equipNavName, ids)
- finNHaystackMapPointsToEquipApply(items, site, equip)
- finNHaystackPointWriteArray(conn, id)
- finNHaystackPullPropTags(conn, tags, filter, ids: [,])
- finNHaystackPullPropsForm(id, selectedDicts: null)
- finNHaystackQuery(id, selectedIds)
- finNHaystackReadSize(conn, filter)
- finNHaystackReadUnique(conn, filter, column)
- finNHaystackRebuildCache(conn)
- finNHaystackRemoveBrokenRefs(haystackConn)
- finNHaystackSearchAndReplace(conn, filter, searchText, replaceText, ids: [,])
- finNHaystackShowPointsInWatch(conn, watchId)
- finNHaystackShowWatches(conn)
- finNHaystackSyncNiagaraEquipApply(connFilter, targetFilter, updateNavName)
- finNHaystackUniqueEquipTypes(haystackConn)
- finNHaystackUniqueTags(conn, filter)
- finNHaystackViewEquipTypesCommit(connId, tagsToApply)
- finNHaystackViewEquipTypesForm(id, selectedDicts: null)
- finToAlarm(params)
- finToNormal(params)
- nHaystackQueryApply(connFilter, filter, tag, option, needle)
概述(中译)
FIN NHaystack
API 正文(英文)
funcs
| finAddFloorToEquipCommit | Axon function |
| finCommitNHaystackApplyBatchTags | Axon function |
| finFormNHaystackApplyBatchTags | Axon function |
| finFormNHaystackMapPointsToEquip | Axon function |
| finNHaystackAddEquips | finNHaystackAddEquips This method calls the addEquips op on nhaystack |
| finNHaystackAddFloorToEquip | Axon function |
| finNHaystackAddHaystackSlots | finNHaystackAddHaystackSlots This method calls the applyBatchTag op on nhaystack |
| finNHaystackAdvancedApplyBatchTagsCommit | Axon function |
| finNHaystackApplyAddEquips | Axon function |
| finNHaystackApplyBatchTags | finNHaystackApplyBatchTags This method calls the applyBatchTag op on nhaystack |
| finNHaystackApplyFolioFilter | finNHaystackApplyFolioFilter This method runs the given filter against the Folio database, and ships the grid down to nhaystack |
| finNHaystackCopyEquipTags | finNHaystackCopyEquipTags |
| finNHaystackDelete | finNHaystackDelete |
| finNHaystackDeleteHaystackSlot | finNHaystackDeleteHaystackSlot |
| finNHaystackFindDuplicatePoints | finNHaystackFindDuplicatePoints |
| finNHaystackFormAddEquips | Axon function |
| finNHaystackFormAddHaystackSlots | Axon function |
| finNHaystackFormAdvancedApplyBatchTags | Axon function |
| finNHaystackFormApplyBatchTags | Axon function |
| finNHaystackFormCopyEquipTags | Axon function |
| finNHaystackFormDelete | Axon function |
| finNHaystackFormDeleteHaystackSlot | Axon function |
| finNHaystackFormPriorityArray | Axon function |
| finNHaystackFormRebuildCache | Axon function |
| finNHaystackFormSyncEquips | Axon function |
| finNHaystackInvoke | Axon function |
| finNHaystackMapPointsToEquip | finNHaystackMapPointsToEquip This method applies equipRef tags to a list of points, so that those points become children of the given equip |
| finNHaystackMapPointsToEquipApply | Axon function |
| finNHaystackPointWriteArray | finNHaystackPointWriteArray |
| finNHaystackPullPropTags | finNHaystackPullPropTags |
| finNHaystackPullPropsForm | Axon function |
| finNHaystackQuery | Axon function |
| finNHaystackReadSize | finNHaystackReadSize This method calls read with the given filter, and then counts the number of resulting recs |
| finNHaystackReadUnique | finNHaystackReadUnique This method calls read with the given filter, and then finds the unique values of the given column |
| finNHaystackRebuildCache | finNHaystackRebuildCache This method calls rebuildCache in NHaystack |
| finNHaystackRemoveBrokenRefs | Axon function |
| finNHaystackSearchAndReplace | finNHaystackSearchAndReplace This method renames components by replacing searchText with replaceText |
| finNHaystackShowPointsInWatch | finNHaystackShowPointsInWatch |
| finNHaystackShowWatches | finNHaystackShowWatches |
| finNHaystackSyncNiagaraEquipApply | Axon function |
| finNHaystackUniqueEquipTypes | Axon function |
| finNHaystackUniqueTags | finNHaystackUniqueTags |
| finNHaystackViewEquipTypesCommit | Axon function |
| finNHaystackViewEquipTypesForm | Axon function |
| finToAlarm | finToAlarm |
| finToNormal | finToNormal |
| nHaystackQueryApply | Axon function |
def
func:finAddFloorToEquipCommit
finAddFloorToEquipCommit(items, floor, suffix)
Axon function
meta
| def | func:finAddFloorToEquipCommit |
| is | func |
| lib | lib:finNHaystackExt |
| name | finAddFloorToEquipCommit |
| private | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(items, floor,suffix)=>do
if(items == "") return []
mymap:{}
items.each(p=> do
connId:p.get("connRef")
ar :[]
if(mymap.has(connId.toStr))
ar = mymap.get(connId.toStr)
ar = ar.add(p)
mymap = mymap.set(connId.toStr,ar)
end)
mymap.each((arr,conn)=>do
connId:parseRef(conn)
filter: "("+ arr.map(r=> "id==@"+r->id).concat(" or ") + ")"
finNHaystackApplyBatchTags(connId,filter,"floorName:\""+floor + " " + suffix +"\"")
end)
enddef
func:finCommitNHaystackApplyBatchTags
finCommitNHaystackApplyBatchTags(items, tags)
Axon function
meta
| def | func:finCommitNHaystackApplyBatchTags |
| is | func |
| lib | lib:finNHaystackExt |
| name | finCommitNHaystackApplyBatchTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(items,tags) => do
if(items == "") return []
mymap:{}
items.each(p=> do
connId:p.get("connRef")
ar :[]
if(mymap.has(connId.toStr))
ar = mymap.get(connId.toStr)
ar = ar.add(p)
mymap = mymap.set(connId.toStr,ar)
end)
mymap.each((arr,conn)=>do
connId:parseRef(conn)
filter: "("+ arr.map(r=> "id==@"+r->id).concat(" or ") + ")"
finNHaystackApplyBatchTags(connId,filter,tags)
end)
enddef
func:finFormNHaystackApplyBatchTags
finFormNHaystackApplyBatchTags(id, selectedDicts)
Axon function
meta
| appFormOn | oldFolio |
| def | func:finFormNHaystackApplyBatchTags |
| dis | toLocale("finNHaystackExt::nHaystackApplyBatchTags") |
| finForm | ✓ |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | axType |
| is | func |
| lib | lib:finNHaystackExt |
| name | finFormNHaystackApplyBatchTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts) => do
selectedIds:""
if(selectedDicts != null) do
selectedIds = selectedDicts
end
body: [
{name: "tags", editorType: "textinput", prompt: toLocale("finNHaystackExt::enterListOfTagsToAddOrRemove"), encapsulate: true},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::nHaystackBatchEditTags"),
"name": "nbatchEditTags",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finCommitNHaystackApplyBatchTags("+ selectedIds.toAxonCode +",\$tags)",
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Nhaystack+Apply+Batch+Tags",
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finFormNHaystackMapPointsToEquip
finFormNHaystackMapPointsToEquip(id, selectedDicts)
Axon function
meta
| appFormOn | oldFolio |
| def | func:finFormNHaystackMapPointsToEquip |
| dis | toLocale("finNHaystackExt::nHaystackMapPtsToEquip") |
| finForm | ✓ |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | axType and point |
| is | func |
| lib | lib:finNHaystackExt |
| name | finFormNHaystackMapPointsToEquip |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts)=>do
selectedIds:""
if(selectedDicts != null) do
selectedIds= selectedDicts
end
body:[
{name:"site",editorType:"textinput",prompt:toLocale("j2FinToolsExt::siteName")},
{name:"equip",editorType:"textinput",prompt:"Equip Name"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{
"dis":toLocale("finNHaystackExt::mapPtsToEquip"),
"name": "mapPointsToEquipForm",
"body":body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackMapPointsToEquipApply("+selectedIds.toAxonCode + ",\$site,\$equip)" ,
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Nhaystack+Map+Points+To+Equip",
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackAddEquips
finNHaystackAddEquips(conn, targetFilter, siteName, ids: [,])
finNHaystackAddEquips This method calls the addEquips op on nhaystack. It uses the targetFilter to find recs, and then adds the equip
meta
| construct | finNHaystackAddEquips(conn, targetFilter, siteName, ids)... |
| def | func:finNHaystackAddEquips |
| example | finNHaystackAddEquips(conn, "device", "mySite") This ex... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackAddEquips |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackAddFloorToEquip
finNHaystackAddFloorToEquip(id, selectedDicts)
Axon function
meta
| appFormOn | oldFolio |
| def | func:finNHaystackAddFloorToEquip |
| dis | toLocale("finNHaystackExt::nHaystackAddFloorToEquip") |
| finForm | ✓ |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | axType and equip |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackAddFloorToEquip |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts)=> do
selectedIds:""
if(selectedDicts != null) do
selectedIds = selectedDicts
end
body:[
{
name: "namePrefix",
editorType: "combobox",
prompt: toLocale("finNHaystackExt::namePrefix"),
selectedValueTags:"val",
labelField:"dis",
defIndex:0,
dataProvider:[
{val:toLocale("j2FinToolsExt::floor"),dis:toLocale("j2FinToolsExt::floor")},
{val:toLocale("finNHaystackExt::basement"),dis:toLocale("finNHaystackExt::basement")},
{val:toLocale("finNHaystackExt::groundFloor"),dis:toLocale("finNHaystackExt::groundFloor")},
{val:toLocale("finNHaystackExt::mezzanine"),dis:toLocale("finNHaystackExt::mezzanine")},
{val:toLocale("finNHaystackExt::roof"),dis:toLocale("finNHaystackExt::roof")},
{val:toLocale("finNHaystackExt::utility"),dis:toLocale("finNHaystackExt::utility")},
{val:"",dis:toLocale("finStackMobileExt::saveAsCustom")}
].toAxonCode
},
{name:"suffix", editorType:"textinput",defVal:"1",prompt:toLocale("finNHaystackExt::suffixName")},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::addFloorToEquip"),
"name": "addFloorToEquipForm",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finAddFloorToEquipCommit("+selectedIds.toAxonCode + ",\$namePrefix,\$suffix)" ,
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Nhaystack+Add+Floor+To+Equip",
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackAddHaystackSlots
finNHaystackAddHaystackSlots(conn, targetFilter, ids: [,])
finNHaystackAddHaystackSlots This method calls the applyBatchTag op on nhaystack. It uses the targetFilter to find recs, and then adds or removes tags on those recs.
meta
| construct | finNHaystackAddHaystackSlots(conn, targetFilter, ids?) |
| def | func:finNHaystackAddHaystackSlots |
| example | finNHaystackAddHaystackSlots(conn, "point") This exampl... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackAddHaystackSlots |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackAdvancedApplyBatchTagsCommit
finNHaystackAdvancedApplyBatchTagsCommit(connId, targetFilter, tags, searchTag, searchFunction, searchValue)
Axon function
meta
| def | func:finNHaystackAdvancedApplyBatchTagsCommit |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackAdvancedApplyBatchTagsCommit |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(connId, targetFilter, tags, searchTag, searchFunction, searchValue) => do
recs: haystackCall(connId, "read",{filter:targetFilter})
ids: null
if (searchFunction == "contains") do
ids = recs.findAll( row => if(row[searchTag].contains(searchValue) and not row->axType.contains("History")) true else false).toRecIdList()
else if (searchFunction == "startsWith") do
ids = recs.findAll( row => if(row[searchTag].startsWith(searchValue) and not row->axType.contains("History")) true else false).toRecIdList()
else if (searchFunction == "endsWith") do
ids = recs.findAll( row => if(row[searchTag].endsWith(searchValue) and not row->axType.contains("History")) true else false).toRecIdList()
end
if (ids.size == 0) do
finFormAlertOk(
toLocale("finNHaystackExt::noMatchingRecords"),
toLocale("finNHaystackExt::noRecordsMatchQuery"))
else do
params:
[ "@" + connId,
toAxonCode(targetFilter),
toAxonCode(tags),
"[" + ids.map(id => id.toAxonCode).concat(",") + "]"
].concat(",")
body: [
{name: "label", editorType: "label", text: toLocale("finNHaystackExt::confirmEditRecords").replace("{number}", ids.size) },
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::ok"), controlBar: true}
]
{ "dis":toLocale("finNHaystackExt::confirmEdit"),
"name": "foo",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackApplyBatchTags(" + params + ")",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackApplyAddEquips
finNHaystackApplyAddEquips(id, targetFilter, siteName, ids: [])
Axon function
meta
| def | func:finNHaystackApplyAddEquips |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackApplyAddEquips |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, targetFilter, siteName, ids: []) => do
if (targetFilter != "")
targetFilter = "device == \"" + targetFilter + "\""
readById(id).finNHaystackAddEquips(targetFilter,siteName,ids)
enddef
func:finNHaystackApplyBatchTags
finNHaystackApplyBatchTags(conn, targetFilter, tags, ids: [,], returnResultRows: false)
finNHaystackApplyBatchTags This method calls the applyBatchTag op on nhaystack. It uses the targetFilter to find recs, and then adds or removes tags on those recs.
meta
| construct | finNHaystackApplyBatchTags(conn, targetFilter, tags, ids... |
| def | func:finNHaystackApplyBatchTags |
| example | finNHaystackApplyBatchTags(@connId, "equip", "foo, -bar,... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackApplyBatchTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackApplyFolioFilter
finNHaystackApplyFolioFilter(conn, filter)
finNHaystackApplyFolioFilter
This method runs the given filter against the Folio database, and ships the grid down to nhaystack. NHaystack takes the grid and applies the tags to each component, via the axSlotPath entry.
Tags which should not be written down to nhaystack are automatically stripped out.
meta
| construct | finNHaystackApplyFolioFilter(conn, filter) |
| def | func:finNHaystackApplyFolioFilter |
| example | finNHaystackApplyFolioFilter(@connId, "point and equipRe... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackApplyFolioFilter |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackCopyEquipTags
finNHaystackCopyEquipTags(conn, fromEquip, targetFilter, toEquips: [,])
finNHaystackCopyEquipTags
meta
| construct | finNHaystackCopyEquipTags(conn, fromEquip, toEquips) |
| def | func:finNHaystackCopyEquipTags |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackCopyEquipTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackDelete
finNHaystackDelete(conn, ids)
finNHaystackDelete
meta
| construct | finNHaystackDelete(conn, ids) |
| def | func:finNHaystackDelete |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackDelete |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackDeleteHaystackSlot
finNHaystackDeleteHaystackSlot(conn, ids)
finNHaystackDeleteHaystackSlot
meta
| construct | finNHaystackDeleteHaystackSlot(conn, ids) |
| def | func:finNHaystackDeleteHaystackSlot |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackDeleteHaystackSlot |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackFindDuplicatePoints
finNHaystackFindDuplicatePoints(conn)
finNHaystackFindDuplicatePoints
meta
| construct | finNHaystackFindDuplicatePoints(conn) |
| def | func:finNHaystackFindDuplicatePoints |
| example | finNHaystackFindDuplicatePoints(@connId) This example r... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFindDuplicatePoints |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackFormAddEquips
finNHaystackFormAddEquips(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormAddEquips |
| dis | toLocale("finStackMobileExt::addHaystackEquip") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will add Hastack Equip or multiple Equips to Niagar... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormAddEquips |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{name: "deviceSelector", editorType: "combobox", prompt: toLocale("finNHaystackExt::selectDeviceType"),
dataProvider: "readById(@" + id + ").finNHaystackReadUnique(\"device\", \"device\")",
labelField: "device", selectedValueTags: "device", encapsulate: true},
{name: "siteName", editorType: "textinput",prompt:toLocale("j2FinToolsExt::siteName"),
toolTip:"This creates and/or references Equips to the site you enter in here"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::addHaystackEquipToNiagara"),
"name": "create a note",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackApplyAddEquips(" + id.toAxonCode + ",\$deviceSelector,\$siteName)",
"helpDoc":"/wiki/display/FINStack/Add+Haystack+Equip",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
else do
// Create a list of selected ids if at least two things are selected.
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "input8", editorType: "list", prompt: toLocale("finNHaystackExt::listOfComponentsToAddEquipsTo"), dataProvider: selDis,
labelField: "val", height: 100, selectedValueTags: "val",headerIconLeft:"internal:INFO_ICON",headerToolTip:"Add Equips"},
{name: "siteName", editorType: "textinput",prompt:toLocale("j2FinToolsExt::siteName"),
toolTip:"This creates and/or references Equips to the Site you enter in here"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::addEquipmentToNiagra"),
"name": "create a note",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackApplyAddEquips(" + id.toAxonCode + ",\"\",\$siteName," + selList + ")",
"helpDoc":"/wiki/display/FINStack/Add+Haystack+Equip",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackFormAddHaystackSlots
finNHaystackFormAddHaystackSlots(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormAddHaystackSlots |
| dis | toLocale("finNHaystackExt::addHaystackSlot") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will add Haystack slots to points in Niagara |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormAddHaystackSlots |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{name: "targetFilter", editorType: "textinput",prompt:toLocale("finStackExt::targetFilter"), toolTip: "A filter for the Niagara objects. IE.. point and writable"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::addHaystackSlotInNiagra"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackAddHaystackSlots(@" + id + ",\$targetFilter)",
"helpDoc":"/wiki/display/FINStack/Add+Haystack+Slot",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
else do
// Create a list of selected ids if at least two things are selected.
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "input8", editorType: "list", prompt: toLocale("fin5CoreExt::list"), dataProvider: selDis,
labelField: "val", height: 100, selectedValueTags: "val"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::applyBatchEditToAx"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackAddHaystackSlots(@" + id + ",\"\"," + selList + ")",
"helpDoc":"/wiki/display/FINStack/Add+Haystack+Slot",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackFormAdvancedApplyBatchTags
finNHaystackFormAdvancedApplyBatchTags(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormAdvancedApplyBatchTags |
| dis | toLocale("finNHaystackExt::advancedStringEditor") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This is an advanded form, be careful. It will allow you ... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormAdvancedApplyBatchTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{name: "targetFilter", editorType: "textinput",prompt:toLocale("finStackExt::targetFilter"), toolTip: "A filter for the Niagara objects",defVal:"point"},
{name:"searchTag", editorType:"textinput", prompt:toLocale("j2FinToolsExt::searchTag"),defVal:"navName",toolTip: "The tag name of what you want to search for. IE.. navName" },
{
name: "searchFunction",
editorType: "combobox",
prompt: toLocale("j2FinToolsExt::searchFunction"),
dataProvider: [
{dis:toLocale("j2FinToolsExt::contains"),val:"contains",selected:true},
{dis:toLocale("j2FinToolsExt::startsWith"),val:"startsWith"},
{dis:toLocale("j2FinToolsExt::endsWith"),val:"endsWith"}
].toAxonCode,
labelField: "dis",
selectedValueTags: "val",
defIndex: 0
},
{name:"searchValue", editorType:"textinput", prompt:toLocale("finNHaystackExt::searchStringVal"),defVal:"SupplyAirTemp",toolTip: "The tag value of what you want to apply the new tags to." },
{name: "tags", editorType: "textinput",prompt:toLocale("j2FinToolsExt::tagsToApplyOrRemove"),
toolTip: "The tags to apply to the filtered Niagara objects (i.e. number:12,foo) to remove just put -beforeTag",defVal:"navNameFormat:\"SAT\""},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::applyBatchEditToAx"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackAdvancedApplyBatchTagsCommit(@" + id + ",\$targetFilter,\$tags,\$searchTag,\$searchFunction,\$searchValue)",
"helpDoc": "/wiki/display/FINStack/Advanced+String+Editor",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackFormApplyBatchTags
finNHaystackFormApplyBatchTags(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormApplyBatchTags |
| dis | toLocale("finStackExt::gbApplyBatchTags") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will add/edit/remove tags to Niagara |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormApplyBatchTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{name: "targetFilter", editorType: "textinput",prompt:toLocale("finStackExt::targetFilter"), toolTip: "A filter for the Niagara objects"},
{name: "tags", editorType: "textinput",prompt:toLocale("j2FinToolsExt::tagsToApplyOrRemove"),
toolTip: "The tags to apply to the filtered Niagara objects (i.e. number:12,foo) to remove just put -beforeTag"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::applyBatchEditToAx"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackApplyBatchTags(@" + id + ",\$targetFilter,\$tags)",
"helpDoc":"/wiki/display/FINStack/Apply+Batch+Tags+-+Haystack",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
else do
// Create a list of selected ids if at least two things are selected.
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "input8", editorType: "list", prompt: toLocale("finNHaystackExt::listOfComponentsToApplyBatchTags"), dataProvider: selDis,
labelField: "val", height: 100, selectedValueTags: "val"},
{name: "tags", editorType: "textinput",prompt:toLocale("j2FinToolsExt::tagsToApplyOrRemove"),
toolTip: "The tags to apply to the filtered Niagara objects (i.e. number:12,foo) to remove just put -beforeTag"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::applyBatchEditToAx"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackApplyBatchTags(@" + id + ",\"id\",\$tags," + selList + ")",
"helpDoc":"/wiki/display/FINStack/Apply+Batch+Tags+-+Haystack",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackFormCopyEquipTags
finNHaystackFormCopyEquipTags(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormCopyEquipTags |
| dis | toLocale("j2FinToolsExt::cloneEquipPointTags") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will clone/create your Equip and Points tags in Nia... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormCopyEquipTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
str1: "haystackReadAll(readById(@" + id + "), site)"
str2: "haystackReadAll(readById(@" + id + "), equip and siteRef == \$siteInput)"
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
body: [
{name: "siteInput", editorType: "combobox", prompt: toLocale("j2FinToolsExt::site"), dataProvider: str1, labelField: "dis", selectedValueTags: "id"},
{name: "equipInput", editorType: "combobox", prompt: toLocale("finNHaystackExt::equipYouWantToCopy"), dataProvider: str2, labelField: "dis", selectedValueTags: "id"},
{name: "targetFilter", editorType: "textinput",prompt:toLocale("finStackExt::targetFilter"), toolTip: "A filter for the Niagara objects"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::cloneEquipAndPtTagsInNiagra"),
"name": "copyEquipTags",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackCopyEquipTags(@" + id + ",\$equipInput,\$targetFilter)",
"helpDoc":"/wiki/display/FINStack/Clone+Equip-Point+Tags",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
else do
str1: "haystackReadAll(readById(@" + id + "), site)"
str2: "haystackReadAll(readById(@" + id + "), equip and siteRef == \$siteInput)"
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "siteInput", editorType: "combobox", prompt: toLocale("j2FinToolsExt::site"), dataProvider: str1, labelField: "dis", selectedValueTags: "id"},
{name: "equipInput", editorType: "combobox", prompt: toLocale("finNHaystackExt::equipYouWantToCopy"), dataProvider: str2, labelField: "dis", selectedValueTags: "id"},
{name: "input8", editorType: "list", prompt: toLocale("finNHaystackExt::listOfComponentsEffectedByCloning"),
dataProvider: selDis, labelField: "val", height: 100, selectedValueTags: "val"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::cloneEquipAndPtTagsInNiagra"),
"name": "copyEquipTags",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackCopyEquipTags(@" + id + ",\$equipInput,\"id\"," + selList + ")", // "id" will be ignored in nhaystack
"helpDoc":"/wiki/display/FINStack/Clone+Equip-Point+Tags",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackFormDelete
finNHaystackFormDelete(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormDelete |
| dis | toLocale("finNHaystackExt::deleteEquip") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will delete the equip component in Niagara. |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormDelete |
| uiFormOn | equip |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "input8", editorType: "list", prompt: toLocale("finNHaystackExt::listOfComponentsToRemoveTags"), dataProvider: selDis,
labelField: "val", height: 100, selectedValueTags: "val",toolTip:"IF the component is an Equip it will remove it, if it's a Point it will remove the Haystack Slot. (This will not remove the Point)"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::deleteEquipComponetInNiagra"),
"name": "create a note",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "readById(" + id + ").finNHaystackDelete(" + selList + ")",
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Delete+Equip"
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackFormDeleteHaystackSlot
finNHaystackFormDeleteHaystackSlot(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackFormDeleteHaystackSlot |
| dis | toLocale("finNHaystackExt::deleteHaystackSlot") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will delete the Haystack Slot in Niagara. |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormDeleteHaystackSlot |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
query:{ "dis": toLocale("finNHaystackExt::deleteHaystackSlotFromNiagara"),
"name": "finNHaystackFormDeleteHaystackSlot",
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "",
"helpDoc": "/wiki/display/FINStack/Delete+Haystack+Slot",
"finForm": marker() }
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{name: "targetFilter", editorType: "textinput",prompt:toLocale("finStackExt::targetFilter"), toolTip: "A filter for the Niagara objects. IE.. point and writable"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
query = query.set("commitAction", "readById("+id+").finNHaystackDeleteHaystackSlot(haystackReadAll(@"+id+", parseFilter(\$targetFilter)).toRecIdList)")
end
else do
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{name: "input8", editorType: "list", prompt: toLocale("finNHaystackExt::listOfComponentsToRemoveHaystackSlot"), dataProvider: selDis, labelField: "val", selectedValueTags: "val"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
query = query.set("commitAction", "readById("+id+").finNHaystackDeleteHaystackSlot("+selList+")")
end
query.set("body", body.toJSON).toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackFormPriorityArray
finNHaystackFormPriorityArray(id)
Axon function
meta
| def | func:finNHaystackFormPriorityArray |
| dis | toLocale("finNHaystackExt::haystackPriorityArray") |
| formOn | haystackWrite |
| help | This will display the haystack PriorityArray. |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormPriorityArray |
| uiFormOn | point |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id) => do
rec: toRec(id)
provider:
"finNHaystackPointWriteArray(@" + rec->haystackConnRef + ", @" + rec->haystackCur + ")" +
".map((r) => if (not r.has(\"val\")) r.set(\"val\", \"null\") else r)"
body: [
{ name: "table",
editorType: "table",
prompt: toLocale("finNHaystackExt::haystackPriorityArray"),
height:500,
dataProvider: provider
},
{name: "okButton", editorType: "button", label: toLocale("finStackExt::ok"), controlBar: true},
]
{ "dis": toLocale("finNHaystackExt::haystackPriorityArray"),
"name": "foo",
"body": body.toJSON,
"cancelButton": "\$okButton",
"helpDoc": "/wiki/display/FINStack/Haystack+Priority+Array",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackFormRebuildCache
finNHaystackFormRebuildCache(id)
Axon function
meta
| def | func:finNHaystackFormRebuildCache |
| dis | toLocale("finNHaystackExt::rebuildCache") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | This will execute nHaystack action to rebuild cache in N... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormRebuildCache |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id) => do
body: [
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::rebuildNHaystackCacheInNiagra"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackRebuildCache(@" + id + ")",
"helpDoc":"/wiki/display/FINStack/Rebuild+Cache",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackFormSyncEquips
finNHaystackFormSyncEquips(id)
Axon function
meta
| appFormOn | oldFolio |
| def | func:finNHaystackFormSyncEquips |
| dis | toLocale("finNHaystackExt::nHaystackSyncEquips") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackFormSyncEquips |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id)=> do
filter:"haystackConn "
if(id != null) do
rec:read(parseFilter("id==@"+id),false)
if(rec != null and rec.has("haystackConn"))
filter = filter + " and id==@"+id.toStr
end
body:[
{name:"connFilter",editorType:"textinput",defVal:filter,prompt:toLocale("finNHaystackExt::affectedConnector")},
{name:"targetFilter",editorType:"textinput",defVal:"point and equipRef==", prompt:toLocale("j2FinToolsExt::equipFilter")},
{name:"updateNavName",editorType:"checkbox",label:toLocale("finNHaystackExt::updateNavName")},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::syncNiagaraEquips"),
"name": "finFormSyncNiagaraEquips",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackSyncNiagaraEquipApply(\$connFilter,\$targetFilter,\$updateNavName)",
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Nhaystack+Sync+Equips",
"refreshTrees": marker()
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackInvoke
finNHaystackInvoke(id, action, args: null)
Axon function
meta
| def | func:finNHaystackInvoke |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackInvoke |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, action, args: null) => do
rec: toRec(id)
conn: toRec(rec->haystackConnRef)
if (args == null)
haystackInvokeAction(conn, rec->haystackWrite, action)
else
haystackInvokeAction(conn, rec->haystackWrite, action, args)
enddef
func:finNHaystackMapPointsToEquip
finNHaystackMapPointsToEquip(conn, siteNavName, equipNavName, ids)
finNHaystackMapPointsToEquip
This method applies equipRef tags to a list of points, so that those points become children of the given equip. If there is no Equip or Site by those name(s) in niagara, then an Equip and/or Site is created.
The rebuildCache action should be run in Niagara after this method is invoked.
meta
| construct | finNHaystackMapPointsToEquip(conn, siteNavName, equipNav... |
| def | func:finNHaystackMapPointsToEquip |
| example | finNHaystackMapPointsToEquip(@connId, "mySite", "myEquip... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackMapPointsToEquip |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackMapPointsToEquipApply
finNHaystackMapPointsToEquipApply(items, site, equip)
Axon function
meta
| def | func:finNHaystackMapPointsToEquipApply |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackMapPointsToEquipApply |
| private | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(items,site,equip)=> do
if(items == "") return []
mymap:{}
items.each(p=> do
connId:p.get("connRef")
ar :[]
if(mymap.has(connId.toStr))
ar = mymap.get(connId.toStr)
ar = ar.add(p)
mymap = mymap.set(connId.toStr,ar)
end)
mymap.each((arr,conn)=>do
connId:parseRef(conn)
arr = arr.map(r=>r->id.toStr.replace("@",""))
if(arr.size > 0) do
try
finNHaystackMapPointsToEquip(connId,site,equip,arr)
catch(err) logErr("NHaystack","failed mapping points to equip",err)
end
end)
enddef
func:finNHaystackPointWriteArray
finNHaystackPointWriteArray(conn, id)
finNHaystackPointWriteArray
meta
| construct | finNHaystackPointWriteArray(conn, id) |
| def | func:finNHaystackPointWriteArray |
| example | finNHaystackPointWriteArray(@connId, @myPointId) This e... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackPointWriteArray |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackPullPropTags
finNHaystackPullPropTags(conn, tags, filter, ids: [,])
finNHaystackPullPropTags
meta
| construct | finNHaystackPullPropTags(conn, tags, filter) |
| def | func:finNHaystackPullPropTags |
| example | finNHaystackPullPropTags(@connId, ["foo","bar"], "kind =... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackPullPropTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackPullPropsForm
finNHaystackPullPropsForm(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackPullPropsForm |
| dis | toLocale("finNHaystackExt::pullPropertyTags") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | Pull the properties or facets out of Niagara and update ... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackPullPropsForm |
| uiFormOn | haystackConn or point |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
body: [
{
name: "filterText",
editorType: "textinput",
defVal:"point",
prompt:toLocale("finStackExt::finFilter")
},
{
name: "tagsToPull",
editorType: "list",
prompt: toLocale("finNHaystackExt::selectTagsToPull"),
dataProvider: "[\"minVal\",\"maxVal\",\"precision\",\"unit\",\"enum\",\"actions\"]",
listType: "checkbox",
labelField: "val",
height: 150,
selectedValueTags: "val"
},
{ name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{ name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true},
]
{ "dis": toLocale("finNHaystackExt::pullNiagraProperties"),
"name": "foo",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackPullPropTags(@" + id +",\$tagsToPull,\$filterText)",
"helpDoc":"/wiki/display/FINStack/Pull+Property+Tags",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
// something selected
end else do
// Create a list of selected ids if at least two things are selected.
selList: "[" + selectedDicts.map() (row => "@" + row->id.toStr).concat(",") + "]"
selDis: "[" + selectedDicts.map() (row => "\"" + row->id.toStr + "\"").concat(",") + "]"
body: [
{
name: "selected",
editorType: "list",
prompt:toLocale("finNHaystackExt::listOfComponentsToPullPropsFrom"),
dataProvider: selDis,
labelField: "val",
height: 150,
selectedValueTags: "val"
},
{
name: "tagsToPull",
editorType: "list",
prompt: toLocale("finNHaystackExt::selectTagsToPull"),
dataProvider: "[\"minVal\",\"maxVal\",\"precision\",\"unit\"]",
listType: "checkbox",
labelField: "val",
height: 150,
selectedValueTags: "val",
},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::pullNiagraProperties"),
"name": "foo",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackPullPropTags(@" + id + ",\$tagsToPull,\"\"," + selList + ")",
"helpDoc":"/wiki/display/FINStack/Pull+Property+Tags",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
enddef
func:finNHaystackQuery
finNHaystackQuery(id, selectedIds)
Axon function
meta
| appFormOn | builder,oldFolio |
| def | func:finNHaystackQuery |
| dis | toLocale("finNHaystackExt::nHaystackQuery") |
| finForm | ✓ |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackQuery |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id,selectedIds)=>do
filter:"haystackConn "
if(selectedIds != null) do
filter = filter + "and (" + selectedIds.map(rec=>"id==@" + rec->id).concat(" or ") +")"
end
body:[
{name:"filter",editorType:"textinput",defVal:"point and temp",prompt:toLocale("finStackExt::finFilter")},
{name:"tag",editorType:"textinput",defVal:"dis", prompt:toLocale("j2FinToolsExt::searchTag")},
{
name:"option",
editorType:"combobox",
labelField:"dis",
selectedValueTags:"val",
defIndex:0,
dataProvider:[
{dis:toLocale("j2FinToolsExt::contains"),val:"contains",selected:true},
{dis:toLocale("j2FinToolsExt::startsWith"),val:"startsWith"},
{dis:toLocale("j2FinToolsExt::endsWith"),val:"endsWith"}
].toAxonCode
},
{name:"needle",editorType:"textinput"},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
{ "dis": toLocale("finNHaystackExt::nHaystackBatchEditTags"),
"name": "finNHaystackQueryForm",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction":"",
"gotoAction": "finstack:folio:axonQuery=nHaystackQueryApply(\""+ filter +"\",\"\$filter\",\"\$tag\",\"\$option\",\"\$needle\")",
"finForm": marker(),
"helpDoc":"/wiki/display/FINStack/Nhaystack+Query",
}.toGrid.addMeta({formExecute: marker()})
enddef
func:finNHaystackReadSize
finNHaystackReadSize(conn, filter)
finNHaystackReadSize This method calls read with the given filter, and then counts the number of resulting recs.
meta
| construct | finNHaystackReadSize(conn, filter) |
| def | func:finNHaystackReadSize |
| example | finNHaystackReadSize(@connId, "point and temp") This ex... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackReadSize |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackReadUnique
finNHaystackReadUnique(conn, filter, column)
finNHaystackReadUnique This method calls read with the given filter, and then finds the unique values of the given column
meta
| construct | finNHaystackReadUnique(conn, filter, column) |
| def | func:finNHaystackReadUnique |
| example | finNHaystackReadUnique(@connId, "point", "tz") This exa... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackReadUnique |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackRebuildCache
finNHaystackRebuildCache(conn)
finNHaystackRebuildCache This method calls rebuildCache in NHaystack. This is an expensive operation, so be careful.
meta
| construct | finNHaystackRebuildCache() |
| def | func:finNHaystackRebuildCache |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackRebuildCache |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackRemoveBrokenRefs
finNHaystackRemoveBrokenRefs(haystackConn)
Axon function
meta
| def | func:finNHaystackRemoveBrokenRefs |
| dis | toLocale("finNHaystackExt::removeBrokenRefs") |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackRemoveBrokenRefs |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(haystackConn) => do
haystackCall(haystackConn, "extended", toGrid([{function:"rebuildCache"}]))
enddef
func:finNHaystackSearchAndReplace
finNHaystackSearchAndReplace(conn, filter, searchText, replaceText, ids: [,])
finNHaystackSearchAndReplace This method renames components by replacing searchText with replaceText.
meta
| construct | finNHaystackSearchAndReplace(conn, filter, searchText, r... |
| def | func:finNHaystackSearchAndReplace |
| example | finNHaystackSearchAndReplace(@connId, "point", "foo", "b... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackSearchAndReplace |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackShowPointsInWatch
finNHaystackShowPointsInWatch(conn, watchId)
finNHaystackShowPointsInWatch
meta
| construct | finNHaystackShowPointsInWatch(conn, watchId) |
| def | func:finNHaystackShowPointsInWatch |
| example | finNHaystackShowPointsInWatch(@connId, @watchId) This e... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackShowPointsInWatch |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackShowWatches
finNHaystackShowWatches(conn)
finNHaystackShowWatches
meta
| construct | finNHaystackShowWatches(conn) |
| def | func:finNHaystackShowWatches |
| example | finNHaystackShowWatches(@connId) This example returns a... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackShowWatches |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackSyncNiagaraEquipApply
finNHaystackSyncNiagaraEquipApply(connFilter, targetFilter, updateNavName)
Axon function
meta
| def | func:finNHaystackSyncNiagaraEquipApply |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackSyncNiagaraEquipApply |
| private | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(connFilter,targetFilter,updateNavName)=> do
conn: read(parseFilter(connFilter))
points: readAll(parseFilter(targetFilter))
map:{}
points.each(p=>do
if(p.has("haystackCur")) do
cur :p.get("haystackCur").toStr
curAr :cur.split(".")
equipName: curAr.remove(-1).concat(".")
arr:[]
if(map.has(equipName))
arr = map.get(equipName)
arr = arr.add(p)
map = map.set(equipName,arr)
end
end)
//ignored tags
ignored:[
"id", "mod",
"axAnnotated", "axStatus",
"cur", "curDis", "curErr", "curStatus", "curVal",
"dis", "disMacro", "equip", "equipRef", "floorRef",
"haystackConnRef", "haystackCur",
"his", "hisCollectInterval", "hisEnd", "hisEndVal", "hisErr", "hisId",
"hisSize", "hisStart", "hisStatus",
"kind", "navName", "navNameFormat", "point", "precision", "sensor",
"site", "siteRef", "tz",
"writeErr", "writeLevel", "writeStatus", "writeVal",
"actions","enum","function","haystackWrite","haystackWriteLevel","hisCollectCov","writable"
]
ignoredfs:["id","dis","mod","axType","axSlotPath","navName","siteRef","floorRef"]
nequips:conn.haystackReadAll(parseFilter("equip"))
map.each((arr,equipName)=>do
p:arr[0]
equipRec: p->equipRef.toRec
nequipRec: nequips.find(e=> e->id.toStr==equipName)
//echo("equipRec:"+nequipRec)
if(nequipRec != null) do
tags:[]
equipRec.each((val,key)=>do
if(ignored.index(key)<0)do
if(val == marker())
tags = tags.add(key)
else
tags = tags.add(key+":"+val)
end
end)
tagApply : tags.concat(",")
//sync equip from fs to niagara
if(tagApply != "") do
if(not updateNavName)
finNHaystackApplyBatchTags(conn,equipFilter,tagApply)
else do
tagApply = tags.add("navNameFormat",equipRec.get("navName")).concat(",")
finNHaystackApplyBatchTags(conn,equipFilter,tagApply)
if(equipName.startsWith("S.")) do
//update haystackCur,haystackWrite, haystackHis of all points of this equip
arr.each(p=>do
changes:{}
if(p.has("haystackCur")) do
path: (p.get("haystackCur").toStr).split(".")
name:path[-1]
changes = changes.set("haystackCur",parseRef("S."+ equipName + "."+name))
end
if(p.has("haystackHis")) do
path:(p.get("haystackCur").toStr).split(".")
name:path[-1]
changes = changes.set("haystackHis",parseRef("S."+ equipName + "."+name))
end
if(p.has("haystackWrite")) do
path:(p.get("haystackCur").toStr).split(".")
name:path[-1]
changes = changes.set("haystackWrite",parseRef("S."+ equipName + "."+name))
end
//echo("changes:"+changes)
diff(p,changes).commit
end)
end
end
end
//sync equip from niagara to fs
changes:{}
nequipRec.each((val,key)=> do
if(ignoredfs.index(key) < 0 and not equipRec.has(key)) do
changes = changes.set(key,val)
end
end)
//echo("n2fs changes:"+changes)
try
diff(equipRec,changes).commit
catch(er) logErr("NHaystack","failed to sync equip from niagara",er)
end
end)
enddef
func:finNHaystackUniqueEquipTypes
finNHaystackUniqueEquipTypes(haystackConn)
Axon function
meta
| def | func:finNHaystackUniqueEquipTypes |
| dis | toLocale("finNHaystackExt::fetchNHaystackUniqueEquipType... |
| example | finNHaystackUniqueEquipTypes(read(haystackConn and dis==... |
| help | Fetch unique equip types from an NHaystack AX station |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackUniqueEquipTypes |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(haystackConn) => do
haystackCall(haystackConn, "extended", toGrid([{function:"uniqueEquipTypes"}]))
enddef
func:finNHaystackUniqueTags
finNHaystackUniqueTags(conn, filter)
finNHaystackUniqueTags
meta
| construct | finNHaystackUniqueTags(conn, filter) |
| def | func:finNHaystackUniqueTags |
| example | finNHaystackUniqueTags(@connId, "point") This example r... |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackUniqueTags |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finNHaystackViewEquipTypesCommit
finNHaystackViewEquipTypesCommit(connId, tagsToApply)
Axon function
meta
| def | func:finNHaystackViewEquipTypesCommit |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackViewEquipTypesCommit |
| private | ✓ |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(connId, tagsToApply) => do
tagsToApply.each s => do
id: toStr(s->id)
tags: s->tags
targetFilter: "equipType == " + parseInt(id[4..-1])
finNHaystackApplyBatchTags(connId, targetFilter, tags)
end
enddef
func:finNHaystackViewEquipTypesForm
finNHaystackViewEquipTypesForm(id, selectedDicts: null)
Axon function
meta
| def | func:finNHaystackViewEquipTypesForm |
| dis | toLocale("finNHaystackExt::viewEquipTypes") |
| folderPath | toLocale("finStackExt::rightMenuConnectors") + "/" + toL... |
| formOn | haystackConn |
| help | View Equipment Types |
| is | func |
| lib | lib:finNHaystackExt |
| name | finNHaystackViewEquipTypesForm |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(id, selectedDicts: null) => do
if (selectedDicts == null or selectedDicts.size == 0)
return {}
if (selectedDicts[0].has("haystackConn")) do
numFound: try finNHaystackUniqueEquipTypes(id).size() catch 0
if (numFound > 0) do
body: [
{ name: "EquipTypes",
editorType: "table",
dataProvider: "finNHaystackUniqueEquipTypes(" + id.toAxonCode + ")",
height: 200,
toolTip: "Copy and Paste this to Excel to view better"
},
{
name: "tagsToApply",
editorType: "list",
prompt: toLocale("finNHaystackExt::selectEquipTypesAndTagsToApply"),
defValTagName: "selected",
dataProvider: "finNHaystackUniqueEquipTypes(" + id.toAxonCode + ")",
height: 125,
itemRenderer: [
{name: "selected", editorType: "checkbox"},
{name: "id", editorType: "label", text: "\$id"},
{name: "tags", editorType: "textinput"}
],
toolTip: "Tags to apply e.g. 'foo, num:42'"
},
{name: "cancelButton", editorType: "button", label: toLocale("finStackExt::cancel"), controlBar: true},
{name: "applyButton", editorType: "button", label: toLocale("finStackExt::coreApply"), controlBar: true}
]
// return form grid
{ "dis": toLocale("finNHaystackExt::viewEquipTypesAndApplyBatchTags"),
"name": "TODO do we actually need this?",
"body": body.toJSON,
"cancelButton": "\$cancelButton",
"commitButton": "\$applyButton",
"commitAction": "finNHaystackViewEquipTypesCommit(" + id.toAxonCode + ",\$tagsToApply)",
"helpDoc":"/wiki/display/FINStack/View+Equip+Types",
"finForm": marker()
}.toGrid.addMeta({formExecute: marker()})
end
else
return finFormAlertOk(toLocale("finNHaystackExt::viewEquipTypesAndApplyBatchTags"), toLocale("finNHaystackExt::noUniqueEquipsFound").replace("{name}", readById(id).dis))
end
enddef
func:finToAlarm
finToAlarm(params)
finToAlarm
meta
| def | func:finToAlarm |
| is | func |
| lib | lib:finNHaystackExt |
| name | finToAlarm |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:finToNormal
finToNormal(params)
finToNormal
meta
| def | func:finToNormal |
| is | func |
| lib | lib:finNHaystackExt |
| name | finToNormal |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
def
func:nHaystackQueryApply
nHaystackQueryApply(connFilter, filter, tag, option, needle)
Axon function
meta
| def | func:nHaystackQueryApply |
| is | func |
| lib | lib:finNHaystackExt |
| name | nHaystackQueryApply |
supertypes
| feature | Feature namespace of definitions formatted as feature:name |
| func | Axon function |
src
(connFilter,filter,tag,option,needle)=>do
conns:readAll(parseFilter(connFilter))
rows:[]
conns.each(conn=>do
rs:conn.haystackReadAll(parseFilter(filter)).findAll(p=> do
val:""
if(p.has(tag))
val = p.get(tag)
else if(tag == "dis")
val = p.dis
if(val != null)
val = val.toStr.lower
if(option == "startsWith")
return val.startsWith(needle.lower)
else if(option == "endsWith")
return val.endsWith(needle.lower)
else if(option == "contains")
return val.contains(needle.lower)
return false
end)
if(rs != null) do
rs = rs.map(p=> do
return p.set("connRef",conn->id)
end)
rows = rows.addAll(rs.toRecList)
end
end)
return rows
end