An Application to create dividing head tables

Advert

An Application to create dividing head tables

Home Forums Suggested Online Resources An Application to create dividing head tables

Viewing 25 posts - 76 through 100 (of 100 total)
  • Author
    Posts
  • #241664
    Alex Collins
    Participant
      @alexcollins55045

      This is so screaming out for a web based application.
      ​I may (with permission) steal some of the code snippets and have a bash.

      Advert
      #241665
      Roger Woollett
      Participant
        @rogerwoollett53105
        Posted by Alex Collins on 06/06/2016 18:15:25:

        This is so screaming out for a web based application.
        ​I may (with permission) steal some of the code snippets and have a bash.

        Feel free. You might like to wait until I have got the config screen working.

        #241675
        Ajohnw
        Participant
          @ajohnw51620

          My aim is a bit different to Rogers. I want a list of what divisions I can do but if you want to use anything I posted fine by me. There is a bit of a mess in the results saving area. I was playing around with that but apart from Star Office Basic problems with integer divides it's fine. It's based on how it would be done on pencil and paper. There is only one odd ball that needed an exception. A division of 60 or however many teeth the worm has. I work each plate from the largest hole count down and stop checking the plate once one has been found that can do it – so if a plate does have 2 rings that can do it the lowest angular error one is used.

          I'm assuming cnc plates – same positional error on all holes. My plates were produced via cnc.

          John

          Edited By Ajohnw on 06/06/2016 19:16:14

          #241709
          SillyOldDuffer
          Moderator
            @sillyoldduffer
            Posted by Roger Woollett on 06/06/2016 16:16:02:

            Thanks for that John. I will look into it. What platform are you using?

            I found that python 2 does integer division – python 3 converts to float so I had to float some arguments to get the code to work on python 3. I am working on a configure screen so will look at this later.

            Hi Roger,

            You've bumped into one of the differences between Python 2 and Python 3. Python 3 added the // operator to do integer division which is why / produces floats, for example:

            dave@sparrow:~/Desktop/stirling$ python3
            Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
            [GCC 5.3.1 20160330] on linux
            Type "help", "copyright", "credits" or "license" for more information.
            >>> 8/3
            2.6666666666666665
            >>> 8//3
            2

            Cheers,

            Dave

            #241712
            Neil Wyatt
            Moderator
              @neilwyatt

              I have a similar spreadsheet for my RT, which has a handle graduated in 60 steps of 1/10 degree.

              It tells me how many turns past zero and what reading to end on.

              #241727
              Ajohnw
              Participant
                @ajohnw51620

                The thing I don't like about Python as Roger has used it or the way StarBasic has hooked directly into what looks like Java declarations of one sort or another is all of the extra typing. There is also more than one interface out of the Basic that looks much the same – UNO. OOBasic is some kind of very bad joke.

                disgust Suppose it's not the right way of looking at it but it adds to the time taken. Maybe it comes from doing a lot of work in assembler where I do usually use long meaningful labels and plenty of comments.

                I've thought about using TCL/TK but TCL looks like it has lots of scope for typo's that actually do something. Impressive though. I have a USB oscilloscope and all of the PC crunching work is done it including FFT and screen plots.

                I've always had a feeling that Java is probably the sensible answer – apart from extra typing but the tools can generate a lot of that. I did start using QT at one point but doc's hopeless as always out of date and bugs too.

                John

                 

                Edited By Ajohnw on 07/06/2016 00:07:14

                #241747
                Roger Woollett
                Participant
                  @rogerwoollett53105

                  John – I am not sure what you mean about the extra typing but I don't find that a problem. I have used an object oriented approach for many years, mainly with C++, so I am happy with that.

                  I much prefer C++ as a language but it needs to be recompiled for every platform. Also the GUI libraries are complex and there is too much of a learning curve for me to want to do the occasional project.

                  I don't like python's reliance on indentation or its obsession with self but clearly the designers have their reasons. I do find it quick to develop programs and it is very portable so for me is the best choice in this instance.

                  #241817
                  Ajohnw
                  Participant
                    @ajohnw51620

                    It's probably sour grapes Roger from what has happened to the Basic's in xxxxxOffice, At times I have used Basic a lot for speed to try out various algorithms and also when it's all that is available. Apart from graphics it's has always been a very capable language. Much maligned because of the B for beginner. The A for all purpose is very true.

                    Probably more sour grapes down to work. I did write PC code at one point to test other systems. Usually using C and sometimes assembler. As my job was to get product I was working on out there came a point when keeping up with windows became unrealistic. I did buy Visual Studio some years ago V4 ?? for home use. My attitude to that was why do I have to type all of this junk as the compiler should do it for me. No OO then. I have used an OO approach for a long time when designing code but that doesn't mean what it means these days. It just means how the job to be done is approached and viewed. I have only ever seen one explanation of what this means in practice, oddly done by MS. I'll only bore people with it if they insist. I did run through it with one pro modern OO person and his comment was yes i can see that but no way am I going to do it.

                    From time to time I do feel the need to write code at home which is why I have done this on a spreadsheet. That provides the graphics. As mentioned I did look at TCL/TK but TCL syntax is unusual and could be mistake prone. I've wondered about Java several times because like QT the graphics can happen automatically. It also unlike QT seems to be pretty stable. No need for rewrites or at least less of them when new versions come out.

                    Python, Ruby, Perl ? Can't make my mind up but look now and again. All seem to need bolts ons for graphics. Java seems to need less of that, swing, beans etc and it's cross platform. Not that cross platform matters for my own use. KDE5 the linux desktop seems to be going in a similar direction to QT. It will have all that applications need in it. Be interesting to see if this works out. It's like to need pure C++ in order to make any use of it and is probably straying further down into the system than is used to. Much of underlying Linux is written in C and KDE was just a C++ wrapper on top of this. Interesting because MS have probably been beavering away for some years to make sure that there software is split up into sensible functional layers – just like Linux is or maybe was at some point. It makes serious changes much easier to do.

                    John

                    #241822
                    Neil Wyatt
                    Moderator
                      @neilwyatt

                      Having played with Python, I couldn't help thinking it was essentially an enhanced BASIC with a few changes to make it different.

                      BBC BASIC for Windows seems to have equal or greater capabilties than Python, and unlimited potential due to teh dorect access to teh Windows API and even inline assembler for the truly brave.

                      #241830
                      John McNamara
                      Participant
                        @johnmcnamara74883

                        Hi
                        There are several reasons Basic has survived for so many years. Probably number 1 is the available support on the net. Type a plain English question and in most cases you will find help. There have been many many thousands of books written about it, easily obtained second hand or new. It is self documenting, the written code, is more English like than many other languages. (However it is good practice to extensively comment your code as well).

                        And these days it can be free google: visual basic express or use the links below.

                        **LINK**

                        Visual Studio express
                        **LINK**

                        OK I know Microsoft are not popular at the moment but this software a bargain, not only is it free it is also capable of creating professional level software applications. It is also regularly updated.
                        There are many other free basic's around if you insist however none have the same level of support.

                        Regards
                        John

                        #241843
                        Roger Woollett
                        Participant
                          @rogerwoollett53105

                          My problem with Basic is that as far as I know there is no standard. The original Dartrmouth BASIC was an incredibly cut down FORTRAN designed to run on the primitive time sharing computers of the time. BBC basic was a much enhanced language and Visual Basic is miles away from the original. As I understand it Visual Basic is a proprietary product of Microsoft. There have been many other "BASICs" over time – all different.

                          Languages like Fortran, C and C++ have standards blessed by international standards authorities. Python does not have this level of accreditation but does have a written standard. As far as I know implementations on all sorts of platforms conform to the same standard making it as portable as any language.

                          #241857
                          Ajohnw
                          Participant
                            @ajohnw51620

                            MS VB has been used to create many commercial applications often one offs for specific companies or for things that wont sell in large numbers.

                            Unless people actually write a lot of software it can be difficult to see why what is now called Object Orientated is used so much. In a nutshell it allows other "things" to be easily pulled into a project. It can be good or bad. My desktop for instance had some one working on it who decided to pull in the digital clock that most PC's have some where into an appointments type thingy. They could do this easily without worry at all about how it worked. The catch from my point of view was that the thingy also needed another piece of software that me and many many others didn't want on there machine at all. Net result in this case would have been that unless I had them installed and running I wouldn't have my beloved digital clock and calender. I'm retired and sometimes need reminding what day of the week it is. Fortunately I made some noises in the right place and kept my digital clock.

                            There are other things that can happen that sound good and may or may not be. All pc's need to catalogue information is some fashion. This is a better example of why. In a nut shell something needs to index things so that they can be retrieved. This might include emails, files on the system and etc. The list is endless. So some one writes a piece of code that takes objects and indexes and catalogues them not really caring what they are. People then use this when ever they need the service and there is only one piece of software on the machine that does this. In the case I am thinking of what I had looked at on my machine, also on the web, my emails, my file system and other things were regarded as all being the same type of object. Where this one didn't work out well was with emails. There was a package that did all of it's cataloguing and indexing itself. Performance wise it could handle a much faster rate of email arrivals. There was a huge difference. It also compacted them. Overheads were extremely low so no signs elsewhere of it going about it's business. The new way benefits from a faster machine but still wont match it. Classifying objects that are suitable for similar processing is what OO should be about but that's long since gone.

                            Having been lectured by the pundits that have a lot to do with what goes on C++ came about because of the need for a 100% reliable compiler as there was even doubts about ADA. It was intended to be very strict syntax wise to suit modern multitasking systems and also to help maintain a reliable compiler and to try and stop programmers from making certain types of mistakes. How the next iteration came about is a little obscure. My feeling is that it started with data base programmers wanting to move this and that from here to there and evolved from that sort of thing. Most applications take something in and put it somewhere. I have mentioned this and the answer is often you could be right but it;'s gone way past that now. The reason is productivity. It often is when the tools that are used to produce software evolve.

                            The next evolution is what has happened in xxxxOffice and elsewhere. LibrOffic call it UNO, Universal Network Orientated blah blah what ever it is. When writing code in this sometimes web addresses have to be used followed by the usual dot this and that. Software often follows fashion so the same thing gets added to Basic. From what I can see it's also in MS VB at least as far as spreadsheets are concerned however they have extended the Basic like syntax to allow that to be used if needed. They couldn't resist sticking dots in front of some of the parameters. xxxxOffice haven't done this so their Basic is stuck with using typical OO sytax. The differences for instance is 4 or 5 lines of code against one to access a cell and myriads of possible operations few of which are actually needed. Some people think that this style of syntax is self documenting. No comment.

                            John

                            Edited By Ajohnw on 07/06/2016 17:29:32

                            Edited By Ajohnw on 07/06/2016 17:31:05

                            #241878
                            Alex Collins
                            Participant
                              @alexcollins55045

                              Hi all.

                              ​After a bit of Thought and effort, I have created a CSV file using the Python examples.

                              I thought about calculating everything with MySQL. As this will initially run on a raspberry pi, decided a flat database was best. If this expands to a real server I will use the Database to do the maths.

                              I have a LAMPpI (Linux, Apache, MySQL, Php, pI) server built.

                              Just need to dump the CSV into a database and write a lil web app in php.
                              I'm thinking a drop down for the divisions and a display of:

                              Divisions | Whole Turns | Part Turns | Plate Hole Count | Plate Number (Myford)

                              If i'm able to get on I will publish a beta later this week.

                              Alex.

                              #241880
                              Ajohnw
                              Participant
                                @ajohnw51620

                                CSV is probably the easiest way to do it with any language – even unobasic apart from the integer aspect as that can write to files. Then load into a word processor and use the table import utility they usually have. Export to pdf, print or whatever.

                                CSV = coma separated values.

                                John

                                #241886
                                SillyOldDuffer
                                Moderator
                                  @sillyoldduffer
                                  Posted by Ajohnw on 07/06/2016 19:48:21:

                                  CSV is probably the easiest way to do it with any language – even unobasic apart from the integer aspect as that can write to files. Then load into a word processor and use the table import utility they usually have. Export to pdf, print or whatever.

                                  CSV = coma separated values.

                                  John

                                  I hate to disagree but Comma Separated Values can be very difficult to work with. Think about decoding a CSV file where one of the data fields contains "Gerald's school has a minimum height requirement of 4' 11", unless you know the Head's secret password. By the way it's "girls' school""

                                  Have you discovered Gambas yet? It's the linux equivalent of Visual Basic, not a clone, but many similarities. Excellent for moderately complex graphical applications and you avoid learning an object model like Qt.

                                  Dare I suggest in response to other comments that Python is effortlessly better than Basic. The assertion is only untrue if you know Basic and have never learned Python. I agree there's no reason to learn Python if you're happy with something else.

                                  Cheers,

                                  Dave

                                  #241897
                                  Ajohnw
                                  Participant
                                    @ajohnw51620

                                    Libreoffice has no probablem at all importing csv into a table Dave. Just open the list with it and use the import tool to put it into a table. I have done that already using that application I linked to. Then noticed that it was skipping divides that I know my plates can do. With that I just copy pasted the app's output into the wp as text. The way it came I could then tidy it a litlle with search and replace – substitute for 0 turns for instance. That way I could also play with the font size and layout easily and quickly. A language that just dumped to a console could do it as well. Usually when people write something to produce a table or a csv they do know what is in the fields.

                                    I don't really have any feelings about Basic and Python at all really. Just if adequate and I know the syntax there isn't any point in learning another. I do have strong feeling about fashion changing Basic to a point where the whole idea behind it has been lost. I have had all of them on may machine at one time or the other but not Python3. Gambas for a basic is a bit bloated and I had forgotten about that one. It looks like it really does use integer if needed.

                                    As to OO style coding to me I may as well forget all of them and get to grips with Java. There is rather a lot available for it and it was intended for graphics from day one. The Sun site is extensive and there are sites like this one

                                    **LINK**

                                    Then there is Blue J and lots and lots of other types of things about on the web. I reached this conclusion a while ago looking around at this sort of thing.

                                    **LINK**

                                    The site I found explained very clearly why they decided to use Java and I have used a number of pure java applications. This even included a very capable file sharing program at one point. Given the amount of DSP related Java hits on google it looks like the site has influenced a lot of other people too. Some Prof some where ran it. sad So if I ever do pick up YET ANOTHER language I think you can guess which one it's likely to be. Sad 'cause I don't really want to bother but if I do I may as well make it worthwhile.

                                    John

                                    Edited By Ajohnw on 07/06/2016 23:22:02

                                    #241903
                                    John McNamara
                                    Participant
                                      @johnmcnamara74883

                                      Hi all

                                      I knew when I proposed Visual Basic it would lead to the inevitable debate on what is the best, If you are just programming for your own use, it does not matter! just pick one and learn it. If this is to be your first foray into programming it will be very difficult if you cannot get help particularly at the beginners level, lots of it, make sure of this before you chose your path. It could be the difference between success or failure.

                                      Regards
                                      John

                                      #241930
                                      Roger Woollett
                                      Participant
                                        @rogerwoollett53105

                                        I think this discussion shows that there will always be different opinions when it comes to languages and coding style. My opinion remains that you should use whatever suits you (and perhaps your employer).

                                        I have now updates my program to include a configure view (which you will see the first time you run it) that allows you to put in the parameters for your device. The holes in each plate should be given as a comma separated list. There is a button to load the parameters for my rotary table (HV4) which will show you the format.

                                        It has not had much testing – mainly on Windows using python 3.4. I have run it briefly on a Raspberry pi using python and python3.

                                        Please let me know if you find it useful and also let me know if you find bugs.

                                        It is on Github

                                        https://github.com/RogerWoollett/Workshop

                                        Edited By Roger Woollett on 08/06/2016 10:30:59

                                        #241995
                                        SillyOldDuffer
                                        Moderator
                                          @sillyoldduffer
                                          Posted by Ajohnw on 07/06/2016 23:21:44:

                                          Libreoffice has no probablem at all importing csv into a table Dave.

                                          John

                                          Edited By Ajohnw on 07/06/2016 23:22:02

                                          Hi John,

                                          You're right! It even worked with my horrible example. I'm impressed.

                                          Expecting to have loads of spare time after retiring I too decided to learn Java. I got as far as buying a book only to find I'm far too busy to read it. Ho Hum.

                                          Cheers,

                                          Dave

                                          #241998
                                          SillyOldDuffer
                                          Moderator
                                            @sillyoldduffer

                                            Posted by Roger Woollett on 08/06/2016 10:29:58:

                                            It has not had much testing – mainly on Windows using python 3.4. I have run it briefly on a Raspberry pi using python and python3.

                                            Please let me know if you find it useful and also let me know if you find bugs.

                                            It is on Github

                                            **LINK**

                                            Edited By Roger Woollett on 08/06/2016 10:30:59

                                            Hi Roger,

                                            I've not given it a comprehensive thrashing but so far as I can see your code runs OK on Ubuntu 16.04. I tried Python2 and Python3.

                                            I have a gear wheel project halfway down my "to do" list and will be back to your program when it reaches the top of the list.

                                            Well done!

                                            Cheers,

                                            Dave

                                            #242007
                                            Alex Collins
                                            Participant
                                              @alexcollins55045

                                              Hi Roger

                                              Works perfic on my pI as well.

                                              I have hacked your code around to test the next number and output to a CSV. (I'm not a programmer)

                                              #242008
                                              Ajohnw
                                              Participant
                                                @ajohnw51620

                                                If some one is thinking of having a go it might be worth mentioning that a book on a specific language may not have any details in it at all concerning windows style graphical applications. It will have lessons of one sort of another to enable people to get to grips with the language using a dos box / console.

                                                When it comes to actual windows and other things that display on the desktop and can do things there are 2 basic ways of going about it.

                                                This is a TK tutorial.It starts with some of the problems they have but eventually shows what has to be done.

                                                **LINK**

                                                It's not clear if TK can be used the other way it's done – visually which is how these two work.

                                                QT

                                                **LINK**

                                                **LINK**

                                                I think this one may be available for Python. I've seen mention of QT4 being used but have no idea how extensive it is. Info here. It looks like other software has to be used to convert the QT aspects to something Python can use.

                                                **LINK**

                                                One problem maybe – my cynical view – they have messed up QT4 and are restarting on QT5. These sort of things tend to start too rapidly these days. Earlier QT's needed complete rewrites each time a new version was used.

                                                This is a simple Java visual one

                                                **LINK**

                                                There are others.

                                                The visual ones can get pretty complicated. The items being created in a "window" can be dragged around and sized visually and the code to do them is generated automatically. There can be lots of options on the bits and pieces. Can the user resize them ? if so which parts resize and how are they positioned etc. What code is linked to the actions – mouse over, clicked and all sorts of things.

                                                It looks like people in Oz educate their children well. There is a good run down on the evolution of Basic here

                                                **LINK**

                                                It's interesting to look at some of the ones they link to. What's C syntax doing in this one and etc. Oh this one offers OO. Personally I'm inclined to think that there are broad similarities in all of them and other languages up to a point. A language using OO techniques will look much like any other using the same techniques. In other respects all, well most languages offer the same facilities for processing text and numbers. Some may need several primitive functions to be used to do something, another might have a single function that will do the same thing.. Really it makes more sense when choosing to pick one that is stable and used a lot. That limits the field.

                                                John

                                                #242331
                                                Ajohnw
                                                Participant
                                                  @ajohnw51620

                                                  I'm bleary eyed having had a java day and a half. There are some decent java tutorials on youtube. The BlueJ ones can help with terminology but largely seem to be aimed at people buying a £70 book that gets updated now and again.

                                                  There are a whole series by thus person

                                                  **LINK**

                                                  That one surprise is learn Java in 30min. Good luck but though they are rather rapid the series of 20 odd is worth a look. He explains a number of things very clearly, unlike BlueJ. The last few video's go through gui's with swing.

                                                  So to give it a go I downloaded and installed Eclipse. It works but the part that interested me the window builder just caused it to miss behave. Looking on the web there were indications that it hasn't worked on Linux for years and doesn't get fixed as all dev's are on windows. I saw mention of the evil Google. Not sure why.

                                                  So downloaded Netbeans choosing the one that includes "everything". Turns out that there are other bits and pieces too. Doubt if I will use it but installed a Python bolt on. In this respect it's an IDE and can cope with lots of languages.

                                                  Looking around in it a Swing application seems to be the only one that allows easy graphical front ends visually so I followed the example given. While doing this there is an icon which fires up the window so that it can be tried. It generates code with todo's after all of the signals. Nice because it can just be written and OO aspects added gradually if needed. I found that rather than leaving things as button1 to n and text field 1 to n etc the names can be changed to what they do and that then appears in the code. No mention in the tutorial.

                                                  However when I hit run it doesn't pop up. It also produces a distribution as a jar. That wont run either and generated a 52 error which I think means that the java it's running in is older than the one used in the IDE. So I set the build platform option to a Linux distribution one which includes icedtea rather than the usual java runtime. Error went but still doesn't pop up. There is another one for me to try as well. I've never had much luck updating Java to a linux version directly from Sun.

                                                  Swing seems to need an extension library maybe even at runtime. Seems odd to me that people will generate gui's hard wired in pure code but I don't know what java app development means in practice. I'd see writing all of the code to implement and position a button etc as being a job for lunatics due to them actually trying to do it. There are form designers out there but the ones I found, free of course don't seem to easily allow modification on the fly.

                                                  I have tried to use QT in the past. Think it was V3 and Nokia was still involved. The doc's were not anything like up to date even to the extent of correct syntax. I was trying to take advantage of the fact that the cifs network protocol was initially intended to allow diskless workstations to function to allow me to work freely on disks in a NAS. The idea was to produce and icon, click on it, get asked for the password and then open a folder view of the disk and being able to run apps from it and read and write locally or on the NAS. It did have enough facilities to do this but just wouldn't work, syntax or maybe bugs. The upstream Linux people had crippled cifs to prevent apps from being run over it but there were sufficient comments in the source file to allow it to function as it always had. I had to bug report it 3 times before they changed the source files. I'm not sure what platforms QT will run on or if there is enough info about to allow it to be used. From rumours about KDE5 QT5 may turn out to be a virtual machine just like java is. QT was intended in part for prototyping. It had a C++ interface so that run time could be speeded up in places if needed. Lots were using it directly and not bothering with C++ at all.

                                                  John

                                                   

                                                  Edited By Ajohnw on 11/06/2016 13:01:43

                                                  #247029
                                                  Michael Gilligan
                                                  Participant
                                                    @michaelgilligan61133

                                                    John,

                                                    This thread has been quiet for a few weeks.

                                                    I've just come-across a very tidy way of tabulating the results ['though not of calculating them], in this Aciera document.

                                                    p27 et seq. may be to your taste.

                                                    MichaelG.

                                                    #247058
                                                    Ajohnw
                                                    Participant
                                                      @ajohnw51620

                                                      That's the sort of thing I intend to produce but with a table column per plate Michael.

                                                      A couple of weeks ago I was all set to update my machine so that I could write some code to generate the table. Then came car searches and a lot of email to ing and frow ing so went on the back burner for a while. There have been few other similar problems holding me back as well.

                                                      It also looks like I aught to use a 3D cad package to finalise the design of a 3D printer – that also needs me to upgrade my machine.

                                                      All I can say at the moment is soon.

                                                      John

                                                      Edited By Ajohnw on 17/07/2016 23:28:13

                                                    Viewing 25 posts - 76 through 100 (of 100 total)
                                                    • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                                    Advert

                                                    Latest Replies

                                                    Viewing 25 topics - 1 through 25 (of 25 total)
                                                    Viewing 25 topics - 1 through 25 (of 25 total)

                                                    View full reply list.

                                                    Advert

                                                    Newsletter Sign-up