My Blog

A blog about my daily, weekly or monthly things that keep me busy.

Blog List

Change the URL of a Jahia blog

As ambitious I thought I was to make a weekly blog, I got busy with some other things so I had to change my blog name from ‘weekly stuff’ to ‘my blog’, what a appropriate name! It is possible to change the name of the blog through the UI, unfortunately it doesn’t change the name within the URL itself.   Since Jahia’s blogging tool works through the life workspace I had to resort to changing the name of the blog through Jahia’s repository browser.   Here is how to do it: Go to : http://<your website>/tools/ login and click on JCR repository browser. Then go to ‘sites’ and navigate through the ‘pages’ to the page where your blog is located. In my case this was : /sites/rvt/home/blog. Since the blog is located only within the live workspace, you must click the link ‘switch to live’ to show the actual node where all your posts are located under   Your blog should now show up:   Click on the little edit icon to edit the name of the node, I changed it from ‘weeklystuff’ to ‘myblog’ After clearing the cache, the new URL should be generated using your new name!   Think about SEO! If your blog has been indexed by search engine already you might want to send a permanent redirect to redirect

Read full post

GCodebuilder within CNCTools

Within GCodeTools I added a little toolset to create GCode in such a way that we are a bit more flexible in how our output can look like. This is specially important because some dialect's of g-code is just a tad different then what I have normally encountered when I was researching g-code.   GCodeBuilder doesn't try to be a new printer dialect, it will geared towards g-code based machine's where you can always have 'move' style coordinates.   However, it does try to solve issue how comment's look like, if there is a space between g-code words, what words to print out etc,, and it allows for a more easy style of writing how G-Code looks like within you code then plain 'print' statement's.   GCode Builder does use a 'builder' style way of creating of a GCode block.   Example 1: Let's create a example of making a G0 move to coordinate 10.0,10.0 (XY) [code:java] GCodeBuilder gCodeBuilder = GCodeBuilder.builder().G0(10.0,10.0); System.out.print(gCodeBuilder.toString()); Output: G0X10Y10 [/code:java]   Example 2: Now let's move X to coorinate : 20.0 and Z coordinate 10.0; [code:java] GCodeBuilder gCodeBuilder = GCodeBuilder.builder().G0().X(20.0).Z(10); System.out.print(gCodeBuilder.toS

Read full post

JavFX StringBinding

JavaFX has some nice way's to bind to bind data together to form into a 'output'. If you are ever wondered how you can format a label, based on multiple input's then StringBinding is your friend. With String binding you can respond to change event's from other string properties and combine then ino one single output. I created a little sample demonstrating this by having two input's and one output. For each input it takes the first two characters of a string and concate them. If you enter Foo Bar, the output should be FoBa. How does this work? [code:java] StringBinding myBinding = new StringBinding() { { super.bind(in1.textProperty(), in2.textProperty()); } @Override protected String computeValue() { return getFirstTwo(in1.getText()) + getFirstTwo(in2.getText()); } }; [/code:java]   You can create a string binding using a anonymouse class as shown above. You call the super constructor by passing your other string's you want to bind. And the output is calculated at ComputeValue(...). The method getFirstTwo(..) will siimple take from every string teh first two character's and return them. Once you have this setup you can bind this back into a label like this: out.textProperty().bind(

Read full post

JavaFX custom controls

Today I was asked how to create 1 fxml with multiple controllers. The question itself sounds a bit odd bit there was some logic behind this question. What the user wanted was one fxml with a tab conponent. And each tab he wanted seperate controlers to input data. His though was that he should beable to add two more controllers within that one fxml that allows a controller for each of the tabs and allow to control the components within each tab with a seperate controller. The right solution would be to create 1 fxml for just the main controller and to add two more controllers, one for each tab and 2 more controllers for the tab's The following code structure should do thr trick: The nice thing with flex is that it's very easy to create custom controls. Let's take a look at the Main fxml for this: [code:xml] <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="295.0" prefWidth="440.0" styleClass="theme, AnchorPaneHome" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="com.rvantwisk.javafxsamples.Main"> <children> <Label layoutX="23.0" layoutY="14.0" text="Example tab container with two sub

Read full post

G-Code viewer

For my CNCTools project I needed to have a G-code viewer, so when a user creates new g-code it would be handy to see the result of his/her actions.  When I started this project I was imaging that each module would use it's own drafting routines but although you could make fancier drawing's, you can never know for sure if the created g-code would really do what it's intended. This is why I decided to create a viewer for g-code so all the module needs to do is output the g-code and it will be displayed. The additional benefit is that when the viewer get's updated with more features, all moduels will automatically bemefit from it. The current state of the viewer is that it is capable of simulating G2/G3 (XY plane) G0, G1 with the axis X,Y,Z and A. This doesn't sound to much, but for a lot of work (remember I do wood working) this is plenty enough. For the moment I am working on some of the other features for teh CNCtools project and I am planning to pick teh g-code viewer up again to extend it's capabilities as I feel that should be required when I want to move CNCTools into Beta stage. At least it should show the XYZ vectors and have better camaera capabilities, which are currently a

Read full post

Pocketing and Surfacing added on CNC tools

Today I started additing to Pocketing and surfacing to CNCtools. For some time now I tried to find a open source tools that allows me to create simple pockets and surfacing area's when preparing my material. However, unlike (properly) metal worker's, with woodworking you have to take into consideration the direction of the grain and most surfacing/pocketing ascript's I found don't allow me to add setup the direction of the grain and setup clumb or conventional cutting. And sometimes I just want to do something fast and I just need to setup 'Zig Zag' pattern. The below image show's a linear vertical pattern where milling is omly done in one direction. Other options that are currently setup are Linear (both horizontal and veritcal) that will do single path, eg from left to right or right to left only. Here is a other image sohowing the Zig Zag mattern. THis will speed up the process, but could (depending on teh type of wood) leave mill marks. The algorithm I am using is pretty allow me to also use other shape's, like circle: The algorithm I am using essentially allow me to use any type of shape, as long as each point on a shape can 'see' other opposite site. That means a shape like a

Read full post

Tags

Last comments