Skip to content
Snippets Groups Projects
Commit d255cbf3 authored by Stéphane  DALLONGEVILLE's avatar Stéphane DALLONGEVILLE
Browse files

Minors changes + fix on config refresh

parent 7683de19
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,6 @@ public class ConfigurationPanel extends JPanel ...@@ -44,7 +44,6 @@ public class ConfigurationPanel extends JPanel
final Runnable configsRefresher; final Runnable configsRefresher;
final Runnable groupRefresher; final Runnable groupRefresher;
String groupNameRefresh; String groupNameRefresh;
String configNameRefresh;
boolean fromCacheRefresh; boolean fromCacheRefresh;
/** /**
...@@ -84,17 +83,28 @@ public class ConfigurationPanel extends JPanel ...@@ -84,17 +83,28 @@ public class ConfigurationPanel extends JPanel
@Override @Override
public void run() public void run()
{ {
// keep it cool :) // wait for config to be loaded..
ThreadUtil.sleep(20); ThreadUtil.sleep(300);
ThreadUtil.invokeLater(new Runnable() try
{ {
@Override // get config name
public void run() final String configName = getCore().getCurrentConfig(groupNameRefresh);
ThreadUtil.invokeLater(new Runnable()
{ {
refresgGroupNow(groupNameRefresh, configNameRefresh); @Override
} public void run()
}); {
refresgGroupNow(groupNameRefresh, configName);
}
});
}
catch (Exception e)
{
System.err.print(e.getMessage());
}
} }
}; };
} }
...@@ -392,15 +402,14 @@ public class ConfigurationPanel extends JPanel ...@@ -392,15 +402,14 @@ public class ConfigurationPanel extends JPanel
return getMMStudio().getCore(); return getMMStudio().getCore();
} }
public void refresgGroupNow(String groupName, String configName) public void refresgGroupNow(String group, String config)
{ {
groupPad.refreshGroup(groupNameRefresh, configNameRefresh); groupPad.refreshGroup(group, config);
} }
public void refreshGroup(String groupName, String configName) public void refreshGroup(String group)
{ {
groupNameRefresh = groupName; groupNameRefresh = group;
configNameRefresh = configName;
ThreadUtil.bgRunSingle(groupRefresher); ThreadUtil.bgRunSingle(groupRefresher);
} }
......
...@@ -680,7 +680,7 @@ public class MMMainFrame extends IcyFrame ...@@ -680,7 +680,7 @@ public class MMMainFrame extends IcyFrame
* *
* @param filePath * @param filePath
*/ */
void loadConfig(final String filePath) public void loadConfig(final String filePath)
{ {
// show loading message // show loading message
final LoadingFrame loadingFrame = new LoadingFrame( final LoadingFrame loadingFrame = new LoadingFrame(
...@@ -829,7 +829,7 @@ public class MMMainFrame extends IcyFrame ...@@ -829,7 +829,7 @@ public class MMMainFrame extends IcyFrame
preferences.putBoolean(ID_DISPLAYACQ, value); preferences.putBoolean(ID_DISPLAYACQ, value);
} }
void refreshGUI() public void refreshGUI()
{ {
if (cameraPanel != null) if (cameraPanel != null)
cameraPanel.refresh(); cameraPanel.refresh();
...@@ -837,7 +837,7 @@ public class MMMainFrame extends IcyFrame ...@@ -837,7 +837,7 @@ public class MMMainFrame extends IcyFrame
acquisitionInfoPanel.refresh(); acquisitionInfoPanel.refresh();
} }
void refreshConfigs() public void refreshConfigs()
{ {
if (configPanel != null) if (configPanel != null)
configPanel.refreshConfigs(false); configPanel.refreshConfigs(false);
...@@ -961,6 +961,8 @@ public class MMMainFrame extends IcyFrame ...@@ -961,6 +961,8 @@ public class MMMainFrame extends IcyFrame
@Override @Override
public void onConfigGroupChanged(String groupName, String newConfig) public void onConfigGroupChanged(String groupName, String newConfig)
{ {
if (configPanel != null)
configPanel.refreshGroup(groupName);
if (acquisitionInfoPanel != null) if (acquisitionInfoPanel != null)
acquisitionInfoPanel.refresh(); acquisitionInfoPanel.refresh();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment