|
|
|
@@ -22,6 +22,11 @@ require( 'WinConst')
|
|
|
|
|
|
|
|
|
|
_G.package.loaded.JSON = nil
|
|
|
|
|
local JSON = require( 'JSON')
|
|
|
|
|
_G.package.loaded.XML = nil
|
|
|
|
|
local XML = require( 'xml2lua')
|
|
|
|
|
_G.package.loaded.XMLHandler = nil
|
|
|
|
|
local XMLHandler = require( 'xml2lua_tree')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local s_dDowelTol = 1
|
|
|
|
|
local s_dSimplSolidApprox = 0.2 -- approssimazione lineare nel caso di solidi semplificati
|
|
|
|
@@ -4989,6 +4994,40 @@ local function DrawHandle( nOutlineId, sHandleSide, dHandleH, nLayerId, bSlide,
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function GetHandleHeight( nAreaId)
|
|
|
|
|
|
|
|
|
|
-- verifico se è definita tra le opzioni
|
|
|
|
|
local vOptions = EgtGetInfo( nAreaId, WIN_HDW_OPTIONS, 'vs') or {}
|
|
|
|
|
for i = 1, #vOptions do
|
|
|
|
|
local vString = EgtSplitString( vOptions[i], '=')
|
|
|
|
|
if #vString == 2 and vString[1] == WIN_HDW_HANDLE_HEIGHT then
|
|
|
|
|
local dVal = tonumber( vString[2])
|
|
|
|
|
return dVal
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- chiedo il file di opzioni dalla ferramenta. Se viene fatto solo il calcolo delle opzioni Hman viene lasciato a 0, per avere valore di default
|
|
|
|
|
-- è necessario fargli calcolare anche altro ( e.g. lista ferramenta)
|
|
|
|
|
local _, _, tOptions = WinCalculate.AddHardware( nAreaId, false, true, false, true)
|
|
|
|
|
if #tOptions > 0 then
|
|
|
|
|
-- lettura della stringa xml delle opzioni
|
|
|
|
|
local handler = XMLHandler:new()
|
|
|
|
|
local parser = XML.parser( handler)
|
|
|
|
|
parser:parse( tOptions[1])
|
|
|
|
|
local tabOptions = handler.root
|
|
|
|
|
-- cerco parametro altezza maniglia
|
|
|
|
|
for i = 1, #tabOptions['ParametriOpzioni']['Parametri'] do
|
|
|
|
|
if tabOptions['ParametriOpzioni']['Parametri'][i]['NomeParametro'] == WIN_HDW_HANDLE_HEIGHT then
|
|
|
|
|
local sHandleH = tabOptions['ParametriOpzioni']['Parametri'][i]['ValoreCorrente']
|
|
|
|
|
return tonumber( sHandleH)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return 500 -- restituisco valore di default
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che disegna la ferramenta
|
|
|
|
|
local function DrawSashHardware( nAreaId, nRefAreaId, nLayerId, bPreview)
|
|
|
|
@@ -5040,15 +5079,7 @@ local function DrawSashHardware( nAreaId, nRefAreaId, nLayerId, bPreview)
|
|
|
|
|
local sHandleSide = EgtIf( bLeftSlide, 'Sx', 'Dx')
|
|
|
|
|
|
|
|
|
|
-- recupero altezza maniglia dalle opzioni
|
|
|
|
|
local dHandleH = 400
|
|
|
|
|
local vOptions = EgtGetInfo( nRefAreaId, WIN_HDW_OPTIONS, 'vs') or {}
|
|
|
|
|
for i = 1, #vOptions do
|
|
|
|
|
local vString = EgtSplitString( vOptions[i], '=')
|
|
|
|
|
if #vString == 2 and vString[1] == WIN_HDW_HANDLE_HEIGHT then
|
|
|
|
|
dHandleH = tonumber( vString[2])
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
local dHandleH = GetHandleHeight( nRefAreaId)
|
|
|
|
|
|
|
|
|
|
DrawHandle( nOutlineId, sHandleSide, dHandleH, nLayerId, true, bPreview)
|
|
|
|
|
|
|
|
|
@@ -5060,17 +5091,8 @@ local function DrawSashHardware( nAreaId, nRefAreaId, nLayerId, bPreview)
|
|
|
|
|
local nLeftId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_LEFT)
|
|
|
|
|
local nRightId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_RIGHT)
|
|
|
|
|
|
|
|
|
|
-- recupero dati della maniglia
|
|
|
|
|
-- recupero lato maniglia
|
|
|
|
|
local sHandleSide = EgtGetInfo( nRefAreaId, WIN_HDW_HANDLE)
|
|
|
|
|
local dHandleH = 500
|
|
|
|
|
local vOptions = EgtGetInfo( nRefAreaId, WIN_HDW_OPTIONS, 'vs') or {}
|
|
|
|
|
for i = 1, #vOptions do
|
|
|
|
|
local vString = EgtSplitString( vOptions[i], '=')
|
|
|
|
|
if #vString == 2 and vString[1] == WIN_HDW_HANDLE_HEIGHT then
|
|
|
|
|
dHandleH = tonumber( vString[2])
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- cerniere
|
|
|
|
|
if nSashType == WIN_SASHTYPES.INACTIVE or nSashType == WIN_SASHTYPES.INACTIVE_OUT or
|
|
|
|
@@ -5091,6 +5113,8 @@ local function DrawSashHardware( nAreaId, nRefAreaId, nLayerId, bPreview)
|
|
|
|
|
|
|
|
|
|
-- maniglia
|
|
|
|
|
if nSashType == WIN_SASHTYPES.ACTIVE or nSashType == WIN_SASHTYPES.ACTIVE_IN or nSashType == WIN_SASHTYPES.NULL then
|
|
|
|
|
-- recupero altezza maniglia
|
|
|
|
|
local dHandleH = GetHandleHeight( nRefAreaId)
|
|
|
|
|
if sHandleSide == 'Sx' then
|
|
|
|
|
DrawHandle( nRightId, sHandleSide, dHandleH, nLayerId, false, bPreview)
|
|
|
|
|
else
|
|
|
|
@@ -5442,7 +5466,7 @@ end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che aggiunge l'hardware
|
|
|
|
|
function WinCalculate.AddHardwareForSash( nFrameId, bMachiningList, bHardwareList, bPositionList, bOptionList, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
local function AddHardwareForSash( nFrameId, nReturnMode, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
-- cerco ed indicizzo ante del serramento
|
|
|
|
|
local SashList = {}
|
|
|
|
|
SearchSash( nFrameId, SashList)
|
|
|
|
@@ -5545,21 +5569,6 @@ function WinCalculate.AddHardwareForSash( nFrameId, bMachiningList, bHardwareLis
|
|
|
|
|
sText = sText .. vOptions[i] .. '\n'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Calcolo codice di ritorno
|
|
|
|
|
local nReturnMode = 0
|
|
|
|
|
if bHardwareList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.HARDWARELIST
|
|
|
|
|
end
|
|
|
|
|
if bPositionList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.POSITIONLIST
|
|
|
|
|
end
|
|
|
|
|
if bMachiningList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.MACHININGLIST
|
|
|
|
|
end
|
|
|
|
|
if bOptionList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.OPTIONLIST
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Canali
|
|
|
|
|
local QuestionChannel = "EgwHardwareQuestion"
|
|
|
|
|
local AnswerChannel = "EgwHardwareAnswer" .. os.time()
|
|
|
|
@@ -5580,36 +5589,36 @@ function WinCalculate.AddHardwareForSash( nFrameId, bMachiningList, bHardwareLis
|
|
|
|
|
local bOk = EgtRedisAsyncPublish( QuestionChannel, JsonQuestion)
|
|
|
|
|
local AnswerArgs
|
|
|
|
|
if bOk then
|
|
|
|
|
EgtOutLog('Messaggio Redis pubblicato:' .. QuestionChannel .. ' ' .. JsonQuestion)
|
|
|
|
|
-- EgtOutLog( 'Messaggio Redis pubblicato:' .. QuestionChannel .. ' ' .. JsonQuestion)
|
|
|
|
|
EgtOutLog( 'Messaggio Redis pubblicato')
|
|
|
|
|
local bOk, Answer = EgtRedisAsyncSubscribeOneMessage( AnswerChannel, 1500)
|
|
|
|
|
if bOk then
|
|
|
|
|
EgtOutLog('Risposta Redis ricevuta:' .. Answer)
|
|
|
|
|
-- EgtOutLog( 'Risposta Redis ricevuta:' .. Answer)
|
|
|
|
|
EgtOutLog( 'Risposta Redis ricevuta')
|
|
|
|
|
local JsonAnswer = JSON:decode( Answer)
|
|
|
|
|
AnswerArgs = JsonAnswer['Args']
|
|
|
|
|
AnswerArgs.OutputChannel = nil
|
|
|
|
|
else
|
|
|
|
|
local sErrorMsg = 'Errore! Risposta dal canale calcolo hardware Agb non arrivata!'
|
|
|
|
|
EgtOutLog(sErrorMsg)
|
|
|
|
|
return 0, { Error = sErrorMsg}
|
|
|
|
|
EgtOutLog( 'Errore! Risposta dal canale calcolo hardware Agb non arrivata!')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local sErrorMsg = 'Errore! Pubblicazione sul canale calcolo hardware Agb fallita!'
|
|
|
|
|
EgtOutLog(sErrorMsg)
|
|
|
|
|
return 0, { Error = sErrorMsg}
|
|
|
|
|
EgtOutLog( 'Errore! Pubblicazione sul canale calcolo hardware Agb fallita!')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if bHardwareList then
|
|
|
|
|
local tHardware= JSON:decode( AnswerArgs.HardwareList)
|
|
|
|
|
if ( nReturnMode & WIN_HDW_RETURNMODE.HARDWARELIST) ~= 0 then
|
|
|
|
|
local tHardware = JSON:decode( AnswerArgs.HardwareList)
|
|
|
|
|
table.insert( OutputKitList, tHardware)
|
|
|
|
|
end
|
|
|
|
|
if bPositionList then
|
|
|
|
|
local tPosition= JSON:decode( AnswerArgs.PositionList)
|
|
|
|
|
if ( nReturnMode & WIN_HDW_RETURNMODE.POSITIONLIST) ~= 0 then
|
|
|
|
|
local tPosition = JSON:decode( AnswerArgs.PositionList)
|
|
|
|
|
table.insert( OutputPositionList, tPosition)
|
|
|
|
|
end
|
|
|
|
|
if bMachiningList then
|
|
|
|
|
local tMachining= JSON:decode( AnswerArgs.MachiningList)
|
|
|
|
|
if ( nReturnMode & WIN_HDW_RETURNMODE.MACHININGLIST) ~= 0 then
|
|
|
|
|
local tMachining = JSON:decode( AnswerArgs.MachiningList)
|
|
|
|
|
CalcHdwMachining( tMachining, SashList)
|
|
|
|
|
--disegno la ferramenta
|
|
|
|
|
-- disegno la ferramenta
|
|
|
|
|
if s_bCalcSolid then
|
|
|
|
|
-- recupero o creo il gruppo per disegno ferramenta
|
|
|
|
|
local nAuxLayerId = GetAuxLayer()
|
|
|
|
@@ -5618,157 +5627,63 @@ function WinCalculate.AddHardwareForSash( nFrameId, bMachiningList, bHardwareLis
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if bOptionList then
|
|
|
|
|
if ( nReturnMode & WIN_HDW_RETURNMODE.OPTIONLIST) ~= 0 then
|
|
|
|
|
table.insert( OutputOptionList, AnswerArgs.OptionList)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che crea stringa per richiesta hardware AGB
|
|
|
|
|
function WinCalculate.GetAGBSashDescription( nFrameId)
|
|
|
|
|
-- cerco ed indicizzo ante del serramento
|
|
|
|
|
local SashList = {}
|
|
|
|
|
SearchSash( nFrameId, SashList)
|
|
|
|
|
|
|
|
|
|
-- ordino per X e Y
|
|
|
|
|
local function compareXY(a,b)
|
|
|
|
|
if abs( a.ptCenter:getX() - b.ptCenter:getX()) < GEO.EPS_SMALL then
|
|
|
|
|
return a.ptCenter:getY() < b.ptCenter:getY()
|
|
|
|
|
else
|
|
|
|
|
return a.ptCenter:getX() < b.ptCenter:getX()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
table.sort( SashList, compareXY)
|
|
|
|
|
|
|
|
|
|
-- correggo nomi Frame del telaio in base all'ordinamento delle ante
|
|
|
|
|
for nIndex = 1, #SashList do
|
|
|
|
|
for nFrameIndex = 1, #SashList[nIndex].Frame do
|
|
|
|
|
local nFrameId = SashList[nIndex].Frame[nFrameIndex]
|
|
|
|
|
local sName = EgtGetName( nFrameId)
|
|
|
|
|
EgtSetName( nFrameId, nIndex .. '.' .. sName)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- recupero preferito della ferramenta
|
|
|
|
|
--local nFavourite = EgtGetInfo( nFrameId, WIN_HDW_FAVOURITE)
|
|
|
|
|
--if bOnlyRequest then
|
|
|
|
|
nFavourite = WDG.HDWFAVOURITE
|
|
|
|
|
--end
|
|
|
|
|
if not nFavourite or nFavourite == WIN_HDW_NULL then
|
|
|
|
|
EgtOutLog('Warning! No hardware favourite set!')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
local sHandle = EgtGetInfo( nFrameId, WIN_HDW_HANDLE)
|
|
|
|
|
if bOnlyRequest then
|
|
|
|
|
sHandle = WDG.HDWHANDLE
|
|
|
|
|
end
|
|
|
|
|
if not sHandle then
|
|
|
|
|
EgtOutLog('Warning! No hardware handle set!')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local sText = 'S_NAME=' .. nFavourite .. '\n' ..
|
|
|
|
|
'RECORDID=15A' .. '\n'
|
|
|
|
|
|
|
|
|
|
-- recupero il tipo di apertura
|
|
|
|
|
local nOpeningType = WIN_OPENING_TYPES.NULL
|
|
|
|
|
if #SashList > 0 then
|
|
|
|
|
nOpeningType = EgtGetInfo( SashList[1].nAreaId, WIN_OPENING_TYPE, 'i')
|
|
|
|
|
end
|
|
|
|
|
-- recupero se scorrevole
|
|
|
|
|
local bSlide = EgtGetInfo( nFrameId, WIN_SLIDE_WINDOW, 'b') or false
|
|
|
|
|
|
|
|
|
|
if bSlide then
|
|
|
|
|
-- le dimensioni per alzante scorrevole sono quelle del telaio
|
|
|
|
|
local nOutlineLayId = EgtGetFirstInGroup( nFrameId, WIN_AREAOUTLINE)
|
|
|
|
|
local nBottomId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_BOTTOM)
|
|
|
|
|
local dMet = EgtCurveLength( nBottomId)
|
|
|
|
|
local nLeftId = EgtGetFirstNameInGroup( nOutlineLayId, WIN_LEFT)
|
|
|
|
|
local dHet = EgtCurveLength( nLeftId)
|
|
|
|
|
sText = sText .. 'MET=' .. tostring( dMet) .. '\n'
|
|
|
|
|
sText = sText .. 'HET=' .. tostring( dHet) .. '\n'
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
if #SashList >= 1 and abs( SashList[1].LHeight - SashList[1].RHeight) < GEO.EPS_SMALL then
|
|
|
|
|
sText = sText .. 'HBB=' .. tostring( SashList[1].LHeight) .. '\n'
|
|
|
|
|
else
|
|
|
|
|
for nSashIndex = 1, #SashList do
|
|
|
|
|
if nSashIndex == 1 then
|
|
|
|
|
sText = sText .. 'HBB_sx=' .. tostring( SashList[nSashIndex].LHeight) .. '\n'
|
|
|
|
|
else
|
|
|
|
|
sText = sText .. 'HBB_' .. tostring( nSashIndex - 1) .. 'B=' .. tostring( SashList[nSashIndex].LHeight) .. '\n'
|
|
|
|
|
end
|
|
|
|
|
if nSashIndex == #SashList then
|
|
|
|
|
sText = sText .. 'HBB_dx=' .. tostring( SashList[nSashIndex].RHeight) .. '\n'
|
|
|
|
|
else
|
|
|
|
|
sText = sText .. 'HBB_' .. tostring( nSashIndex) .. '=' .. tostring( SashList[nSashIndex].RHeight) .. '\n'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if #SashList == 1 then
|
|
|
|
|
sText = sText .. 'LBB=' .. tostring( SashList[1].BWidth) .. '\n'
|
|
|
|
|
if SashList[1].BCArrow then
|
|
|
|
|
sText = sText .. 'FRECCIA_1=' .. tostring( SashList[1].BCArrow) .. '\n'
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
for nSashIndex = 1, #SashList do
|
|
|
|
|
sText = sText .. 'LBB' .. nSashIndex .. '=' .. tostring( SashList[nSashIndex].BWidth) .. '\n'
|
|
|
|
|
if SashList[nSashIndex].BCArrow then
|
|
|
|
|
sText = sText .. 'FRECCIA_' .. nSashIndex .. '=' .. tostring( SashList[nSashIndex].BCArrow) .. '\n'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
sText = sText .. 'FINESTRAPORTAFINESTRA=Finestra' .. '\n' ..
|
|
|
|
|
'Q=1' .. '\n'
|
|
|
|
|
|
|
|
|
|
-- opzione manoserramento ( non per vasistas altrimenti sovrascrive l'opzione)
|
|
|
|
|
if nOpeningType ~= WIN_OPENING_TYPES.TILTONLY_TOP then
|
|
|
|
|
sText = sText .. 'MANOSERRAMENTO=' .. sHandle .. '\n'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local vOptions = EgtGetInfo( nFrameId, WIN_HDW_OPTIONS, 'vs') or {}
|
|
|
|
|
for i = 1, #vOptions do
|
|
|
|
|
sText = sText .. vOptions[i] .. '\n'
|
|
|
|
|
end
|
|
|
|
|
return sText
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che aggiunge l'hardware
|
|
|
|
|
function WinCalculate.AddHardware( nAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList)
|
|
|
|
|
--local bRedisConnect = EgtRedisAsyncConnect( ENG.Param2)
|
|
|
|
|
local bRedisConnect = EgtRedisAsyncConnect( 'redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true')
|
|
|
|
|
if not bRedisConnect then
|
|
|
|
|
EgtOutLog('Errore! Impossibile connettersi con il server Redis dal Lua!')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local OutputKitList = {}
|
|
|
|
|
local OutputPositionList = {}
|
|
|
|
|
local OutputOptionList ={}
|
|
|
|
|
WinCalculate.AddHardwareRec( nAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
EgtRedisAsyncDisconnect()
|
|
|
|
|
return OutputKitList, OutputPositionList, OutputOptionList
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function WinCalculate.AddHardwareRec( nAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
local function AddHardwareRec( nAreaId, nReturnMode, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
|
|
|
|
|
if EgtExistsInfo( nAreaId, WIN_HDW_FAVOURITE) then
|
|
|
|
|
-- se area ha un preferito definito allora devo calcolare la ferramenta sulle sue ante
|
|
|
|
|
return WinCalculate.AddHardwareForSash( nAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
return AddHardwareForSash( nAreaId, nReturnMode, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
else
|
|
|
|
|
-- verifico se ci sono sotto-aree
|
|
|
|
|
local nChildAreaId = EgtGetFirstNameInGroup( nAreaId, WIN_AREA .. '*')
|
|
|
|
|
while nChildAreaId do
|
|
|
|
|
-- lancio verifica di quell'area
|
|
|
|
|
WinCalculate.AddHardwareRec( nChildAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
AddHardwareRec( nChildAreaId, nReturnMode, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
nChildAreaId = EgtGetNextName( nChildAreaId, WIN_AREA .. '*')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che aggiunge l'hardware
|
|
|
|
|
function WinCalculate.AddHardware( nAreaId, bMachiningList, bHardwareList, bPositionList, bOptionList)
|
|
|
|
|
-- connessione a Redis
|
|
|
|
|
local bRedisConnect = EgtRedisAsyncConnect( 'redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true')
|
|
|
|
|
if not bRedisConnect then
|
|
|
|
|
EgtOutLog('Errore! Impossibile connettersi con il server Redis dal Lua!')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- calcolo codice di ritorno, i.e. tipologie di conti da fare sulla ferramenta ( e.g calcolo lavorazioni, calcolo lista ferramenta, ...)
|
|
|
|
|
local nReturnMode = 0
|
|
|
|
|
if bMachiningList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.MACHININGLIST
|
|
|
|
|
end
|
|
|
|
|
if bHardwareList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.HARDWARELIST
|
|
|
|
|
end
|
|
|
|
|
if bPositionList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.POSITIONLIST
|
|
|
|
|
end
|
|
|
|
|
if bOptionList then
|
|
|
|
|
nReturnMode = nReturnMode + WIN_HDW_RETURNMODE.OPTIONLIST
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local OutputKitList = {}
|
|
|
|
|
local OutputPositionList = {}
|
|
|
|
|
local OutputOptionList = {}
|
|
|
|
|
AddHardwareRec( nAreaId, nReturnMode, OutputKitList, OutputPositionList, OutputOptionList)
|
|
|
|
|
|
|
|
|
|
EgtRedisAsyncDisconnect()
|
|
|
|
|
|
|
|
|
|
return OutputKitList, OutputPositionList, OutputOptionList
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
-- funzione che disegna l'hardware
|
|
|
|
|
local function DrawHardware( nAreaId, nAuxLayerId)
|
|
|
|
|