This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

widget template
#6
Hi
There is no such thing what you are looking for. Some users created a scripts with direct database write where they shifted groups of a template page.  This will work only if you have certain pattern of object creation.
Here is an example
https://forum.logicmachine.net/showthrea...50#pid7450

Not sure what for but I wrote some script to shift visu objects based on selected shift. It may be useful to you.
Code:
planID = 8  --plan number shown after # in quisk visu preview http://URL/scada-vis/#6
visObjectType = 1  --all binary objects are type 0 and all numeric objects are type 1

--All Manin objects will be shifted by selected addres.
controlObjectMain = 0
controlObjectSub = 0
controlObjectAddress = 0

--Select shift for status object. If status object is not used in object visu it will be ignored.
statusObjectMain = 0
statusObjectSub = 0
statusObjectAddress = 0

------------------------------------------ End Parameters ------------------------------------------
------------------------------ DON'T CHANGE ANYTHING UNDER THIS LINE -------------------------------
dbobjects = db:getall('SELECT id, object, statusobject FROM visobjects WHERE floor = ' .. planID .. ' AND type = ' .. visObjectType .. '')
--log(dbobjects)
for _, tableData in ipairs(dbobjects) do
  oldControlAddress = tableData.object
  oldStatusAddress = tableData.statusobject
  currentRow = tableData.id
  newControlAddress = oldControlAddress + ((controlObjectMain * 2048) + (controlObjectSub * 256) + controlObjectAddress)
  newStatusAddress = oldStatusAddress + ((statusObjectMain * 2048) + (statusObjectSub * 256) + statusObjectAddress)
 
  log('oldControlAddress= '..tostring(oldControlAddress)..', currentRow= '..tostring(currentRow)..', newControlAddress= ' ..tostring(newControlAddress)..', newStatusAddress= ' ..tostring(newStatusAddress) )
  db:update('visobjects', { object = newControlAddress }, { id = currentRow })
  if (oldControlAddress == oldStatusAddress) then --if no status object selected main object must be used
  db:update('visobjects', { statusobject = newControlAddress }, { id = currentRow })
    else
  db:update('visobjects', { statusobject = newStatusAddress }, { id = currentRow })
    end

 
end 
log('update finished')
script.disable(_SCRIPTNAME)

Always make a backup before using any of this scripts.

BR
------------------------------
Ctrl+F5
Reply


Messages In This Thread
widget template - by Frank68 - 10.07.2020, 06:18
RE: widget template - by admin - 10.07.2020, 06:44
RE: widget template - by Frank68 - 10.07.2020, 08:14
RE: widget template - by admin - 10.07.2020, 08:35
RE: widget template - by Frank68 - 10.07.2020, 14:37
RE: widget template - by Daniel - 10.07.2020, 15:33

Forum Jump: