Skip to content

Commit 450f309

Browse files
committed
5.0 release
1 parent af02595 commit 450f309

File tree

207 files changed

+2573
-7776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+2573
-7776
lines changed

Common/Variance/UI/MainForm.cs

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Eto.Forms;
1212
using Eto.Veldrid;
1313
using geoWrangler;
14+
using shapeEngine;
1415
using Veldrid;
1516
using VeldridEto;
1617
using PixelFormat = Veldrid.PixelFormat;
@@ -29,6 +30,7 @@ public partial class MainForm
2930
private VarianceContextGUI varianceContext;
3031

3132
private Command quitCommand, helpCommand, aboutCommand, clearLayer, copyLayer, pasteLayer, newSim, openSim, revertSim, saveSim, saveAsSim;
33+
private Command expExpandersCommand, collExpandersCommand;
3234

3335
private List<string> notList, booleanList;
3436

@@ -42,10 +44,10 @@ private void setupUIDataContext(List<string> notList_, List<string> booleanList_
4244
DataContext = new UIStringLists
4345
{
4446
subShapeList = commonVars.subshapes,
45-
shapes = commonVars.getAvailableShapes(),
46-
noiseTypeList = commonVars.getNoiseTypes(),
47-
subShapePos = commonVars.getAvailableSubShapePositions(),
48-
tipLocs = commonVars.getAvailableTipsLocations(),
47+
shapes = ShapeLibrary.getAvailableShapes(CentralProperties.shapeTable),
48+
noiseTypeList = NoiseC.noiseTypes,
49+
subShapePos = ShapeSettings.getAvailableSubShapePositions(),
50+
tipLocs = ShapeSettings.getAvailableTipsLocations(),
4951
rngTypeList = commonRNG.rngTypes,
5052
externalTypeList = commonVars.getExternalTypes(),
5153
externalFilterList = commonVars.getExternalFilterList(),
@@ -54,7 +56,7 @@ private void setupUIDataContext(List<string> notList_, List<string> booleanList_
5456
openGLMode = commonVars.getOpenGLModeList(),
5557
notList = notList_,
5658
fallOffList = RayCast.fallOffList,
57-
polyFillList = commonVars.getPolyFillTypes(),
59+
polyFillList = ShapeSettings.getPolyFillTypes(),
5860
geoCoreStructureList = commonVars.structureList,
5961
geoCoreLDList = commonVars.activeStructure_LayerDataTypeList,
6062
geoCoreStructureList_exp = commonVars.structureList_exp,
@@ -197,6 +199,15 @@ private void loadPrefs()
197199
{
198200
}
199201

202+
try
203+
{
204+
varianceContext.vc.expandUI = Convert.ToBoolean(prefs.Descendants("expandUI").First().Value);
205+
}
206+
catch (Exception)
207+
{
208+
}
209+
210+
200211
varianceContext.vc.rngMappingEquations.Clear();
201212
varianceContext.vc.rngMappingEquations.Add("Box-Muller");
202213
try
@@ -607,6 +618,8 @@ private void savePrefs()
607618

608619
prefsXML.Root.Add(new XElement("friendlyNumber", varianceContext.vc.friendlyNumber));
609620

621+
prefsXML.Root.Add(new XElement("expandUI", varianceContext.vc.expandUI));
622+
610623
string equationString = "";
611624
for (int i = 0; i < commonVars.rngCustomMapping.Count; i++)
612625
{
@@ -833,10 +846,7 @@ private void uiVars()
833846
simulationSettingsGroupBoxHeight = 180;
834847
userGuidanceWidth = 395;
835848
userGuidanceHeight = simulationOutputGroupBoxHeight + simulationSettingsGroupBoxHeight + 22;
836-
837-
simButtonWidth = 64;
838-
simButtonHeight = 55;
839-
849+
840850
replayNumWidth = 80;
841851

842852
multiThreadWarnWidth = 300;
@@ -1588,7 +1598,7 @@ private void setup_tabs()
15881598
tabPage_2D_PASearch_table = new TableLayout();
15891599
tabPage_2D_PASearch_scrollable = new Scrollable {Content = tabPage_2D_PASearch_table};
15901600

1591-
tabPage_2D_PASearch = new TabPage {Text = "PA Search", Content = tabPage_2D_PASearch_scrollable};
1601+
tabPage_2D_PASearch = new TabPage {Text = "Process Assumptions Search", Content = tabPage_2D_PASearch_scrollable};
15921602

15931603

15941604
tabControl_2D_simsettings.Pages.Add(tabPage_2D_PASearch);
@@ -1597,7 +1607,7 @@ private void setup_tabs()
15971607
private void setup_layout()
15981608
{
15991609
// mainPanel is tab UI.
1600-
Panel mainPanel = new() {Size = new Size(920, 800), Content = mainTable};
1610+
Panel mainPanel = new() {Size = new Size(920, 750), Content = mainTable};
16011611
// force the UI out to contain the panel. Hope this will be redundant eventually with the table UI.
16021612
// rightPanel will take viewport and controls.
16031613
Panel rightPanel = new();
@@ -1717,14 +1727,21 @@ private void commands()
17171727

17181728
saveAsSim = new Command { MenuText = "Save As", ToolBarText = "Save As", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.S };
17191729
saveAsSim.Executed += saveAsHandler;
1730+
1731+
expExpandersCommand = new Command {MenuText = "Unfold All", ToolBarText = "Unfold All", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.X };
1732+
expExpandersCommand.Executed += expandExpanders;
1733+
1734+
collExpandersCommand = new Command {MenuText = "Fold All", ToolBarText = "Fold All", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.C };
1735+
collExpandersCommand.Executed += collapseExpanders;
17201736

17211737
// create menu
17221738
Menu = new MenuBar
17231739
{
17241740
Items = {
17251741
//File submenu
17261742
new ButtonMenuItem { Text = "&File", Items = { newSim, openSim, revertSim, saveSim, saveAsSim } },
1727-
new ButtonMenuItem { Text = "&Edit", Items = { copyLayer, pasteLayer, clearLayer } }
1743+
new ButtonMenuItem { Text = "&Edit", Items = { copyLayer, pasteLayer, clearLayer } },
1744+
new ButtonMenuItem { Text = "&View", Items = { expExpandersCommand, collExpandersCommand } },
17281745
},
17291746
QuitItem = quitCommand,
17301747
HelpItems = {
@@ -1742,26 +1759,21 @@ private void setup_buttons(TableCell tc)
17421759
tc.Control = TableLayout.AutoSized(p, centered: true);
17431760

17441761
TableLayout buttons_table = new();
1745-
p.Content = buttons_table;
1762+
p.Content = TableLayout.AutoSized(buttons_table);
17461763
buttons_table.Rows.Add(new TableRow());
1747-
1748-
btn_singleCPU = new Button {Text = "Single\r\nCPU"};
1749-
btn_singleCPU.Click += monteCarloSingleThreadEventHandler;
1750-
setSize(btn_singleCPU, simButtonWidth, simButtonHeight);
1751-
// buttons_table.Rows[0].Cells.Add(new TableCell() { Control = btn_singleCPU });
1752-
1753-
btn_multiCPU = new Button {Text = "Multi\r\nCPU"};
1754-
setSize(btn_multiCPU, simButtonWidth, simButtonHeight);
1755-
btn_multiCPU.Click += monteCarloMultipleThreadEventHandler;
1756-
buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_multiCPU });
1764+
1765+
btn_Run = new Button {Text = "Run"};
1766+
//setSize(btn_Run, simButtonWidth, simButtonHeight);
1767+
btn_Run.Click += monteCarloMultipleThreadEventHandler;
1768+
buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_Run });
17571769

17581770
btn_Cancel = new Button {Text = "Cancel"};
1759-
setSize(btn_Cancel, simButtonWidth, simButtonHeight);
1760-
btn_Cancel.Click += btnCancel;
1771+
// setSize(btn_Cancel, simButtonWidth, simButtonHeight);
1772+
//btn_Cancel.Click += btnCancel;
17611773
buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_Cancel });
17621774

17631775
btn_STOP = new Button {Text = "STOP"};
1764-
setSize(btn_STOP, simButtonWidth, simButtonHeight);
1776+
//setSize(btn_STOP, simButtonWidth, simButtonHeight);
17651777
btn_STOP.Click += btnSTOP;
17661778
buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_STOP });
17671779
}

Common/Variance/UI/UIHandlers.cs

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ private void aboutMe(object sender, EventArgs e)
1515
creditText += varianceContext.vc.licenceName;
1616
creditText += "\r\n\r\n";
1717
creditText += "Libraries used:\r\n";
18-
creditText += " Eto.Forms : UI framework\r\n\thttps://github.com/picoe/Eto/wiki\r\n";
18+
creditText += " Eto.Forms : UI framework\r\n\thttps://github.com/picoe/Eto\r\n";
1919
creditText += " Eto.Veldrid : Eto Veldrid viewport\r\n\thttps://github.com/picoe/Eto.Veldrid\r\n";
2020
creditText += " DesignLibs : Design libraries\r\n\thttps://github.com/philstopford/DesignLibs_GPL\r\n";
21-
creditText += " clipperLib : geometry processing, area, SVG output reference\r\n\thttp://sourceforge.net/projects/polyclipping/\r\n";
21+
creditText += " Clipper2 : geometry processing\r\n\thttps://github.com/AngusJohnson/Clipper2\r\n";
2222
creditText += " KD-Sharp : for spacing/enclosure\r\n\thttps://code.google.com/p/kd-sharp/\r\n";
2323
creditText += " LibTessDotNet : for Delauney triangulation (tone inversion of n polygons)\r\n\thttps://github.com/speps/LibTessDotNet\r\n";
2424
creditText += " Mersenne Twister : \r\n\thttp://www.centerspace.net/resources/free-stuff/mersenne-twister\r\n";
25-
creditText += " ExpressionParser : \r\n\thttp://lundin.info/mathparser\r\n";
26-
creditText += " MiscUtil : \r\n\thttp://yoda.arachsys.com/csharp/miscutil/\r\n";
25+
creditText += " ExpressionParser : \r\n\thttps://github.com/plundin/Mathparser\r\n";
26+
creditText += " MiscUtil : \r\n\thttps://github.com/loory/MiscUtil\r\n";
2727
aboutBox = new CreditsScreen(this, creditText);
2828
}
2929
Point location = new(Location.X + (Width - aboutBox.Width) / 2,
@@ -93,9 +93,7 @@ private void mcPreviewSettingsChanged(object sender, EventArgs e)
9393

9494
private void mainTabChanged(object sender, EventArgs e)
9595
{
96-
btn_singleCPU.Enabled = false;
97-
98-
btn_multiCPU.Enabled = false;
96+
btn_Run.Enabled = false;
9997
btn_STOP.Enabled = false;
10098

10199
// statusProgressBar.Visible = false;
@@ -423,4 +421,26 @@ private void getComment()
423421
globalUIFrozen = false;
424422
});
425423
}
424+
425+
private void collapseExpanders(object sender, EventArgs e)
426+
{
427+
changeExpanders(false);
428+
}
429+
430+
private void expandExpanders(object sender, EventArgs e)
431+
{
432+
changeExpanders(true);
433+
}
434+
435+
private void changeExpanders(bool toState)
436+
{
437+
gadgets_exp.Expanded = toState;
438+
expander_gadgets.Expanded = toState;
439+
twoD_LayerUISetup_biasEtch_expanders(toState);
440+
twoD_LayerUISetup_boolean_expanders(toState);
441+
twoD_LayerUISetup_geoCore_expanders(toState);
442+
twoD_LayerUISetup_litho_expanders(toState);
443+
twoD_LayerUISetup_layoutOriginParameters_expanders(toState);
444+
twoD_LayerUISetup_subShape_expanders(toState);
445+
}
426446
}

Common/Variance/UI/UIHandlers_doe.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,16 @@ private void doeSettingsChanged()
164164
int colorIndex = tile % varianceContext.vc.colors.resultColors.Length; // map our result into the available colors.
165165
PointF[] currentTile = tilePoly.ToArray();
166166
int length = currentTile.Length;
167+
int col1 = col;
168+
int row1 = row;
167169
#if !VARIANCESINGLETHREADED
168170
Parallel.For(0, length, pt =>
169171
#else
170172
for (int pt = 0; pt < length; pt++)
171173
#endif
172174
{
173-
currentTile[pt].X += (float)(col * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.colPitch));
174-
currentTile[pt].Y += (float)(row * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowPitch));
175+
currentTile[pt].X += (float)(col1 * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.colPitch));
176+
currentTile[pt].Y += (float)(row1 * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowPitch));
175177
}
176178
#if !VARIANCESINGLETHREADED
177179
);

Common/Variance/UI/UIHandlers_email.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Globalization;
3+
using EmailNS;
4+
using Error;
35

46
namespace Variance;
57

@@ -19,7 +21,7 @@ private void emailSettingsChanged(object sender, EventArgs e)
1921
varianceContext.vc.host = commonVars.getNonSimulationSettings().host = text_server.Text;
2022
varianceContext.vc.emailPwd = commonVars.getNonSimulationSettings().emailPwd = varianceContext.vc.aes.EncryptToString(text_emailPwd.Text);
2123
varianceContext.vc.port = commonVars.getNonSimulationSettings().port = num_port.Value.ToString(CultureInfo.InvariantCulture);
22-
varianceContext.vc.ssl = commonVars.getNonSimulationSettings().ssl = (bool)checkBox_SSL.Checked;
24+
varianceContext.vc.ssl = commonVars.getNonSimulationSettings().ssl = (bool)checkBox_SSL.Checked!;
2325

2426
bool emailOK = validateEmailSettings();
2527
checkBox_EmailCompletion.Enabled = emailOK;
@@ -32,7 +34,14 @@ private void emailSettingsChanged(object sender, EventArgs e)
3234

3335
private void emailTest(object sender, EventArgs e)
3436
{
35-
Email.Send(varianceContext.vc.host, varianceContext.vc.port, varianceContext.vc.ssl, "Variance Email Test", "Testing 1 2 3", varianceContext.vc.emailAddress, varianceContext.vc.aes.DecryptString(varianceContext.vc.emailPwd));
37+
try
38+
{
39+
Email.Send(varianceContext.vc.host, varianceContext.vc.port, varianceContext.vc.ssl, "Variance Email Test", "Testing 1 2 3", varianceContext.vc.emailAddress, varianceContext.vc.aes.DecryptString(varianceContext.vc.emailPwd));
40+
}
41+
catch (Exception ex)
42+
{
43+
ErrorReporter.showMessage_OK(ex.Message, "Error sending mail");
44+
}
3645
}
3746

3847
}

Common/Variance/UI/UIHandlers_file.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ private void pNew(bool prompt)
263263
commonVars.setGCCDV(varianceContext.vc.geoCoreCDVariation);
264264
commonVars.setLayerPreviewDOETile(varianceContext.vc.layerPreviewDOETile);
265265
commonVars.setFriendly(varianceContext.vc.friendlyNumber);
266+
commonVars.setExpandedUI(varianceContext.vc.expandUI);
266267
setupGUI();
267268
resetViewPorts();
268269
set2DSelectedIndex(storeIndex);
@@ -337,7 +338,8 @@ await Application.Instance.InvokeAsync(() =>
337338
MultiSelect = false,
338339
Filters =
339340
{
340-
new FileFilter("Layout Files (*.gds; *.gdsii; *.oas; *.oasis; *.gds.gz; *.gdsii.gz; *.oas.gz; *.oasis.gz)", ".gds", ".gdsii", "*.oas", "*.oasis", ".gds.gz", ".gdsii.gz", "*.oas.gz", "*.oasis.gz")
341+
new FileFilter("Layout Files (*.gds; *.gdsii; *.oas; *.oasis; *.gds.gz; *.gdsii.gz; *.oas.gz; *.oasis.gz)", ".gds", ".gdsii", "*.oas", "*.oasis", ".gds.gz", ".gdsii.gz", "*.oas.gz", "*.oasis.gz"
342+
, ".GDS", ".GDSII", "*.OAS", "*.OASIS", ".GDS.GZ", ".GDSII.GZ", "*.OAS.GZ", "*.OASIS.GZ")
341343
}
342344
};
343345

@@ -387,13 +389,13 @@ await Application.Instance.InvokeAsync(() =>
387389
commonVars.getLayerSettings(settingsIndex).setString(EntropyLayerSettings.properties_s.file, commonVars.getGeoCoreHandler(settingsIndex).getFilename());
388390
// Clear tracking for external point data.
389391
commonVars.getLayerSettings(settingsIndex).setReloaded(false);
392+
390393
try
391394
{
392395
comboBox_structureList_geoCore.SelectedIndex = commonVars.getGeoCoreHandler(settingsIndex).getGeo().activeStructure;
393396
}
394397
catch (Exception)
395398
{
396-
397399
}
398400
try
399401
{
@@ -471,7 +473,7 @@ private bool layoutLoad(int settingsIndex, string filename)
471473
{
472474
commonVars.getGeoCoreHandler(settingsIndex).updateGeoCoreHandler(filename, GeoCore.fileType.oasis);
473475
}
474-
476+
475477
return commonVars.getGeoCoreHandler(settingsIndex).isValid();
476478
}
477479
default:
@@ -487,7 +489,7 @@ private void iDRMFileChooser_Handler(object sender, EventArgs e)
487489
MultiSelect = false,
488490
Filters =
489491
{
490-
new FileFilter("CSV Files (*.csv)", ".csv")
492+
new FileFilter("CSV Files (*.csv)", ".csv", ".CSV")
491493
}
492494
};
493495
bool reading = false;
@@ -534,7 +536,7 @@ private void QuiltFileChooser_Handler(object sender, EventArgs e)
534536
MultiSelect = false,
535537
Filters =
536538
{
537-
new FileFilter("CSV Files (*.csv)", ".csv")
539+
new FileFilter("CSV Files (*.csv)", ".csv", ".CSV")
538540
}
539541
};
540542
bool reading = false;

Common/Variance/UI/UIHandlers_geoCore.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
4-
using System.Linq;
54
using System.Threading;
65
using System.Threading.Tasks;
76
using Eto.Forms;
@@ -28,10 +27,10 @@ private async void exportActiveLayerToLayout()
2827
Title = "Enter file to save",
2928
Filters =
3029
{
31-
new FileFilter("GDS file", "*.gds", ".gdsii"),
32-
new FileFilter("GDS file, GZIP compressed", "*.gds.gz", "*.gdsii.gz"),
33-
new FileFilter("OAS file", "*.oas", "*.oasis"),
34-
new FileFilter("OAS file. GZIP compressed", "*.oas.gz", "*.oasis.gz")
30+
new FileFilter("GDS file", "*.gds", ".gdsii", "*.GDS", ".GDSII"),
31+
new FileFilter("GDS file, GZIP compressed", "*.gds.gz", "*.gdsii.gz", "*.GDS.GZ", "*.GDSII.GZ"),
32+
new FileFilter("OAS file", "*.oas", "*.oasis", "*.OAS", "*.OASIS"),
33+
new FileFilter("OAS file. GZIP compressed", "*.oas.gz", "*.oasis.gz", "*.OAS.GZ", "*.OASIS.GZ")
3534
}
3635
};
3736
if (sfd.ShowDialog(ParentWindow) != DialogResult.Ok)
@@ -166,7 +165,7 @@ private void toGeoCore(int type, string file)
166165

167166
GeoLibPoint[] ePoly = GeoWrangler.resize_to_int(polys[poly], scale);
168167

169-
gcell_root.addPolygon(ePoly.ToArray(), layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly.
168+
gcell_root.addPolygon(ePoly, layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly.
170169
}
171170
}
172171

Common/Variance/UI/UIHandlers_layer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ private void customRNGContextMenu()
167167
private void omitLayerCheckboxChanged(object sender, EventArgs e)
168168
{
169169
// Establish which sender raised the event so that we can push the value to the correct layer.
170-
int index = Array.IndexOf(cB_omit, sender);
171-
setOmitLayer(index, (bool)((CheckBox)sender).Checked);
170+
int index = Array.IndexOf(cB_omit, (CheckBox)sender);
171+
setOmitLayer(index, (bool)((CheckBox)sender).Checked!);
172172
}
173173

174174
private void setOmitLayer(int index, bool status)
@@ -196,7 +196,7 @@ private void bgLayerCheckboxChanged(int settingsIndex)
196196
{
197197
for (int i = 0; i < cB_bg.Length; i++)
198198
{
199-
if ((bool)cB_bg[i].Checked && cB_bg[i].Enabled)
199+
if ((bool)cB_bg[i].Checked! && cB_bg[i].Enabled)
200200
{
201201
commonVars.getLayerSettings(settingsIndex).setIntArrayValue(EntropyLayerSettings.properties_intarray.bglayers, i, 1);
202202
}

0 commit comments

Comments
 (0)