diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-04-12 18:57:10 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-04-12 18:57:10 -0300 |
commit | 52931022eb25080e33f2362c3b0bd4361f0cdb0b (patch) | |
tree | 90d83cb3c68f66d41971099887c321e56dd6d00f | |
parent | d2aa79321df798c297334dbcf4e56320b84400ba (diff) | |
download | PSP.git-52931022eb25080e33f2362c3b0bd4361f0cdb0b.tar.gz PSP.git-52931022eb25080e33f2362c3b0bd4361f0cdb0b.tar.xz PSP.git-52931022eb25080e33f2362c3b0bd4361f0cdb0b.zip |
Open control implementation
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | PSP.workspace | 4 | ||||
-rw-r--r-- | Project/ControlEditor.cpp | 16 | ||||
-rw-r--r-- | Project/ControlEditor.h | 7 | ||||
-rw-r--r-- | Project/ControlEditor.wxcp | 13 | ||||
-rw-r--r-- | Project/ControlEditorBase.cpp | 10 | ||||
-rw-r--r-- | Project/ControlEditorBase.h | 6 | ||||
-rw-r--r-- | Project/FileHanding.cpp | 202 | ||||
-rw-r--r-- | Project/FileHanding.h | 4 | ||||
-rw-r--r-- | Project/Project.mk | 20 | ||||
-rw-r--r-- | Project/Project.txt | 2 |
11 files changed, 208 insertions, 80 deletions
@@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo "----------Building project:[ Project - Release ]----------" + @echo "----------Building project:[ Project - Debug ]----------" @cd "Project" && "$(MAKE)" -f "Project.mk" clean: - @echo "----------Cleaning project:[ Project - Release ]----------" + @echo "----------Cleaning project:[ Project - Debug ]----------" @cd "Project" && "$(MAKE)" -f "Project.mk" clean diff --git a/PSP.workspace b/PSP.workspace index 8132425..d5d4c55 100644 --- a/PSP.workspace +++ b/PSP.workspace @@ -2,11 +2,11 @@ <CodeLite_Workspace Name="PSP" Database="" Version="10.0.0"> <Project Name="Project" Path="Project/Project.project" Active="Yes"/> <BuildMatrix> - <WorkspaceConfiguration Name="Debug" Selected="no"> + <WorkspaceConfiguration Name="Debug" Selected="yes"> <Environment/> <Project Name="Project" ConfigName="Debug"/> </WorkspaceConfiguration> - <WorkspaceConfiguration Name="Release" Selected="yes"> + <WorkspaceConfiguration Name="Release" Selected="no"> <Environment/> <Project Name="Project" ConfigName="Release"/> </WorkspaceConfiguration> diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp index 4fedfa3..cb0edf3 100644 --- a/Project/ControlEditor.cpp +++ b/Project/ControlEditor.cpp @@ -718,3 +718,19 @@ void ControlEditor::OnExportClick(wxCommandEvent& event) fileHandling.SaveControl(saveFileDialog.GetPath()); wxFileName fileName(saveFileDialog.GetPath()); } + +void ControlEditor::OnImportClick(wxCommandEvent& event) +{ + wxFileDialog openFileDialog(this, _("Open CTL file"), "", "", "CTL files (*.ctl)|*.ctl", + wxFD_OPEN | wxFD_FILE_MUST_EXIST); + if(openFileDialog.ShowModal() == wxID_CANCEL) return; + + wxFileName fileName(openFileDialog.GetPath()); + + FileHanding fileHandling(this); + if(!fileHandling.OpenControl(fileName)) { + wxMessageDialog msgDialog(this, _("It was not possible to open the selected file."), _("Error"), + wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } +}
\ No newline at end of file diff --git a/Project/ControlEditor.h b/Project/ControlEditor.h index 40a2b0a..2dd4051 100644 --- a/Project/ControlEditor.h +++ b/Project/ControlEditor.h @@ -81,10 +81,13 @@ class ControlEditor : public ControlEditorBase virtual void RotateSelectedElements(bool clockwise); virtual void DeleteSelectedElements(); virtual void CheckConnections(); - virtual std::vector<ConnectionLine*> GetConnectionLineList() { return m_connectionList; } - virtual std::vector<ControlElement*> GetControlElementList() { return m_elementList; } + virtual std::vector<ConnectionLine*> GetConnectionLineList() const { return m_connectionList; } + virtual std::vector<ControlElement*> GetControlElementList() const { return m_elementList; } + virtual void SetConnectionsList(std::vector<ConnectionLine*> connectionList) { m_connectionList = connectionList; } + virtual void SetElementsList(std::vector<ControlElement*> elementList) { m_elementList = elementList; } protected: + virtual void OnImportClick(wxCommandEvent& event); virtual void OnExportClick(wxCommandEvent& event); virtual void OnKeyDown(wxKeyEvent& event); virtual void OnIdle(wxIdleEvent& event); diff --git a/Project/ControlEditor.wxcp b/Project/ControlEditor.wxcp index 04c0c44..347a1a3 100644 --- a/Project/ControlEditor.wxcp +++ b/Project/ControlEditor.wxcp @@ -230,7 +230,7 @@ "m_properties": [{ "type": "winid", "m_label": "ID:", - "m_winid": "wxID_ANY" + "m_winid": "ID_RIBBON_IMPORT" }, { "type": "string", "m_label": "Name:", @@ -265,7 +265,14 @@ "m_label": "Construct the Dropdown Menu:", "m_value": true }], - "m_events": [], + "m_events": [{ + "m_eventName": "wxEVT_COMMAND_TOOL_CLICKED", + "m_eventClass": "wxCommandEvent", + "m_eventHandler": "wxCommandEventHandler", + "m_functionNameAndSignature": "OnImportClick(wxCommandEvent& event)", + "m_description": "Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED). Pass the id of the tool", + "m_noBody": false + }], "m_children": [] }, { "m_type": 4462, @@ -278,7 +285,7 @@ "m_properties": [{ "type": "winid", "m_label": "ID:", - "m_winid": "wxID_ANY" + "m_winid": "ID_RIBBON_EXPORT" }, { "type": "string", "m_label": "Name:", diff --git a/Project/ControlEditorBase.cpp b/Project/ControlEditorBase.cpp index 4fe00fc..1156e7b 100644 --- a/Project/ControlEditorBase.cpp +++ b/Project/ControlEditorBase.cpp @@ -62,9 +62,9 @@ ControlEditorBase::ControlEditorBase(wxWindow* parent, wxWindowID id, const wxSt m_toolbarMain->AddTool(wxID_ANY, _("New"), wxXmlResource::Get()->LoadBitmap(wxT("new32")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); - m_toolbarMain->AddTool(wxID_ANY, _("Import"), wxXmlResource::Get()->LoadBitmap(wxT("imp32")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); + m_toolbarMain->AddTool(ID_RIBBON_IMPORT, _("Import"), wxXmlResource::Get()->LoadBitmap(wxT("imp32")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); - m_toolbarMain->AddTool(wxID_ANY, _("Export"), wxXmlResource::Get()->LoadBitmap(wxT("exp32")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); + m_toolbarMain->AddTool(ID_RIBBON_EXPORT, _("Export"), wxXmlResource::Get()->LoadBitmap(wxT("exp32")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); m_toolbarMain->AddSeparator(); @@ -136,7 +136,8 @@ ControlEditorBase::ControlEditorBase(wxWindow* parent, wxWindowID id, const wxSt } #endif // Connect events - this->Connect(wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnExportClick), NULL, this); + this->Connect(ID_RIBBON_IMPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnImportClick), NULL, this); + this->Connect(ID_RIBBON_EXPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnExportClick), NULL, this); m_glCanvas->Connect(wxEVT_PAINT, wxPaintEventHandler(ControlEditorBase::OnPaint), NULL, this); m_glCanvas->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(ControlEditorBase::OnLeftClickDown), NULL, this); m_glCanvas->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(ControlEditorBase::OnLeftClickUp), NULL, this); @@ -152,7 +153,8 @@ ControlEditorBase::ControlEditorBase(wxWindow* parent, wxWindowID id, const wxSt ControlEditorBase::~ControlEditorBase() { - this->Disconnect(wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnExportClick), NULL, this); + this->Disconnect(ID_RIBBON_IMPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnImportClick), NULL, this); + this->Disconnect(ID_RIBBON_EXPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(ControlEditorBase::OnExportClick), NULL, this); m_glCanvas->Disconnect(wxEVT_PAINT, wxPaintEventHandler(ControlEditorBase::OnPaint), NULL, this); m_glCanvas->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(ControlEditorBase::OnLeftClickDown), NULL, this); m_glCanvas->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(ControlEditorBase::OnLeftClickUp), NULL, this); diff --git a/Project/ControlEditorBase.h b/Project/ControlEditorBase.h index e72ca31..ac89b32 100644 --- a/Project/ControlEditorBase.h +++ b/Project/ControlEditorBase.h @@ -39,6 +39,11 @@ class ControlEditorBase : public wxFrame { +public: + enum { + ID_RIBBON_EXPORT = 10001, + ID_RIBBON_IMPORT = 10002, + }; protected: wxToolBar* m_toolbarMain; wxAuiManager* m_auimgr; @@ -48,6 +53,7 @@ protected: wxStatusBar* m_statusBarMain; protected: + virtual void OnImportClick(wxCommandEvent& event) { event.Skip(); } virtual void OnExportClick(wxCommandEvent& event) { event.Skip(); } virtual void OnPaint(wxPaintEvent& event) { event.Skip(); } virtual void OnLeftClickDown(wxMouseEvent& event) { event.Skip(); } diff --git a/Project/FileHanding.cpp b/Project/FileHanding.cpp index 11ba8d9..4b87f2e 100644 --- a/Project/FileHanding.cpp +++ b/Project/FileHanding.cpp @@ -1722,61 +1722,82 @@ void FileHanding::SaveControl(wxFileName path) writeXML.close(); } -bool FileHanding::OpenControl(wxFileName path) { return false; } -void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode) +bool FileHanding::OpenControl(wxFileName path) { - ControlElementContainer ctrlContainer; - ctrlContainer.FillContainer(m_controlEditor); + rapidxml::xml_document<> doc; + rapidxml::file<> xmlFile(path.GetFullPath()); - //{ Connection line - auto cLinesNode = AppendNode(doc, elementsNode, "ConnectionList"); - auto connLineList = ctrlContainer.GetConnectionLineList(); - for(auto it = connLineList.begin(), itEnd = connLineList.end(); it != itEnd; ++it) { - ConnectionLine* cLine = *it; - auto cLineNode = AppendNode(doc, cLinesNode, "Connection"); - SetNodeAttribute(doc, cLineNode, "ID", cLine->GetID()); + doc.parse<0>(xmlFile.data()); - // CAD properties - auto cadProp = AppendNode(doc, cLineNode, "CADProperties"); - auto position1 = AppendNode(doc, cadProp, "Position1"); - auto posX1 = AppendNode(doc, position1, "X"); - SetNodeValue(doc, posX1, cLine->GetPointList()[0].m_x); - auto posY1 = AppendNode(doc, position1, "Y"); - SetNodeValue(doc, posY1, cLine->GetPointList()[0].m_y); - auto position2 = AppendNode(doc, cadProp, "Position2"); - auto posX2 = AppendNode(doc, position2, "X"); - SetNodeValue(doc, posX2, cLine->GetPointList()[5].m_x); - auto posY2 = AppendNode(doc, position2, "Y"); - SetNodeValue(doc, posY2, cLine->GetPointList()[5].m_y); - auto offset = AppendNode(doc, cadProp, "Offset"); - SetNodeValue(doc, offset, cLine->GetOffset()); + auto projectNode = doc.first_node("Control"); + if(!projectNode) return false; + // auto nameNode = projectNode->first_node("Name"); + // if(!nameNode) return false; + // m_controlEditor->SetName(nameNode->value()); - // Child list - auto childsNode = AppendNode(doc, cLineNode, "ChildList"); - auto childList = cLine->GetLineChildList(); - for(auto itC = childList.begin(), itCEnd = childList.end(); itC != itCEnd; ++itC) { - ConnectionLine* childLine = *itC; - auto childNode = AppendNode(doc, childsNode, "Child"); - SetNodeAttribute(doc, childNode, "ID", childLine->GetID()); - } + // Open elements + auto elementsNode = projectNode->first_node("ControlElements"); + if(!elementsNode) return false; - // Parent list - auto parentsNode = AppendNode(doc, cLineNode, "ParentList"); - auto parentList = cLine->GetParentList(); - for(auto itP = parentList.begin(), itPEnd = parentList.end(); itP != itPEnd; ++itP) { - Element* parent = *itP; - auto parentNode = AppendNode(doc, parentsNode, "Parent"); - SetNodeAttribute(doc, parentNode, "ID", parent->GetID()); - } + std::vector<ControlElement*> elementList; + std::vector<ConnectionLine*> connectionList; - auto parentLine = AppendNode(doc, cLineNode, "ParentLine"); - if(cLine->GetParentLine()) { - ConnectionLine* parent = cLine->GetParentLine(); - SetNodeAttribute(doc, parentLine, "ID", parent->GetID()); - } else { - SetNodeAttribute(doc, parentLine, "ID", -1); + auto expListNode = elementsNode->first_node("ExponentialList"); + if(!expListNode) return false; + auto expNode = expListNode->first_node("Exponential"); + while(expNode) { + int id = GetAttributeValueInt(expNode, "ID"); + Exponential* exponential = new Exponential(id); + + auto cadPropNode = expNode->first_node("CADProperties"); + if(!cadPropNode) return false; + + auto position = cadPropNode->first_node("Position"); + double posX = GetNodeValueDouble(position, "X"); + double posY = GetNodeValueDouble(position, "Y"); + auto size = cadPropNode->first_node("Size"); + double width = GetNodeValueDouble(size, "Width"); + double height = GetNodeValueDouble(size, "Height"); + double angle = GetNodeValueDouble(cadPropNode, "Angle"); + + exponential->SetWidth(width); + exponential->SetHeight(height); + exponential->SetAngle(angle); + exponential->SetPosition(wxPoint2DDouble(posX, posY)); + exponential->StartMove(exponential->GetPosition()); + + auto nodeList = expNode->first_node("NodeList"); + if(!nodeList) return false; + auto nodeN = nodeList->first_node("Node"); + std::vector<Node*> nodeVector; + while(nodeN) { + auto nodePosition = nodeN->first_node("Position"); + double nodePosX = GetNodeValueDouble(nodePosition, "X"); + double nodePosY = GetNodeValueDouble(nodePosition, "Y"); + double nodeAngle = GetNodeValueDouble(nodeN, "Angle"); + bool isConnected = (bool)GetNodeValueInt(nodeN, "IsConnected"); + Node::NodeType nodeType = (Node::NodeType)GetNodeValueInt(nodeN, "Type"); + Node* node = new Node(wxPoint2DDouble(nodePosX, nodePosY), nodeType, 2.0); + node->SetAngle(nodeAngle); + node->SetConnected(isConnected); + nodeVector.push_back(node); + nodeN = nodeN->next_sibling("Node"); } - } //} + exponential->SetNodeList(nodeVector); + elementList.push_back(exponential); + + expNode = expNode->next_sibling("Exponential"); + } + + m_controlEditor->SetElementsList(elementList); + m_controlEditor->Redraw(); + return true; +} + +void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode) +{ + ControlElementContainer ctrlContainer; + ctrlContainer.FillContainer(m_controlEditor); //{ Constant auto constsNode = AppendNode(doc, elementsNode, "ConstantList"); @@ -1872,6 +1893,56 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::x auto value = AppendNode(doc, gainNode, "Value"); SetNodeValue(doc, value, gain->GetValue()); } //} + + //{ Connection line + auto cLinesNode = AppendNode(doc, elementsNode, "ConnectionList"); + auto connLineList = ctrlContainer.GetConnectionLineList(); + for(auto it = connLineList.begin(), itEnd = connLineList.end(); it != itEnd; ++it) { + ConnectionLine* cLine = *it; + auto cLineNode = AppendNode(doc, cLinesNode, "Connection"); + SetNodeAttribute(doc, cLineNode, "ID", cLine->GetID()); + + // CAD properties + auto cadProp = AppendNode(doc, cLineNode, "CADProperties"); + auto position1 = AppendNode(doc, cadProp, "Position1"); + auto posX1 = AppendNode(doc, position1, "X"); + SetNodeValue(doc, posX1, cLine->GetPointList()[0].m_x); + auto posY1 = AppendNode(doc, position1, "Y"); + SetNodeValue(doc, posY1, cLine->GetPointList()[0].m_y); + auto position2 = AppendNode(doc, cadProp, "Position2"); + auto posX2 = AppendNode(doc, position2, "X"); + SetNodeValue(doc, posX2, cLine->GetPointList()[5].m_x); + auto posY2 = AppendNode(doc, position2, "Y"); + SetNodeValue(doc, posY2, cLine->GetPointList()[5].m_y); + auto offset = AppendNode(doc, cadProp, "Offset"); + SetNodeValue(doc, offset, cLine->GetOffset()); + + // Child list + auto childsNode = AppendNode(doc, cLineNode, "ChildList"); + auto childList = cLine->GetLineChildList(); + for(auto itC = childList.begin(), itCEnd = childList.end(); itC != itCEnd; ++itC) { + ConnectionLine* childLine = *itC; + auto childNode = AppendNode(doc, childsNode, "Child"); + SetNodeAttribute(doc, childNode, "ID", childLine->GetID()); + } + + // Parent list + auto parentsNode = AppendNode(doc, cLineNode, "ParentList"); + auto parentList = cLine->GetParentList(); + for(auto itP = parentList.begin(), itPEnd = parentList.end(); itP != itPEnd; ++itP) { + Element* parent = *itP; + auto parentNode = AppendNode(doc, parentsNode, "Parent"); + SetNodeAttribute(doc, parentNode, "ID", parent->GetID()); + } + + auto parentLine = AppendNode(doc, cLineNode, "ParentLine"); + if(cLine->GetParentLine()) { + ConnectionLine* parent = cLine->GetParentLine(); + SetNodeAttribute(doc, parentLine, "ID", parent->GetID()); + } else { + SetNodeAttribute(doc, parentLine, "ID", -1); + } + } //} } void FileHanding::SaveControlNodes(rapidxml::xml_document<>& doc, @@ -1895,14 +1966,26 @@ void FileHanding::SaveControlNodes(rapidxml::xml_document<>& doc, } } -void FileHanding::SaveControlChildren(rapidxml::xml_document<>& doc, - rapidxml::xml_node<>* childrenNode, - std::vector<Node*> childList) +// void FileHanding::SaveControlChildren(rapidxml::xml_document<>& doc, +// rapidxml::xml_node<>* childrenNode, +// std::vector<Node*> childList) +//{ +// +//} + +ControlElement* FileHanding::GetControlElementFromID(std::vector<ControlElement*> elementList, int id) +{ + for(auto it = elementList.begin(), itEnd = elementList.end(); it != itEnd; ++it) { + ControlElement* element = *it; + if(element->GetID() == id) return element; + } + return NULL; +} - rapidxml::xml_node<>* FileHanding::AppendNode(rapidxml::xml_document<>& doc, - rapidxml::xml_node<>* parentNode, - const char* name, - rapidxml::node_type nodeType) +rapidxml::xml_node<>* FileHanding::AppendNode(rapidxml::xml_document<>& doc, + rapidxml::xml_node<>* parentNode, + const char* name, + rapidxml::node_type nodeType) { rapidxml::xml_node<>* node = doc.allocate_node(nodeType, name); parentNode->append_node(node); @@ -1981,3 +2064,12 @@ int FileHanding::GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* } return (int)iValue; } + +int FileHanding::GetAttributeValueInt(rapidxml::xml_node<>* node, const char* atrName) +{ + long intValue; + auto atr = node->first_attribute(atrName); + if(!atr) return false; + wxString(atr->value()).ToCLong(&intValue); + return (int)intValue; +}
\ No newline at end of file diff --git a/Project/FileHanding.h b/Project/FileHanding.h index a00d929..8783070 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -50,10 +50,12 @@ protected: double GetNodeValueDouble(rapidxml::xml_node<>* parent, const char* nodeName); int GetNodeValueInt(rapidxml::xml_node<>* parent, const char* nodeName); int GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* nodeName, const char* atrName); + int GetAttributeValueInt(rapidxml::xml_node<>* node, const char* atrName); void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector<Node*> nodeList); - void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector<Node*> childList); + //void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector<Node*> childList); + ControlElement* GetControlElementFromID(std::vector<ControlElement*> elementList, int id); }; #endif // FILEHANDING_H diff --git a/Project/Project.mk b/Project/Project.mk index 3dc3138..117bc4c 100644 --- a/Project/Project.mk +++ b/Project/Project.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Release +## Debug ProjectName :=Project -ConfigurationName :=Release +ConfigurationName :=Debug WorkspacePath :=C:/Users/NDSE-69/Documents/GitHub/PSP ProjectPath :=C:/Users/NDSE-69/Documents/GitHub/PSP/Project -IntermediateDirectory :=./Release +IntermediateDirectory :=./Debug OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=NDSE-69 -Date :=10/04/2017 +Date :=12/04/2017 CodeLitePath :="C:/Program Files/CodeLite" LinkerName :=C:/TDM-GCC-64/bin/g++.exe SharedObjectLinkerName :=C:/TDM-GCC-64/bin/g++.exe -shared -fPIC @@ -28,7 +28,7 @@ LibraryPathSwitch :=-L PreprocessorSwitch :=-D SourceSwitch :=-c OutputFile :=$(IntermediateDirectory)/pspufu -Preprocessors :=$(PreprocessorSwitch)NDEBUG $(PreprocessorSwitch)UNICODE +Preprocessors :=$(PreprocessorSwitch)UNICODE ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E @@ -52,8 +52,8 @@ LibPath := $(LibraryPathSwitch). AR := C:/TDM-GCC-64/bin/ar.exe rcu CXX := C:/TDM-GCC-64/bin/g++.exe CC := C:/TDM-GCC-64/bin/gcc.exe -CXXFLAGS := -O2 -Wall $(shell wx-config --cflags) $(Preprocessors) -CFLAGS := -O2 -Wall $(Preprocessors) +CXXFLAGS := -g -O0 -Wall $(shell wx-config --cflags) $(Preprocessors) +CFLAGS := -g -O0 -Wall $(Preprocessors) ASFLAGS := AS := C:/TDM-GCC-64/bin/as.exe @@ -89,11 +89,11 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) MakeIntermediateDirs: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" $(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" + @$(MakeDirCommand) "./Debug" PreBuild: @@ -645,6 +645,6 @@ $(IntermediateDirectory)/IOControlForm.cpp$(PreprocessSuffix): IOControlForm.cpp ## Clean ## clean: - $(RM) -r ./Release/ + $(RM) -r ./Debug/ diff --git a/Project/Project.txt b/Project/Project.txt index e29b621..70535ac 100644 --- a/Project/Project.txt +++ b/Project/Project.txt @@ -1 +1 @@ -./Release/main.cpp.o ./Release/win_resources.rc.o ./Release/ElementDataObject.cpp.o ./Release/Element.cpp.o ./Release/ArtMetro.cpp.o ./Release/wxGLString.cpp.o ./Release/MainFrame.cpp.o ./Release/Workspace.cpp.o ./Release/FileHanding.cpp.o ./Release/ControlEditor.cpp.o ./Release/Camera.cpp.o ./Release/MainFrameBitmaps.cpp.o ./Release/WorkspaceBitmaps.cpp.o ./Release/BusFormBitmaps.cpp.o ./Release/ElementFormBitmaps.cpp.o ./Release/ControlEditorBitmaps.cpp.o ./Release/MainFrameBase.cpp.o ./Release/WorkspaceBase.cpp.o ./Release/ElementForm.cpp.o ./Release/ControlEditorBase.cpp.o ./Release/Bus.cpp.o ./Release/Line.cpp.o ./Release/Transformer.cpp.o ./Release/Machines.cpp.o ./Release/SyncGenerator.cpp.o ./Release/IndMotor.cpp.o ./Release/Branch.cpp.o ./Release/SyncMotor.cpp.o ./Release/Shunt.cpp.o ./Release/Load.cpp.o ./Release/Inductor.cpp.o ./Release/Capacitor.cpp.o ./Release/PowerElement.cpp.o ./Release/ElectricCalculation.cpp.o ./Release/PowerFlow.cpp.o ./Release/Fault.cpp.o ./Release/Text.cpp.o ./Release/GraphicalElement.cpp.o ./Release/ControlElement.cpp.o ./Release/TransferFunction.cpp.o ./Release/ConnectionLine.cpp.o ./Release/Sum.cpp.o ./Release/Multiplier.cpp.o ./Release/Limiter.cpp.o ./Release/RateLimiter.cpp.o ./Release/Exponential.cpp.o ./Release/Constant.cpp.o ./Release/Gain.cpp.o ./Release/IOControl.cpp.o ./Release/ControlElementContainer.cpp.o ./Release/BusForm.cpp.o ./Release/GeneratorStabForm.cpp.o ./Release/LineForm.cpp.o ./Release/SwitchingForm.cpp.o ./Release/TransformerForm.cpp.o ./Release/LoadForm.cpp.o ./Release/ReactiveShuntElementForm.cpp.o ./Release/IndMotorForm.cpp.o ./Release/SyncMachineForm.cpp.o ./Release/TextForm.cpp.o ./Release/TransferFunctionForm.cpp.o ./Release/SumForm.cpp.o ./Release/LimiterForm.cpp.o ./Release/RateLimiterForm.cpp.o ./Release/ExponentialForm.cpp.o ./Release/ConstantForm.cpp.o ./Release/GainForm.cpp.o ./Release/IOControlForm.cpp.o +./Debug/main.cpp.o ./Debug/win_resources.rc.o ./Debug/ElementDataObject.cpp.o ./Debug/Element.cpp.o ./Debug/ArtMetro.cpp.o ./Debug/wxGLString.cpp.o ./Debug/MainFrame.cpp.o ./Debug/Workspace.cpp.o ./Debug/FileHanding.cpp.o ./Debug/ControlEditor.cpp.o ./Debug/Camera.cpp.o ./Debug/MainFrameBitmaps.cpp.o ./Debug/WorkspaceBitmaps.cpp.o ./Debug/BusFormBitmaps.cpp.o ./Debug/ElementFormBitmaps.cpp.o ./Debug/ControlEditorBitmaps.cpp.o ./Debug/MainFrameBase.cpp.o ./Debug/WorkspaceBase.cpp.o ./Debug/ElementForm.cpp.o ./Debug/ControlEditorBase.cpp.o ./Debug/Bus.cpp.o ./Debug/Line.cpp.o ./Debug/Transformer.cpp.o ./Debug/Machines.cpp.o ./Debug/SyncGenerator.cpp.o ./Debug/IndMotor.cpp.o ./Debug/Branch.cpp.o ./Debug/SyncMotor.cpp.o ./Debug/Shunt.cpp.o ./Debug/Load.cpp.o ./Debug/Inductor.cpp.o ./Debug/Capacitor.cpp.o ./Debug/PowerElement.cpp.o ./Debug/ElectricCalculation.cpp.o ./Debug/PowerFlow.cpp.o ./Debug/Fault.cpp.o ./Debug/Text.cpp.o ./Debug/GraphicalElement.cpp.o ./Debug/ControlElement.cpp.o ./Debug/TransferFunction.cpp.o ./Debug/ConnectionLine.cpp.o ./Debug/Sum.cpp.o ./Debug/Multiplier.cpp.o ./Debug/Limiter.cpp.o ./Debug/RateLimiter.cpp.o ./Debug/Exponential.cpp.o ./Debug/Constant.cpp.o ./Debug/Gain.cpp.o ./Debug/IOControl.cpp.o ./Debug/ControlElementContainer.cpp.o ./Debug/BusForm.cpp.o ./Debug/GeneratorStabForm.cpp.o ./Debug/LineForm.cpp.o ./Debug/SwitchingForm.cpp.o ./Debug/TransformerForm.cpp.o ./Debug/LoadForm.cpp.o ./Debug/ReactiveShuntElementForm.cpp.o ./Debug/IndMotorForm.cpp.o ./Debug/SyncMachineForm.cpp.o ./Debug/TextForm.cpp.o ./Debug/TransferFunctionForm.cpp.o ./Debug/SumForm.cpp.o ./Debug/LimiterForm.cpp.o ./Debug/RateLimiterForm.cpp.o ./Debug/ExponentialForm.cpp.o ./Debug/ConstantForm.cpp.o ./Debug/GainForm.cpp.o ./Debug/IOControlForm.cpp.o |