Easy Raspberry Pi GUI App Development Beginner Part 2

Easy Raspberry Pi GUI App Development Beginner Part 2

Git Sourth

スクリーンショット 2020-04-11 21.51.04.png

Development flow

  1. Realization of binding between DataGridView and Model TreeView --How to deploy to Raspberry Pi Note on connecting from Mac to Raspberry Pi with RealVNC --Development tips, designer tool operation tips

How to change the design

Click MainWindow to launch the GUI designer tool. Drag the part from the toolbox. スクリーンショット 2020-04-12 2.14.06.png

After putting Fixed in VBox, you can adjust the layout inside the box by setting the height of Fixed. スクリーンショット 2020-04-18 11.36.39.png

Official development guide

Explanation of Button Control

How to write the coding for TreeView

About the contents of the app

It is an application that manages data running on Linux. List Insert Update Delete works. I'm using Sqlite3

How to run on Linux

Install GTKSharp

install glade $ sudo apt-get install glade

Install MonoDevelop on Linux

Postscript 4/14 Be sure to go to User Settings-Project-Build ** Disable "Build with MSBuild instead of xbuild" **

Missing Microsoft.CSharp.Core.targets file error

“/Home/pi/,cache/MonoDevelop/7.0/MSBuild/1068_1/Microsoft.CSharp.Core.targets was not found.

If you get

~~ Solution-Refer-Add or update Microsoft.CSharp ~~ ~~ If you still get an error ~~ ~~ RaspberryPi-Display-Display hidden folders ~~ ~~ MSBuild / If there are multiple folders under, delete both ~~ ~~ Add Microsoft.CSharp again ~~

Postscript 4/14 User Settings-Project-Build I get an error ** Disable "Build with MSBuild instead of xbuild" **

スクリーンショット 2020-04-14 11.13.57.png

https://github.com/mono/mono/issues/14875

This is a setting you need to do in Monodevelop before starting a new project. Search under Settings and disable "Create with MSBuild instead of xbuild"

How to debug when it works on Mac but not on Linux

Install and launch monodevelop $ monodevelop

Load and debug the Visual Studio SIN file Visual Studio Sin files on Windows and Visul Studio files on Mac are compatible

Deploy to Raspberry Pi

  1. Mount using NetTalk  sudo apt-get install netatalk https://studio.beatnix.co.jp/diary/apple/mac2raspberry-pi/ https://qiita.com/junkoda/items/d024ee0bf6c50d2f3cc4

  2. Use RealVnc

Use RealVnc which is pre-installed on Raspberry Pi. Connect from Mac to Raspberry Pi with RealVnc You can also connect from the Finder, but you cannot transfer files, so use RealVncViewr to connect.

About data binding in Linux GUI apps

Official site describes how to bind.

Impressions of ease of binding development

WindowsForm bindings> Cococa bindings >>> Gtk bindings

type Impressions
WindowsForm Select the class property name from the part property window Connect to the DB from the property window
CoCoa Select a part in StoryBoard, set ArrayController etc. and connect with DB, set in the property window of the part A little coding
Gtk Implemented by coding

How to run a file on Linux

Double-click the icon file $ mono app path

Binding library

I made a library that simply generates bindings.

void _mkTreeView() {

	Gtk.TreeViewColumnEx artistColumn = new Gtk.TreeViewColumnEx();
	artistColumn._mkCellRendererText();
	artistColumn.Sizing = TreeViewColumnSizing.Fixed;
	artistColumn.FixedWidth = 200;
	artistColumn.Title = "Artist";
	artistColumn.bindingPropertyName = "Artist";

	treeview.AppendColumn(artistColumn);

	artistColumn._mkBinding();

	this.ShowAll();

}

TreeViewColumnEx

File bundling

There seems to be a way to run it without installing mono. It seems that the dll can be bundled and distributed. There seems to be a way to make it in .dmg format. http://wraikny.hatenablog.com/entry/2018/03/29/225021 https://qiita.com/econa77/items/d0e7d3a75d8fd3bb7777

exe encryption

Introduction and use of .NET program obfuscation tool

I've bought Babel before and it worked fine and was reasonably priced.

Sqlite encryption

sqlcipher

There is software called sqlcipher, which can be used free of charge if implemented from open source.

Password encryption / decryption of SQLite3 DB for each file

Impressions

I was able to easily create a data app using the GUI Windows and Cocoa are easier to develop for treeView and bindings.

Please let me know if there is any convenient way to make GTK.

Tips for developing and operating designer tools

Event handler method statements are automatically generated when you press Clicked
スクリーンショット 2020-04-10 19.13.40.png
Useful for displaying document outlines
スクリーンショット 2020-04-10 19.12.08.png ##### Layout using VBox and HBox, and place buttons and TreeView inside [Official video](https://www.youtube.com/watch?v=yQihbDcnmNA) has a commentary on creating a layout. スクリーンショット 2020-04-10 19.24.12.png
FatViewController measures: Classes were categorized using partial classes
スクリーンショット 2020-04-10 19.15.12.png
You can check the source of GTk samples on Git on the site called hotexamples.

I will list the sources that are coming from git

Search by * c # gtk hotexamples method name etc. *

スクリーンショット 2020-04-09 21.29.09.png

I found a site where you can browse the GTK source on GitHub like this

Sqlite management software

It is a convenient software although it is charged.

Sqlite management

Applications you are considering using

I am thinking of using it as a database application on Raspberry Pi. I am thinking of a management application that displays and sends the information fetched by the sensor in a list.

C # side Use database application Sqlite3 Export API client source with Swagger Codegen Tensorflow (GPU version of C # is faster) C # version of OpenCV C # version of picamera Combined with Swagger, a Web API communication library for third parties IO related Run python script

Python side Various sensors written with python are written with python IO related

If there is a sensor written in C #, write it in C #

Easy Raspberry Pi GUI App Development Beginner Part 1 Easy introduction to Raspberry Pi Gui application development Easy Raspberry Pi GUI application development parts sample collection

Recommended Posts

Easy Raspberry Pi GUI App Development Beginner Part 1
Easy Raspberry Pi GUI App Development Beginner Part 2
Easy GUI app with Tkinter Text
"Honwaka Notification Lamp" on Raspberry Pi Part 2
"Honwaka Notification Lamp" on Raspberry Pi Part 1
"Honwaka Notification Lamp" on Raspberry Pi Part 3
Matrix multiplication on Raspberry Pi GPU (Part 2)
[Python] Udemy Image Judgment AI App Development Part1
Easy connection between Raspberry Pi and AWS IoT
Stock investment analysis app made with Raspberry Pi
Build a Python development environment on Raspberry Pi
Raspberry Pi backup
Easy IoT to start with Raspberry Pi and MESH
Problems and countermeasures in smartphone app game development Part 1
Try to visualize the room with Raspberry Pi, part 1
Problems and countermeasures in smartphone app game development Part 2