Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Geithner, Thomas
desk-control
Commits
e381da02
Commit
e381da02
authored
Sep 20, 2017
by
Mall, Anon
Browse files
linakdesk constructor
parent
1027f06e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/desk-controller.cpp
View file @
e381da02
...
...
@@ -129,6 +129,29 @@ DummyDesk::doDeskControl()
}
}
LinakDesk
::
LinakDesk
(
std
::
string
offset_file
)
:
Controller
(
offset_file
),
m_smallStep
(
false
),
m_finished
(
true
)
{
unique_lock
<
mutex
>
lck
(
m_cmdMutex
);
if
(
libusb_init
(
0
)
!=
0
)
{
fprintf
(
stderr
,
"Error failed to init libusb"
);
}
libusb_set_debug
(
0
,
LIBUSB_LOG_LEVEL_WARNING
);
//and let usblib be verbose
m_udev
=
usb2lin06
::
openDevice
();
if
(
m_udev
==
NULL
)
{
fprintf
(
stderr
,
"Error NO device"
);
cout
<<
"could not USB device"
<<
endl
;
}
initDevice
(
m_udev
);
m_currentHeight
=
getInternalHeight
();
lck
.
unlock
();
}
void
LinakDesk
::
setHeight
(
int
height
)
{
...
...
@@ -197,26 +220,9 @@ LinakDesk::move(Command cmd)
void
LinakDesk
::
doDeskControl
(
void
)
{
m_finished
=
true
;
unique_lock
<
mutex
>
lck
(
m_cmdMutex
);
if
(
libusb_init
(
0
)
!=
0
)
{
fprintf
(
stderr
,
"Error failed to init libusb"
);
}
libusb_set_debug
(
0
,
LIBUSB_LOG_LEVEL_WARNING
);
//and let usblib be verbose
m_udev
=
usb2lin06
::
openDevice
();
if
(
m_udev
==
NULL
)
{
fprintf
(
stderr
,
"Error NO device"
);
cout
<<
"could not USB device"
<<
endl
;
}
initDevice
(
m_udev
);
m_currentHeight
=
getInternalHeight
();
int
target_height
=
m_currentHeight
;
lck
.
unlock
();
while
(
true
)
{
lck
.
lock
();
...
...
src/desk-controller.h
View file @
e381da02
...
...
@@ -91,6 +91,7 @@ class LinakDesk : public Controller
Operation
operationState
;
};
LinakDesk
(
std
::
string
offset_file
=
"desk_offset.conf"
);
virtual
void
doDeskControl
(
void
);
virtual
void
setHeight
(
int
height
);
virtual
int
getHeight
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment