Skip to content

Instantly share code, notes, and snippets.

View martonmiklos's full-sized avatar

Miklós Márton martonmiklos

View GitHub Profile
@martonmiklos
martonmiklos / gist:6e7d57be9570e5b5ef53
Created December 13, 2014 15:21
Quit action for a Qt application with a Do not ask again checkbox
void MainWindow::on_actionQuit_triggered()
{
bool exit = false;
QSettings settings;
if (settings.value("quitWithoutPrompt").toBool()) {
exit = true;
} else {
QMessageBox quitQuestion;
QCheckBox checkBox;
checkBox.setText(tr("Do not ask again"));
#include <ros/ros.h>
#include <ros/publisher.h>
#include <ros/master.h>
int main(int argc, char** argv)
{
ros::init(argc, argv, "ros_something");
ros::start();
XmlRpc::XmlRpcValue params("ros_topic_list");
@martonmiklos
martonmiklos / ProfileStatusIndicator.qml
Created October 13, 2016 11:31
ProfileStatusIndicator.qml
GNU nano 2.2.6 File: /usr/share/lipstick-jolla-home-qt5/statusarea/ProfileStatusIndicator.qml
/****************************************************************************
**
** Copyright (C) 2013 Jolla Ltd.
** Contact: Vesa Halttunen <vesa.halttunen@jollamobile.com>
**
****************************************************************************/
import QtQuick 2.0
uint8_t batter_check()
{
uint16_t cell_2;
uint16_t cell_3;
uint16_t cell_4;
uint8_t cell_count = 0;
cell_2 = designvoltage / 2;
cell_3 = designvoltage / 3;
cell_4 = designvoltage / 4;
uint8_t batter_check()
{
if ((6000 < designvoltage)&&(designvoltage < 8000))
{
return 2;
}
if ((9000 < designvoltage)&&(designvoltage < 12000))
{
return 3;
uint8_t batter_check()
{
uint8_t cell_count = 0;
uint8_t led_color = 0; // 0 zöld 1 sárga 2 piros
/* cella feszek a cell_voltages -ben vannak ami egy uint16_t cell_1_voltages[4];*/
if ((3000 < designvoltage / 2)&&(designvoltage / 2 < 4000))
{
--
primary: false
superPrimary: false
rawContactId: 400
mimeType: 10
]
[instance 0x7e0570: 0x7e0014/com.mediatek.apst.util.entity.contacts.StructuredName
field data:
0x7e0006/com.mediatek.apst.util.entity.DatabaseRecordEntity:
_id: 1403
for (size_t i = 0; i < vel_joint_names.size(); ++i)
{
hardware_interface::JointStateHandle joint_state_handle(vel_joint_names[i],
&joints_[i].act_pos, &joints_[i].act_vel, &dummy_effort);
joint_state_interface_.registerHandle(joint_state_handle);
hardware_interface::JointHandle joint_handle(
joint_state_handle, &joints_[i].ref_vel);
velocity_joint_interface_.registerHandle(joint_handle);
}
for (size_t i = 0; i < vel_joint_names.size(); ++i)
{
hardware_interface::JointStateHandle joint_state_handle(vel_joint_names[i],
&joints_[i].act_pos, &joints_[i].act_vel, &dummy_effort);
joint_state_interface_.registerHandle(joint_state_handle);
hardware_interface::JointHandle joint_handle(
joint_state_handle, &joints_[i].ref_vel);
velocity_joint_interface_.registerHandle(joint_handle);
}
for (size_t i = 0; i < vel_joint_names.size(); ++i)
{
hardware_interface::JointStateHandle joint_state_handle(vel_joint_names[i],
&joints_[i].act_pos, &joints_[i].act_vel, &dummy_effort);
joint_state_interface_.registerHandle(joint_state_handle);
hardware_interface::JointHandle joint_handle(
joint_state_handle, &joints_[i].ref_vel);
velocity_joint_interface_.registerHandle(joint_handle);
}