Commit 53958f41 authored by helene ortiz's avatar helene ortiz
Browse files

Extend log process for all token events on all computers (main but also

remote).
parent f1f45a7c
4.0.63 dd/09/2020
------
* Add 2 preference values to restore main window x and y.
4.0.62 14/09/2020
------
* Extend log process for all token events on all computers (main but also remote).
4.0.61 08/09/2020
------
* Improvement: When "view logs" menu displays the message "you must log in to view logs!", automatically opens the login popup.
* Add 2 preference values to restore main window x and y.
* Fix bug: PAL and XBU files were not read properly.
* Fix bug: when synchronizing view state of launchpad (among box view or text view), also synchronize swithview button icon.
* Fix bug: when synchronizing view state of launchpad (among box view or text view), also synchronize switchview button icon.
* Fix bug: delete of an unknown command box in the launch pad did not delete it on server side.
* Keep arrow down and up for combo boxes, add CTRL key to move down/up among command boxes.
* Fix bug: in settings commandbox, combos were not cleared before refresh + (root) directory was not correctly initialised.
......
......@@ -47,8 +47,7 @@ public class TokenManager implements TokenEventListener {
public final static String MAIN = "main";
public final static String TABLET = "tablet";
private static BufferedWriter writer = null;
private static String fileName;
private TokenManager() {
}
......@@ -59,14 +58,12 @@ public class TokenManager implements TokenEventListener {
instance.setTokenState(new OwnedByOtherTokenState());
DataNotificationClient.getInstance().addTokenChangeListener(instance);
if (ConfigManager.getInstance().isMainClient()) {
// Initialise debug file
try {
fileName = ConfigManager.getInstance().getString("logsDirectory") + ConfigManager.FILE_SEPARATOR + "token_" + Nomad.getDateAndTime() + ".log";
writer = Nomad.initFile(fileName);
} catch (IOException e) {
e.printStackTrace();
}
// Initialise debug file
try {
String fileName = ConfigManager.getInstance().getString("logsDirectory") + ConfigManager.FILE_SEPARATOR + "token_" + Nomad.getDateAndTime() + ".log";
writer = Nomad.initFile(fileName);
} catch (IOException e) {
e.printStackTrace();
}
}
......@@ -102,7 +99,7 @@ public class TokenManager implements TokenEventListener {
@Override
public void onTokenChangeEvent(TokenEvent event) {
String owner = null;
log("1. EVENT " + event.getState() + " " + event.getOwnerClientID() + " user " + event.getUser() + " at " + event.getOwnerEndpoint() + " REMOTE CONTROL " + event.getRemoteControlState());
......@@ -140,13 +137,13 @@ public class TokenManager implements TokenEventListener {
// Then, manage token state
boolean tokenStateChanged = true;
boolean ownedByMe = SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getClientId() == event.getOwnerClientID();
log("2. getTokenStateMessage = " + getTokenStateMessage + " getClientID " + SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).getClientId() + " OwnerID " + event.getOwnerClientID() + " ownedByMe " + ownedByMe);
log(" TOKEN STATE IS : " + tokenState);
if (RemoteControlManager.getInstance().isDisabled() && ConfigManager.getInstance().isRemoteClient()) {
tokenStateChanged = !tokenState.isDisabled();
tokenState.setDisabled();
......@@ -176,13 +173,13 @@ public class TokenManager implements TokenEventListener {
}
}
log(" AFTER BIG IF : " + tokenState + " tokenStateChanged " + tokenStateChanged);
if (tokenStateChanged || getTokenStateMessage) {
// Manage enability of menu items
MainWindowPeer.getInstance().manageMenuItemsEnability();
log("3. CALLING getCommandBar().onTokenChangeEvent() " + TokenManager.getInstance().tokenIsOwnedByMe());
// Manage enability of command bar buttons (i.e. launch pad start/stop/pause buttons)
MainWindowPeer.getInstance().getCommandBar().onTokenChangeEvent();
......@@ -247,8 +244,8 @@ public class TokenManager implements TokenEventListener {
PlotyManager.getInstance().restorePlots();
}
}
public void log(String message) {
if (writer != null) {
String logMessage = Nomad.getDateAndTime() + " " + message;
......
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