Skip to content
Snippets Groups Projects
Commit e8c2fe72 authored by Barbara B. Frosik's avatar Barbara B. Frosik
Browse files

changing experimentSynchronizer

parent 8c165798
No related branches found
No related tags found
No related merge requests found
......@@ -432,7 +432,7 @@ class ExperimentList extends JFrame
}
private String convertDate2Dir(String startDate) throws ParseException {
String month = startDate.substring(0,3);
String month = startDate.substring(3,6);
String numMonth = null;
if (month.equals("JAN")) {
numMonth = "01";
......@@ -459,14 +459,8 @@ class ExperimentList extends JFrame
} else if (month.equals("DEC")) {
numMonth = "12";
}
String agreableStartDate = numMonth + startDate.substring(3, startDate.length());
// parse the date
DateFormat f = new SimpleDateFormat("M-d-y");
Date d = f.parse(agreableStartDate);
// now print the date
DateFormat out = new SimpleDateFormat("yyyy-MM");
return out.format(d);
return "20" + startDate.substring(7, 9) + "-" + numMonth;
}
}
......
......@@ -67,11 +67,16 @@ public final class LoginWindow extends JFrame {
// sconnection.setLogin(user, pass);
// dconnection.setLogin(user, pass);
int aaResult = sconnection.login(user, pass);
if ((dconnection.login(user, pass) != aaResult) || (dconnection.login(user, pass) != aaResult)) {
if (dconnection.login(user, pass) != aaResult) {
JOptionPane.showMessageDialog(null,"inconsistent login response",
"Error",JOptionPane.ERROR_MESSAGE);
return;
}
}
if ((drconnection != null) && (drconnection.login(user, pass) != aaResult)) {
JOptionPane.showMessageDialog(null,"inconsistent login response",
"Error",JOptionPane.ERROR_MESSAGE);
return;
}
switch (aaResult) {
case ServiceConnection.ServiceConnectionStatus.SUCCESS:
setVisible(false);
......
......@@ -34,10 +34,10 @@ public class DaqServiceConnection extends ServiceConnection{
String directory;
String dateDirectory;
if (dataDir.endsWith("/")) {
dateDirectory = dataDir + "/" + startDateDir;
dateDirectory = dataDir + startDateDir;
directory = dataDir + startDateDir + "/" + experimentName;
} else {
dateDirectory = dataDir + startDateDir;
dateDirectory = dataDir + "/" + startDateDir;
directory = dataDir + "/" + startDateDir + "/" + experimentName;
}
......
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