OpenGL

Const Port v1.5

Finally I've gotten around to polishing off some new features in Const Port and making a version that can be released. There's a few major features added in this version and a lot of smaller things changed to the existing tool set, so let's get started explaining them.

The main feature I'd like to point out is the ability to run python scripts that interpret the input from the COM port and output data for Const Port to show. There are now a list of configuration options to set exactly how this works and what python script should be run. Then in Const Port if you hit ctrl+P it will attempt to start an instance of python and attach itself to the stdin and stdout so it can send and receive data from it. This means anything printed out by python will show up in the Const Port output window, and if you have the configuration set up correctly, any data received from the COM port will be piped to the python program for processing. There's still a bit of weirdness with how the stdio works in python so you'll have to do sys.stdout.flush() for any output to be pushed to the screen before the script has ended. For now there is an example python script called asciiHex.py that will take the com port data and output the hex values of the characters (spaces and new lines preserved).

screenshot1_5-2.png

Another major feature that has been added is the ability to define and customize your regular expression triggers to a far greater degree. You can now define as many regular expressions as you want each with it's own list of effects that should be applied should it match the line. This allows you to set more complicated formatting and line coloring than ever before. A list of possible effects can be found in the commented example expression. "new_line" and "clear_screen" have not been implemented yet but the rest of the effects work and more will be added as the project progresses.

We've also done a bit of an upgrade on the com menu to support disconnecting from the current port and configuration options for renaming the ports with any alias you want. As you can see in the screenshot above I have named my FTDI cable coming from my controller "PIC32MZ", and the other two ports that show up are for other devices on my system that I don't use so I've named them "System1" and "System2".

Another helpful feature that's been added to the platform layer is the ability to launch the default program to edit a specific file. This allows us to make better use of the gear button on the main menu to open up the GlobalConfig.json file for you to edit quickly and easily. Many of the options in the JSON file will have UI counterparts later so you won't have to leave Const Port in order to change the settings. However, for now this is a good option to make finding and opening the file easier. NOTE: If you're having trouble with it opening the file make sure you have a default program for the .json file type.

The last major thing I'd like to mention briefly is the vastly improved support for different themes. We've added a ton of new configuration color options so almost every piece of the UI color scheme can be set separately. Along with this we've made a mock "Neon" color scheme to show the potential:

screenshot1_5-3.png

So with all of those things out of the way, let's get that download link.

And, as before, there is also a debug version that will open the console window so you can see the debug output of the program if something is going wrong.

As a final note, one of the reasons this version has taken so long to release is a lot of the time has been spent on a OSX platform layer. I was planning on getting the layer usable before this release but we are still having some trouble with making the application bundle work and various configuration options like that so I've decided to release the changes as they stand now and wait till the next version before releasing the OSX variant. That being said, you can go download the source code and compile a fairly usable version for OSX if you would like. The majority of the progam's functionalities are working so it could be a very useful tool. You can download the source code below.

CHangelog:

  • Added support for running a python instance with stdin and stdout routed to through Const Port so you can make scripts that interpret the output of the COM port or perform other tasks when certain things happen.
  • Changed the way regular expression triggers are defined the configuration options to allow support for any number of triggers each with it's own list of effects that will be applied when they match the line
  • Made the settings button open the configuration file for editing with the default program chosen by the operating system.
  • Added an info window with a short description of the program that can be accessed by pressing the information button
  • Removed the arrow button from the main menu
  • Added options to switch the RX and TX LEDs between square and circular modes
  • Added more options for how the RX and TX LEDs are sized
  • Added a temporary implementation of routing the recieved text to a file without showing it on the screen. This can be started and stopped with the Ctrl+F shortcut. The file will be named after the COM port and saved in the current working directory.
  • Added an option to make the application automatically open the saved file for editing when "Save to File" button is pressed
  • Fixed some of the formatting problems with different font sizes so the buttons and windows should work a bit better with smaller or larger font sizes
  • Added the ability to choose a separate font size for the main text versus the UI text elements
  • Made the application regenerate the fonts when the configuration file is reloaded with Ctrl+R
  • Added the ability to disconnect from the current port without connecting to another one.
  • Added configuration options to allow renaming of ports with a user defined alias
  • Added better support for different naming conventions of the platform layer for available ports
  • Made the COM menu tabs more dynamic in how they choose to format their text to allow for longer names and various font sizes
  • Added a lot of new color options to allow the user to change the UI theme to much greater accuracy
  • Added an example "Neon" color scheme
  • Made the rendering of the main menu button circles dynamic to allow for greater customization
  • Made the rendering of the exit button on the menus dynamic instead of using a predefined image
  • Changed the way the main menu's height is chosen to support a greater variety of options for the RX and TX LEDs and font sizes
  • Changed the naming convention of the configuration options to be all lower case and underscores between words
  • Added a file cursor that will always show at the end of the file. Disabled the hover cursor and hover line options by default
  • Added an option to turn on auto-echo of input text  to free up the embedded application the responsibility of echoing the user's input

Const Port v1.2

Const Port version 1.2 is now finished. I added a 1.1 version to the bitbucket repository but there was only a few random features added so I didn't go through a full release announcement process. 

Version 1.2 is mainly focused around adding the ability to configure the UART settings (Baud Rate, Parity, etc.) through the COM menu. There's also a lot of other smaller features and fixes added on the side. See the changelog below for a full list of features.

The updated COM menu

The updated COM menu

Changelog:

[1.2]

  • Reformatted the COM menu to include options for Baud Rate, Num Bits, Parity mode, and Stop Bits
  • Changes to the COM menu are not applied until you press the Connect button
  • Ctrl+[1-9]  now open COM port 1-9 rather than just an index in the list of available COM ports
  • COM settings are now grouped in a single structure that can be passed around
  • Re-enabled the colorful selection for fun (4th of July?)
  • Changed the way COM ports are enumerated internally
  • Set the supported OpenGL version to 3.0. Modified the shaders to work accordingly

[1.1]

  • Added simple line marks. You can click on the line number gutter to add marks. Shift+click makes the marks slightly thicker.
  • Ctrl+M marks the last line received (Ctrl+Shift+M for thicker mark)
  • A readout in the status menu indicates time since last line was received
  • When text is selected the readout indicates how many characters are selected
  • Removed max size limit on the window
  • Disabled the TOPMOST option when compiled for release mode
  • Connected COM port is displayed in the window title and in the status bar

Const Port v1.0

So over the past year I've been working as a firmware developer and I've been frustrated with the lack of quality tools for tasks that I perform daily. I've toyed with the idea of making my own version of these tools but many of them are out of the scope of a one person development team.

However, I got the idea one day to make a better serial COM port reading application. I've tried using Putty, Tera Term, Real Term and many others, and they all have certain perks but each one comes with a heavy load of quirks and design problems. Most of them try hard to be an all-in-one terminal application that supports many types of text communications. Putty is a great tool if all you are doing is SSHing into a remote server, however when it comes to data stream reading it doesn't provide most of the features I would like. And some of the features I would expect of even the simplest text editor it has sacrificed at the hand of trying to be an All-In-One Application. 

So I decided to start making my own application. Since I spend most of my day reading debug output from my embedded applications it would be a huge time saver to have something that provides me with the functionality I need. And while I'm at it, it will provide a great platform for experimentation with features that I think would be fun or exciting.

I started working on it mid last week. I started by stripping the platform layer I had from my last project and some GLFW/GLEW code I had from the project before that and started creating a simple architecture. Like all of my projects recently it supports dynamically reloaded code with a clean line between application and platform layer. With OpenGL as the rendering technology we should be able to port it nicely to other platforms later, though for now it only works on windows. The whole thing is hand written, even the math functions for Matrices and Vectors are my own. The project compiles in C++ using the MSVC compiler however most of the code is written to C like standards.

After about a week of work I'm surprised how far the project has come. Much of the basic functionality came together quickly and I've even had time to add some of the nice features I've wanted to try. There's still a lot of things to be done before I can say it's releasable, however I feel like it already at a point that I can use it for real use at work.

The name is temporary, and likely to be changed in the future

The name is temporary, and likely to be changed in the future

I figure now that it is somewhat functional I will begin releasing versions for people to download if they would like. Keep in mind that the program DOES NOT support many of the features you might expect from a finished application. For example, currently you can only open a COM port at 115200, 8n1 settings since the UI doesn't have a place for configuration yet. If you'd like to change it, you have to recompile the application. However, since I am releasing the source code you are welcome to do so. You'll have to compile with GLEW and GLFW but other than that you should be able to get it working with only some minor path tweaks to the build.bat file.

So with all that said, if you'd still like to download it and check it out you can get a windows (x64) compiled version here:

Or you can find the source code on BitBucket: 

Since the application is so unfinished I can't guarantee that I'll be able to get to any bug reports any time soon. You can still log them on bitbucket if you'd like though. I also won't accept any pull requests. However if you have any feature suggestions I'm happy to hear them, you can email me at robbitay@gmail.com

2016 Gallery 6: Other OpenGL Stuff

A side project that never developed into anything. Simply got some rendering stuff copied over and then it was abandoned

I worked on making a rasterizer for shapes defined by quadratic curves. It works off the assumption that, taken any point you can cast a ray in any direction, count the number of intersections going one way and going the other and the resulting numb…

I worked on making a rasterizer for shapes defined by quadratic curves. It works off the assumption that, taken any point you can cast a ray in any direction, count the number of intersections going one way and going the other and the resulting number determines whether the point is inside the shape or not. The white interior here is actually a rasterized bitmap created using the curves. I looped through each pixel and performed the containment test to determine whether it was white or transparent. There was no antialiasing and it was painfully slow and unusable but it was a great educational project.

2016 Gallery 5: Bitmap Font Creator

I toyed with the idea of making a editor that would handle creating the meta-data I needed to load in and draw a bitmap font. It wasn't very useful once I found some libraries to actually render TrueType Font files into a bitmap but it was a fun project to work on.

First attempt at finding the different image parts. I believe the problem was a simple for loop comparing the y with width instead of height

Found all the characters. We are drawing them with random colors to show that they are separated

Some stuff is coming together. The blue lines indicated the alignment to the bottom of the line. The width of the characters was not adjustable yet.

Added the ability to specify the width of each character so they fit together better when drawn in a word/sentence. Also added some alignment guides

Loading a smaller font

Had some fun with shaders again and made a cool moving background for the selected and hovering characters. Added a message in the bottom right for outputting information. Also, not in the image, I tried making a Lua console that you could call C functions from. It used the fonts created from the program.

2016 Gallery 3: The Last of OpenTK

After struggling with the speed of OpenTK I worked on only a couple other projects before finally moving on. These were the last things I ever made in OpenTK

I wanted to try my hand at method for "Triangle Soup" vs. sphere collision detection. I got to the point where I had divided the levels triangles into a quad tree and tested moving the sphere around and seeing which triangles it would have to do intersection tests with

I also worked on a 2D snake game for a demonstration. It was a simple snake game with a couple more features not shown here. It had a grid that moved like Geometry wars and bombs that would spawn that you would have to dodge. It was a fun game to show people and mess with the settings (speed, spawn-rate, etc.)