Octave

    Table of contents
    to the older version or return to version archive.

    Combined revision comparison

    Comparing version 14:24, 8 Apr 2020 by aduarte with version 23:25, 16 Sep 2024 by aduarte.

    ...

    Download the following libraries into a folder of your system:

    Apache XML-RPC
    Apache Jakarta Commons

    Since the server at baco computer uses an older version, if you are planing on accessing it server, you should download this version of SDAS Core Libraries and Client:

    SDAS Core Libraries
    SDAS Client

    If you are using a different server, download these instead:

    SDAS Core Libraries
    SDAS Client

    Add the SDAS libraries to the octave classpath

    These example assume that you have saved all the jar files in the folder /home/user/sdas/

    javaaddpath("/home/user/sdas/SDAS.jar")
    javaaddpath("/home/user/sdas/SDASClient.jar")
    javaaddpath("/home/user/sdas/commons-codec-1.3.jar")
    javaaddpath("/home/user/sdas/xmlrpc-2.0.jar") 

    Beware that on Windows you must use / instead of the regular \. If you have saved all the jar files in the folder C:\sdas\, for example:

    javaaddpath("C:/sdas/SDAS.jar")
    javaaddpath("C:/sdas/SDASClient.jar")
    javaaddpath("C:/sdas/commons-codec-1.3.jar")
    javaaddpath("C:/sdas/xmlrpc-2.0.jar") 
    

    Get a connection to the sdas server

    client = javaObject("org.sdas.core.client.SDASClient", "baco.ipfn.ist.utl.pt", 8888);
    

    Search eventsEdit section

    found = client.searchDeclaredEventsByName('S');
    
    found = client.searchDeclaredEventsByName('SHOTS');
    
    found = client.searchDeclaredEventsByName('SHOT', 'en');
    
    found = client.searchDeclaredEventsByUniqueID('0x0000SHOT', 'en');
    
    found = client.searchDeclaredEventsByDescription('ShotSHOT');
    
    found = client.searchDeclaredEventsByDescription('ShotSHOT', 'en');
    
    for i=1:1:size(found)
        found(i).toString
    end
    
    max = client.searchMaxEventNumber('0x0000')
    
    min = client.searchMinEventNumber('0x0000')
    

    Search events in a time windowEdit section

    NOTE: You can construct time with a resolution of picosseconds, just add to the example values for millis, micros, nanos and picos
    NOTE 2: Date constructors have the months index to 0 (January is 0 and December is 11)

    Search events in December 2005:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 1);
    date_end =  javaObject("org.sdas.core.time.Date", 2005, 11, 31);
    tstart =  javaObject("org.sdas.core.time.TimeStamp", date_start);
    tend =  javaObject("org.sdas.core.time.TimeStamp", date_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end
    

    Search events in the 22 December 2005 between 5pm and 6pm:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 22);
    date_end = javaObject("org.sdas.core.time.Date", 2005,11,22);
    time_start = javaObject("org.sdas.core.time.Time", 17, 0, 0);
    time_end = javaObject("org.sdas.core.time.Time", 18, 0, 0);
    tstart = javaObject("org.sdas.core.time.TimeStamp", date_start, time_start);
    tend = javaObject("org.sdas.core.time.TimeStamp", date_end, time_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end

    Search parametersEdit section

    parametersFound = client.searchParametersByName('DENS');
    
    parametersFound = client.searchParametersByName('DENS', 'pt');
    
    parametersFound = client.searchParametersByUniqueID('DENS');
    
    parametersFound = client.searchParametersByDescription('current');
    
    
    for i = 1:1:size(parametersFound)
        parametersFound(i).toString
    end
    

    Search dataEdit section

    This function returns the parameters unique identifiers where the data isn’t null for the selected event:

    dataFound = client.searchDataByEvent('0x0000', 17898);
    for i = 1:1:size(dataFound)
        dataFound (i)
    end
    

    Get data

    NOTE: The unique identifiers are CASE-SENSITIVE

    The returned data structure gives you information about:

    • start time
    • end time
    • time of the event
    • mime_type
    • the parameter unique identifier

    Data for only one parameter

    dataStructArray=client.getData('POST.PROCESSED.DENSITY','0x0000', 17898)
    dataStruct=dataStructArray(1);
    dens=dataStruct.getData;
    for i=1:length(dens)
    density(i)=dens(i);
    end
    tstart = dataStruct.getTStart;
    tend = dataStruct.getTEnd;
    

    Calculate the time between samples

    tbs= (tend.getTimeInMicros - tstart.getTimeInMicros)/length(density);
    

    Get the events  associated with this data

    events = dataStruct.getEvents;
    

    The event time (I’m assuming the event I want is at the index 0, but I should check first...)

    tevent = events(1).getTimeStamp;
    

    The delay of the start time relative to the event time

    delay = tstart.getTimeInMicros - tevent.getTimeInMicros
    

    Finally create the time array 

    times = delay:tbs:delay+tbs*(length(density)-1);

    And plot the data

    plot(times, density);

    Data for several parameters in the same event

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},'0x0000', 17898)
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 

    Data for several parameters in different events

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different events

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY',{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different event numbers

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY', '0x0000', [17898,17899])
    

    More example code is available on the Octave Code page.

    Version from 14:24, 8 Apr 2020

    This revision modified by aduarte (Ban)

    ...

    Download the following libraries into a folder of your system:

    Apache XML-RPC
    Apache Jakarta Commons

    Since the server at baco computer uses an older version, if you are planing on accessing it server, you should download this version of SDAS Core Libraries and Client:

    SDAS Core Libraries
    SDAS Client

    If you are using a different server, download these instead:

    SDAS Core Libraries
    SDAS Client

    Add the SDAS libraries to the octave classpath

    These example assume that you have saved all the jar files in the folder /home/user/sdas/

    javaaddpath("/home/user/sdas/SDAS.jar")
    javaaddpath("/home/user/sdas/SDASClient.jar")
    javaaddpath("/home/user/sdas/commons-codec-1.3.jar")
    javaaddpath("/home/user/sdas/xmlrpc-2.0.jar") 

    Beware that on Windows you must use / instead of the regular \. If you have saved all the jar files in the folder C:\sdas\, for example:

    javaaddpath("C:/sdas/SDAS.jar")
    javaaddpath("C:/sdas/SDASClient.jar")
    javaaddpath("C:/sdas/commons-codec-1.3.jar")
    javaaddpath("C:/sdas/xmlrpc-2.0.jar") 
    

    Get a connection to the sdas server

    client = javaObject("org.sdas.core.client.SDASClient", "baco.ipfn.ist.utl.pt", 8888);
    

    Search eventsEdit section

    found = client.searchDeclaredEventsByName('S');
    
    found = client.searchDeclaredEventsByName('S');
    
    found = client.searchDeclaredEventsByName('SHOT', 'en');
    
    found = client.searchDeclaredEventsByUniqueID('SHOT', 'en');
    
    found = client.searchDeclaredEventsByDescription('SHOT');
    
    found = client.searchDeclaredEventsByDescription('SHOT', 'en');
    
    for i=1:1:size(found)
        found(i).toString
    end
    
    max = client.searchMaxEventNumber('0x0000')
    
    min = client.searchMinEventNumber('0x0000')
    

    Search events in a time windowEdit section

    NOTE: You can construct time with a resolution of picosseconds, just add to the example values for millis, micros, nanos and picos
    NOTE 2: Date constructors have the months index to 0 (January is 0 and December is 11)

    Search events in December 2005:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 1);
    date_end =  javaObject("org.sdas.core.time.Date", 2005, 11, 31);
    tstart =  javaObject("org.sdas.core.time.TimeStamp", date_start);
    tend =  javaObject("org.sdas.core.time.TimeStamp", date_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end
    

    Search events in the 22 December 2005 between 5pm and 6pm:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 22);
    date_end = javaObject("org.sdas.core.time.Date", 2005,11,22);
    time_start = javaObject("org.sdas.core.time.Time", 17, 0, 0);
    time_end = javaObject("org.sdas.core.time.Time", 18, 0, 0);
    tstart = javaObject("org.sdas.core.time.TimeStamp", date_start, time_start);
    tend = javaObject("org.sdas.core.time.TimeStamp", date_end, time_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end

    Search parametersEdit section

    parametersFound = client.searchParametersByName('DENS');
    
    parametersFound = client.searchParametersByName('DENS', 'pt');
    
    parametersFound = client.searchParametersByUniqueID('DENS');
    
    parametersFound = client.searchParametersByDescription('current');
    
    
    for i = 1:1:size(parametersFound)
        parametersFound(i).toString
    end
    

    Search dataEdit section

    This function returns the parameters unique identifiers where the data isn’t null for the selected event:

    dataFound = client.searchDataByEvent('0x0000', 17898);
    for i = 1:1:size(dataFound)
        dataFound (i)
    end
    

    Get data

    NOTE: The unique identifiers are CASE-SENSITIVE

    The returned data structure gives you information about:

    • start time
    • end time
    • time of the event
    • mime_type
    • the parameter unique identifier

    Data for only one parameter

    dataStructArray=client.getData('POST.PROCESSED.DENSITY','0x0000', 17898)
    dataStruct=dataStructArray(1);
    dens=dataStruct.getData;
    for i=1:length(dens)
    density(i)=dens(i);
    end
    tstart = dataStruct.getTStart;
    tend = dataStruct.getTEnd;
    

    Calculate the time between samples

    tbs= (tend.getTimeInMicros - tstart.getTimeInMicros)/length(density);
    

    Get the events  associated with this data

    events = dataStruct.getEvents;
    

    The event time (I’m assuming the event I want is at the index 0, but I should check first...)

    tevent = events(1).getTimeStamp;
    

    The delay of the start time relative to the event time

    delay = tstart.getTimeInMicros - tevent.getTimeInMicros
    

    Finally create the time array 

    times = delay:tbs:delay+tbs*(length(density)-1);

    And plot the data

    plot(times, density);

    Data for several parameters in the same event

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},'0x0000', 17898)
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 

    Data for several parameters in different events

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different events

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY',{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different event numbers

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY', '0x0000', [17898,17899])
    

    More example code is available on the Octave Code page.

    Current version

    This revision modified by aduarte (Ban)

    ...

    Download the following libraries into a folder of your system:

    Apache XML-RPC
    Apache Jakarta Commons

    Since the server at baco computer uses an older version, if you are planing on accessing it server, you should download this version of SDAS Core Libraries and Client:

    SDAS Core Libraries
    SDAS Client

    If you are using a different server, download these instead:

    SDAS Core Libraries
    SDAS Client

    Add the SDAS libraries to the octave classpath

    These example assume that you have saved all the jar files in the folder /home/user/sdas/

    javaaddpath("/home/user/sdas/SDAS.jar")
    javaaddpath("/home/user/sdas/SDASClient.jar")
    javaaddpath("/home/user/sdas/commons-codec-1.3.jar")
    javaaddpath("/home/user/sdas/xmlrpc-2.0.jar") 

    Beware that on Windows you must use / instead of the regular \. If you have saved all the jar files in the folder C:\sdas\, for example:

    javaaddpath("C:/sdas/SDAS.jar")
    javaaddpath("C:/sdas/SDASClient.jar")
    javaaddpath("C:/sdas/commons-codec-1.3.jar")
    javaaddpath("C:/sdas/xmlrpc-2.0.jar") 
    

    Get a connection to the sdas server

    client = javaObject("org.sdas.core.client.SDASClient", "baco.ipfn.ist.utl.pt", 8888);
    

    Search eventsEdit section

    found = client.searchDeclaredEventsByName('S');
    
    found = client.searchDeclaredEventsByName('SHOT');
    
    found = client.searchDeclaredEventsByName('SHOT', 'en');
    
    found = client.searchDeclaredEventsByUniqueID('0x0000');
    
    found = client.searchDeclaredEventsByDescription('Shot');
    
    found = client.searchDeclaredEventsByDescription('Shot', 'en');
    
    for i=1:1:size(found)
        found(i).toString
    end
    
    max = client.searchMaxEventNumber('0x0000')
    
    min = client.searchMinEventNumber('0x0000')
    

    Search events in a time windowEdit section

    NOTE: You can construct time with a resolution of picosseconds, just add to the example values for millis, micros, nanos and picos
    NOTE 2: Date constructors have the months index to 0 (January is 0 and December is 11)

    Search events in December 2005:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 1);
    date_end =  javaObject("org.sdas.core.time.Date", 2005, 11, 31);
    tstart =  javaObject("org.sdas.core.time.TimeStamp", date_start);
    tend =  javaObject("org.sdas.core.time.TimeStamp", date_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end
    

    Search events in the 22 December 2005 between 5pm and 6pm:

    date_start = javaObject("org.sdas.core.time.Date", 2005, 11, 22);
    date_end = javaObject("org.sdas.core.time.Date", 2005,11,22);
    time_start = javaObject("org.sdas.core.time.Time", 17, 0, 0);
    time_end = javaObject("org.sdas.core.time.Time", 18, 0, 0);
    tstart = javaObject("org.sdas.core.time.TimeStamp", date_start, time_start);
    tend = javaObject("org.sdas.core.time.TimeStamp", date_end, time_end);
    eventsFound = client.searchEventsByEventTimeWindow(tstart, tend);
    for i = 1:1:size(eventsFound)
        eventsFound(i).toString
    end

    Search parametersEdit section

    parametersFound = client.searchParametersByName('DENS');
    
    parametersFound = client.searchParametersByName('DENS', 'pt');
    
    parametersFound = client.searchParametersByUniqueID('DENS');
    
    parametersFound = client.searchParametersByDescription('current');
    
    
    for i = 1:1:size(parametersFound)
        parametersFound(i).toString
    end
    

    Search dataEdit section

    This function returns the parameters unique identifiers where the data isn’t null for the selected event:

    dataFound = client.searchDataByEvent('0x0000', 17898);
    for i = 1:1:size(dataFound)
        dataFound (i)
    end
    

    Get data

    NOTE: The unique identifiers are CASE-SENSITIVE

    The returned data structure gives you information about:

    • start time
    • end time
    • time of the event
    • mime_type
    • the parameter unique identifier

    Data for only one parameter

    dataStructArray=client.getData('POST.PROCESSED.DENSITY','0x0000', 17898)
    dataStruct=dataStructArray(1);
    dens=dataStruct.getData;
    for i=1:length(dens)
    density(i)=dens(i);
    end
    tstart = dataStruct.getTStart;
    tend = dataStruct.getTEnd;
    

    Calculate the time between samples

    tbs= (tend.getTimeInMicros - tstart.getTimeInMicros)/length(density);
    

    Get the events  associated with this data

    events = dataStruct.getEvents;
    

    The event time (I’m assuming the event I want is at the index 0, but I should check first...)

    tevent = events(1).getTimeStamp;
    

    The delay of the start time relative to the event time

    delay = tstart.getTimeInMicros - tevent.getTimeInMicros
    

    Finally create the time array 

    times = delay:tbs:delay+tbs*(length(density)-1);

    And plot the data

    plot(times, density);

    Data for several parameters in the same event

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},'0x0000', 17898)
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 

    Data for several parameters in different events

    dataStruct=client.getMultipleData({'POST.PROCESSED.DENSITY', 'POST.PROCESSED.IPLASMA'},{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different events

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY',{'0x0000','0x0000'}, [17898,17899])
    dataStructDens=dataStruct(1,1);
    dataStructIP=dataStruct(2,1);
    dens=dataStructDens.getData(); 
    ip=dataStructIP.getData(); 
    

    Data for the same parameter in different event numbers

    dataStruct=client.getMultipleData('POST.PROCESSED.DENSITY', '0x0000', [17898,17899])
    

    More example code is available on the Octave Code page.

    Powered by MindTouch Core