Skip to content

Commit

Permalink
Merge pull request #6 from sdcTools/master
Browse files Browse the repository at this point in the history
Commit Anco's changes: Overlappign variables, Apriori filename bug, w…
  • Loading branch information
ppdewolf committed Nov 10, 2016
2 parents bd807ef + db135c9 commit db06d42
Show file tree
Hide file tree
Showing 18 changed files with 62 additions and 338 deletions.
11 changes: 10 additions & 1 deletion _TauChanges.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ date : Oct 18, 2016 3:45:15 PM
summary : Length code-names spanning variables for hypercube dynamic

date : Oct 18, 2016
summary : Correctly resetting file-format (free/fixed) when changing in one session
summary : Correctly resetting file-format (free/fixed) when changing in one session

date : Nov 3, 2016
summary : Overlapping variables in fixed format allowed

date : Nov 7, 2016
summary : Apriori filename bug repaired

date : Nov 10, 2016
summary : Display error message when using special characters (accents)
2 changes: 1 addition & 1 deletion src/tauargus/gui/DialogSpecifyMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private void buttonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
metadata.verify();
}
catch (ArgusException ex) {
JOptionPane.showMessageDialog(this, ex.getMessage());
if (!ex.getMessage().isEmpty()){JOptionPane.showMessageDialog(this, ex.getMessage());}
return;
}
//It looks a bit weird, but the PanelEditVariable stores the new statusses in oldmetadata.
Expand Down
2 changes: 1 addition & 1 deletion src/tauargus/gui/FrameMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void actionPerformed(ActionEvent actionEvent) {
// Anco 1.6
// } catch (ArgusException | FileNotFoundException ex) {
} catch (ArgusException ex) {
JOptionPane.showMessageDialog(FrameMain.this, ex.getMessage());}
if (!ex.getMessage().isEmpty()){JOptionPane.showMessageDialog(FrameMain.this, ex.getMessage());}}
catch ( FileNotFoundException ex) {
JOptionPane.showMessageDialog(FrameMain.this, ex.getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion src/tauargus/model/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public class Application {
// for interfacing with C++ dll
static {
System.loadLibrary("tauhitas");
System.loadLibrary("TauArgusJava");
System.loadLibrary("TauRounder");
System.loadLibrary("TauArgusJava");
// System.loadLibrary("XXRoundCom");
// System.loadLibrary("libTauRounder");
// System.loadLibrary("TauArgusJava");
Expand Down
16 changes: 13 additions & 3 deletions src/tauargus/model/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import argus.utils.SystemUtils;
//import tauargus.utils.Tokenizer;
import argus.utils.Tokenizer;
import static tauargus.utils.TauArgusUtils.ShowWarningMessage;

public class Metadata implements Cloneable {
public static final int DATA_ORIGIN_MICRO = 1;
Expand Down Expand Up @@ -713,7 +714,8 @@ public void write(String fileName) {
}

public void verify() throws ArgusException {
if (variables.isEmpty()) {
boolean overlapFound = false; String overlapString = "";
if (variables.isEmpty()) {
throw new ArgusException("No variables have been specified.");
}

Expand Down Expand Up @@ -755,8 +757,11 @@ public void verify() throws ArgusException {
int b2 = variable2.bPos;
int e2 = b2 + variable2.varLen;
if (b2 < e1 && e2 > b1) {
throw new ArgusException("Variable " + variable.name + " and variable " + variable2.name + " overlap.");
}
// throw new ArgusException("Variable " + variable.name + " and variable " + variable2.name + " overlap.");
if (overlapFound) {overlapString = overlapString + "\n";}
overlapFound = true;
overlapString = overlapString + "Variable " + variable.name + " and variable " + variable2.name + " overlap.";
}
if (StringUtils.equalsIgnoreCase(variable.name, variable2.name)) {
throw new ArgusException("Variable" + i + " and variable" + j + " have the same name.");
}
Expand Down Expand Up @@ -802,6 +807,11 @@ public void verify() throws ArgusException {
throw new ArgusException("There is no request code specified for variable" + variable.name + ".");
}
}
}
if (overlapFound){int i = ShowWarningMessage(overlapString);
if (i == 0 ) {
throw new ArgusException(""); //overlapString);
}
}
}

Expand Down
24 changes: 17 additions & 7 deletions src/tauargus/model/SaveTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,38 @@ public class SaveTable {
static public void writeTable(final TableSet tableSet, int selectedFormat)throws ArgusException{
int respType = 0;
String hs;
Boolean oke= true;
int[] dimSequence = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
if (tableSet.rounded ){respType = 1;}
if (tableSet.ctaProtect) {respType = 2;}
switch (selectedFormat) {
case TableSet.FILE_FORMAT_CSV:
if (!tauArgus.WriteCSV(tableSet.index, tableSet.safeFileName, dimSequence, respType)){
throw new ArgusException ("An unexpected error occurred when writing the CVS file to"+
throw new ArgusException ("An unexpected error occurred when writing the CVS file to "+
tableSet.safeFileName);
}
break;
case TableSet.FILE_FORMAT_PIVOT_TABLE:
hs = makeFirstLine(tableSet, respType);
tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 0,
false, writeSupppressEmpty, hs, writeAddStatus, respType);
if (!tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 0,
false, writeSupppressEmpty, hs, writeAddStatus, respType)){
throw new ArgusException ("An unexpected error occurred when writing the CVS file to "+
tableSet.safeFileName);
}
break;
case TableSet.FILE_FORMAT_CODE_VALUE:
tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 0,
false, writeSupppressEmpty, "", writeAddStatus, respType);
if (!tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 0,
false, writeSupppressEmpty, "", writeAddStatus, respType)){
throw new ArgusException ("An unexpected error occurred when writing the Code-value file to "+
tableSet.safeFileName);
}
break;
case TableSet.FILE_FORMAT_SBS:
tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 1,
writeSBSHierarchicalLevels, true, "", true, respType);
if (!tauArgus.WriteCellRecords(tableSet.index, tableSet.safeFileName, 1,
writeSBSHierarchicalLevels, true, "", true, respType)){
throw new ArgusException ("An unexpected error occurred when writing the SBSS file to "+
tableSet.safeFileName);
}
break;
case TableSet.FILE_FORMAT_INTERMEDIATE:
// The GUI thread (EDT) should not be used for long running tasks,
Expand Down
2 changes: 1 addition & 1 deletion src/tauargus/model/TableSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ public boolean equals(Object obj) {

public void clearHistory(){
if (!Application.isProtectCoverTable()){
TauArgusUtils.DeleteFile(Application.getTempFile("Apriori" + index + "C"));
TauArgusUtils.DeleteFile(Application.getTempFile("Apriori" + index + ".htm"));
TauArgusUtils.DeleteFile(Application.getTempFile("HistStat" + index + ".htm"));
TauArgusUtils.DeleteFile(Application.getTempFile("HistCost" + index + ".htm"));
TauArgusUtils.DeleteFile(Application.getTempFile("HistPL" + index + ".htm"));
Expand Down
Binary file removed src/tauargus/resources/old/4.0.1_SplashScreen.jpg
Binary file not shown.
86 changes: 0 additions & 86 deletions src/tauargus/resources/old/ContextHelp.java

This file was deleted.

Loading

0 comments on commit db06d42

Please sign in to comment.