From 213008ed37a546099e9daa990bf19885943b876b Mon Sep 17 00:00:00 2001 From: hskwk Date: Mon, 6 Jul 2015 11:18:51 +0900 Subject: [PATCH] 123123 --- psychlops/core/graphic/psychlops_g_shape.cpp | 5 + psychlops/core/graphic/psychlops_g_shape.h | 8 +- .../devices/psychlops_devices_parallelport.h | 5 +- .../win32/psychlops_devices_parallelport_Win32.cpp | 32 + win32gl/dev/psychlopswin32.cbp | 93 +++ .../trunk/@EasyInstaller/psychlopswin32.pj2 | 702 +++++++++++---------- .../psychlopswin32codeblockstemplate_12.11.pj2 | 2 +- .../psychlopswin32codeblockstemplate_13.12woCV.pj2 | 2 +- .../templates/wizard/PsychlopsGL/wizard.script | 12 +- .../templates/wizard/PsychlopsGL/wizard.script | 6 +- .../templates/wizard/PsychlopsGL/wizard.script | 12 +- .../templates/wizard/PsychlopsGL/wizard.script | 6 +- win32gl/test/Psychlops_win32cblibtest.cbp | 6 +- win32gl/test/bugfix.cpp | 28 +- win32gl/test/compilenew.cpp | 77 ++- 15 files changed, 617 insertions(+), 379 deletions(-) diff --git a/psychlops/core/graphic/psychlops_g_shape.cpp b/psychlops/core/graphic/psychlops_g_shape.cpp index c89a84e..4cacb6f 100644 --- a/psychlops/core/graphic/psychlops_g_shape.cpp +++ b/psychlops/core/graphic/psychlops_g_shape.cpp @@ -397,6 +397,10 @@ namespace Psychlops { datum = p; return *this; } + Polygon& Polygon::draw() { + Shape::draw_base(*Drawable::prime); + return *this; + } Polygon& Polygon::draw(Drawable& target) { Shape::draw_base(target); return *this; @@ -422,6 +426,7 @@ namespace Psychlops { return *this; } + Polygon& Polygon::centering() { Shape::centering(*Drawable::prime); return *this; } Polygon& Polygon::centering(const Figure& fig) { centering(fig.getDatum()); return *this; } Polygon& Polygon::centering(const Drawable &target) { centering(target.getCenter()); return *this; } Polygon& Polygon::centering(const double x, const double y, const double z) { centering(Point(x,y,z)); return *this; } diff --git a/psychlops/core/graphic/psychlops_g_shape.h b/psychlops/core/graphic/psychlops_g_shape.h index 3381218..73fdbac 100644 --- a/psychlops/core/graphic/psychlops_g_shape.h +++ b/psychlops/core/graphic/psychlops_g_shape.h @@ -240,12 +240,14 @@ namespace Devices // Polygon& append(const double x, const double y, const Color& col); virtual Polygon& centering(const Point &p); - virtual Polygon& draw(Drawable &target = *Drawable::prime); + virtual Polygon& draw(); + virtual Polygon& draw(Drawable &target); virtual Polygon& draw(const Color& col, Drawable &target = *Drawable::prime); virtual Polygon& draw(const Stroke& strk, Drawable &target = *Drawable::prime); - + + virtual Polygon& centering(); virtual Polygon& centering(const Figure& fig); - virtual Polygon& centering(const Drawable &target = *Drawable::prime); + virtual Polygon& centering(const Drawable &target); virtual Polygon& centering(const double x, const double y, const double z = 0); virtual Polygon& shift(const double x, const double y, const double z = 0); diff --git a/psychlops/extension/devices/psychlops_devices_parallelport.h b/psychlops/extension/devices/psychlops_devices_parallelport.h index a317e48..b26e748 100644 --- a/psychlops/extension/devices/psychlops_devices_parallelport.h +++ b/psychlops/extension/devices/psychlops_devices_parallelport.h @@ -29,7 +29,10 @@ namespace Devices { GenericParallelPort(std::string port_name, size_t pin); virtual ~GenericParallelPort(); - virtual void trigger(); + virtual void trigger(); + void trigger(int length); + void trigger(const char *data, size_t length); + void trigger(std::string data); }; } diff --git a/psychlops/platform/win32/psychlops_devices_parallelport_Win32.cpp b/psychlops/platform/win32/psychlops_devices_parallelport_Win32.cpp index e333375..36f2882 100644 --- a/psychlops/platform/win32/psychlops_devices_parallelport_Win32.cpp +++ b/psychlops/platform/win32/psychlops_devices_parallelport_Win32.cpp @@ -41,6 +41,38 @@ namespace Devices { } } + void GenericParallelPort::trigger(int dn) { + int n=1; + if(dn>0) { n=dn; } + DOCINFO diInfo = {0}; + diInfo.cbSize = sizeof (DOCINFO); + diInfo.lpszDocName = ""; + if (StartDoc((HDC)handle , &diInfo) > 0) { + for(int i=0; i 0) { + TextOut((HDC)handle , 0 , 0 , data, length); + EndDoc((HDC)handle); + } + } + + void GenericParallelPort::trigger(std::string data) { + DOCINFO diInfo = {0}; + diInfo.cbSize = sizeof (DOCINFO); + diInfo.lpszDocName = ""; + if (StartDoc((HDC)handle , &diInfo) > 0) { + TextOut((HDC)handle , 0 , 0 , data.c_str(), data.length()); + EndDoc((HDC)handle); + } + } + } } /* <- namespace Psycholops */ diff --git a/win32gl/dev/psychlopswin32.cbp b/win32gl/dev/psychlopswin32.cbp index 5c197fe..7a2ad43 100644 --- a/win32gl/dev/psychlopswin32.cbp +++ b/win32gl/dev/psychlopswin32.cbp @@ -256,6 +256,90 @@ + + + + + + @@ -344,6 +428,9 @@