YEP that's exactly what i've done...
Maybe you'll consider control of acrnema.map file with use of database some like:
when ull use conquest-start file:
(just create web part to change rows in database)
(.....)
init_delay = 0
if ENV['opts'].assoc:
# just reload the acrnema.map
cmd.append("--read_amap:")
pidfile = '/dev/null'
init_delay = 0
pidfile = open(pidfile, 'w')
# start the instances
retval = 0
for instance in ENV['instances']:
try:
inst_dir = "%s/%s" % (CONFDIR, instance)
os.chdir(inst_dir)
_null = open("%s/dgate.log" % inst_dir, "a")
cmd2 = ["sudo","-u","root","%s/acrnema" % inst_dir]
k = Popen(cmd2, stdout=_null, stderr=STDOUT)
d = Popen(cmd, stdout=_null, stderr=STDOUT)
time.sleep(init_delay)
if d.returncode:
(.....)
dicom.ini
(.....)
# Names of the database tables
PatientTableName = DICOMPatients
StudyTableName = DICOMStudies
SeriesTableName = DICOMSeries
ImageTableName = DICOMImages
DMarkTableName = DICOMAccessUpdates
RegisteredMOPDeviceTable = RegisteredMOPIDs
UIDToMOPIDTable = UIDToMOPID
UIDToCDRIDTable = UIDToCDRID
AETableName = DICOMAeList
(....)
some uncompiled file
Ive got already compiled file acrnema (if You want it jus ask)
[root@alfa c_progs]# cat acrnema.cpp
#include <stdio.h>
#include <my_global.h>
#include <mysql.h>
#include <libini.h>
#include <iostream>
#include <fstream>
#include "simpleini.h"
using namespace std;
int main() {
MYSQL *conn;
MYSQL_RES *result;
MYSQL_ROW row;
int num_fields;
int i, errorcheck;
CSimpleIniA ini;
ini.SetUnicode();
ini.LoadFile("dicom.ini");
const char * serwer = ini.GetValue("sscscp", "SQLHost", "default");
const char * base = ini.GetValue("sscscp", "SQLServer", "default");
const char * user = ini.GetValue("sscscp", "Username", "default");
const char * pass = ini.GetValue("sscscp", "Password", "default");
const char * name = ini.GetValue("sscscp", "AETableName", "default");
const char * n;
string w;
w="SELECT * FROM ";
w.append(name);
n=w.c_str();
conn = mysql_init(NULL);
ofstream myfile ("acrnema.map", ios::out);
if (conn == NULL) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
exit(1);
}
!mysql_real_connect(conn, serwer, user, pass, base, 0, NULL, 0);
if (conn == NULL)
{
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
exit(1);
}
mysql_query(conn,n);
result = mysql_store_result(conn);
num_fields = mysql_num_fields(result);
while ((row = mysql_fetch_row(result)))
{
for(i = 0; i < num_fields; i++)
{
myfile << row[i];
myfile << " ";
}
myfile << "\n";
}
mysql_free_result(result);
mysql_close(conn);
myfile.close();
return 0;
}
and database:
DROP TABLE IF EXISTS `DICOMAeList`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `DICOMAeList` (
`AETitle` varchar(30) NOT NULL,
`IP_Host` varchar(45) NOT NULL,
`Port` int(4) NOT NULL,
`Compress` varchar(2) NOT NULL,
PRIMARY KEY (`AETitle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `DICOMAeList`
--
LOCK TABLES `DICOMAeList` WRITE;
/*!40000 ALTER TABLE `DICOMAeList` DISABLE KEYS */;
INSERT INTO `DICOMAeList` VALUES ('Divinus','192.168.0.95',4096,'ul'));
/*!40000 ALTER TABLE `DICOMAeList` ENABLE KEYS */;
UNLOCK TABLES;