Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/packaging/debian/kernel.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@
./usr/local/mdsplus/tdi/python/addfun.py
./usr/local/mdsplus/tdi/python/ctime.py
./usr/local/mdsplus/tdi/python/getShotDB.py
./usr/local/mdsplus/tdi/python/influxSignal.py
./usr/local/mdsplus/tdi/python/intersect1d.py
./usr/local/mdsplus/tdi/python/pyfun.py
./usr/local/mdsplus/tdi/python/setdiff1d.py
./usr/local/mdsplus/tdi/python/influxSignal.py
./usr/local/mdsplus/tdi/remote/GetManyExecute.fun
./usr/local/mdsplus/tdi/remote/ListConnections.fun
./usr/local/mdsplus/tdi/remote/MdsConnect.fun
Expand Down
12 changes: 6 additions & 6 deletions deploy/packaging/debian/matlab.noarch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
./usr/local/mdsplus/matlab/MDSplusAPI.m
./usr/local/mdsplus/matlab/mdsFromMatlab.m
./usr/local/mdsplus/matlab/mdsInfo.m
./usr/local/mdsplus/matlab/mdsToMatlab.m
./usr/local/mdsplus/matlab/mdsUsePython.m
./usr/local/mdsplus/matlab/mdsclose.m
./usr/local/mdsplus/matlab/mdsconnect.m
./usr/local/mdsplus/matlab/mdsdisconnect.m
./usr/local/mdsplus/matlab/mdsFromMatlab.m
./usr/local/mdsplus/matlab/mdsgetmsg.m
./usr/local/mdsplus/matlab/mdsInfo.m
./usr/local/mdsplus/matlab/mdsopen.m
./usr/local/mdsplus/matlab/MDSplusAPI.m
./usr/local/mdsplus/matlab/mdsput.m
./usr/local/mdsplus/matlab/mdstcl.m
./usr/local/mdsplus/matlab/mdstest.m
./usr/local/mdsplus/matlab/mdsToMatlab.m
./usr/local/mdsplus/matlab/mdsUsePython.m
./usr/local/mdsplus/matlab/mdsvalue.m
./usr/local/mdsplus/matlab/private/javaActivate.m
./usr/local/mdsplus/matlab/private/javaConnect.m
Expand All @@ -21,4 +21,4 @@
./usr/local/mdsplus/matlab/private/pythonConnect.m
./usr/local/mdsplus/matlab/private/pythonExecute.m
./usr/local/mdsplus/matlab/private/pythonFromMatlab.m
./usr/local/mdsplus/matlab/private/pythonToMatlab.m
./usr/local/mdsplus/matlab/private/pythonToMatlab.m
2 changes: 2 additions & 0 deletions deploy/packaging/debian/rfxdevices.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
./usr/local/mdsplus/pydevices/RfxDevices/CAENV1740.py
./usr/local/mdsplus/pydevices/RfxDevices/CONTIPPSETUP.py
./usr/local/mdsplus/pydevices/RfxDevices/CRIO_FAU.py
./usr/local/mdsplus/pydevices/RfxDevices/CRIO_MPAG.py
./usr/local/mdsplus/pydevices/RfxDevices/CYGNET4K.py
./usr/local/mdsplus/pydevices/RfxDevices/DEMOADC.py
./usr/local/mdsplus/pydevices/RfxDevices/DEMOSTREAM.py
Expand Down Expand Up @@ -87,6 +88,7 @@
./usr/local/mdsplus/pydevices/RfxDevices/NI6259AI.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6259EV.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6368AI.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6368EV.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6682.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6683.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6683REC.py
Expand Down
2 changes: 1 addition & 1 deletion deploy/packaging/redhat/kernel.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@
./usr/local/mdsplus/tdi/python/addfun.py
./usr/local/mdsplus/tdi/python/ctime.py
./usr/local/mdsplus/tdi/python/getShotDB.py
./usr/local/mdsplus/tdi/python/influxSignal.py
./usr/local/mdsplus/tdi/python/intersect1d.py
./usr/local/mdsplus/tdi/python/pyfun.py
./usr/local/mdsplus/tdi/python/setdiff1d.py
./usr/local/mdsplus/tdi/python/influxSignal.py
./usr/local/mdsplus/tdi/remote
./usr/local/mdsplus/tdi/remote/GetManyExecute.fun
./usr/local/mdsplus/tdi/remote/ListConnections.fun
Expand Down
12 changes: 6 additions & 6 deletions deploy/packaging/redhat/matlab.noarch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
./usr/local/mdsplus/matlab
./usr/local/mdsplus/matlab/MDSplusAPI.m
./usr/local/mdsplus/matlab/mdsFromMatlab.m
./usr/local/mdsplus/matlab/mdsInfo.m
./usr/local/mdsplus/matlab/mdsToMatlab.m
./usr/local/mdsplus/matlab/mdsUsePython.m
./usr/local/mdsplus/matlab/mdsclose.m
./usr/local/mdsplus/matlab/mdsconnect.m
./usr/local/mdsplus/matlab/mdsdisconnect.m
./usr/local/mdsplus/matlab/mdsFromMatlab.m
./usr/local/mdsplus/matlab/mdsgetmsg.m
./usr/local/mdsplus/matlab/mdsInfo.m
./usr/local/mdsplus/matlab/mdsopen.m
./usr/local/mdsplus/matlab/MDSplusAPI.m
./usr/local/mdsplus/matlab/mdsput.m
./usr/local/mdsplus/matlab/mdstcl.m
./usr/local/mdsplus/matlab/mdstest.m
./usr/local/mdsplus/matlab/mdsToMatlab.m
./usr/local/mdsplus/matlab/mdsUsePython.m
./usr/local/mdsplus/matlab/mdsvalue.m
./usr/local/mdsplus/matlab/private
./usr/local/mdsplus/matlab/private/javaActivate.m
Expand All @@ -23,4 +23,4 @@
./usr/local/mdsplus/matlab/private/pythonConnect.m
./usr/local/mdsplus/matlab/private/pythonExecute.m
./usr/local/mdsplus/matlab/private/pythonFromMatlab.m
./usr/local/mdsplus/matlab/private/pythonToMatlab.m
./usr/local/mdsplus/matlab/private/pythonToMatlab.m
2 changes: 2 additions & 0 deletions deploy/packaging/redhat/rfxdevices.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
./usr/local/mdsplus/pydevices/RfxDevices/CAENV1740.py
./usr/local/mdsplus/pydevices/RfxDevices/CONTIPPSETUP.py
./usr/local/mdsplus/pydevices/RfxDevices/CRIO_FAU.py
./usr/local/mdsplus/pydevices/RfxDevices/CRIO_MPAG.py
./usr/local/mdsplus/pydevices/RfxDevices/CYGNET4K.py
./usr/local/mdsplus/pydevices/RfxDevices/DEMOADC.py
./usr/local/mdsplus/pydevices/RfxDevices/DEMOSTREAM.py
Expand Down Expand Up @@ -88,6 +89,7 @@
./usr/local/mdsplus/pydevices/RfxDevices/NI6259AI.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6259EV.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6368AI.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6368EV.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6682.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6683.py
./usr/local/mdsplus/pydevices/RfxDevices/NI6683REC.py
Expand Down
170 changes: 38 additions & 132 deletions device_support/national/AsyncStoreManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,6 @@
pthread_mutex_t globalMutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t segmentMutex = PTHREAD_MUTEX_INITIALIZER;

// Support class for enqueueing storage requests
/*
class SaveItem {
void *buffer;
char dataType;
int bufSize;
int sampleToRead;
int segmentSize;
int counter;
int dataNid;
int resampledNid;
int clockNid;
float timeIdx0;
void *treePtr;
SaveItem *nxt;
char *eventName;
int streamFactor;
double period;
TreeNode *dataNode;
TreeNode *clockNode;
TreeNode *resampledNode;
char *streamName;
float streamGain;
float streamOffset;
int shot;
int gain;
int numCoeffs;
float *coeffs;
public:
*/
SaveItem::SaveItem(void *buffer, int bufSize, int sampleToRead, char dataType,
int segmentSize, int counter, int dataNid, int clockNid,
float timeIdx0, void *treePtr, int shot, int streamFactor,
Expand Down Expand Up @@ -61,71 +31,28 @@ SaveItem::SaveItem(void *buffer, int bufSize, int sampleToRead, char dataType,
this->numCoeffs = numCoeffs;
this->coeffs = coeffs;
nxt = 0;
/*
dataNode = new TreeNode(dataNid, (Tree *)treePtr);
clockNode = new TreeNode(clockNid, (Tree *)treePtr);
resampledNode = NULL;
if (resampledNid > 0)
resampledNode = new TreeNode(resampledNid, (Tree *)treePtr);
*/
}

/***********
void setNext(SaveItem *itm)
{
nxt = itm;
}

SaveItem *getNext()
{
return nxt;
}
int getShot() { return shot;}
Tree *getTree() { return(Tree *)treePtr;}
int getDataNid() {return dataNid;}


vector<string> split(const char *str, char c = ' ')
{
vector<string> result;

do
{
const char *begin = str;

while(*str != c && *str)
str++;
void SaveItem::save()
{

result.push_back(string(begin, str));
} while (0 != *str++);
Tree *tree = new Tree( ((Tree *)treePtr)->getName(), ((Tree *)treePtr)->getShot());

return result;
}
dataNode = new TreeNode(dataNid, tree);
clockNode = new TreeNode(clockNid, tree);
resampledNode = NULL;
if (resampledNid > 0)
resampledNode = new TreeNode(resampledNid, tree);

void sendChannelSegmentPutEvent(TreeNode *dataNode)
{
try
{
char *path;
vector<string> tokens;
char event[256];
char treeStr[64];

path=dataNode->getPath();
tokens = split((const char *)path, ':');
sprintf(treeStr,"%s", (tokens[0].substr(1)).data());

tokens = split(tokens[tokens.size()-2].data(), '.');
sprintf(event,"%s_%s_CH%s", treeStr, tokens[0].data(),
(tokens[1].substr(8)).data()); Event::setevent(event);
}
catch(MdsException *exc)
{
printf("Send Event Error: %s\n", exc->what());
}
}
***********************/

void SaveItem::save()
{
// Streaming stuff

if (streamName && streamFactor > 0 && (counter % streamFactor) == 0)
Expand Down Expand Up @@ -209,19 +136,12 @@ void SaveItem::save()
Data *startTime;
Data *endTime;
Data *dim;
Tree *tree = (Tree *)treePtr;
//Tree *tree = (Tree *)treePtr;
if (timeIdx0 != timeIdx0) // is a NaN float
{
// printf("Configuration for gclock\n");
// printf("---------------- time at idx 0 NAN\n");
/*
startTime = tree->tdiCompile("begin_of($)+slope_of($)*$", clockNode,
clockNode,startIdx); endTime =
tree->tdiCompile("begin_of($)+slope_of($)*$", clockNode, clockNode,
endIdx); dim = tree->tdiCompile("build_range(begin_of($)+slope_of($)*$,
begin_of($)+slope_of($)*($), slope_of($))", clockNode, clockNode,
startIdx, clockNode, clockNode, endIdx, clockNode);
*/
/*
startTime =
compileWithArgs("NIADCClockSegment($1, $2, $3, 0, 'start_time')",
(Tree *)treePtr, 3, clockNode, startIdx, endIdx);
Expand All @@ -230,17 +150,20 @@ void SaveItem::save()
(Tree *)treePtr, 3, clockNode, startIdx, endIdx);
dim = compileWithArgs("NIADCClockSegment($1, $2, $3, 0, 'dim')",
(Tree *)treePtr, 3, clockNode, startIdx, endIdx);
*/
startTime =
compileWithArgs("NIADCClockSegment($1, $2, $3, 0, 'start_time')",
tree, 3, clockNode, startIdx, endIdx);
endTime =
compileWithArgs("NIADCClockSegment($1, $2, $3, 0, 'end_time')",
tree, 3, clockNode, startIdx, endIdx);
dim = compileWithArgs("NIADCClockSegment($1, $2, $3, 0, 'dim')",
tree, 3, clockNode, startIdx, endIdx);
}
else
{
Data *timeAtIdx0 = new Float32(timeIdx0);
/*
startTime = tree->tdiCompile("$+slope_of($)*$", timeAtIdx0, clockNode,
startIdx); endTime = tree->tdiCompile("$+slope_of($)*$",timeAtIdx0,
clockNode, endIdx); dim = tree->tdiCompile("build_range($+slope_of($)*$,
$+slope_of($)*($), slope_of($))", timeAtIdx0, clockNode, startIdx,
timeAtIdx0, clockNode, endIdx, clockNode);
*/
/*
startTime = compileWithArgs(
"NIADCClockSegment($1, $2, $3, $4, 'start_time')", (Tree *)treePtr, 4,
clockNode, startIdx, endIdx, timeAtIdx0);
Expand All @@ -250,6 +173,16 @@ void SaveItem::save()
dim = compileWithArgs("NIADCClockSegment($1, $2, $3, $4, 'dim')",
(Tree *)treePtr, 4, clockNode, startIdx, endIdx,
timeAtIdx0);
*/
startTime = compileWithArgs(
"NIADCClockSegment($1, $2, $3, $4, 'start_time')", tree, 4,
clockNode, startIdx, endIdx, timeAtIdx0);
endTime = compileWithArgs("NIADCClockSegment($1, $2, $3, $4, 'end_time')",
tree, 4, clockNode, startIdx, endIdx,
timeAtIdx0);
dim = compileWithArgs("NIADCClockSegment($1, $2, $3, $4, 'dim')",
tree, 4, clockNode, startIdx, endIdx,
timeAtIdx0);
}
switch (dataType)
{
Expand Down Expand Up @@ -374,23 +307,10 @@ void SaveItem::save()
}
delete dataNode;
delete clockNode;
delete tree;
}

/*

extern "C" void *handleSave(void *listPtr);

class SaveList
{
public:
pthread_cond_t itemAvailable;
pthread_t thread;
bool threadCreated;
SaveItem *saveHead, *saveTail;
bool stopReq;
pthread_mutex_t mutex;
public:
*/
SaveList::SaveList()
{
int status = pthread_mutex_init(&mutex, NULL);
Expand All @@ -399,21 +319,7 @@ SaveList::SaveList()
stopReq = false;
threadCreated = false;
}
/*
int getQueueLen()
{
pthread_mutex_lock(&mutex);
int len = 0;
SaveItem *currItem = saveHead;
while(currItem)
{
len++;
currItem = currItem->getNext();
}
pthread_mutex_unlock(&mutex);
return len;
}
**/

void SaveList::addItem(void *buffer, int bufSize, int sampleToRead,
char dataType, int segmentSize, int counter, int dataNid,
int clockNid, float trigTime, void *treePtr, int shot,
Expand Down Expand Up @@ -463,8 +369,8 @@ void SaveList::executeItems()
pthread_exit(NULL);
}
/*
int nItems = 0;
for(SaveItem *itm = saveHead; itm; itm = itm->getNext(),
int nItems = 0;
for(SaveItem *itm = saveHead; itm; itm = itm->getNext(),
nItems++); if(nItems > 2) printf("THREAD ACTIVATED: %d items
pending\n", nItems);
*/
Expand All @@ -473,8 +379,8 @@ void SaveList::executeItems()
saveHead = saveHead->getNext();

/*
int nItems = 0;
for(SaveItem *itm = saveHead; itm; itm = itm->getNext(),
int nItems = 0;
for(SaveItem *itm = saveHead; itm; itm = itm->getNext(),
nItems++); if(nItems > 2) printf("THREAD ACTIVATED: %d items pending\n",
nItems);
*/
Expand Down
6 changes: 4 additions & 2 deletions device_support/national/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CFLAGS_RELEASE := -fPIC -O3
LDFLAGS_RELEASE =

CFLAGS = -fPIC -O3 -I${MDSPLUS_DIR}/include -I${CODAC_ROOT}/include -std=c++11
LDFLAGS = -fPIC -O0 -L${MDSPLUS_DIR}/lib -L${CODAC_ROOT}/lib/ -lm -lNiFpga -lpxi6259 -lnixseries -lpthread -lMdsObjectsCppShr
LDFLAGS = -fPIC -O0 -L${MDSPLUS_DIR}/lib -L${CODAC_ROOT}/lib/ -lm -lNiFpga -lpxi6259 -lnixseries -lpthread -lMdsObjectsCppShr -ltcn

# Debug builds (make debug)

Expand All @@ -29,7 +29,7 @@ SOURCES_EXE=generateWave.cpp probeTermControl.cpp startStopTermControl.cpp writ
BIN = $(patsubst %.cpp,%,$(SOURCES_EXE))


all: libNiInterface $(EXE_PROGRAM)
all: libNiInterface $(EXE_PROGRAM) ni6683_info


libNiInterface : $(OBJECTS)
Expand All @@ -41,6 +41,8 @@ libNiInterface : $(OBJECTS)
$(BIN): $(SOURCES_EXE)
$(CC) $(LDFLAGS) -L . -lNiInterface $(CFLAGS) -o $@ $@.cpp

ni6683_info : ni6683_info.c
$(CC) -L${CODAC_ROOT}/lib -lnisync $(CFLAGS) -o $@ $@.c

clean:
rm -f $(OBJECTS)
Expand Down
Loading