Commit 55679355dc3c7386bce108de096a48d7ece5f145

Authored by Steve Greedy
1 parent 2ccd78e5

Mesh Scaling

Apply fix affecting Windows OS
GUI/SW1/SRC/BUNDLEBLDR.cpp
... ... @@ -334,7 +334,7 @@ void BUNDLEBLDR::OnListboxRDown(wxMouseEvent& event)
334 334 wxString strMessage;
335 335 wxString strItem = ListBox1->GetString(item);
336 336  
337   - strMessage = "Are you sure you wish to delete: ";
  337 + strMessage = "Are you sure you w DrawBundleCsection();ish to delete: ";
338 338 strMessage = strMessage << strItem;
339 339 // Confirm cable component deletion?
340 340 wxMessageDialog bb_ConfirmDelete (this, strMessage, _("Please confirm delete") ,wxYES_NO|wxCENTRE,wxDefaultPosition );
... ... @@ -355,7 +355,7 @@ void BUNDLEBLDR::PopulateListControl(void)
355 355 {
356 356 ListBox1->Clear();
357 357  
358   - Button1->Enable();
  358 + Button1->Enable(); DrawBundleCsection();
359 359  
360 360 Bundle *Current = bundle_root;
361 361  
... ... @@ -485,8 +485,11 @@ void BUNDLEBLDR::OnCheckListBox1Toggled(wxCommandEvent&amp; event)
485 485  
486 486 void BUNDLEBLDR::OnPanel1Paint(wxPaintEvent& event)
487 487 {
  488 +
488 489 DrawPanel();
489   - DrawBundleCsection();
  490 + //DrawBundleCsection();
  491 +
  492 +
490 493 }
491 494  
492 495 void BUNDLEBLDR::DrawPanel()
... ... @@ -667,7 +670,7 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin
667 670 dc.SetPen( wxPen( wxColor(0,0,0),1 ) );
668 671 dc.SetBrush(wxBrush(*wxBLACK, wxSOLID));
669 672 dc.DrawCircle( wxPoint(size_h/2+scaledxCoord,size_v/2+scaledyCoord), inner_conductor_Scaledradius );
670   - DrawBundleCsection();
  673 +
671 674 }
672 675  
673 676 if (str.compare("Twinax") == 0 ){
... ... @@ -1302,6 +1305,15 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin
1302 1305 }
1303 1306 }
1304 1307  
  1308 + if(CheckBox1->GetValue())
  1309 + {
  1310 + // Ground Plane
  1311 + int size_hl, size_vl;
  1312 + Panel1->GetSize(&size_hl, &size_vl );
  1313 + dc.SetPen( wxPen( (*wxBLACK) ,5 , wxSOLID) );
  1314 + dc.DrawLine( 0, size_vl/2, size_hl,size_vl/2 );
  1315 + }
  1316 +
1305 1317 }
1306 1318  
1307 1319 void BUNDLEBLDR::OnButton1Click(wxCommandEvent& event)
... ... @@ -1471,7 +1483,8 @@ void BUNDLEBLDR::OnButton2Click(wxCommandEvent&amp; event)
1471 1483 meshfile = meshfile.substr(0, extindex);
1472 1484  
1473 1485 extindex = meshfile.find_last_of (".");
1474   -
  1486 + int size_h, size_v;
  1487 + Panel1->GetSize(&size_h, &size_v );
1475 1488 meshfile = meshfile.substr(0, extindex);
1476 1489  
1477 1490 meshfile = meshfile.substr(2,meshfile.length());
... ... @@ -1523,9 +1536,11 @@ void BUNDLEBLDR::OnComboBox1Selected(wxCommandEvent&amp; event)
1523 1536 {
1524 1537 wxString meshToView;
1525 1538 meshToView<<ComboBox1->GetValue();
1526   - draw_mesh(Panel1,meshToView);
  1539 + draw_mesh(Panel1,meshToView, scale);
1527 1540  
1528 1541 MeshSelected = 1;
  1542 +
  1543 + TextCtrl8->Disable();
1529 1544 }
1530 1545  
1531 1546 void BUNDLEBLDR::OnTextCtrl4Text(wxCommandEvent& event)
... ... @@ -1557,9 +1572,11 @@ void BUNDLEBLDR::OnSpinButton1Change(wxSpinEvent&amp; event)
1557 1572  
1558 1573 maxXY.ToDouble(&maxDimension);
1559 1574  
1560   - FormatPanel(maxDimension);
1561   -
1562   - DrawBundleCsection();
  1575 + if (MeshSelected == 0)
  1576 + {
  1577 + FormatPanel(maxDimension);
  1578 + DrawBundleCsection();
  1579 + }
1563 1580  
1564 1581 }
1565 1582  
... ... @@ -1573,7 +1590,20 @@ void BUNDLEBLDR::OnTextCtrl8TextEnter(wxCommandEvent&amp; event)
1573 1590  
1574 1591 FormatPanel(maxDimension);
1575 1592  
1576   - DrawBundleCsection();
  1593 +
  1594 + if (MeshSelected == 1)
  1595 + {
  1596 + scale = scale + 0.1;
  1597 +
  1598 + wxString meshToView;
  1599 + meshToView<<ComboBox1->GetValue();
  1600 + draw_mesh(Panel1,meshToView, scale);
  1601 + }
  1602 +
  1603 + else
  1604 + {
  1605 + DrawBundleCsection();
  1606 + }
1577 1607  
1578 1608 }
1579 1609  
... ... @@ -1595,7 +1625,20 @@ void BUNDLEBLDR::OnSpinButton1ChangeUp(wxSpinEvent&amp; event)
1595 1625  
1596 1626 FormatPanel(maxDimension);
1597 1627  
1598   - DrawBundleCsection();
  1628 + if (MeshSelected == 1)
  1629 + {
  1630 + scale = scale + 0.05;
  1631 +
  1632 + wxString meshToView;
  1633 + meshToView<<ComboBox1->GetValue();
  1634 + draw_mesh(Panel1,meshToView, scale);
  1635 + }
  1636 +
  1637 + else
  1638 + {
  1639 + DrawBundleCsection();
  1640 + }
  1641 +
1599 1642 }
1600 1643  
1601 1644 void BUNDLEBLDR::OnSpinButton1ChangeDown(wxSpinEvent& event)
... ... @@ -1618,6 +1661,21 @@ void BUNDLEBLDR::OnSpinButton1ChangeDown(wxSpinEvent&amp; event)
1618 1661  
1619 1662 FormatPanel(maxDimension);
1620 1663  
1621   - DrawBundleCsection();
  1664 +
  1665 + if (MeshSelected == 1)
  1666 + {
  1667 + scale = scale - 0.05;
  1668 +
  1669 + if (scale <= 0.05) scale = 0.05;
  1670 +
  1671 + wxString meshToView;
  1672 + meshToView<<ComboBox1->GetValue();
  1673 + draw_mesh(Panel1,meshToView, scale);
  1674 + }
  1675 +
  1676 + else
  1677 + {
  1678 + DrawBundleCsection();
  1679 + }
1622 1680 }
1623 1681  
... ...
GUI/SW1/SRC/BUNDLEBLDR.h
... ... @@ -148,7 +148,9 @@ class BUNDLEBLDR: public wxDialog
148 148 wxString MESH_PARAM1;
149 149 wxString MESH_PARAM2;
150 150  
151   - int MeshSelected;
  151 + int MeshSelected = 0;
  152 +
  153 + float scale = 1.0;
152 154  
153 155  
154 156 //(*Declarations(BUNDLEBLDR)
... ...
GUI/SW1/SRC/DCONN.cpp
... ... @@ -576,7 +576,7 @@ void DCONN::OnComboBox1Selected(wxCommandEvent&amp; event)
576 576 {
577 577 wxString meshToView;
578 578 meshToView<<ComboBox1->GetValue();
579   - draw_mesh(Panel1,meshToView);
  579 + draw_mesh(Panel1,meshToView, scale);
580 580 }
581 581  
582 582 void DCONN::OnCheckBox2Click(wxCommandEvent& event)
... ...
GUI/SW1/SRC/DCONN.h
... ... @@ -94,6 +94,8 @@ class DCONN: public wxDialog
94 94 wxString MESH_PARAM1;
95 95 wxString MESH_PARAM2;
96 96  
  97 + float scale = 1.0;
  98 +
97 99 //(*Declarations(DCONN)
98 100 wxTextCtrl* TextCtrl4;
99 101 wxStaticText* StaticText2;
... ...
GUI/SW1/SRC/MESH_LAPLACE.cpp
... ... @@ -41,7 +41,7 @@
41 41 #include "MESH_LAPLACE.h"
42 42  
43 43  
44   -void draw_mesh(wxPanel *Panel, wxString mesh_to_draw)
  44 +void draw_mesh(wxPanel *Panel, wxString mesh_to_draw, float zoom)
45 45 {
46 46 wxClientDC dc(Panel);
47 47 dc.Clear();
... ... @@ -108,6 +108,8 @@ void draw_mesh(wxPanel *Panel, wxString mesh_to_draw)
108 108  
109 109 dc.SetPen( wxPen( *wxBLUE));
110 110  
  111 + scale = scale * zoom;
  112 +
111 113 int i, polygon_edges, v1, v2, v3;
112 114  
113 115 v1 = 0;
... ... @@ -135,7 +137,7 @@ void draw_mesh(wxPanel *Panel, wxString mesh_to_draw)
135 137 meshFile.close();
136 138 }
137 139  
138   -void zoom_mesh(wxPanel *Panel, wxString mesh_to_draw)
  140 +void zoom_mesh(wxPanel *Panel, wxString mesh_to_draw, float zoom)
139 141 {
140 142  
141 143 wxClientDC dc(Panel);
... ...
GUI/SW1/SRC/MESH_LAPLACE.h
... ... @@ -87,8 +87,8 @@ using namespace std;
87 87 // DECLARE_EVENT_TABLE()
88 88 //};
89 89  
90   -void draw_mesh(wxPanel *Panel, wxString mesh_to_draw);
91   -void zoom_mesh(wxPanel *Panel, wxString mesh_to_draw);
  90 +void draw_mesh(wxPanel *Panel, wxString mesh_to_draw, float scale);
  91 +void zoom_mesh(wxPanel *Panel, wxString mesh_to_draw, float scale);
92 92  
93 93 //class MESH_LAPLACE: public wxDialog
94 94 //{
... ...
GUI/SW1/SRC/SPACEWIRE.cpp
... ... @@ -1624,7 +1624,7 @@ void SPACEWIRE::OnComboBox1Selected(wxCommandEvent&amp; event)
1624 1624 {
1625 1625 wxString meshToView;
1626 1626 meshToView<<ComboBox1->GetValue();
1627   - draw_mesh(Panel1,meshToView);
  1627 + draw_mesh(Panel1,meshToView, scale);
1628 1628 }
1629 1629  
1630 1630 void SPACEWIRE::OnCheckBox3Click(wxCommandEvent& event)
... ...
GUI/SW1/SRC/SPACEWIRE.h
... ... @@ -90,6 +90,8 @@ class SPACEWIRE: public wxDialog
90 90 void spacewireSchematic();
91 91 void OnHighlightSchematic(wxCommandEvent & event);
92 92  
  93 + float scale = 1.0;
  94 +
93 95 wxString FD_ESR1;
94 96 wxString FD_ESR2;
95 97 wxString FD_ESR3;
... ...
GUI/SW1/SRC/SW1_GUIApp.h
... ... @@ -68,7 +68,7 @@ class SW1_GUIApp : public wxApp
68 68 wxBitmap splashimage;
69 69  
70 70 std::string SACAMOS_V_NUMBER = "SPICE_CABLE_MODEL_BUILDER_version=\"v4.0.0\"";
71   - std::string SACAMOS_V_DATE = "SPICE_CABLE_MODEL_BUILDER_date=\"27th September 2018\"";
  71 + std::string SACAMOS_V_DATE = "SPICE_CABLE_MODEL_BUILDER_date=\"5th October 2018\"";
72 72  
73 73  
74 74  
... ...
GUI/SW1/SRC/TP.cpp
... ... @@ -1158,7 +1158,7 @@ void TP::OnPanel4MouseWheel(wxMouseEvent&amp; event)
1158 1158  
1159 1159 wxClientDC dc(Panel4);
1160 1160 dc.Clear();
1161   - zoom_mesh(Panel4,fileName);
  1161 + zoom_mesh(Panel4,fileName,scale);
1162 1162 }
1163 1163  
1164 1164  
... ... @@ -1166,7 +1166,7 @@ void TP::OnComboBox1Selected(wxCommandEvent&amp; event)
1166 1166 {
1167 1167 wxString meshToView;
1168 1168 meshToView<<ComboBox1->GetValue();
1169   - draw_mesh(Panel4,meshToView);
  1169 + draw_mesh(Panel4,meshToView, scale);
1170 1170 }
1171 1171  
1172 1172 void TP::OnCheckBox4Click(wxCommandEvent& event)
... ...
GUI/SW1/SRC/TP.h
... ... @@ -91,6 +91,8 @@ class TP: public wxDialog
91 91 void tpSchematic();
92 92 void OnHighlightSchematic(wxCommandEvent & event);
93 93  
  94 + float scale = 1.0;
  95 +
94 96 wxString FD_ESR1;
95 97 wxString FD_ESR2;
96 98 wxString FD_ESR3;
... ...
GUI/SW1/SRC/TWINAX.cpp
... ... @@ -1140,7 +1140,7 @@ void TWINAX::OnComboBox1Selected(wxCommandEvent&amp; event)
1140 1140 {
1141 1141 wxString meshToView;
1142 1142 meshToView<<ComboBox1->GetValue();
1143   - draw_mesh(Panel1,meshToView);
  1143 + draw_mesh(Panel1,meshToView, scale);
1144 1144 }
1145 1145  
1146 1146 void TWINAX::OnCheckBox3Click(wxCommandEvent& event)
... ...
GUI/SW1/SRC/TWINAX.h
... ... @@ -91,6 +91,8 @@ class TWINAX: public wxDialog
91 91 void twinaxSchematic();
92 92 void OnHighlightSchematic(wxCommandEvent & event);
93 93  
  94 + float scale = 1.0;
  95 +
94 96 wxString FD_ESR1;
95 97 wxString FD_ESR2;
96 98 wxString FD_ESR3;
... ...
GUI/SW1/SRC/UTP.cpp
... ... @@ -688,14 +688,14 @@ void UTP::OnPanel1MouseWheel(wxMouseEvent&amp; event)
688 688  
689 689 wxClientDC dc(Panel1);
690 690 dc.Clear();
691   - zoom_mesh(Panel1,fileName);
  691 + zoom_mesh(Panel1,fileName, scale);
692 692 }
693 693  
694 694 void UTP::OnComboBox1Selected(wxCommandEvent& event)
695 695 {
696 696 wxString meshToView;
697 697 meshToView<<ComboBox1->GetValue();
698   - draw_mesh(Panel1,meshToView);
  698 + draw_mesh(Panel1,meshToView, scale);
699 699 }
700 700  
701 701 void UTP::EditExistingCable()
... ...
GUI/SW1/SRC/UTP.h
... ... @@ -92,6 +92,8 @@ class UTP: public wxDialog
92 92 void utpSchematic();
93 93 void OnHighlightSchematic(wxCommandEvent & event);
94 94  
  95 + float scale = 1.0;
  96 +
95 97 wxString FD_ESR1;
96 98 wxString FD_ESR2;
97 99 wxString FD_ESR3;
... ...
GUI/SW1/SRC/resources/Build
1 1 GUI:
2 2 Version: v4.0.0
3   -Date: 27th September 2018
  3 +Date: 5th October 2018
4 4  
5 5 SPICE_CABLE_MODEL_BUILDER
6 6 Version: v4.0.0
... ...
version_information.inc
1 1 SPICE_CABLE_MODEL_BUILDER_version="v4.0.0"
2   -SPICE_CABLE_MODEL_BUILDER_date="27th September 2018"
  2 +SPICE_CABLE_MODEL_BUILDER_date="5th October 2018"
... ...