marcelvanherk / Conquest-DICOM-Server

Conquest DICOM server, aiming for complete source code release
112 stars 47 forks source link

IgnoreRewrite #41

Open lncoll opened 3 months ago

lncoll commented 3 months ago

Found your new addition to dgate, IgnoreRewrite. I was using a lua script to avoid rewriting files, but this looks better. But needed to modify slightly, to add a line in logs. This is as is working fine in my tests:

  // newly written image (not rewritten image): use selection preferred storage if enough space  
  if (*rRoot)  
  {  
    if (Storage[0])  
    {  
      int PreferredDevice = atoi(Storage+3);  
      if(CheckFreeStoreOnMAGDevice(PreferredDevice) > 30)  
        sprintf(Device, "MAG%d", PreferredDevice);  
    }  
  }  
  else    
  {  
    rewrite=TRUE;  
    char szRootSC[64], temp[64];  
    if (MyGetPrivateProfileString(RootConfig, "MicroPACS", RootConfig, szRootSC, 64, ConfigFile))  
    {  
      MyGetPrivateProfileString(szRootSC, "IgnoreRewrite", "0", temp, 64, ConfigFile);  
      if (atoi(temp))  
      {  
        OperatorConsole.printf("File already exists: %s\n", rFilename);  
        Filename[0]=0;  
        delete DDOPtr;  
        return TRUE;  
      }  
    }  
  }  

Just added the OperatorConsole line and cleaning the filename. Hope this helps.

Luis