Having and issue installing pygal

This took a little longer than it should to figure out..
For what ever reason install pygal using pip on my debian stretch yielded this error.

pi@tomrpi3:~ $ pip install pygal
Collecting pygal
Exception:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 353, in run
wb.build(autobuilding=True)
File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 749, in build
self.requirement_set.prepare_files(self.finder)
File “/usr/lib/python2.7/dist-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/usr/lib/python2.7/dist-packages/pip/req/req_set.py”, line 554, in _prepare_file
require_hashes
File “/usr/lib/python2.7/dist-packages/pip/req/req_install.py”, line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 568, in _get_pages
page = self._get_page(location)
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File “/usr/lib/python2.7/dist-packages/pip/index.py”, line 792, in get_page
“Cache-Control”: “max-age=600”,
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 501, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/lib/python2.7/dist-packages/pip/download.py”, line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 488, in request
resp = self.send(prep, **send_kwargs)
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py”, line 609, in send
r = adapter.send(request, **kwargs)
File “/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py”, line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File “/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py”, line 423, in send
timeout=timeout
File “/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py”, line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File “/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py”, line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’

I get the impression that this might pip in the repo’s might not be at the correct version.
https://stackoverflow.com/questions/37495375/python-pip-install-throws-typeerror-unsupported-operand-types-for-retry

I didn’t want to go down that route, but I did find another option here:
https://www.howtoinstall.co/en/debian/stretch/python-pygal

sudo apt-get update
sudo apt-get install python-pygal

Posted in Uncategorized | Leave a comment

Exciting things happen in freecad Ver.17 and down the Rabbit hole we go.

I’m a long time Freecad user but  I’ve been staying away from the bleeding edge of development since the stable build basically worked and suited my needs.  I have had way too many irons in the fire in my life for a while and I’ve been attempting to avoid the rabbit holes as well as the blinky lights of distraction for what I want to get done.

Most of my area of my limited free-time focus has been on getting my MPCNC to work with Machinekit as well a a semi-secret(at the moment) project I’m planning on Kickstarting.    The sultry calls of the sirens of the .17 daily build of FreeCAD have been getting louder.

The work that’s being done on the freeCAD Path workbench is frankly darn impressive and development has been very rapid.   The version from the Ubuntu repository I had been using was more than a   1000+ commits behind the bleeding edge of development of the  daily-build.  So that basically got me into .17 build.    I really like what’s going on with this stuff, so at this point, so it’s worth it to me to invest some time, since I’m not planning on looking back( I hope I don’t regret this)

My other fun project is a DIY linear bearing project that I’ve been iterating for the last couple of years.  I’m in the rev “L” series at the moment. Here’s a sneak peak.

Prototype Linear bearing for the Wedgie

I’ve gotten comfortable to the idiosyncrasies of pre .17 Part Design and can work around them and saw no compelling reason to really change.
Well that’s what I was telling myself anyway.

So, I wanted to do another variant to my L series bearing and I wound up  using the daily build of .17 which I was using for Path.

There have been some major changes as you can see from the Release Notes.   Basically, the part design workbench have had a major revamp.  The most significant to me are the new  Body and Part containers.   This is a huge paradigm shift that got me feeling like a total beginner at the moment.   Unfortunately the dust hasn’t settled yet since there is still very active development, and the documentation on this stuff is a bit scattered at the moment.
There are some of the new things that you’ll be able to do.

I need to wrap my head around this, and as I figure it out and get used to it, hope to do a few blog post/videos about this.

 

Posted in Uncategorized | Leave a comment

Problems Ssh’ng into my Beaglebone Black using my W530 with Nvidia drivers

I was moving along, having all kinds of fun ssh’ng into my Beaglebone using my W530 laptop with out any difficulties.  My problems started when I wanted do use dual monitors with my docking port.   In order to do that, I needed to install the Nvidia proprietary drivers.   I got that working and than  wound up having all kinds of problems running axis in machinekit.

Here’s what was happening:

ssh -X machinekit@192.168.7.2
Debian GNU/Linux 8

Machinekit Debian Image 2017-02-12

Support/FAQ: http://www.machinekit.io/

default username:password is [machinekit:machinekit]

machinekit@192.168.7.2’s password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Mar 5 06:17:03 2017 from 192.168.7.1
machinekit@beaglebone:~$ machinekit &
[1] 6183
machinekit@beaglebone:~$ MACHINEKIT – 0.1
Machine configuration directory is ‘/home/machinekit/machinekit/configs/MPCNC’
Machine configuration file is ‘MPCNC.ini’
Starting Machinekit…
io started
emc/iotask/ioControl.cc 752: can’t load tool table.
halcmd loadusr io started
cape-universal overlay found
cape-bone-iio overlay found
task pid=7902
emcTaskInit: using builtin interpreter
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 692
Current serial number in output stream: 693
Shutting down and cleaning up Machinekit…
Cleanup done
Machinekit terminated with an error. You can find more information in the log:
/home/machinekit/linuxcnc_debug.txt
and
/home/machinekit/linuxcnc_print.txt
as well as in the output of the shell command ‘dmesg’ and in the terminal

So this took me a while to figure out which a little help from from Linux guru’s from the makerspace I belong to.

I found some suggestions at https://elrepo.org/bugs/view.php?id=610
This solution talked about  adding this to an xorg,config file in the /etc/X11/ folder

Section “ServerFlags”
Option “AllowIndirectGLX” “on” # or “off”
EndSection

I tried that and I couldn’t get that to work.
I found another fix here: https://bugzilla.gnome.org/show_bug.cgi?id=586777#c8

Recently, Xorg changed its behavior to disallow indirect GLX by default. This means that ssh -X no longer works with OpenGL applications, which is a pretty serious problem.

The only way to re-enable indirect GLX is to pass +iglx to Xorg. However, GDM has no way to pass arbitrary flags to Xorg.

The only workaround is to rename Xorg to Xorg.original and replace it with a wrapper that adds +iglx, e.g.:

#!/bin/bash
exec /usr/bin/Xorg.original "$@" +iglx

(for you kids at home, don't forget to sudo chmod +x /usr/sbin/Xorg)

So first things first we need to locate Xorg

jonasthomas@jonasthomas-ThinkPad-W530:~$ which Xorg
/usr/bin/Xorg

sudo cp /usr/bin/Xorg /usr/bin/Xorg.original

So with the with Xorg program copied into Xorg.original just replace the contents of Xorg with the file above.

This worked for me. If you have this issue as well, I hope it helps you out as well.

 

Posted in Uncategorized | Leave a comment

Its been a while. Playing around with screen resolution on a atrix lapdock for beaglebone black and machinekit

I’ve been playing around with machinekit lately and I’ve gotten around to using with my Beaglebone Black with a Cramps board.  It’s been a huge amount of fun.   I had a Atrix Lapdock that I wanted to use but I was having some issues with screen resolution.  This can be a little troublesome since I can’t to shut off warning messages that pop up.  The other issues, that I’ve been having is that if my usb is plugged into the bbb while it’s booting the keyboard and atrix mouse don’t work.  If I plug the usb in after boot up, it’s fine(weird)

The Atrix lapdock screen resolution is 1366 x 768:

So I was looking at a post   and  came up with this per the suggestion to add to  uEnv.txt

kms_force_mode=video=HDMI-A-1:1366x768M@60

Well, that didn’t work. Then a little more googling brought me to this.

http://beagleboard.org/project/Lapdock/

which suggested adding this to the uEnv.txt file:

optargs=quiet drm.debug=7 capemgr.disable_partno=BB-BONELT-HDMI video=HDMI-A-1:1360x768M@60

That worked.

 

Posted in Uncategorized | Leave a comment

Problems with the Rockbot.

I’ve been having some intermittent skipping issues on the Y-axis on my Rockbot and I wanted to go over some of my settings on my polulos..  My table is very smooth running, although in hind site it’s inertial mass is probably a little more than it should be.

Going back through my notes, I have this motor https://ultimachine.com/content/kysan-1124090-nema-17-stepper-motor

and this driver https://ultimachine.com/content/pololu-a4988-stepper-driver-heatsink-kit

If memory serves me, I sorted calibrated by feel and sound..  It probably should be dialed in a little better.

Anyway, I found this guide.

https://www.pololu.com/blog/484/video-setting-the-current-limit-on-pololu-stepper-motor-driver-carriers

So According to this it looks like my limiter is the A4988 Driver..  It looks like they only want  me to drive 1 amp with air cooling only…  My motors can handle up to 1.5 amps.

The magic formula’s are here

Another way to set the current limit is to measure the voltage on the “ref” pin and to calculate the resulting current limit (the current sense resistors are 0.05Ω). The ref pin voltage is accessible on a via that is circled on the bottom silkscreen of the circuit board. The current limit relates to the reference voltage as follows:

Current Limit = VREF × 2.5

So, for example, if the reference voltage is 0.3 V, the current limit is 0.75 A. As mentioned above, in full step mode, the current through the coils is limited to 70% of the current limit, so to get a full-step coil current of 1 A, the current limit should be 1 A/0.7=1.4 A, which corresponds to a VREF of 1.4 A/2.5=0.56 V. See the A4988 datasheet for more information.

So  I measured a reference voltage of  .156 Volts X 2.5   = 0.39 amps…
Yikes.  It looks like I’m stalling out the motor versus triggering the thermal shut off for the motors.

So seems like I want to crank this up to 1/2.5 = .4 Volts.  Something for tomorrow.

 

 

 

 

Posted in Uncategorized | Tagged | Leave a comment

More refactoring with the polyline.

I haven’t much time lately for playing around with pencil2d.   Work as well as other life commitments haven’t left much gas in the tank for me to pursue fun stuff like this.  Currently I’m having a rare quiet Sunday morning moment more or less where I can take a 50k foot view to see what I’m trying to do and hopefully break things down into some manageable bites that I can squeeze in between the chaotic moments of life.  This is going to a train of thought post that probably won’t be of any interest to anyone but me, so read at your own risk.

So far I managed to separate the bezier from the polyline in the code.  There was a desire by the pencil2d developers to have the polyline function in both the bitmap and vector modes.   This dual functionality requirement is giving me some headache at the moment.  In bitmap mode lines are stored as a bitmap.    Trying to maintain this dual functionality at the moment is just slowing me down.

But.. Some of the design requirements are…

Polyline saved as a bitmap can never be edited as a polyline.
As new polyline can be either a bitmap or vector.

Another requirement, that will need to be implemented at some point.
Need to know in the mouse movements we’re dragging a point to move a line(s) or if we’re creating a new line from an existing point.

Rather than stripping bitmap out of the polyline code completely I think I should treat it as a non-implemented feature.  I think once I get the main functionality implemented for vector mode shouldn’t be that hard to implement for bitmap.

In addition, the way the polyline data structure is going to change as well.  If memory serves me it appears the app assumes that a line will be drawn point to point… In essence there is no line object… A line object needs to be implemented.  This also means that container objects will also need to be designed etc… etc.. blah blah blah…

Also, I noticed(working from memory) that when qt renders lines it is using a 3 dimensional data to project on a 2d plane.    The pencil2d  polyline points should be 3 dimensional as opposed to planar. (This doesn’t mean we’re going to use the z at this point, but I think since qt can handle it, why not lay the foundation to have a 3d polyline so it can eventually be implemented…)   Ultimately I could see  some type vector tool of a  a constrained stick figure that could be manipulated  frame to frame in 3d space but proect on a 2d plan.,  This would give the animator a stick figure to place and  could draw around it.  Seems like that would be pretty cool to do.

As with anything all great journeys being with a single step…
Hopefully  I can map out some small additional steps as well that I can knock off on something other that a quiet Sunday.

Anyway…..  Next steps(more or less)

Research how best practise for handling non-implemented features so I get a break when debugging through the IDE, but doesn’t throw an exception when the IDE is running.

Refactor Code to polyline.cpp (et all?) that bitmap mode is a non implemented feature.

(?Need to add code that editing an existing object is a non implemented feature?)

(?Need to add code that saving an existing object is a non implemented feature?)

Create a line object.

modify the container objects to accommodate both lines and points.
(When I get this point, I need to break down a bunch of small digestible steps)

Sub goal. Draw the polyline out with a point to point line using the line object.

Get the polyline object to save.
(More sub steps to detail)
Get object to retrieve
(More sub steps to detail)

Get this working with bitmap mode.

(Need to break down additional steps)

When I get this point, the new polyline should mimic the currently existing polyline both in bitmap and vector mode. I would say that would be the point where we’re saying we’re done with that phase of the project.

That’s not to say we’re done, done… but at least it gives me a hard edge to strive for..
The next project after that would be do be able to drag a point and have the lines follow it.

Posted in Uncategorized | Leave a comment

Refactoring the polyline in pencil2d

So I’ve managed to get myself deep into the rabbit hole now.    https://github.com/pencil2d/pencil/issues/423

The way things are structured in pencil2d is that a polyline would be drawn in bitmap mode and  a bezier would be drawn in vector mode.  In my mind these are two very distinct ways of doing things and it makes no sense to me that they should be combined in the same class.
So….  I created a branch called polylineRefactor and  basically copied bezier.cpp into a separate class called \graphics\vector\polyline.cpp and commented out anything that looked like it had something to do with a bezier as well as anything else that keeps the program from building and running. https://github.com/JonasThomas/pencil/commit/ab9c2ad4e0588097e590c9518e5d493de9c1e89d

I left bezier.cpp intact for the most part for now and tried disconnecting it from pencil.  I think at some point it will need refactoring as well and at some point there should be a bezier icon on the pencil2d sight.
Anyway… At this point, the polyline tool is totally unusable.   If I do a mousedown I get a line starting at the start of the screen and the line drawing to the current  mouse position.   This is both vector and bitmap.
So… I’m thinking next steps.

Get the start of the line to appear at mouse down event.
Get the end of the line and new line to start and the second mouse down event.
Don’t have much time this weekend, but if I could get this done it would be a good start.Fun fun fun…. 😉

Posted in Uncategorized | Tagged | Leave a comment

Converting a Ogv to Avi in youtube in ubuntu 14.04

Sometime Linux can really be annoying(I still like like it though).
So I’ve been trying to use recordmydesktop to record which saves natively in OGV.   Unfortunately youtube doesn’t like OGV you need to convert to AVI.

So I tried the magical incantation that google seems to say and this happened:

jonasthomas@JTLapTop:~/Videos$ mencoder Issue436.ogv -ovc lavc -oac mp3lame -o Issue436.avi
MEncoder 1.1-4.8 (C) 2000-2012 MPlayer Team
success: format: 0  data: 0x0 - 0x67d9c7
libavformat version 54.20.4 (external)
Mismatching header version 54.20.3
libavformat file format detected.
[ogg @ 0x7f8a734c1600]Multiple fisbone for the same stream is not implemented. Update your Libav version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[ogg @ 0x7f8a734c1600]22 bytes of comment header remain
[ogg @ 0x7f8a734c1600]truncated comment header, 1 comments not found
[ogg @ 0x7f8a734c1600]max_analyze_duration reached
[lavf] stream 1: video (theora), -vid 0
[lavf] stream 2: audio (vorbis), -aid 0
VIDEO:  [theo]  1424x832  0bpp   -nan fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x6F656874  size:1424x832  fps: -nan  ftime:=  -nan
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.35.0 (external)
AUDIO: 22050 Hz, 1 ch, floatle, 90.0 kbit/12.75% (ratio: 11248->88200)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [fftheora] vfm: ffmpeg (FFmpeg Theora)
==========================================================================
MP3 audio selected.
Movie-Aspect is 1.71:1 - prescaling to correct movie aspect.
videocodec: libavcodec (1424x832 fourcc=34504d46 [FMP4])
[mpeg4 @ 0x7f8a72c19aa0]framerate not set
Could not open codec.
FATAL: Cannot initialize video driver.
Movie-Aspect is 1.71:1 - prescaling to correct movie aspect.
videocodec: libavcodec (1424x832 fourcc=34504d46 [FMP4])
[mpeg4 @ 0x7f8a72c19aa0]framerate not set
Could not open codec.
FATAL: Cannot initialize video driver.

So memcoder isn’t working.  And FFmpeg doesn’t seem to be loaded in 14.04 for some reason or another…  But I did find some instructions to get it loaded.

http://www.faqforge.com/linux/how-to-install-ffmpeg-on-ubuntu-14-04/

So looking for the magical incantation: http://ubuntuforums.org/showthread.php?t=1613179

So  I tried this:

jonasthomas@JTLapTop:~/Videos$ ffmpeg -i Issue436.ogv -vcodec libx264 -vpre medium -crf 24 -threads 0 -acodec copy Issue436.mkv
ffmpeg version N-77455-g4707497 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
  libavutil      55. 11.100 / 55. 11.100
  libavcodec     57. 20.100 / 57. 20.100
  libavformat    57. 20.100 / 57. 20.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 21.101 /  6. 21.101
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[ogg @ 0x26f8500] Broken file, keyframe not correctly marked.
Input #0, ogg, from 'Issue436.ogv':
  Duration: 00:02:17.80, start: 0.000000, bitrate: 395 kb/s
    Stream #0:0: Data: none
    Stream #0:1: Video: theora, yuv420p, 1424x832 [SAR 1:1 DAR 89:52], 15 fps, 15 tbr, 15 tbn, 15 tbc
    Metadata:
      RECORDMYDESKTOP : 0.3.8.1
    Stream #0:2: Audio: vorbis, 22050 Hz, mono, fltp, 89 kb/s
File for preset 'medium' not found
jonasthomas@JTLapTop:~/Videos$ 

Ok… Now I found this: http://ubuntuforums.org/showthread.php?t=1957290

This incantation seems to work.

jonasthomas@JTLapTop:~/Videos$ ffmpeg -i Issue436.ogv -vcodec mpeg4 -qscale 3 -acodec libmp3lame -aq 4 Issue436.mp4

Hoo… Hoo… Success.

 

Posted in Uncategorized | Leave a comment

Just some quick notes on enabling/Disabling stuff in qt

I’m a little to tired to work on this at the moment,  but I had some links that I want to look at

http://stackoverflow.com/questions/9506614/how-to-gray-out-a-menu-item-in-qt

http://doc.qt.io/qt-4.8/qtoolbutton.html

 

ToolBoxWidget::ToolBoxWidget(const QString title, QWidget* pParent ) :
    BaseDockWidget( title, pParent, Qt::Tool )
{
    QFrame* toolGroup = new QFrame();
    setWidget( toolGroup );

    QGridLayout* layout = new QGridLayout();

    pencilButton = newToolButton( QIcon( "://icons/pencil2.png" ), tr( "Pencil Tool <b>(N)</b>: Sketch with pencil" ) );
    selectButton = newToolButton( QIcon( ":icons/select.png" ), tr( "Select Tool <b>(V)</b>: Select an object" ) );
    moveButton = newToolButton( QIcon( ":icons/arrow.png" ), tr( "Move Tool <b>(Q)</b>: Move an object" ) );
    handButton = newToolButton( QIcon( ":icons/hand.png" ), tr( "Hand Tool <b>(H)</b>: Move the canvas" ) );
    penButton = newToolButton( QIcon( ":icons/pen.png" ), tr( "Pen Tool <b>(P)</b>: Sketch with pen" ) );
    eraserButton = newToolButton( QIcon( ":icons/eraser.png" ), tr( "Eraser Tool <b>(E)</b>: Erase" ) );
    polylineButton = newToolButton( QIcon( ":icons/polyline.png" ), tr( "Polyline Tool <b>(Y)</b>: Create line/curves" ) );
    bucketButton = newToolButton( QIcon( ":icons/bucket.png" ), tr( "Paint Bucket Tool <b>(K)</b>: Fill selected area with a color" ) );
    colouringButton = newToolButton( QIcon( ":icons/brush.png" ), tr( "Brush Tool <b>(B)</b>: Paint smooth stroke with a brush" ) );
    eyedropperButton = newToolButton( QIcon( ":icons/eyedropper.png" ), tr( "Eyedropper Tool <b>(I)</b>: Set color from the stage<br><b>[ALT]</b> for instant access" ) );
    clearButton = newToolButton( QIcon( ":icons/clear.png" ), tr( "Clear Frame <b>(Ctrl+D)</b>: Erases content of selected frame" ) );
    smudgeButton = newToolButton( QIcon( ":icons/smudge.png" ), tr( "Smudge Tool <b>(A)</b>:<br>Edit polyline/curves<br>Liquify bitmap pixels<br><b>+[Alt]</b>: Smooth" ) );

    pencilButton->setWhatsThis( tr( "Pencil Tool (N)" ) );
    selectButton->setWhatsThis( tr( "Select Tool (V)" ) );
    moveButton->setWhatsThis( tr( "Move Tool (Q)" ) );
    handButton->setWhatsThis( tr( "Hand Tool (H)" ) );
    penButton->setWhatsThis( tr( "Pen Tool (P)" ) );
    eraserButton->setWhatsThis( tr( "Eraser Tool (E)" ) );
    polylineButton->setWhatsThis( tr( "Polyline Tool (Y)" ) );
    bucketButton->setWhatsThis( tr( "Paint Bucket Tool(K)" ) );
    colouringButton->setWhatsThis( tr( "Brush Tool(B)" ) );
    eyedropperButton->setWhatsThis( tr( "Eyedropper Tool (I)" ) );
    clearButton->setWhatsThis( tr( "Clear Tool" ) );
    smudgeButton->setWhatsThis( tr( "Smudge Tool (A)" ) );

    pencilButton->setCheckable( true );
    penButton->setCheckable( true );
    polylineButton->setCheckable( true );
    bucketButton->setCheckable( true );
    colouringButton->setCheckable( true );
    smudgeButton->setCheckable( true );
    eyedropperButton->setCheckable( true );
    selectButton->setCheckable( true );
    moveButton->setCheckable( true );
    handButton->setCheckable( true );
    eraserButton->setCheckable( true );
    pencilButton->setChecked( true );

    layout->setMargin( 2 );
    layout->setSpacing( 0 );

    layout->addWidget( moveButton, 0, 0 );
    layout->setAlignment( moveButton, Qt::AlignRight );
    layout->addWidget( clearButton, 0, 1 );
    layout->setAlignment( clearButton, Qt::AlignLeft );

    layout->addWidget( selectButton, 1, 0 );
    layout->setAlignment( selectButton, Qt::AlignRight );
    layout->addWidget( colouringButton, 1, 1 );
    layout->setAlignment( colouringButton, Qt::AlignLeft );

    layout->addWidget( polylineButton, 2, 0 );
    layout->setAlignment( polylineButton, Qt::AlignRight );
    layout->addWidget( smudgeButton, 2, 1 );
    layout->setAlignment( smudgeButton, Qt::AlignLeft );

    layout->addWidget( penButton, 3, 0 );
    layout->setAlignment( penButton, Qt::AlignRight );
    layout->addWidget( handButton, 3, 1 );
    layout->setAlignment( handButton, Qt::AlignLeft );

    layout->addWidget( pencilButton, 4, 0 );
    layout->setAlignment( pencilButton, Qt::AlignRight );
    layout->addWidget( bucketButton, 4, 1 );
    layout->setAlignment( bucketButton, Qt::AlignLeft );

    layout->addWidget( eyedropperButton, 5, 0 );
    layout->setAlignment( eyedropperButton, Qt::AlignRight );
    layout->addWidget( eraserButton, 5, 1 );
    layout->setAlignment( eraserButton, Qt::AlignLeft );

    toolGroup->setLayout( layout );
    toolGroup->setMaximumHeight( 6 * 32 + 1 );

    this->setMaximumHeight( 200 );

    connect( pencilButton, &QToolButton::clicked, this, &ToolBoxWidget::pencilOn );
    connect( eraserButton, &QToolButton::clicked, this, &ToolBoxWidget::eraserOn );
    connect( selectButton, &QToolButton::clicked, this, &ToolBoxWidget::selectOn );
    connect( moveButton, &QToolButton::clicked, this, &ToolBoxWidget::moveOn );
    connect( penButton, &QToolButton::clicked, this, &ToolBoxWidget::penOn );
    connect( handButton, &QToolButton::clicked, this, &ToolBoxWidget::handOn );
    connect( polylineButton, &QToolButton::clicked, this, &ToolBoxWidget::polylineOn );
    connect( bucketButton, &QToolButton::clicked, this, &ToolBoxWidget::bucketOn );
    connect( eyedropperButton, &QToolButton::clicked, this, &ToolBoxWidget::eyedropperOn );
    connect( colouringButton, &QToolButton::clicked, this, &ToolBoxWidget::brushOn );
    connect( smudgeButton, &QToolButton::clicked, this, &ToolBoxWidget::smudgeOn );

    // pass to editor
    connect( clearButton, &QToolButton::clicked, this, &ToolBoxWidget::clearButtonClicked );
}

 

Posted in Uncategorized | Tagged | Leave a comment

Pencil2d Initial thoughts on the Copy paste within a frame bugs #414

I’ve been looking at the code and playing with the app  figure out how to replicate this
It seems that the selection/move tool by themselves are working pretty good.

I was playing the the move tool and noticed a couple of features that are pretty cool.  If you use the move tool with a shift enter, the object gets moved along the x-y and the hold the control down will rotated the selection, you can scale the selected bitmap….All  pretty cool… but that’s not our bug.

I’ve been trying to come up with a consistent way to generate the bug for testing.  I can’t seem I can seem to find it at the moment.  One thing that I’m observing multiple times but I can’t do it intentionally, is that a copy based occurs if I draw on the original, the copy also updates. (I’m assuming this is a bug and not a feature.)

Also if I do a file new, I’m seeming a invisible selection that blanks out what ever I’m drawing.  This seems to be happens only after the weird copy occurs.  My suspicion root cause is some combination of mouse clicks, key-strokes that you would normally never do, but are allowed.

One thing that does seem strange to me is that cut- copy and paste from the command from the pull down are enabled at all times.   It seems me that the business rule should be if you perform any of these actions the selection box should be displayed.   The corollary would be if the selection box is not displayed the copy-cut-paste should not be enabled,  If ctrl-x ctrl-v, ctrl-c is attempted with no selection box is displayed, a modal message pops saying that you can’t do that from the pop-up menu.

Now in my mind when a paste if performed via a ctrl-v the copy should be placed where the mouse cursor resides (upper left corner)
If we don’t want to give an error message when some does  a edit-paste it seems to me that when some does a edit->paste the copy should be placed in the middle of the screen, the selection is switched to the copy.

My current thinking is that if a ctrl-v is pressed (after initial ctrl-c) the selection could move to the copy (and in the background perform a new copy to the selection.  This should enable you to keep hitting ctrl-V to get multiple copies.

Whenever the selection is not visible, the clipboard is cleared.

In my mind, the next step should be only to allow Edit=>copy, Edit=>Paste,Edit=>cut, Ctrl-C, Ctrl-V,Ctrl-X only if the selection grid.   Before, I invest the time in doing that, I think I should get the ok from Matt to go for it.

I was just looking at this post..  http://www.pencil2d.org/forums/topic/capturing-paper-animation/   That might just mess up my perfect plan..  Could we want to paste images from outside pencil2d?  I suppose that could be a Edit-Past-Special(with behavior the same as Edit-Paste?

 

 

 

 

Posted in Uncategorized | 2 Comments