Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Project/editors/Workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Workspace::Workspace(wxWindow* parent, wxString name, wxStatusBar* statusBar, wx
m_camera = new Camera();
m_selectionRect = wxRect2DDouble(0, 0, 0, 0);

for (int i = 0; i < NUM_ELEMENTS; ++i) { m_elementNumber[i] = 1; }
// for (int i = 0; i < NUM_ELEMENTS; ++i) { m_elementNumber[i] = 1; }

const int widths[4] = { -3, -1, 100, 100 };
m_statusBar->SetStatusWidths(4, widths);
Expand Down Expand Up @@ -126,6 +126,21 @@ Workspace::~Workspace()
if (m_tipWindow) delete m_tipWindow;
if (m_properties) delete m_properties;
}
void Workspace::UpdateElementNumbersFromList()
{
// Reset counters
for (int i = 0; i < NUM_ELEMENTS; ++i) {
m_elementNumber[i] = 1;
}

// Scan existing elements
for (auto* element : m_elementList) {
int type = element->GetElementType();
if (type >= 0 && type < NUM_ELEMENTS) {
m_elementNumber[type]++;
}
}
}

void Workspace::OnPaint(wxPaintEvent& event)
{
Expand Down Expand Up @@ -2005,6 +2020,9 @@ bool Workspace::Paste()
}

UpdateElementsID();

UpdateElementNumbersFromList();

m_mode = WorkspaceMode::MODE_PASTE;
m_statusBar->SetStatusText(_("Click to paste."));
UpdateStatusBar();
Expand Down Expand Up @@ -2231,6 +2249,8 @@ void Workspace::SetElementList(std::vector<Element*> elementList)
m_elementList.clear();
for (auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it)
m_elementList.push_back(static_cast<PowerElement*>(*it));
UpdateElementNumbersFromList();

}

void Workspace::OnIdle(wxIdleEvent& event)
Expand Down
2 changes: 2 additions & 0 deletions Project/editors/Workspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class Workspace : public WorkspaceBase
Workspace();
Workspace(wxWindow* parent, wxString name = wxEmptyString, wxStatusBar* statusBar = nullptr, wxAuiNotebook* auiNotebook = nullptr);
virtual ~Workspace();


wxString GetName() const { return m_name; }
std::vector<Element*> GetElementList() const;
Expand Down Expand Up @@ -164,6 +165,7 @@ class Workspace : public WorkspaceBase
void UpdateElementsID();
bool UpdateTextElements();
void UpdateHeatMap();
void UpdateElementNumbersFromList();

int GetElementNumber(ElementID elementID) { return m_elementNumber[elementID]; }
void IncrementElementNumber(ElementID elementID) { m_elementNumber[elementID]++; }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Further details can be found in the published papers:

All detailed descriptions of the source-code can be found at [**Online Documentation**](https://thales1330.github.io/PSP/doxygen/html/index.html), generated by [Doxygen](http://www.doxygen.org).

## [](#header-2)⚙️ Build Instructions (via CMake)
## [](#header-2)⚙️ Build Instructions [via CMake]

To compile **PSP‑UFU**, make sure the `CMakeLists.txt` file is located at the root of the repository.

Expand Down
98 changes: 98 additions & 0 deletions build/CMakeCache.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# This is the CMakeCache file.
# For build in directory: c:/Users/hp/PSP/build
# It was generated by CMake: C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//Semicolon separated list of supported configuration types, only
// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
// else will be ignored.
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo

//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=C:/Users/hp/PSP/build/CMakeFiles/pkgRedirects

//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=PSP-UFU

//Value Computed by CMake
CMAKE_PROJECT_VERSION:STATIC=1.0

//Value Computed by CMake
CMAKE_PROJECT_VERSION_MAJOR:STATIC=1

//Value Computed by CMake
CMAKE_PROJECT_VERSION_MINOR:STATIC=0

//Value Computed by CMake
CMAKE_PROJECT_VERSION_PATCH:STATIC=

//Value Computed by CMake
CMAKE_PROJECT_VERSION_TWEAK:STATIC=

//Value Computed by CMake
PSP-UFU_BINARY_DIR:STATIC=C:/Users/hp/PSP/build

//Value Computed by CMake
PSP-UFU_IS_TOP_LEVEL:STATIC=ON

//Value Computed by CMake
PSP-UFU_SOURCE_DIR:STATIC=C:/Users/hp/PSP


########################
# INTERNAL cache entries
########################

//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/hp/PSP/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=0
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=3
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/bin/ctest.exe
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Visual Studio 17 2022
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=Win32
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/hp/PSP
//Name of CMakeLists files to read
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/share/cmake-4.0

15 changes: 15 additions & 0 deletions build/CMakeFiles/4.0.3/CMakeSystem.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Windows-6.2.9200")
set(CMAKE_HOST_SYSTEM_NAME "Windows")
set(CMAKE_HOST_SYSTEM_VERSION "6.2.9200")
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")



set(CMAKE_SYSTEM "Windows-6.2.9200")
set(CMAKE_SYSTEM_NAME "Windows")
set(CMAKE_SYSTEM_VERSION "6.2.9200")
set(CMAKE_SYSTEM_PROCESSOR "AMD64")

set(CMAKE_CROSSCOMPILING "FALSE")

set(CMAKE_SYSTEM_LOADED 1)
11 changes: 11 additions & 0 deletions build/CMakeFiles/CMakeConfigureLog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

---
events:
-
kind: "message-v1"
backtrace:
- "C:/Users/hp/Downloads/winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4/mingw64/share/cmake-4.0/Modules/CMakeDetermineSystem.cmake:205 (message)"
- "CMakeLists.txt:2 (project)"
message: |
The system is: Windows - 6.2.9200 - AMD64
...
1 change: 1 addition & 0 deletions build/CMakeFiles/cmake.check_cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file