From: Joel Holdsworth Date: Wed, 21 Jan 2015 01:11:22 +0000 (-0500) Subject: Added InputOutput binding X-Git-Tag: pulseview-0.3.0~241 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=0c9136370d062b08e47657e12f77518197d89339 Added InputOutput binding --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6848be50..99314d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,7 @@ set(pulseview_SOURCES pv/storesession.cpp pv/util.cpp pv/binding/binding.cpp + pv/binding/inputoutput.cpp pv/binding/device.cpp pv/data/analog.cpp pv/data/analogsegment.cpp diff --git a/pv/binding/inputoutput.cpp b/pv/binding/inputoutput.cpp new file mode 100644 index 00000000..42ebf062 --- /dev/null +++ b/pv/binding/inputoutput.cpp @@ -0,0 +1,114 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2015 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include "inputoutput.hpp" + +using boost::none; + +using std::make_pair; +using std::map; +using std::pair; +using std::shared_ptr; +using std::string; +using std::vector; + +using Glib::VariantBase; +using Glib::VariantType; + +using sigrok::Option; + +using pv::prop::Double; +using pv::prop::Enum; +using pv::prop::Int; +using pv::prop::Property; +using pv::prop::String; + +namespace pv { +namespace binding { + +InputOutput::InputOutput( + const map> &options) +{ + for (pair> o : options) + { + const shared_ptr