Skip to content

Instantly share code, notes, and snippets.

View haakov's full-sized avatar

Håkon Vågsether haakov

View GitHub Profile
@haakov
haakov / FpsController.cs
Created April 1, 2017 13:36
Unity3D FPS Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FpsController : MonoBehaviour {
public float mouseSensitivityX = 1.0f;
public float mouseSensitivityY = 1.0f;
public float walkSpeed = 10.0f;
@haakov
haakov / CMakeLists.txt
Created March 3, 2018 11:16
CMake file to compile GNU Radio display_qt C++ example standalone
find_package(Qt5Widgets REQUIRED)
include_directories(
${GR_QTGUI_INCLUDE_DIRS}
${GR_ANALOG_INCLUDE_DIRS}
${GR_FILTER_INCLUDE_DIRS}
${GR_BLOCKS_INCLUDE_DIRS}
${GR_FFT_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${QT_INCLUDE_DIRS}
@haakov
haakov / cmdline_converter.py
Last active August 2, 2023 13:07
Standalone GNU Radio XML -> YAML block converter script
#
# Short script for converting GNU Radio XML blocks to YAML blocks
# without having to start GRC
#
# Please note that this program _WILL_ overwrite files.
#
# How to use:
# 1. Save this file to grc/converter/cmdline_converter.py
# 2. Navigate back to the GNU Radio project root
# 3. Run: python3 -m grc.converter.cmdline_converter [name.xml]
id: blocks_multiply_const_vxx
label: Multiply Const
parameters:
- id: type
label: IO Type
dtype: enum
options: [complex, float, int, short]
option_attributes:
const_type: [complex_vector, real_vector, int_vector, int_vector]
@haakov
haakov / gnuradio_bools.txt
Created October 10, 2018 21:41
GNU Radio YAML files with bool parameter types
gr-analog/grc/analog_ctcss_squelch_ff.block.yml
gr-blocks/grc/blocks_burst_tagger.block.yml
gr-blocks/grc/blocks_copy.block.yml
gr-blocks/grc/blocks_file_meta_sink.block.yml
gr-blocks/grc/blocks_file_sink.block.yml
gr-blocks/grc/blocks_pdu_filter.block.yml
gr-blocks/grc/blocks_tag_debug.block.yml
gr-blocks/grc/blocks_throttle.block.yml
gr-blocks/grc/blocks_udp_sink.block.yml
gr-blocks/grc/blocks_udp_source.block.yml
@haakov
haakov / keepalive_timer.ex
Last active March 5, 2019 14:02
Elixir timer function
defmodule Elevator.Timer do
def keepalive_timer(parent, id, msecs) do
receive do
:keepalive ->
keepalive_timer(parent, id, msecs)
after
msecs ->
send(parent, {:timeout, id})
end
@haakov
haakov / BCMock.ex
Created March 5, 2019 14:37
Elixir functions for mocking UDP Broadcast
defmodule Elevator.BCMock do
def bcast_serve do
{:ok, portid} = :gen_udp.open(15660, [:binary, active: true])
server_loop(portid)
end
def server_loop(portid) do
receive do
{:udp, _, _, _, msg} ->
:gen_udp.send(portid, {127, 0, 0, 1}, 15657, msg)
@haakov
haakov / test_examples.py
Last active February 1, 2021 08:55
Test all in-tree GNU Radio examples
# Copyright 2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import pytest
import os
@haakov
haakov / prefs_singleton.txt
Created February 8, 2024 18:08
Uses of prefs::singleton in GNU Radio (Feb 2024)
gr-qtgui/lib/qtgui_util.cc:75: std::string qssfile = gr::prefs::singleton()->get_string("qtgui", "qss", "");
gr-qtgui/lib/qtgui_util.cc:76- if (!qssfile.empty()) {
gr-qtgui/lib/qtgui_util.cc:77- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
docs/usage-manual/(exported from wiki) Logging.txt:182: prefs *p = prefs::singleton();
docs/usage-manual/(exported from wiki) Logging.txt:183- std::string log_file = p->get_string("LOG", "log_config", "");
docs/usage-manual/(exported from wiki) Logging.txt:184- std::string log_level = p->get_string("LOG", "log_level", "off");
docs/usage-manual/(exported from wiki) Configuration Files.txt:63: prefs *p = prefs::singleton();
docs/usage-manual/(exported from wiki) Configuration Files.txt:64-
docs/usage-manual/(exported from wiki) Configuration Files.txt:65-The methods associated with this preferences object are (from class gr::prefs):
gr-uhd/lib/usrp_sink_impl.cc:747: gr::prefs::singleton()->get_long("uhd", "logging_interval_ms", 7