Bläddra i källkod

Use "CmdLineModule" naming convention in test modules.

Sascha Zelzer 13 år sedan
förälder
incheckning
bca72adf2f

+ 0 - 2
Libs/CommandLineModules/Core/Testing/CLIModules/Blur2dImage/CMakeLists.txt

@@ -1,2 +0,0 @@
-
-ctkFunctionCreateCLIModule(Blur2dImage)

+ 0 - 24
Libs/CommandLineModules/Core/Testing/CLIModules/CMakeLists.txt

@@ -1,24 +0,0 @@
-
-# This is very simple and for test purposes
-# only. Relies on naming conventions and has
-# no extensive error checking yet.
-function(ctkFunctionCreateCLIModule name)
-  set(_src_files ${ARGN})
-  list(APPEND _src_files ctkCLIModule${name}.cpp)
-  qt4_add_resources(_src_files ctkCLIModule${name}.qrc)
-
-  add_executable(ctkCLIModule${name} ${_src_files})
-  target_link_libraries(ctkCLIModule${name} CTKCore ${QT_LIBRARIES})
-  add_dependencies(ctkCLITestModules ctkCLIModule${name})
-endfunction()
-
-set(_cli_modules
-  Blur2dImage
-  Tour
-)
-
-add_custom_target(ctkCLITestModules)
-
-foreach(_cli_module ${_cli_modules})
-  add_subdirectory(${_cli_module})
-endforeach()

+ 0 - 2
Libs/CommandLineModules/Core/Testing/CLIModules/Tour/CMakeLists.txt

@@ -1,2 +0,0 @@
-
-ctkFunctionCreateCLIModule(Tour)

+ 0 - 115
Libs/CommandLineModules/Core/Testing/CLIModules/ctkCLIModuleBlur2dImage.xml

@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<executable>
-  <category>Tours</category>
-  <title>Execution Model Tour</title>
-  <description>
-  Shows one of each type of parameter.
-  </description>
-  <version>1.0</version>
-  <documentation-url></documentation-url>
-  <license></license>
-  <contributor>Daniel Blezek</contributor>
-
-  <parameters>
-    <label>Scalar Parameters</label>
-    <description>
-    Variations on scalar parameters
-    </description>
-    <integer>
-      <name>integerVariable</name>
-      <flag>i</flag>
-      <longflag>integer</longflag>
-      <description>
-      An integer without constraints
-      </description>
-      <label>Integer Parameter</label>
-      <default>30</default>
-    </integer>
-    <boolean>
-      <name>booleanParam</name>
-      <flag>b</flag>
-      <description>
-      A boolean without constraints
-      </description>
-      <label>Boolean Parameter</label>
-    </boolean>
-    <file>
-    <name>fileVar</name>
-    <index>3</index>
-    <description>Some file</description>
-    <label>Some file</label>
-    <default>bla</default>
-    <channel>input</channel>
-    </file>
-    <directory>
-    <name>dirVar</name>
-    <index>6</index>
-    <description>Some dir</description>
-        <label>Some dir</label>
-    <default>/home</default>
-    <channel>output</channel>
-    </directory>
-    <geometry fileExtensions="*.jpg, *.txt">
-    <name>geomVar</name>
-    <index>3</index>
-    <description>Some geom</description>
-    <label>Some geom</label>
-    </geometry>
-    <double>
-      <name>doubleVariable</name>
-      <flag>d</flag>
-      <longflag>double</longflag>
-      <description>An double with constraints</description>
-      <label>Double Parameter</label>
-      <default>30</default>
-      <constraints>
-        <minimum>0</minimum>
-        <maximum>1.e3</maximum>
-        <step>0</step>
-      </constraints>
-    </double>
-  </parameters>
-
-  <parameters advanced="true">
-    <label>Vector Parameters</label>
-    <description>Variations on vector parameters</description>
-    <float-vector>
-      <name>floatVector</name>
-      <flag>f</flag>
-      <description>A vector of floats</description>
-      <label>Float Vector Parameter</label>
-      <default>1.3,2,-14</default>
-    </float-vector>
-    <string-vector>
-      <name>stringVector</name>
-      <longflag>string_vector</longflag>
-      <description>A vector of strings</description>
-      <label>String Vector Parameter</label>
-      <default>"foo",bar,"foobar"</default>
-    </string-vector>
-  </parameters>
-
-  <parameters>
-    <label>Enumeration Parameters</label>
-    <description>Variations on enumeration parameters</description>
-    <string-enumeration>
-      <name>stringChoice</name>
-      <flag>e</flag>
-      <longflag>enumeration</longflag>
-      <description>An enumeration of strings</description>
-      <label>String Enumeration Parameter</label>
-      <default>foo</default>
-      <element>foo</element>
-      <element>"foobar"</element>
-      <element>foofoo</element>
-    </string-enumeration>
-    <point>
-    <name>pointVar</name>
-    <flag>p</flag>
-    <description>asf</description>
-    <label>A point</label>
-    <default>0.5,-34.2,43</default>
-      </point>
-  </parameters>
-</executable>
-

+ 1 - 1
Libs/CommandLineModules/Core/Testing/CMakeLists.txt

@@ -1,2 +1,2 @@
-add_subdirectory(CLIModules)
+add_subdirectory(Modules)
 #add_subdirectory(Cpp)

+ 2 - 0
Libs/CommandLineModules/Core/Testing/Modules/Blur2dImage/CMakeLists.txt

@@ -0,0 +1,2 @@
+
+ctkFunctionCreateCmdLineModule(Blur2dImage)

+ 5 - 5
Libs/CommandLineModules/Core/Testing/CLIModules/Blur2dImage/ctkCLIModuleBlur2dImage.cpp

@@ -24,6 +24,7 @@
 #include <QCoreApplication>
 #include <QTextStream>
 #include <QFile>
+#include <QDebug>
 
 #include <cstdlib>
 
@@ -32,7 +33,7 @@ int main(int argc, char* argv[])
   QCoreApplication app(argc, argv);
   // This is used by QSettings
   QCoreApplication::setOrganizationName("CommonTK");
-  QCoreApplication::setApplicationName("CLIModuleBlur2dImage");
+  QCoreApplication::setApplicationName("CmdLineModuleBlur2dImage");
 
   ctkCommandLineParser parser;
   // Use Unix-style argument names
@@ -50,8 +51,7 @@ int main(int argc, char* argv[])
   QHash<QString, QVariant> parsedArgs = parser.parseArguments(QCoreApplication::arguments(), &ok);
   if (!ok)
   {
-    err << "Error parsing arguments: "
-                                              << parser.errorString() << "\n";
+    err << "Error parsing arguments: " << parser.errorString() << "\n";
     return EXIT_FAILURE;
   }
 
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
 
   if (parsedArgs.contains("xml"))
   {
-    QFile xmlDescription(":/ctkCLIModuleBlur2dImage.xml");
+    QFile xmlDescription(":/ctkCmdLineModuleBlur2dImage.xml");
     xmlDescription.open(QIODevice::ReadOnly);
     out << xmlDescription.readAll();
     return EXIT_SUCCESS;
@@ -72,7 +72,7 @@ int main(int argc, char* argv[])
 
   // Do something
 
-  //out << "Got parameter: " << QCoreApplication::arguments();
+  qDebug() << "Got parameter: " << QCoreApplication::arguments();
 
   return EXIT_SUCCESS;
 }

+ 1 - 1
Libs/CommandLineModules/Core/Testing/CLIModules/Blur2dImage/ctkCLIModuleBlur2dImage.qrc

@@ -1,5 +1,5 @@
 <RCC>
     <qresource prefix="/">
-        <file>ctkCLIModuleBlur2dImage.xml</file>
+        <file>ctkCmdLineModuleBlur2dImage.xml</file>
     </qresource>
 </RCC>

Libs/CommandLineModules/Core/Testing/CLIModules/Blur2dImage/ctkCLIModuleBlur2dImage.xml → Libs/CommandLineModules/Core/Testing/Modules/Blur2dImage/ctkCmdLineModuleBlur2dImage.xml


+ 24 - 0
Libs/CommandLineModules/Core/Testing/Modules/CMakeLists.txt

@@ -0,0 +1,24 @@
+
+# This is very simple and for test purposes
+# only. Relies on naming conventions and has
+# no extensive error checking yet.
+function(ctkFunctionCreateCmdLineModule name)
+  set(_src_files ${ARGN})
+  list(APPEND _src_files ctkCmdLineModule${name}.cpp)
+  qt4_add_resources(_src_files ctkCmdLineModule${name}.qrc)
+
+  add_executable(ctkCmdLineModule${name} ${_src_files})
+  target_link_libraries(ctkCmdLineModule${name} CTKCore ${QT_LIBRARIES})
+  add_dependencies(ctkCmdLineTestModules ctkCmdLineModule${name})
+endfunction()
+
+set(_cmdline_modules
+  Blur2dImage
+  Tour
+)
+
+add_custom_target(ctkCmdLineTestModules)
+
+foreach(_cmdline_module ${_cmdline_modules})
+  add_subdirectory(${_cmdline_module})
+endforeach()

+ 2 - 0
Libs/CommandLineModules/Core/Testing/Modules/Tour/CMakeLists.txt

@@ -0,0 +1,2 @@
+
+ctkFunctionCreateCmdLineModule(Tour)

+ 2 - 2
Libs/CommandLineModules/Core/Testing/CLIModules/Tour/ctkCLIModuleTour.cpp

@@ -32,7 +32,7 @@ int main(int argc, char* argv[])
   QCoreApplication app(argc, argv);
   // This is used by QSettings
   QCoreApplication::setOrganizationName("CommonTK");
-  QCoreApplication::setApplicationName("CLIModuleTour");
+  QCoreApplication::setApplicationName("CmdLineModuleTour");
 
   ctkCommandLineParser parser;
   // Use Unix-style argument names
@@ -61,7 +61,7 @@ int main(int argc, char* argv[])
 
   if (parsedArgs.contains("xml"))
   {
-    QFile xmlDescription(":/ctkCLIModuleTour.xml");
+    QFile xmlDescription(":/ctkCmdLineModuleTour.xml");
     xmlDescription.open(QIODevice::ReadOnly);
     QTextStream(stdout, QIODevice::WriteOnly) << xmlDescription.readAll();
   }

+ 1 - 1
Libs/CommandLineModules/Core/Testing/CLIModules/Tour/ctkCLIModuleTour.qrc

@@ -1,5 +1,5 @@
 <RCC>
     <qresource prefix="/">
-        <file>ctkCLIModuleTour.xml</file>
+        <file>ctkCmdLineModuleTour.xml</file>
     </qresource>
 </RCC>

Libs/CommandLineModules/Core/Testing/CLIModules/Tour/ctkCLIModuleTour.xml → Libs/CommandLineModules/Core/Testing/Modules/Tour/ctkCmdLineModuleTour.xml