diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..9acbd6a --- /dev/null +++ b/.clang-format @@ -0,0 +1,32 @@ +# Logic style +Language: Cpp +# manually added flags +FixNamespaceComments: 'false' +SortIncludes: 'false' + + +# flags copied from web editor, https://zed0.co.uk/clang-format-configurator/ +AllowShortBlocksOnASingleLine: 'false' +AllowShortCaseLabelsOnASingleLine: 'false' +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: 'false' +AllowShortLoopsOnASingleLine: 'false' +AlwaysBreakAfterReturnType: None +AlwaysBreakTemplateDeclarations: 'true' +BreakBeforeBraces: Allman +ColumnLimit: '140' +ConstructorInitializerAllOnOneLineOrOnePerLine: 'true' +ContinuationIndentWidth: '4' +Cpp11BracedListStyle: 'false' +IndentWidth: '4' +KeepEmptyLinesAtTheStartOfBlocks: 'false' +MaxEmptyLinesToKeep: '2' +NamespaceIndentation: All +PointerAlignment: Left +SpaceBeforeParens: Never +SpaceInEmptyParentheses: 'false' +SpacesInCStyleCastParentheses: 'true' +SpacesInParentheses: 'true' +SpacesInSquareBrackets: 'true' +TabWidth: '4' +UseTab: Never diff --git a/.gitignore b/.gitignore index 6d27ab2..42afabf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1 @@ -Debug/ -Release/ -Debug-Legacy-1.1.14/ -*.VC.db -*.VC.opendb -*.suo -*.sln.ecd -*.vcxproj.user \ No newline at end of file +/build \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d148baa..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "AnalyzerSDK"] - path = AnalyzerSDK - url = https://github.com/saleae/AnalyzerSDK.git -[submodule "LegacyAnalyzerSDK"] - path = LegacyAnalyzerSDK - url = https://github.com/saleae/AnalyzerSDK.git diff --git a/AnalyzerSDK b/AnalyzerSDK deleted file mode 160000 index 560b7cb..0000000 --- a/AnalyzerSDK +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 560b7cb5846aed3db9ae70e2f2ef9b5a559fd144 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ef4a440 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required (VERSION 3.13) + +project(SimpleSerialAnalyzer) + +add_definitions( -DLOGIC2 ) + +# enable generation of compile_commands.json, helpful for IDEs to locate include files. +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# custom CMake Modules are located in the cmake directory. +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + +include(ExternalAnalyzerSDK) + +set(SOURCES +src/SimpleSerialAnalyzer.cpp +src/SimpleSerialAnalyzer.h +src/SimpleSerialAnalyzerResults.cpp +src/SimpleSerialAnalyzerResults.h +src/SimpleSerialAnalyzerSettings.cpp +src/SimpleSerialAnalyzerSettings.h +src/SimpleSerialSimulationDataGenerator.cpp +src/SimpleSerialSimulationDataGenerator.h +) + +add_analyzer_plugin(${PROJECT_NAME} SOURCES ${SOURCES}) diff --git a/LegacyAnalyzerSDK b/LegacyAnalyzerSDK deleted file mode 160000 index 160745b..0000000 --- a/LegacyAnalyzerSDK +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 160745b96be27868b5355f384fe797a5cbfa7913 diff --git a/Visual Studio/SimpleSerialAnalyzer.sln b/Visual Studio/SimpleSerialAnalyzer.sln deleted file mode 100644 index 4b1727f..0000000 --- a/Visual Studio/SimpleSerialAnalyzer.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleSerialAnalyzer", "SimpleSerialAnalyzer.vcxproj", "{D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Debug-Legacy-1.1.14|Win32 = Debug-Legacy-1.1.14|Win32 - Debug-Legacy-1.1.14|x64 = Debug-Legacy-1.1.14|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|Win32.ActiveCfg = Debug|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|Win32.Build.0 = Debug|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|x64.ActiveCfg = Debug|x64 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug|x64.Build.0 = Debug|x64 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|Win32.ActiveCfg = Debug-Legacy-1.1.14|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|Win32.Build.0 = Debug-Legacy-1.1.14|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|x64.ActiveCfg = Debug-Legacy-1.1.14|x64 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Debug-Legacy-1.1.14|x64.Build.0 = Debug-Legacy-1.1.14|x64 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|Win32.ActiveCfg = Release|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|Win32.Build.0 = Release|Win32 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|x64.ActiveCfg = Release|x64 - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Visual Studio/SimpleSerialAnalyzer.vcxproj b/Visual Studio/SimpleSerialAnalyzer.vcxproj deleted file mode 100644 index 93aca51..0000000 --- a/Visual Studio/SimpleSerialAnalyzer.vcxproj +++ /dev/null @@ -1,255 +0,0 @@ - - - - - Debug-Legacy-1.1.14 - Win32 - - - Debug-Legacy-1.1.14 - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {D7556E7E-A6BF-4BCE-BDC8-E66D2874C301} - SimpleSerialAnalyzer - Win32Proj - 8.1 - - - - DynamicLibrary - v140 - Unicode - true - - - DynamicLibrary - v140 - Unicode - true - - - DynamicLibrary - v140 - Unicode - - - DynamicLibrary - v140 - Unicode - - - DynamicLibrary - v140 - Unicode - - - DynamicLibrary - v140 - Unicode - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>14.0.24720.0 - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - true - - - true - - - true - - - $(SolutionDir)$(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - - - false - - - - Disabled - $(ProjectDir)..\AnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - Level3 - EditAndContinue - - - Analyzer.lib;%(AdditionalDependencies) - $(ProjectDir)..\AnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - - - Disabled - $(ProjectDir)..\LegacyAnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - Analyzer.lib;%(AdditionalDependencies) - $(ProjectDir)..\LegacyAnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - MachineX86 - - - - - Disabled - $(ProjectDir)..\AnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - ProgramDatabase - - - Analyzer64.lib;%(AdditionalDependencies) - $(ProjectDir)..\AnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - - - - - Disabled - $(ProjectDir)..\LegacyAnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - Analyzer64.lib;%(AdditionalDependencies) - $(ProjectDir)..\LegacyAnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - - - - - MaxSpeed - true - $(ProjectDir)..\AnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - Level3 - ProgramDatabase - - - Analyzer.lib;%(AdditionalDependencies) - $(ProjectDir)..\AnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - true - true - MachineX86 - - - - - MaxSpeed - true - $(ProjectDir)..\AnalyzerSDK\include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLESERIALANALYZER_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - Analyzer64.lib;%(AdditionalDependencies) - $(ProjectDir)..\AnalyzerSDK\lib;%(AdditionalLibraryDirectories) - true - Windows - true - true - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build_analyzer.py b/build_analyzer.py deleted file mode 100644 index 594d9af..0000000 --- a/build_analyzer.py +++ /dev/null @@ -1,120 +0,0 @@ -# Python 3 script to build the analyzer - -import os, glob, platform - -#find out if we're running on mac or linux and set the dynamic library extension -if platform.system().lower() == "darwin": - dylib_ext = ".dylib" -else: - dylib_ext = ".so" - -print("Running on " + platform.system()) - -#make sure the release folder exists, and clean out any .o/.so file if there are any -if not os.path.exists( "release" ): - os.makedirs( "release" ) - -os.chdir( "release" ) -o_files = glob.glob( "*.o" ) -o_files.extend( glob.glob( "*" + dylib_ext ) ) -for o_file in o_files: - os.remove( o_file ) -os.chdir( ".." ) - - -#make sure the debug folder exists, and clean out any .o/.so files if there are any -if not os.path.exists( "debug" ): - os.makedirs( "debug" ) - -os.chdir( "debug" ) -o_files = glob.glob( "*.o" ); -o_files.extend( glob.glob( "*" + dylib_ext ) ) -for o_file in o_files: - os.remove( o_file ) -os.chdir( ".." ) - -#find all the cpp files in /source. We'll compile all of them -os.chdir( "source" ) -cpp_files = glob.glob( "*.cpp" ); -os.chdir( ".." ) - -#specify the search paths/dependencies/options for gcc -include_paths = [ "./AnalyzerSDK/include" ] -link_paths = [ "./AnalyzerSDK/lib" ] -link_dependencies = [ "-lAnalyzer" ] #refers to libAnalyzer.dylib or libAnalyzer.so - -debug_compile_flags = "-O0 -w -c -fpic -g" -release_compile_flags = "-O3 -w -c -fpic" - -def run_command(cmd): - "Display cmd, then run it in a subshell, raise if there's an error" - print(cmd) - if os.system(cmd): - raise Exception("Shell execution returned nonzero status") - -#loop through all the cpp files, build up the gcc command line, and attempt to compile each cpp file -for cpp_file in cpp_files: - - #g++ - command = "g++ " - - #include paths - for path in include_paths: - command += "-I\"" + path + "\" " - - release_command = command - release_command += release_compile_flags - release_command += " -o\"release/" + cpp_file.replace( ".cpp", ".o" ) + "\" " #the output file - release_command += "\"" + "source/" + cpp_file + "\"" #the cpp file to compile - - debug_command = command - debug_command += debug_compile_flags - debug_command += " -o\"debug/" + cpp_file.replace( ".cpp", ".o" ) + "\" " #the output file - debug_command += "\"" + "source/" + cpp_file + "\"" #the cpp file to compile - - #run the commands from the command line - run_command(release_command) - run_command(debug_command) - -#lastly, link -#g++ -command = "g++ " - -#add the library search paths -for link_path in link_paths: - command += "-L\"" + link_path + "\" " - -#add libraries to link against -for link_dependency in link_dependencies: - command += link_dependency + " " - -#make a dynamic (shared) library (.so/.dylib) - -if dylib_ext == ".dylib": - command += "-dynamiclib " -else: - command += "-shared " - -#figgure out what the name of this analyzer is -analyzer_name = "" -for cpp_file in cpp_files: - if cpp_file.endswith( "Analyzer.cpp" ): - analyzer_name = cpp_file.replace( "Analyzer.cpp", "" ) - break - -#the files to create (.so/.dylib files) -if dylib_ext == ".dylib": - release_command = command + "-o release/lib" + analyzer_name + "Analyzer.dylib " - debug_command = command + "-o debug/lib" + analyzer_name + "Analyzer.dylib " -else: - release_command = command + "-o\"release/lib" + analyzer_name + "Analyzer.so\" " - debug_command = command + "-o\"debug/lib" + analyzer_name + "Analyzer.so\" " - -#add all the object files to link -for cpp_file in cpp_files: - release_command += "release/" + cpp_file.replace( ".cpp", ".o" ) + " " - debug_command += "debug/" + cpp_file.replace( ".cpp", ".o" ) + " " - -#run the commands from the command line -run_command(release_command) -run_command(debug_command) diff --git a/cmake/ExternalAnalyzerSDK.cmake b/cmake/ExternalAnalyzerSDK.cmake new file mode 100644 index 0000000..d12b7a4 --- /dev/null +++ b/cmake/ExternalAnalyzerSDK.cmake @@ -0,0 +1,57 @@ +include(FetchContent) + +# Use the C++11 standard +set(CMAKE_CXX_STANDARD 11) + +set(CMAKE_CXX_STANDARD_REQUIRED YES) + +if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY OR NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/) +endif() + +# Fetch the Analyzer SDK if the target does not already exist. +if(NOT TARGET Saleae::AnalyzerSDK) + FetchContent_Declare( + analyzersdk + GIT_REPOSITORY https://github.com/saleae/AnalyzerSDK.git + GIT_TAG alpha + GIT_SHALLOW True + GIT_PROGRESS True + ) + + FetchContent_GetProperties(analyzersdk) + + if(NOT analyzersdk_POPULATED) + FetchContent_Populate(analyzersdk) + include(${analyzersdk_SOURCE_DIR}/AnalyzerSDKConfig.cmake) + + if(APPLE OR WIN32) + get_target_property(analyzersdk_lib_location Saleae::AnalyzerSDK IMPORTED_LOCATION) + if(CMAKE_LIBRARY_OUTPUT_DIRECTORY) + file(COPY ${analyzersdk_lib_location} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + else() + message(WARNING "Please define CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DIRECTORY if you want unit tests to locate ${analyzersdk_lib_location}") + endif() + endif() + + endif() +endif() + +function(add_analyzer_plugin TARGET) + set(options ) + set(single_value_args ) + set(multi_value_args SOURCES) + cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} ) + + + add_library(${TARGET} MODULE ${_p_SOURCES}) + target_link_libraries(${TARGET} PRIVATE Saleae::AnalyzerSDK) + + set(ANALYZER_DESTINATION "Analyzers") + install(TARGETS ${TARGET} RUNTIME DESTINATION ${ANALYZER_DESTINATION} + LIBRARY DESTINATION ${ANALYZER_DESTINATION}) + + set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ANALYZER_DESTINATION} + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ANALYZER_DESTINATION}) +endfunction() \ No newline at end of file diff --git a/readme.md b/readme.md index d468764..b38c71f 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,11 @@ # Saleae Analyzer SDK Sample Analyzer The Saleae Analyzer SDK is used to create custom plugins for the Saleae Logic software. These plugins are used to decode protocol data from captured waveforms. -The libraries required to build a custom analyzer are stored in another git repository, located here: -[https://github.com/saleae/AnalyzerSDK](https://github.com/saleae/AnalyzerSDK) +To build your own protocol decoder plugin, first fork, clone, or download this repository. -This repository should be used to create new analyzers for the Saleae software. +Then, make sure you have the required software installed for development. See the [Prerequisites](#-Prerequisites) section below for details. -First, fork, clone or download this repository. Forking is recommended if you plan to use version control or share your custom analyzer publicly. - -Note - This repository contains a submodule. Be sure to include submodules when cloning, for example `git clone --recursive https://github.com/saleae/SampleAnalyzer.git`. If you download the repository from Github, the submodules are not included. In that case you will also need to download the AnalyzerSDK repository linked above and place the AnalyzerSDK folder inside of the SampleAnalyzer folder. - -*Note: an additional submodule is used for debugging on Windows, see section on Windows debugging for more information.* +## Renaming your Analyzer Once downloaded, first run the script rename_analyzer.py. This script is used to rename the sample analyzer automatically. Specifically, it changes the class names in the source code, it changes the text name that will be displayed once the custom analyzer has been loaded into the Saleae Logic software, and it updates the visual studio project. @@ -27,12 +22,89 @@ After that, the script will complete the renaming process and exit. SPI Mark's SPI Analyzer -To build on Windows, open the visual studio project in the Visual Studio folder, and build. The Visual Studio solution has configurations for 32 bit and 64 bit builds. You will likely need to switch the configuration to 64 bit and build that in order to get the analyzer to load in the Windows software. +Once renamed, you're ready to build your analyzer! See the [Building your Analyzer](##-Building-your-Analyzer) section below. -To build on Linux or OSX, run the build_analyzer.py script. The compiled libraries can be found in the newly created debug and release folders. +## Prerequisites - python build_analyzer.py +### Windows -To debug on Windows, please first review the section titled `Debugging an Analyzer with Visual Studio` in the included `doc/Analyzer SDK Setup.md` document. +Dependencies: +- Visual Studio 2017 (or newer) with C++ +- CMake 3.13+ -Unfortunately, debugging is limited on Windows to using an older copy of the Saleae Logic software that does not support the latest hardware devices. Details are included in the above document. \ No newline at end of file +**Visual Studio 2017** + +*Note - newer versions of Visual Studio should be fine.* + +Setup options: +- Programming Languages > Visual C++ > select all sub-components. + +Note - if CMake has any problems with the MSVC compiler, it's likely a component is missing. + +**CMake** + +Download and install the latest CMake release here. +https://cmake.org/download/ + +### MacOS + +Dependencies: +- XCode with command line tools +- CMake 3.13+ + +Installing command line tools after XCode is installed: +``` +xcode-select --install +``` + +Then open XCode, open Preferences from the main menu, go to locations, and select the only option under 'Command line tools'. + +Installing CMake on MacOS: + +1. Download the binary distribution for MacOS, `cmake-*-Darwin-x86_64.dmg` +2. Install the usual way by dragging into applications. +3. Open a terminal and run the following: +``` +/Applications/CMake.app/Contents/bin/cmake-gui --install +``` +*Note: Errors may occur if older versions of CMake are installed.* +### Linux + +Dependencies: +- CMake 3.13+ +- gcc 5+ + +Misc dependencies: + +``` +sudo apt-get install build-essential +``` +## Building your Analyzer + +### Windows + +```bat +mkdir build +cd build +cmake .. -A x64 +cmake --build . +:: built analyzer will be located at SampleAnalyzer\build\Analyzers\Debug\SimpleSerialAnalyzer.dll +``` + +### MacOS + +```bash +mkdir build +cd build +cmake .. +cmake --build . +``` + +### Linux + +```bash +mkdir build +cd build +cmake .. +cmake --build . +``` diff --git a/rename_analyzer.py b/rename_analyzer.py index d5c35ab..9a77694 100644 --- a/rename_analyzer.py +++ b/rename_analyzer.py @@ -11,9 +11,9 @@ print("") print("") print("What would you like to call your new analyzer?") print("") -print(">>The files under '/source' will be modified to use it.") +print(">>The files under '/src' will be modified to use it.") print(">>Examples include Serial, MySerial, JoesSerial, Gamecube, Wiimote, 2Wire, etc.") -print(">>Do not inclide the trailing word 'Analyzer' this will be added automaticly.") +print(">>Do not inclide the trailing word 'Analyzer' this will be added automatically.") print("") print("(press CTRL-C to cancel)") print("") @@ -22,7 +22,7 @@ new_analyzer_name = input( "Your new analyzer name: " ) print("") print("") -print("What is the analyzer's title? (as shown in the add new anlayzer drop down)") +print("What is the analyzer's title? (as shown in the add new analyzer drop down)") print("") print(">>Examples include Async Serial, I2C, Joe's Serial, Gamecube, Wiimote, 2Wire, etc.") print("") @@ -33,24 +33,20 @@ new_analyzer_title = input( "Your new analyzer's title: " ) original_name = "SimpleSerial" +#update the CMakeLists.txt project name -vs_project_path = "Visual Studio" -os.chdir( vs_project_path ) -project_files = glob.glob("*.sln") + glob.glob("*.vcxproj") #returns only the file names, no paths. +cmake_file = glob.glob("CMakeLists.txt") -for file in project_files: +for file in cmake_file: contents = open( file, 'r' ).read() contents = contents.replace( original_name + "Analyzer", new_analyzer_name + "Analyzer" ) contents = contents.replace( original_name.upper() + "ANALYZER", new_analyzer_name.upper() + "ANALYZER" ) contents = contents.replace( original_name + "SimulationDataGenerator", new_analyzer_name + "SimulationDataGenerator" ) open( file, 'w' ).write( contents ) -os.rename( glob.glob("*.sln")[0], new_analyzer_name + "Analyzer.sln" ) -os.rename( glob.glob("*.vcxproj")[0], new_analyzer_name + "Analyzer.vcxproj" ) -source_path = "source" -os.chdir( ".." ) +source_path = "src" os.chdir( source_path ) files = dict() diff --git a/source/SimpleSerialAnalyzer.cpp b/src/SimpleSerialAnalyzer.cpp similarity index 100% rename from source/SimpleSerialAnalyzer.cpp rename to src/SimpleSerialAnalyzer.cpp diff --git a/source/SimpleSerialAnalyzer.h b/src/SimpleSerialAnalyzer.h similarity index 100% rename from source/SimpleSerialAnalyzer.h rename to src/SimpleSerialAnalyzer.h diff --git a/source/SimpleSerialAnalyzerResults.cpp b/src/SimpleSerialAnalyzerResults.cpp similarity index 100% rename from source/SimpleSerialAnalyzerResults.cpp rename to src/SimpleSerialAnalyzerResults.cpp diff --git a/source/SimpleSerialAnalyzerResults.h b/src/SimpleSerialAnalyzerResults.h similarity index 100% rename from source/SimpleSerialAnalyzerResults.h rename to src/SimpleSerialAnalyzerResults.h diff --git a/source/SimpleSerialAnalyzerSettings.cpp b/src/SimpleSerialAnalyzerSettings.cpp similarity index 100% rename from source/SimpleSerialAnalyzerSettings.cpp rename to src/SimpleSerialAnalyzerSettings.cpp diff --git a/source/SimpleSerialAnalyzerSettings.h b/src/SimpleSerialAnalyzerSettings.h similarity index 100% rename from source/SimpleSerialAnalyzerSettings.h rename to src/SimpleSerialAnalyzerSettings.h diff --git a/source/SimpleSerialSimulationDataGenerator.cpp b/src/SimpleSerialSimulationDataGenerator.cpp similarity index 100% rename from source/SimpleSerialSimulationDataGenerator.cpp rename to src/SimpleSerialSimulationDataGenerator.cpp diff --git a/source/SimpleSerialSimulationDataGenerator.h b/src/SimpleSerialSimulationDataGenerator.h similarity index 100% rename from source/SimpleSerialSimulationDataGenerator.h rename to src/SimpleSerialSimulationDataGenerator.h