Conquest-DICOM-Server icon indicating copy to clipboard operation
Conquest-DICOM-Server copied to clipboard

read_amap in association.lua. Problem with comments.

Open lncoll opened this issue 10 months ago • 5 comments

Hi again, I'm using the read_amap function and it has a problem when there is a one line comment. The whole line is ignored, and the next lines until a */ is found. So comments like this ones can't be used:

/* XRAY */
ONEAETITLE     10.10.10.1    104        un
ANOTHERAE      10.10.10.2    104        un    /* Old CR 30 */

To solve I've added a line to remove one line comments. Tested for some days and the issue seems to be solved. The final function is:

function read_amap()  
  local map = {}  
  local incomment=false  
  for t in io.lines(Global.BaseDir..'acrnema.map') do  
    t = string.gsub(t, "/%*.-%*/", "")  
    if string.match(t, '/%*') then  
      incomment=true  
    elseif string.match(t, '%*/') then  
      incomment=false  
    elseif incomment==false then  
      local a,b,c,d,e,f,g,h = string.match(t, string.rep('([0-9a-zA-Z_%.%*]*)%s*', 8))  
      if a~='' then  
        a = {a,b,c,d,e,f,g,h}  
        table.insert(map, a)  
      end  
    end  
  end  
  return map  
end  

lncoll avatar Apr 03 '24 17:04 lncoll

Hi Luis,

I am not sure if the C version of this module can read single line comments. If you do List Dicom Providers on the maintenance page, does it show the correct entries?

thanks,

Marcel

On Wed, Apr 3, 2024 at 6:17 PM lncoll @.***> wrote:

Hi again, I'm using the read_amap function and it has a problem when there is a one line comment. The whole line is ignored, and the next lines until a */ is found. So comments like this ones can't be used:

/* XRAY / ONEAETITLE 10.10.10.1 104 ANOTHERAE 10.10.10.2 104 / Old CR 30 */

To solve I've added a line to remove one line comments. Tested for some days and the issue seems to be solved. The final function is:

function read_amap() local map = {} local incomment=false for t in io.lines(Global.BaseDir..'acrnema.map') do t = string.gsub(t, "/%.-%/", "") if string.match(t, '/%') then incomment=true elseif string.match(t, '%/') then incomment=false elseif incomment==false then local a,b,c,d,e,f,g,h = string.match(t, string.rep('([0-9a-zA-Z_%.%])%s*', 8)) if a~='' then a = {a,b,c,d,e,f,g,h} table.insert(map, a) end end end return map end

— Reply to this email directly, view it on GitHub https://github.com/marcelvanherk/Conquest-DICOM-Server/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDWJPCB7BEJO7675SKC6TY3Q2SFAVCNFSM6AAAAABFVXPUAOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDGNBYGE3DCNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

marcelvanherk avatar Apr 04 '24 11:04 marcelvanherk

Hi Marcel, I have no computers with windows, just use GNU/Linux. So can't test in the gui. But in Linux: the send study function from the newweb interface shows all the servers configured in acrnema.map, even with one line comments.

Is this enough to confirm?

Luis.

lncoll avatar Apr 04 '24 15:04 lncoll

think so.

On Thu, 4 Apr 2024, 16:34 lncoll, @.***> wrote:

Hi Marcel, I have no computers with windows, just use GNU/Linux. So can't test in the gui. But in Linux: the send study function from the newweb interface shows all the servers configured in acrnema.map, even with one line comments.

Is this enough to confirm?

Luis.

— Reply to this email directly, view it on GitHub https://github.com/marcelvanherk/Conquest-DICOM-Server/issues/40#issuecomment-2037536930, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDWJIVKUQUPC3ZNA6D5ETY3VXJVAVCNFSM6AAAAABFVXPUAOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZXGUZTMOJTGA . You are receiving this because you commented.Message ID: @.***>

marcelvanherk avatar Apr 04 '24 16:04 marcelvanherk

Ok, finally I've tested the windows version. The "Known DICOM providers" tab works properly, it shows all the comments, but because simply loads the acrnema.map file in a notepad. After this runs FillAEList procedure, this one didn't process well the comments, just looks for a '*'. In dgate c code the comments are processed ok, I've tested the code and is all ok. Please let me some time to find my old Delphi 4.0 CD-Rom and will try to solve the GUI issue. Or may be can migrate to Lazarus and compile it for windows and Linux, just 10% of probability to do this.

lncoll avatar Apr 08 '24 19:04 lncoll

Just modified the function FillAELists. Now processes ok the c stile comments and the Form1.DicomSystem and Form1.TargetSystem are filled correctly. Attached is the modified .pas if you accept the changes file.

Luis. Serverdriver.zip

lncoll avatar Apr 13 '24 22:04 lncoll

These features have been released in 1.5.0e

marcelvanherk avatar Sep 28 '24 14:09 marcelvanherk