2 #include "GalilController.h"
3 #include "helpers/ScopeException.h"
7 #ifdef SCOPE_USE_GALIL_XYZSTAGE
11 std::mutex GalilController::mutex;
13 GalilController::GalilController(
const std::wstring& _comstring)
14 : comstring(_comstring) {
17 std::wstring GalilController::LibraryVersion() {
18 std::lock_guard<std::mutex> lock(mutex);
19 std::wstring cstr(CA2W(Ctrl().libraryVersion().c_str()));
23 std::wstring GalilController::Connection() {
24 std::lock_guard<std::mutex> lock(mutex);
25 std::wstring cstr(CA2W(Ctrl().connection().c_str()));
29 void GalilController::SetTimeout(
const int32_t& _milliseconds) {
30 Ctrl().timeout_ms = _milliseconds;
33 std::wstring GalilController::Command(
const std::wstring& _cmd) {
34 std::lock_guard<std::mutex> lock(mutex);
35 std::string cmd(CW2A(_cmd.c_str()));
37 ret = Ctrl().command(cmd);
38 std::wstring cret(CA2W(ret.c_str()));
42 double GalilController::CommandValue(
const std::wstring& _cmd) {
43 std::lock_guard<std::mutex> lock(mutex);
44 std::string cmd = CW2A(_cmd.c_str());
45 return Ctrl().commandValue(cmd);
48 Galil& GalilController::Ctrl() {
50 std::string str = CW2A(comstring.c_str());
51 return CreateInstance(str);
55 Galil& GalilController::CreateInstance(
const std::string& stdcomstring) {
56 std::string tmp(stdcomstring);
57 static std::unique_ptr<Galil> _instance(
new Galil(tmp));
This is the include file for standard system include files, or project specific include files that ar...
void ScopeExceptionHandler(const std::string &_origin, const bool &_log, const bool &_showmessagebox, const bool &_trace, const bool &_rethrow)
Handles all exceptions and does nice logging.
Various helper functions and classes for Scope.