Skip to content

Commit

Permalink
Merge pull request #61 from kbuma/issue-44-remove-gproms
Browse files Browse the repository at this point in the history
remove code related to gproms support
  • Loading branch information
kbuma authored Jun 13, 2024
2 parents 52b299b + ed449fa commit ae5a378
Show file tree
Hide file tree
Showing 101 changed files with 17 additions and 20,681 deletions.
5 changes: 0 additions & 5 deletions Master/AspenSinterGUI/OpenFilePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
an Aspen Custom Modeler file (.acmf)
</Paragraph>
</ListItem>
<ListItem>
<Paragraph>
an PSE gPROMS file (.gPJ)
</Paragraph>
</ListItem>
<ListItem>
<Paragraph>
a Microsoft Excel file (.xlsm, .xls, or .xlsx)
Expand Down
52 changes: 2 additions & 50 deletions Master/AspenSinterGUI/Presenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protected virtual void OnPropertyChanged(string strPropertyName)
public sinter.sinter_SimACM o_acm = null; //Only set if sim is an ACM
public sinter.sinter_SimAspen o_aspenplus = null; //Only set if sim is an aspenplus
public sinter.sinter_SimExcel o_excel = null; //Only set if sim is a excel
public sinter.PSE.sinter_simGPROMSconfig o_gproms = null; //Only set if sim is gPROMS

private bool o_saveable = true; //Should we try to save? Occasionally we want to turn off saving
public BackgroundWorker worker; //our bg worker for doing long tasks
Expand Down Expand Up @@ -579,28 +578,18 @@ public sinter.sinter_Sim sim
o_acm = (sinter.sinter_SimACM)o_sim;
o_aspenplus = null;
o_excel = null;
o_gproms = null;
}
else if (o_sim is sinter.sinter_SimAspen)
{
o_aspenplus = (sinter.sinter_SimAspen)o_sim;
o_acm = null;
o_excel = null;
o_gproms = null;
}
else if (o_sim is sinter.sinter_SimExcel)
{
o_excel = (sinter.sinter_SimExcel)o_sim;
o_acm = null;
o_aspenplus = null;
o_gproms = null;
}
else if (o_sim is sinter.PSE.sinter_simGPROMSconfig)
{
o_gproms = (sinter.PSE.sinter_simGPROMSconfig)o_sim;
o_acm = null;
o_aspenplus = null;
o_excel = null;
}
else
{
Expand Down Expand Up @@ -983,20 +972,6 @@ public string checkACMSettings()
return null;
}

public string checkgPROMSErrors()
{
String error = null;
foreach (VariableViewModel vv in allVariables)
{
if (vv.path.Contains("__"))
{
error = String.Format("WARNING: Variable path {0} contains double underscores. This could indicate a bug in your gPROMS file.\n If your Foriegn Object reference looks like this VAR = FO.<Type>__VAR; gPROMS and SimSinter will not interpret it correctly.\n You must have parenthesis '()' at the end of the reference.\n See the SimSinter gPROMS Technical Manual Section 5.3.\n", vv.path);
break;
}
}
return error;
}

#endregion errors

#region commands
Expand All @@ -1009,7 +984,7 @@ public void OpenFileBrowserCommand_CanExecute(object sender, CanExecuteRoutedEve
public void OpenFileBrowserCommand_Executed(object sender, ExecutedRoutedEventArgs args)
{
Microsoft.Win32.OpenFileDialog _fd = new Microsoft.Win32.OpenFileDialog();
_fd.Filter = "All SimSinter Files (*.json,*.txt,*.bkp,*.apw,*.acmf,*.xlsm,*.gPJ)|*.json;*.txt;*.bkp;*.apw;*.acmf;*.xlsm;*.xls;*.xlsx;*.gPJ|AspenSinter Configs(*.json,*.txt)|*.json;*.txt|Aspen Plus Files(*.bkp,*.apw)|*.bkp;*.apw|Aspen Custom Modeler|*.acmf|gPROMS|*.gPJ|Excel Files|*.xlsm;*.xls;*.xlsx|All Files(*.*)|*.*"; // Filter files by extension
_fd.Filter = "All SimSinter Files (*.json,*.txt,*.bkp,*.apw,*.acmf,*.xlsm)|*.json;*.txt;*.bkp;*.apw;*.acmf;*.xlsm;*.xls;*.xlsx|AspenSinter Configs(*.json,*.txt)|*.json;*.txt|Aspen Plus Files(*.bkp,*.apw)|*.bkp;*.apw|Aspen Custom Modeler|*.acmf|Excel Files|*.xlsm;*.xls;*.xlsx|All Files(*.*)|*.*"; // Filter files by extension

// Show open file dialog box
Nullable<bool> result = _fd.ShowDialog();
Expand Down Expand Up @@ -1094,29 +1069,12 @@ public void OpenCommand_Executed(object sender, ExecutedRoutedEventArgs args)
sim.configFileVersion = new Version(sim.configFileVersion.Major, sim.configFileVersion.Minor + 1);


}
else if (extension == ".gencrypt")
{
displayError("gPROMS .gencrypt files cannot be read by SinterConfigGUI. Please supply a .gPJ file.");
}
else if (extension == ".gpj" || extension == ".gPJ")
{
sinter.PSE.sinter_simGPROMSconfig thisGPROMS = new sinter.PSE.sinter_simGPROMSconfig();
thisGPROMS.setupFile = new sinter.sinter_JsonSetupFile();
thisGPROMS.setupFile.aspenFilename = System.IO.Path.GetFileName(filename);
thisGPROMS.setupFile.simDescFile = System.IO.Path.GetFileName(filename);
sim = thisGPROMS;
sim.workingDir = System.IO.Path.GetDirectoryName(filename);
metaDataStatusText = openedSimFile;


}
else if (extension == ".bkp" || extension == ".apw")
{
sinter.sinter_SimAspen thisAspen = new sinter.sinter_SimAspen();
thisAspen.setupFile = new sinter.sinter_JsonSetupFile();
thisAspen.setupFile.aspenFilename = System.IO.Path.GetFileName(filename);
thisAspen.setupFile.simDescFile = System.IO.Path.GetFileName(filename);
sim = thisAspen;
sim.workingDir = System.IO.Path.GetDirectoryName(filename);
metaDataStatusText = openedSimFile;
Expand All @@ -1128,7 +1086,6 @@ public void OpenCommand_Executed(object sender, ExecutedRoutedEventArgs args)
sinter.sinter_SimACM thisAspen = new sinter.sinter_SimACM();
thisAspen.setupFile = new sinter.sinter_JsonSetupFile();
thisAspen.setupFile.aspenFilename = System.IO.Path.GetFileName(filename);
thisAspen.setupFile.simDescFile = System.IO.Path.GetFileName(filename);
sim = thisAspen;
sim.workingDir = System.IO.Path.GetDirectoryName(filename);
metaDataStatusText = openedSimFile;
Expand All @@ -1139,7 +1096,6 @@ public void OpenCommand_Executed(object sender, ExecutedRoutedEventArgs args)
sinter.sinter_SimExcel thisAspen = new sinter.sinter_SimExcel();
thisAspen.setupFile = new sinter.sinter_JsonSetupFile();
thisAspen.setupFile.aspenFilename = System.IO.Path.GetFileName(filename);
thisAspen.setupFile.simDescFile = System.IO.Path.GetFileName(filename);
sim = thisAspen;
sim.workingDir = System.IO.Path.GetDirectoryName(filename);
metaDataStatusText = openedSimFile;
Expand Down Expand Up @@ -1436,7 +1392,7 @@ public void PreviewVariable_Executed(object sender, ExecutedRoutedEventArgs args

public void PreviewToInput_CanExecute(object sender, CanExecuteRoutedEventArgs args)
{
args.CanExecute = (previewVariable.Count > 0 && o_gproms == null); //Can't make inputs in gproms
args.CanExecute = (previewVariable.Count > 0);
}

public void PreviewToInput_Executed(object sender, ExecutedRoutedEventArgs args)
Expand Down Expand Up @@ -1997,10 +1953,6 @@ public MessageBoxResult runChecksAndSave()
if(o_acm != null) {
errorStr = checkACMSettings();
}
if (o_gproms != null)
{
errorStr = checkgPROMSErrors();
}
if (errorStr != null)
{
string caption = "SimSinter Configuration UI WARNING";
Expand Down
35 changes: 0 additions & 35 deletions Master/AspenSinterGUI/VariablesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,41 +103,6 @@ void InputVariables_SelectionChanged(object sender, System.Windows.Controls.Sele
{
presenter.selectedInputVars.Add(item);
}

//gPROMS: Crazy hack to get input variables to all change if the user changes the procesName
if (presenter.o_gproms != null)
{
//First find the processname
VariableViewModel processNameVM = null;
foreach (VariableViewModel item in InputVariables.Items)
{
if (item.name == "ProcessName")
{
processNameVM = item;
break;
}
}

//If the changed, update everything
if (processNameVM != null && ((String)processNameVM.value) != ((String)presenter.o_gproms.processName))
{
if (presenter.o_gproms.gProcesses.ContainsKey((String)processNameVM.value)) //Check to make sure it's a really process name (if it isn't throw an error)
{
presenter.o_gproms.processName = (string) processNameVM.value;
presenter.o_gproms.resetInputVariables();
presenter.inputVariables.Clear(); //This causes the input varialbes selection to change, and processNameVM comes up null.
presenter.outputVariables.Clear();
presenter.allVariables.Clear();
presenter.buildVariableGrids();
}
else
{
presenter.displayError(String.Format("Invalid ProcessName: {0}", processNameVM.value));
}
}

}

}

void OutputVariables_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
Expand Down
50 changes: 0 additions & 50 deletions Master/ConsumerUnitTests/App.Config

This file was deleted.

87 changes: 0 additions & 87 deletions Master/ConsumerUnitTests/ConsumerUnitTests.csproj

This file was deleted.

35 changes: 0 additions & 35 deletions Master/ConsumerUnitTests/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit ae5a378

Please sign in to comment.