LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-03-2011, 04:10 AM   #46
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116

Quote:
Originally Posted by schmitta View Post
IF I wrote a java jre6 gui would it work on linux?
Yes (and with almost no alteration or recompiling), Java's specified to be as platform-independant as possible, or rather it defined an abstract generic platform that is then implemented to each supporting real OS. The Java Runtime Environment is this standard that all Java expects to run in. It's a bit like a lightweight Virtual Machine. Windows, Linux, smartphones, many devices support this standard or cut-down derivatives.
Quote:
Originally Posted by schmitta View Post
Is there a visual java like visual basic?
The answer to this depends whether you're asking can you create graphical user interface with all the usual widgets like buttons, text fields, scroll bars, etc, or if you wish to develop you application in some form of drag&drop hand-holding environment. I believe the latter is what the mention of VisualAge and plugins for Netbeans/Eclipse were in reference, but the answer to the former is yes, there's even several options for Java GUIs, typically Swing is favoured, but there's AWT and SWT also.

Similar to many other languages, Java can also call C/other code, via the Java Native Interface. This should allow you to maintain a single common GUI for Windows or Linux users, and still delegate any platform specific/very low level device interaction to another language. Or you can stick with the design of seperate GUI and device communication processes and use an IPC mechanism as described above.

I'm putting this link for the Java documentation here, it's always a good place to start any specific development and to get an good understanding of how all these things relate. Note the JRE/JavaSE API area, and the Integration Libraries row. CORBA as mentioned previously for IPC is behind the IDL option, and database communication is JDBC.
I too would favour using the Model-View-Controller paradigm/pattern and have the database as the persistent go-between which means devices and users are completely seperate and can use any language/mechanism that can talk to the database/understand SQL.

Many languages have similar features to Java, as mentioned Python and C++ are common for stand-alone apps, and most can be used within/with a web server to use HTML as your GUI. Otherwise you need to choose a widget toolkit, such as Qt, WxWidgets, GTK+, etc.

Cygwin sounds overkill, (DR)DOS shouldn't be needed either.

It would indeed be quite easy to have several web services or virtual directories within the one webserver that are independant and have different access setups, via configuration in the web server as well as your network firewall settings (which could be those managed on the local machine that's running the web server or some larger infrastructure/dedicated firewall device). A couple of lines of config/rules in a standard OS/software firewall should cover this, and you end up maybe with 2 different URLs/using 2 different portnumbers.

Last edited by Proud; 08-03-2011 at 04:32 AM.
 
1 members found this post helpful.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 08-03-2011, 09:23 AM   #47
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
To communicate between a program and LAMP, set the program on the floor beside the LAMP, plug in the LAMP in the nearest wall-socket, then go have a beer.
 
0 members found this post helpful.
Old 08-03-2011, 11:50 AM   #48
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
The prolem with JAVA is that it is a closed system. I still have to communicate serially with my devices from the PC. I will be using a RS485 to USB converter but JAVA has problems talking to USB from windows. I guess I could write a driver in C and have it communicate with java via a file or database. I can have a database and server all in java which would be nice.
 
Old 08-03-2011, 12:28 PM   #49
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Again, Java Native Interface, handle the data directly if you don't want to go via file, database or some IPC.
 
1 members found this post helpful.
Old 08-03-2011, 08:28 PM   #50
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Thanks for the information. I am as new to JAVA as I am to linux. I am using wikipedia a lot now a days.
 
Old 08-03-2011, 10:50 PM   #51
qneill
LQ Newbie
 
Registered: Jul 2004
Location: Austin, TX, USA
Posts: 10

Rep: Reputation: 1
[edited after I read the rest of the posts...]

+1 on the earlier post about using a scripting language (python, perl, ruby). A working prototype might just be good enough for production in this environment. Pretty easy to write deamons/services as well as front-ends as well, and it will be faster. If you know C I'd recommend python.
--
Quentin

Last edited by qneill; 08-03-2011 at 11:01 PM.
 
Old 08-04-2011, 01:55 PM   #52
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Yes but now I have to use windows - 80% of the market using windows and I can't force someone to use linux
 
Old 08-04-2011, 04:07 PM   #53
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Will your system require a computer of any sort that must be attached to the special network full-time? If yes, then you could provide a closed-architecture Linux system on an inexpensive single-board computer dedicated to the job. Then you don't have to worry about support of Windows end-users with issues like installation and other hassles. You said you were going to use RS-485 in your controller network, so a SBC with 485 already in place addresses that issue, too. The connection to the host network then just needs ethernet, which can be a DHCP configuration, and you've taken end-user hassles almost right out of the equation.

--- rod.
 
1 members found this post helpful.
Old 08-04-2011, 07:22 PM   #54
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
I have been told that my units should sell for $50. I really cannot say that the price is $50 for that would start the patent clock. But $50 is rediculus (?) . I think some systems sell for $25000.00. I have two groups to sell to. One is wholesale nurseries with about 50 valves (fifty of my units) to control. The other is oneses and twoses who's group size is probably larger than the large scale nurseries. I have enhanced my device to maybe handle that group without the need of an extra PC. But if they want the full use of the device they would need a pc. The smallest pc (MINI-ITC?) is about $200. With Windows I could make them pay for the software and a RS485 to USB interface. Then use there own already purchased computer . But if it turns out that the small user can use the device without a pc then I could sell a $200 pc as an add on appliance and use linux. It does not come down to what we want but to what the market will bear. Large groups have lots of money but small groups do not. It probably depends on the size of the market. There are not a lot of oneses and twoses. It is not about greed but fear of making it through year one or two. Thanks for bearing with me with my rant and what do you think?
 
Old 08-04-2011, 10:20 PM   #55
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I think you didn't answer the question of whether your scheme requires full-time attachment by some kind of computer. My basis for the question is that people probably don't want to have a computer that they use for general-purpose use tied up doing plant watering supervision. If that is a requirement, then I would think that it would be an attractive feature (as well as saving you some development effort) to have a dedicated supervisory computer. Doing so would allow you to create a turn-key package using whatever platform you choose.

--- rod.
 
Old 08-04-2011, 11:39 PM   #56
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
The device requires a computer (PC) to use all of its functions but can operate standalone with certain restrictions. No control will be allowed over the internet except in a very secure way with the user taking all the responsibility for failure . Only viewing of the system will be allowed for most instances over the internet. Thus to use all of the device's functionality a local PC will be required. This will most likely be a program (GUI) . If the user does not want to record the status of the system every minute or so they can just use the PC to set variables in the device. Since most people will already have a PC and Windows I was going to sell them a RS485 to USB convertor. Every thing else for the gui would be running as a widowns program. To force a user to buy a $200 computer just to set variables in the device seems to be over bearing.
 
Old 08-11-2011, 09:50 PM   #57
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Today I had at least 6 blue screens. When I first turned the machine on I got 14,000+ updates to the windows registry because (I guess) WINDOWS UPDATE installed an update on "Update Tuesday" (which happened on wednesday). Microsoft dedicated 3 hours today (also 3 hours of my time) and more tomorrow to the problem.

I do not really want to depend on windows on the PC that communicates to my devices. So I will develope a Linux based PC including database and server capabilities for systems greater than two devices. It will be in Java Swing so it will be able to migrate to windows and macintosh. The windows/macintosh version will allow a small database but no server and be marketed to one device users. A Linux based PC is more under my control and allows me to fix the version number so that changes will not break my system. I would choose UBUNTU 10.4 (UBUNTU was the only version that installed to disk for me out of all the Linux versions I tried - 11.4 broke for me). I would probably use a mini-itx system as it is cheap. The security that Linux would not break and that it's version could be fixed and stable would allow me to sleep at night. If people want to upgrade to security then they can choose a Linux appliance .
 
Old 08-12-2011, 08:22 AM   #58
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
FWIW on Windows XP and beyond, a bluescreen is rare and typically either failing hardware, or a dodgy 3rd party device driver.

Ubuntu 10.04 seems to be a Long Term Support version, which is what you want to look for, rather than a more frequently updated release from Canonical or any other distro producer.
If a version of Ubuntu works on your hardware, it's likely any linux distro could, it's just which one has the default settings and possibly proprietary device drivers bundled in to make it smooth.

Windows or Linux, you'll always have 2 concerts w.r.t. updates: providing your own should security flaws or bugs be found in your software; and compatability with fixes produced for similar updates to the OS. Granted, Linux installs can quite easily be trimmed to leave less things installed and so less 'surface area' of running services or executable code to cause such updates to be needed, but either OS could produce a conflicting fix and then it'll be down to if you will support that release or cause people to have to choose between updating their OS or your software.

If you're talking which OS to put on a dedicated device, obviously there's far less chance of requiring an OS update that also causes issues with your product, and you can probably skip most updates, but you'll still be more responsible for this machine if it's living within your customers' networks.

Last edited by Proud; 08-12-2011 at 08:23 AM.
 
Old 08-25-2011, 02:47 PM   #59
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 352

Original Poster
Rep: Reputation: Disabled
Java may be a problem. I need a service (daemon) to run all the time collecting data from the devices. Can I run two copies of jvm with one running as a permanent service writing data received to a database and then running the second jvm with gui (swing) accessing the same database to give the user data and to leave messages for the service jvm to send to the devices on the serial network?
 
Old 08-25-2011, 04:37 PM   #60
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Yes. Just like running any other combo of programs, or multiple instances of regular ones afaik. The different instances don't even need to be using the same JRE versions.

It's down to how you plan your database and transactions/interactions with it that'll determine if you cause concurrency issues, same with any language.

Last edited by Proud; 08-25-2011 at 04:39 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Enterprise LAMP Summit & Big LAMP Camp LXer Syndicated Linux News 0 09-21-2009 01:51 AM
LXer: LAMP vs. LAMP Rematch LXer Syndicated Linux News 0 11-08-2006 03:03 AM
A program for FC4 to communicate with a Windows Hyperterminal Program at other end vhasun Linux - Software 2 05-19-2006 02:54 PM
My C Chat Program is unable to communicate. mcp_achindra Programming 1 03-20-2004 10:04 AM
program to communicate directly with ethernet sabby Programming 4 12-18-2002 11:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration