Commit a47a8725 authored by ExplorViz's avatar ExplorViz

Library update

parent 58e9ffc6
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -41,24 +41,24 @@ public class EmotivController implements ActionListener, WindowListener, ChangeL
if(buttonName == "Train Normal"){
activateActionSkills();
if(this.emotivThread.getStopped()){
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_NEUTRAL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_NEUTRAL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
}else{
this.emotivThread.stopWorking();
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_NEUTRAL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_NEUTRAL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
this.emotivThread.continueWorking();
}
}
else if(buttonName == "Train MentalPush"){
activateActionSkills();
if(this.emotivThread.getStopped()){
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_PUSH.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_PUSH.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
}else{
this.emotivThread.stopWorking();
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_PUSH.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_PUSH.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
this.emotivThread.continueWorking();
}
}
......@@ -66,12 +66,12 @@ public class EmotivController implements ActionListener, WindowListener, ChangeL
else if(buttonName == "Train MentalPull"){
activateActionSkills();
if(this.emotivThread.getStopped()){
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_LIFT.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_PULL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
}else{
this.emotivThread.stopWorking();
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(0, EmoState.IEE_MentalCommandAction_t.MC_PULL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingAction(4096, EmoState.IEE_MentalCommandAction_t.MC_PULL.ToInt());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_START.getType());
this.emotivThread.continueWorking();
}
}
......@@ -99,13 +99,13 @@ public class EmotivController implements ActionListener, WindowListener, ChangeL
}
else if(buttonName == "<html><span color='green'>Accept Training</span></html>"){
this.emotivThread.stopWorking();
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_ACCEPT.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_ACCEPT.getType());
Edk.INSTANCE.IEE_EngineClearEventQueue(0x0040);
this.emotivThread.continueWorking();
}
else if(buttonName == "<html><span color='red'>Decline Training</span></html>"){
this.emotivThread.stopWorking();
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(0, Edk.IEE_MentalCommandTrainingControl_t.MC_REJECT.getType());
Edk.INSTANCE.IEE_MentalCommandSetTrainingControl(4096, Edk.IEE_MentalCommandTrainingControl_t.MC_REJECT.getType());
Edk.INSTANCE.IEE_EngineClearEventQueue(0x0040);
this.emotivThread.continueWorking();
}
......@@ -127,9 +127,9 @@ public class EmotivController implements ActionListener, WindowListener, ChangeL
shallBeActivated += EmoState.IEE_MentalCommandAction_t.MC_PULL.ToInt();
shallBeActivated += EmoState.IEE_MentalCommandAction_t.MC_PUSH.ToInt();
NativeLongByReference activeActions = new NativeLongByReference();
Edk.INSTANCE.IEE_MentalCommandGetActiveActions(0, activeActions);
Edk.INSTANCE.IEE_MentalCommandGetActiveActions(4096, activeActions);
if(activeActions.getValue().intValue() != shallBeActivated) {
Edk.INSTANCE.IEE_MentalCommandSetActiveActions(0, shallBeActivated);
Edk.INSTANCE.IEE_MentalCommandSetActiveActions(4096, shallBeActivated);
}
}
......
......@@ -6,6 +6,7 @@ import com.emotiv.Iedk.Edk;
import com.emotiv.Iedk.EdkErrorCode;
import com.emotiv.Iedk.EmoState;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import View.EmotivGUI;
......@@ -109,6 +110,8 @@ public class EmotivInit extends AbstractEmotiv {
updateGUI();
}
if(this.state == 0){ //Gibt an, dass das Eingangssignal in Ordnung ist. EDK_OK
IntByReference userID = new IntByReference();
Edk.INSTANCE.IEE_EmoEngineEventGetUserId(this.eEvent, userID);
emoType(); //Behandelt den Emotypen und handelt dementsprechend
}
}
......
......@@ -236,26 +236,52 @@ public interface Edk extends Library {
public int scopes; // license type
public int date_from; // epoch time //maximum date : 07 Feb 2106
public int date_to; // epoch time
public int seat_count; // number of seat
public int quotaDayLimit; // session limit in day
public int usedQuotaDay; // session used in day
public int quotaMonthLimit; // session limit in month
public int usedQuotaMonth; // session used in month
public int usedQuota; // total session used
public int quota; // total session in the license
public int soft_limit_date; // need authorize the license, then your current quota will be reset to the debit number
// if not, you can still use current quota to hard_limit_date
public int hard_limit_date; // After this date. Your current quota will be reset to 0 and stop using the library
public int seat_count; // number of seat
public int usedQuota; // total session used
public int quota; // total session in the license
//@Override
@Override
protected List<String> getFieldOrder() {
// TODO Auto-generated method stub
return Arrays.asList(new String[] { "scopes", "date_from", "date_to", "soft_limit_date","hard_limit_date", "seat_count" , "usedQuota",
"quota"});
}
}
public static class DebitInfos_t extends Structure {
public static class ByReference extends DebitInfos_t implements Structure.ByReference {}
public int remainingSessions; // remaining session number of the license
public int daily_debit_limit; // the max of session debit number per day
public int total_debit_today; // the number of session debited today
public int time_reset; // time to reset daily debit (seconds)
//@Override
@Override
protected List<String> getFieldOrder() {
// TODO Auto-generated method stub
return Arrays.asList(new String[] { "scopes", "date_from", "date_to", "seat_count","quotaDayLimit", "usedQuotaDay" , "quotaMonthLimit",
"usedQuotaMonth","usedQuota","quota" });
return Arrays.asList(new String[] { "remainingSessions", "daily_debit_limit", "total_debit_today", "time_reset"});
}
}
//! Check infos of the license
//! Check infos of the debit
/*!
* \param licenseID - License key
* \param debitInfo - debit information
* \return EDK_ERROR_CODE
* EDK_OK
* \sa IedkErrorCode.h
*/
public int IEE_GetDebitInformation(String licenseID, DebitInfos_t.ByReference debitInfo);
//! Check infos of the license
/*!
* \param licenseInfo - License Information
* \return EDK_ERROR_CODE
......@@ -271,15 +297,17 @@ public interface Edk extends Library {
*/
public int IEE_LicenseInformation(LicenseInfos_t.ByReference licenseInfo);
//! Authorize a license with a session debit number
/*!
\param licenseID - License key
\param debitNum - Indicates number of sessions will be deducted from license
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
//! Activate a license with license ID
/*
* \param licenseID - License ID
* \return EDK_ERROR_CODE
* - EDK_OK if the command succeeded
* \sa IedkErrorCode.h
\sa IedkErrorCode.h
*/
int IEE_ActivateLicense(String licenseID);
int IEE_AuthorizeLicense(String licenseID, int debitNum);
// ! Initializes the connection to EmoEngine. This function should be called
......
......@@ -76,7 +76,7 @@ public enum EdkErrorCode {
EDK_COULDNT_CONNECT(0x1003),
//! Profile created by EDK_SaveUserProfile() is existed in Emotiv Cloud.
EDK_PROFILE_CLOUD_EXISTED(0x1010),
EDK_CLOUD_PROFILE_EXISTS(0x1010),
//! The file uploaded to cloud is failed
EDK_UPLOAD_FAILED(0x1011),
......@@ -119,11 +119,11 @@ public enum EdkErrorCode {
//! The license is over quota
EDK_OVER_QUOTA(0x2013),
//! The license is over quota in day
EDK_OVER_QUOTA_IN_DAY(0x2014),
//! Debit number is invalid
EDK_INVALID_DEBIT_ERROR(0x2014),
//! The license is over quota in month
EDK_OVER_QUOTA_IN_MONTH(0x2015),
//! Device list of the license is over
EDK_OVER_DEVICE_LIST(0x2015),
EDK_APP_QUOTA_EXCEEDED(0x2016),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment