Loligo Blog

A blog on Photography, Cooking, Programming, Alchohol Making... Contact me at Blog@loligo.co.uk

Loligo Tether Goes Public!

clock June 28, 2009 20:01 by author Mark Compton

For those that have been asking for new dev, or access to the code in order to progress it's state.

I've now loaded up the source code for the Loligo Tether application to Source Forge.

I'm not "sure" how it all works on there with regards to public access or editing etc, but I think you should be able to log on there and grab the code, and even push changes back in, would be nice to get this as a community project and get it off the ground.

There are some fantastic ideas floating around about features wanted in there, and i'm sure there are more than a few developers out there with cameras to have a play with this :)  

anyone who wants to grab a copy of it to test it would be making a great contribution towards helping to make this a more stable product too.

I will have time to put towards making changes and adding new functionality too, so if any feature requests or bug reports could be logged through the sourceforge project this should make it nice and easy to manage :)

this is the location of the sourceforge project

https://sourceforge.net/projects/loligotether

I think if you want to be a developer for the project you may have to request it, or email me and I'll add you.

 

Many thanks everyone for reading my posts and hopefully together we can build a very useful camera tethering tool.

 

Also, if there is any interest in my other projects I'm sure I could put some of those up on sourceforge too :)

 

Cheers

 

Mark Compton 

 



WPF - Object Binding and fancy lists

clock March 15, 2009 20:08 by author Mark Compton

I've only just started on my journey into WPF land, but it's been very difficult trying to find help and info on how to do things, so I thought I'd at least show some info on the progression I'm making with it, as it may help someone out there.

 I'm going to use the Mediocre Centre as an example, as I plan to rewrite the UI for it in WPF.  bear in mind I've not made it too fancy, and it's not very tidy this is in my baby steps phases heh.

This is what this list should look like when were done, as you can see, nothing fancy but I wanted to also show how you can nest components and draw a few fancy things :)  


ok, so where to start..

First you'll need an object to bind, my mediocre centre menu lists may be over complicated for this due to their dynamic nature, so lets create a simple version just to show you the concept.

 ok, Code for the simple objects:

public class MainMenuList

{
  private List<MenuEntry> MenuList = new List<MenuEntry>;
  public MainMenuCollection()
 {
    MenuList.Clear();
    MenuList.Add(new MenuEntry("Videos"));
    MenuList.Add(new MenuEntry("Music"));
    MenuList.Add(new MenuEntry("Exit"));
  } 
  public List<MenuEntry> GetList()
  {
    return MenuList;
  }
}

public class MenuEntry
{
  public String Name { get; set; }
  public MenuEntry(String name)
  {
    Name = name;
  }
}


 

Now you need to add a WPF form, to the project, or start this by creating a WPF application which will give you a WPF form.

this is the part that had me confused for a while, where to put certain code..  so, the next bit of code(xaml) we are going to be putting in the app.xaml in the <Application.Resources> section. 

Before adding anything, you'll have to add a reference in the App.Xaml to your Namespace in which the Menu is contained, which will appear with the others at the top that look similar:


xmlns:src="clr-namespace:MediocreCentre.Menus" 

 

First we are going to add an object data provider, this will allow xaml to talk to the object:

 <Application.Resources>
        <ObjectDataProvider x:Key="MenuItems" ObjectType="{x:Type src:MainMenuList}" MethodName="GetList">
        </ObjectDataProvider>
 <Application.Resources> 

 
So here we can see that we've give this collection a Key "MenuItems" and specified which class the list will come from "MainMenuList" and what method will return us the list "GetList".

Now you also want to put in a DataTemplate which will describe how to display the data in the list, this will also go into the <Application.Resources> section below the ObjectDataProvider

Here's a simple DataTemplate:

 

<DataTemplate x:Key="MenuFormatting" DataType="MenuEntry">
  <StackPanel Orientation="Vertical">
    <TextBlock Width="150" Height="25" Margin="15,5,0,0" FontSize="15">
      <TextBlock.Text>
        <Binding Path="Name" />
      </TextBlock.Text>
    </TextBlock>
  </StackPanel>
</DataTemplate>

 

as you can see, we specify that the datatype being displayed by this template is a "MenuEntry"  and the Binding path is the property we want to read and put into the TextBlock (a label basically)  this is the Binding Path="Name"  which is MenuEntry.Name.

This is the DataTemplate for the "Fancier" list display, but either should work fine, but the following DataTemplate will show you how you can nest controls inside others.

<DataTemplate x:Key="MenuFormatting" DataType="MenuEntry">
  <StackPanel Orientation="Vertical">
    <Canvas Width="150" Height="25" HorizontalAlignment="Left" Margin="0,5,0,0">
      <Rectangle RadiusX="10"  RadiusY="10" Width="150" Height="25" Fill="Gray"/>
      <Rectangle RadiusX="10"  RadiusY="10" Width="148" Height="23" Margin="1,1,1,1">
        <Rectangle.Fill>
          <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
            <GradientStop Color="LightBlue" Offset="0.5" />
            <GradientStop Color="DarkBlue"   Offset="1.5" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <TextBlock Width="150" Height="25" Margin="15,5,0,0" FontSize="15">
        <TextBlock.Text>
          <Binding Path="Name" />
        </TextBlock.Text>
      </TextBlock>
      <Rectangle RadiusX="3"  RadiusY="3" Width="146" Margin="2,2,2,2" Height="12.5" Fill="White" Opacity="0.2" />
    </Canvas>
  </StackPanel>
</DataTemplate>

 

So, you can see from the above code that I've put rectangles all over the place, the RadiusY/X is how rounded you want the edges, so that's a very nice feature :)

 

now after tinkering with that for a while, You'll want to know how to actually display this on the form I spose :)  well this is what you want to do there. 

now this is the simple bit :)

 ok, in the <Grid> section of your form.xaml, you want to add this:

<DockPanel DataContext="{Binding Source={StaticResource MenuItems}}" Grid.Column="0" Grid.Row="0">
  <ListView x:Name="lstMenu" ItemsSource="{Binding }" ItemTemplate="{DynamicResource MenuFormatting}" IsSynchronizedWithCurrentItem="True" DockPanel.Dock="Left" />
</DockPanel>

Once you've added this, you should see the designer actually change and show your items in the list, which is very cool :)   

To explain this a little..  

The Binding Source is pointing to the ObjectDataProvider that we gave the Key=MenuItems 
The ListView ItemSource is set to Binding so that it knows to bind to the Binding Source
The ItemTemplate which tells the Listview how to display each item of data is set to point to the DataTemplate that we called MenuFormatting.

 

and there you have it, a "Fancy" object bound list view.

ps, if there are bugs, sorry lol, I knocked up the code in Notepad and haven't compiled it, rather than drop in all my Mediocre Centre Code.

 

Good luck, and have fun :) 

 

 

 

 

 



Loligosoft Money - The progress continues.

clock February 26, 2009 19:33 by author Mark Compton

An update to progress of the development.

 It's not actually quite usable, with the main screen showing clickable links for accounts and budget review, also a summary of your budget based on income vs spending etc.  You can edit the transactions to assign a category or change a payee etc, you can create and edit a budget.  I've even put in an auto budget feature which will make a budget for you based on your category assignment to your spending, which you can then alter to the budget figures you want.

 here's a few screenshots of the changes, I've chucked some test data in there just to make it look a bit more useful.

 

 The Summary Section of the main page:

 
You can now setup when your financial period begins, You can also choose that this must end on same day each month, and it can take into account weekends, which as above shows that my next financial period begins on 20th March which is because the 21st falls on a saturday, and I always get paid on the weekday prior to that.
The other information on the summary is calculated based on what you have setup in your budget vs how much is in your account and the message will change depending on whether you are within budget or not and wether or not it thinks you will remain within your budget based on what you have setup. it will also tell you how much you are due to have left in the bank if your within your budget.
 
 
 
The Account List:
The account list now enables a hyper link when you hover over an account which you can click on to see details of transactions and also edit them to assign categories or choose to import a statement from your bank (CSV only still)
 
 
 
The Account Detail screen: 
on here you can see a list of the transactions and how they are affecting your running balance of the account, I'm planning on doing some nice colour coding for this screen, but keeping it just functional at the moment.
from here you can assign a category, which if you type in a non-existant category it will be added to the list for future use.
 
 
 
The Budget Review/Setup: 
Here is where you setup your budget for the period, I did a quick autobudget which has created a budget for me based on my spending and what category I assigned to each transaction for the last period.  you can edit any transaction by double clicking on it and changing it to something more rounded or add in a little buffer :)  
 
 
and that's it at the moment, you can add other accounts like credit cards and assign transactions to them.
 
The things i'm working on next are:
 
Transferring of funds (ie to pay a credit card/loan from a bank account).
Better editing of transactions.
Forecasting of account balance ( a nice chart of what your account may look like in the future) 
Some kind of Debt Repayment Planner.
Some nice Reports:
Income vs Spending
Monthly Spending Comparison
Spending by Payee
Spending by Category
 
 
That should keep me going for a little longer heh 


Loligosoft Money

clock February 17, 2009 11:26 by author Mark Compton

ok, after getting annoyed with no accounting package working the way I wanted them too I decided to write my own..

It's not yet comple and is very much a work in progress, but thought you might like to see what I've been up to, and where it looks like it's going generally. 

Here's a snapshot of the homepage as it is currently.

 
So far I have
Account creation, Payee creation, Category creation working
CSV statement import (luckily my bank support downloading in this format, so i'm good heh)
the saving and loading is done for what's been coded so far.
And I spent a little time making it look a little prettier cause it made me feel better lol. 
 
the main plan for this application is to allow me to do budgeting and forecasting the way I want too, which is in depth and also on a period which isn't monthly.. ie my "financial month" runs from 21st of the month when I get paid, so the budgeting in other packages tend to annoy the hell out of me, and also I want forecasting to actually work lol, it's a simpl concept.. I have X in my bank, haven't yet paid Y bills, so result = X-Y...  basically lol.  but I also want it to take into account the fact that my 21st of the month changes on a month by month basis to the last working day.  so that's working now too.
 
 
anyways, gotta go, started playing guitar too and need to practice lol. 
 
 
 


Loligo Tether

clock January 2, 2009 12:42 by author Mark Compton

 

An update to the Loligo Tether application, which I have only tested so far with a Nikon D50 on Vista, but in theory it should work for other cameras on other operating systems.  It requires that the camera is set to shoot in Raw+Jpg (it will delete the Jpg off the camera when it grabs it onto the pc for preview)  it also requires that you have the camera in "P" usb mode, not "M".  if you change this setting on your camera, you'll likely have to turn the camera off, unplug from the computer, then plug back in and turn on.  do this before starting the Loligo Tether.

Here is a screenshot of what it currently looks like: 

 
as you can see, i've tinkered a bit, it has the preview window, and thumbnails of anything that has been synced over (or in the directory previously)
 
it is more stable, and cope with you turning the camera on and off etc whilst running, it will notice you've unplugged it.  
You can now select the location the images will be saved too.
and general bug fixing/tidying.
 
from the screenshot you can see that I did a time lapse, this was with a 30 second interval.  I could make it into a movie, but I didn't leave it going long enough to get the whole cube to melt, and was impatient heh.
 
I've still not created an installer for this application, it is provided as is, and you take it upon yourself to try it of your own free will, and I won't be held responsible for any loss of photos, equipment, time, space etc..
 
You will need to have the .net 3.5 Runtimes installed in order to run this application too.
 
Download Loligo Tether here:
 
and don't forget to have fun :)  
 
if you find any problems, or can think of any ways to improve it, don't hesitate to contact me, either by posting a comment, or emailing me at Mark@loligo.co.uk.
 
Cheers :)
 


Shooting Water droplet with the Loligo Nikon Tether.

clock November 20, 2008 11:57 by author Mark Compton

No recipe today again, I know I'm a slacker.. I did actually cook, but made a pie using some pastry that was made for me by my mother on the weekend, it's a "Secret recipe" although I know it now, so will reveal all when I attempt to recreate it :)

So, i've decided to talk about shooting water droplets and how I achieved the above photo.

 

This was actually a very simple setup, a pan of water, a desklamp, some card to reflect light, and some paper to create a kinda snoot for the on camera flash.

The setup looked like this: 

 
although that's not the lens that was in use at the time, I was using a Nikon Micro old manual focus thing that I got off ebay for about £80.  nice :)  it's a fantastic lens, and if you like the idea of macro photos a cheap ebay lens is a nice starting point.. and manual focus really doesn't cause you grief.
 
So, how was it done, apart from clicking the shutter and hoping for the best..  well, I also had a water dropper that I dropped continuous drops of water into a location that I had focussed the lens onto previously.  and then I wrote a program called Loligo Nikon Tether, which although it currently has the name Nikon in it, I recon it'll work with other cameras considering that I just wrote something that can talk to the camera via PTP (Photo transfer protocol).  so one of the options in this application is to trigger the camera, which is handy :) so I set the camera to fire every 5 seconds so that I could concentrate on dropping water in the correct location :)  much easier..  the Tether application also has the ability to transfer the pic back to the pc and show you a preview of the pic.  
 
The Desklamp was providing some light, and the flash was providing the rest via the snooted on camera flash (the paper wrapped up badly is a snoot heh) 
 
I put the camera on the fastest it would allow with the flash switched on, and let my program go :) 
 
So after taking roughly 500 photos, which happens pretty quick when taking one every 5 seconds lol.  I had a tinker around, found a few favourites and cleaned them up a little, then added a bit of a blue tint, cause I like blue :)
 
The program was written in .net 3.5  so if you want to have a play with it you'll need that runtime.
You also need to create a directory of C:\tethered_Out (for auto transferring)
you'll need to connect your camera via usb before starting the app. 
also if using Vista it seems to have a limitation of only supporting Jpg, so you'll have to set your camera to shoot raw and jpg if it's a nikon.  if your on xp you may be lucky enough for it to find the raws.  but i've only used this on Vista.
 
*Disclaimer* This is very much an alpha piece of software, use it at your own risk. it's not my fault if it somehow destroys your machine, camera or anything else related to you in any way lol.. 
 
 
Enjoy, and keep clicking heh.  it's all about practice, and knowing that out of hundreds of photos, you might get a few good uns :) 
 


Sign in