Skip to content

Commit

Permalink
Major bugfixes and harmonic data calculation
Browse files Browse the repository at this point in the history
Fix program close suddenly on delete bus;
Fix problems related to disconnected buses;
Added harmonic voltages and currents calculation;
Added harmonic data in data form;
Minor bugfixes
  • Loading branch information
Thales1330 committed Sep 22, 2023
1 parent e00b498 commit a1f4db4
Show file tree
Hide file tree
Showing 24 changed files with 8,678 additions and 6,487 deletions.
2 changes: 1 addition & 1 deletion Project/AboutForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AboutForm::~AboutForm() {}
void AboutForm::Init()
{
// Set program version. Format: (Alpha/Beta/Release) (YEAR)w(WEEK)(a/b/c/...)
m_staticTextVersion->SetLabel("2020w31a-beta");
m_staticTextVersion->SetLabel("2023w38a-beta");

// Create developers table
m_gridCredits->EnableGridLines(false);
Expand Down
27 changes: 17 additions & 10 deletions Project/Branch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool Branch::SetNodeParent(Element* parent)

void Branch::RemoveParent(Element* parent)
{
for(int i = 0; i < 2; i++) {
for(unsigned int i = 0; i < m_parentList.size(); i++) {
if(parent == m_parentList[i]) {
m_parentList[i] = nullptr;
m_online = false;
Expand Down Expand Up @@ -155,16 +155,23 @@ void Branch::RotateNode(Element* parent, bool clockwise)

void Branch::UpdateSwitchesPosition()
{
if(m_parentList[0]) {
m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], m_pointList[2]);
} else {
m_pointList[1] = m_pointList[0];
if (m_parentList.size() >= 1) {
if (m_parentList[0]) {
m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], m_pointList[2]);
}
else {
m_pointList[1] = m_pointList[0];
}
}
if(m_parentList[1]) {
m_pointList[m_pointList.size() - 2] =
GetSwitchPoint(m_parentList[1], m_pointList[m_pointList.size() - 1], m_pointList[m_pointList.size() - 3]);
} else {
m_pointList[m_pointList.size() - 2] = m_pointList[m_pointList.size() - 1];

if (m_parentList.size() >= 2) {
if (m_parentList[1]) {
m_pointList[m_pointList.size() - 2] =
GetSwitchPoint(m_parentList[1], m_pointList[m_pointList.size() - 1], m_pointList[m_pointList.size() - 3]);
}
else {
m_pointList[m_pointList.size() - 2] = m_pointList[m_pointList.size() - 1];
}
}
UpdateSwitches();
}
Expand Down
Loading

0 comments on commit a1f4db4

Please sign in to comment.