Recent

Author Topic: Looking for programmer to review and maintain mature Delphi D4 project  (Read 12636 times)

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
I have a rather large project written in Delphi Pro V4 which I purchased in 1998, and started using around 2002 for an application that reads data from a USB serial port for analysis and report generation. It uses the Borland BDE and originally the SerialNG component. But that did not work on Windows 10, so I tried COMDRV32, but it causes crashes. I am transferring the project to an associate as I am now semi-retired and working part-time on other projects. I have only used Free Pascal and Lazarus for a couple of simple projects, and I don't know if they will work for my project. I would also like to try using the TLzComPort component to see if it works on Win10.

As to compensation, that would depend on what my associate would feel is appropriate. This software is part of a system called "Ortmaster" and it sells for a list price of $3995, but there are only about 50 systems in the field and future sales may be only a couple per year. So there is potential for perhaps a couple thousand dollars and some continuing work for bug fixes, maintenance, and new features.

This was my first major Windows GUI application and I learned Delphi "on-the-fly", so it is not well organized and documented. Prior to Delphi I wrote MSDOS console applications using Borland C, and I am primarily an electronics engineer with experience in Z80 assembly and Microchip PIC programming in C.

You may learn more about the product at http://www.ortmaster.com, and you can download the latest stable version as well as the latest version which works on Win10, but the problems are in the COM port driver and requires proprietary hardware for the serial port. The software will run in demo mode using waveform files instead of real data from the serial port.

I'd appreciate any advice you may be able to provide. Thanks!
« Last Edit: April 15, 2017, 02:46:23 am by PStechPaul »

Phil

  • Hero Member
  • *****
  • Posts: 2737
I'd appreciate any advice you may be able to provide. Thanks!

With BDE dependency, unknown report components, and bugs in the serial code, my initial reaction would be that it needs a complete rewrite.

I like the name, though.

How many lines of code? How many forms? How many and what non-Delphi VCL or reporting components does it use?


PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
I can only give a rough estimate. There are about 16 forms with 171 kB, about 25 PAS files with 491 kB, and about 9 database files in dBase4 format. The main PAS file has about 1200 lines and is 40 kB. So I estimate the 491 kB of all files would be about 15,000 lines. But that includes a lot of whitespace, comments, and some unused code.

Here is the project file:
Code: [Select]
program Ortmaster;

uses
  Forms,
  SysUtils,
  Windows,
  OrtImage in 'OrtImage.pas' {fmOrt560},
  OrtData in 'OrtData.pas' {fmReclData},
  OrtResults in 'OrtResults.pas' {fmOrtResults},
  OrtCurve in 'OrtCurve.pas' {fmOrtCurve},
  OrtMain in 'OrtMain.pas' {fmOrt},
  OrtHelp in 'OrtHelp.pas' {fmOrtHelp},
  OrtUpdate in 'OrtUpdate.pas',
  hh_funcs in '..\delphikit\hh_funcs.pas',
  hh in '..\delphikit\hh.pas',
  Comm in '..\PStechLib\Comm.pas' {fmComm},
  Debug in '..\PStechLib\Debug.pas' {fmDebug},
  Waveform in '..\PStechLib\Waveform.pas' {fmWaveform},
  xygraph in '..\PStechLib\xygraph.pas',
  DelayForm in '..\PStechLib\DelayForm.pas' {fmDelay},
  VersionInfo in '..\PStechLib\VersionInfo.pas',
  OrtDatabase in 'OrtDatabase.pas' {fmOrtDatabase},
  Setup in '..\PStechLib\Setup.pas' {fmSetup},
  Cal in '..\PStechLib\Cal.pas' {fmCal},
  Pass in '..\PStechLib\Pass.pas' {fmPass},
  Delays in '..\PStechLib\Delays.pas',
  USB in '..\PStechLib\USB.pas' {fmUSB},
  OrtMeter in 'OrtMeter.pas' {fmOrtMeter},
  OrtReport in 'OrtReport.pas' {fmOrtReport},
  AnalogMeter in '..\PStechLib\AnalogMeter.pas';
//  AnalogMeter in '..\PStechLib\analogmeter\AnalogMeter.pas';

{$R *.RES}

var       ProgName: String;

begin
  Application.Initialize;
  ProgName := ExtractFileName (ParamStr(0) );
  Application.Title := 'Ortmaster for Windows';
  Application.CreateForm(TfmOrt560, fmOrt560);
  Application.CreateForm(TfmOrtReport, fmOrtReport);
  if Uppercase(Progname) <> 'ORTRUN.EXE' then begin
    if ( (ParamCount = 0) or (ParamStr(1) = '!') ) then begin
      fmOrt560.Show;
      While fmOrt560.Visible do begin
        Sleep(100);
        Application.ProcessMessages;
        end;
      end;
  end;
  fmOrt560.Release;
  Application.CreateForm(TfmDebug, fmDebug);
  Application.CreateForm(TfmDelay, fmDelay);
  Application.CreateForm(TfmSetup, fmSetup);
  Application.CreateForm(TfmCal, fmCal);
  Application.CreateForm(TfmPass, fmPass);
//  Application.CreateForm(TfmOrtMeter, fmOrtMeter);
  Application.CreateForm(TfmUSB, fmUSB);
  Application.CreateForm(TfmComm, fmComm);
  Application.CreateForm(TfmWaveform, fmWaveform);
  Application.CreateForm(TfmOrtMeter, fmOrtMeter);
  Application.CreateForm(TfmOrt, fmOrt);
// Following three may be created and destroyed as needed
  Application.CreateForm(TfmOrtDatabase, fmOrtDatabase);
  Application.CreateForm(TfmReclData, fmReclData);
  Application.CreateForm(TfmOrtResults, fmOrtResults);
  Application.CreateForm(TfmOrtCurve, fmOrtCurve);
  Application.CreateForm(TfmOrtHelp, fmOrtHelp);
  OrtMain.ProgName := ProgName;
  Application.Run;
end.

Phil

  • Hero Member
  • *****
  • Posts: 2737
I can only give a rough estimate. There are about 16 forms with 171 kB, about 25 PAS files with 491 kB, and about 9 database files in dBase4 format. The main PAS file has about 1200 lines and is 40 kB. So I estimate the 491 kB of all files would be about 15,000 lines. But that includes a lot of whitespace, comments, and some unused code.

Doesn't sound too bad to rewrite from scratch, maybe even make it cross-platform. Is the xygraph unit your own code or does it use a graphing component? Also, I see that you use Access to generate at least one of the reports. Have you tested to see if that still works with the latest versions of Access? I used to use Access for reports years ago, but they tend to stop working the further you get from the version of Access you used to develop them (in my experience).

Actually, this might be one are where desktop software development is still thriving: highly technical, highly specific software that few can write, so you charge accordingly. Certainly keeping 2 users happy at $3995 a pop is probably easier than keeping 2,000 users happy at $3.95 a pop.

Maybe before you do much else, have you thought about ways to expand the market for this software? For example, to 10-20 sales per year. Maybe by generalizing it so you can attract new users. Or maybe there's some way to do it on a cheap tablet? Or add new functionality in a Web app? Etc. So you can get upgraders and new users. Maybe you've already thought a lot about that, even agonized over this question, but I thought I would throw that out there just in case you haven't.

Another thing to consider if you want to do a complete rewrite is going to a contract software shop and let them do a complete requirements and design analysis. Would probably cost about one sale but could very well be worth it if you're going to have somebody do a rewrite in mistakes avoided, etc.

Dbase is certainly an obsolete db format and your app does have that late 20th century vintage look, so it might be time to give it some real love (read: $ investment).

Also, developers of desktop software are quickly becoming the COBOL programmers of our era. They're not disappearing and they'll be needed for years to come to maintain all the desktop software developed for Windows over the last 20 years, but few young programmers aspire to do that kind of development. So I would think anything you can do to "modernize" the app would help in keeping a programmer interested and engaged.


PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
More information stemming from a PM:

It is difficult to say how much income this might generate. It is a "mature" application that has been working well for as many as 50 customers, and there is a potential market for perhaps 50-100 more. I have never advertised the product, and my sales over the past ten years have been all word-of-mouth and through searches that found my website. This system replaces an earlier version that used MSDOS and the parallel port for data acquisition, and as many as 150 of those systems were sold. Most of my sales have been retrofits for customers who needed to update their systems to Windows platform and the USB port.

Much depends on my associate who is taking over the product line, and he may start advertising and contacting previous customers. If that is successful, I would think perhaps 20-30 units a year could be sold for a few years until the niche market saturates. But there is a good profit margin and I would expect a good rewrite of the software could amount to several thousand dollars over a few months.

[edit] In answer to the previous post, this is a highly specialized application and system which is used by technicians who test Oil Circuit Reclosers that are used by utilities and electric co-ops on their transmission and distribution lines. The previous software in MSDOS was very ugly and primitive, but many of the techs are not very computer-savvy and preferred something stupid-simple. I had been working with an associate who wrote part of the software in old MSDOS Visual Basic, and he handled the sales and service of the product except for the hardware which I designed and built.

He hired some people to make new software for Windows using Visual Basic and IMHO it was truly ugly and problematic. We could not come to agreement so we went separate ways and customers were begging me to supply something, so I built a new interface and a completely new GUI using Delphi. It is admittedly complex but it has been used by many techs and they seem satisfied with it. But I agree that it could use some visual improvement.

The software will run on a WinBook tablet, but it usually runs on a laptop computer that may be dedicated to the test station. I don't know how much people use the database and report functions, and perhaps only a few use MS-Access. I only did that as an option, importing the database tables and creating a custom report. That's an area that could use improvement.

There is another program, BTSA-3T, based on the Ortmaster hardware and software but with a different GUI. It is used by my associate at ETI who is assuming responsibility for the project. That will also need some work, but I think it works on Win10, although not reliably. Here is a picture of the PCB and the application running on my WinBook:

http://enginuitysystems.com/pix/electronics/BTSA3-Winbook_3037.jpg
« Last Edit: April 15, 2017, 04:29:37 am by PStechPaul »

Phil

  • Hero Member
  • *****
  • Posts: 2737
[edit] In answer to the previous post, this is a highly specialized application and system which is used by technicians who test Oil Circuit Reclosers that are used by utilities and electric co-ops on their transmission and distribution lines.

Sounds like a great app. This is where a lot of under-the-radar innovation is going on currently in software/hardware development: in automation, safety, efficiency, etc.

Maybe you need an video ad for your site of the app and hardware being used? Take a look at the short video here. Much of it was shot with a drone camera.

https://loadout.co


PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
I have two videos with links on the website, but they are not very good:

http://www.youtube.com/watch?v=lIfr5ZlIbEM

http://www.youtube.com/watch?v=VErxJOiz4uw

I have made other videos of similar testing. Here is a demo of molded case circuit breaker testing using a product I designed:

https://www.youtube.com/watch?v=ZaCL8wrIKeo

This shows a high current DC test set, producing 20,000 amperes:

https://www.youtube.com/watch?v=Xr713ZUsJws

An overview of various high current test sets I have designed or worked on:

https://www.youtube.com/watch?v=DRAOeTs7JIM

Here is a video showing recloser testing with a different system:

https://www.youtube.com/watch?v=Zkg0k4bM2I0

This shows an arc inside a recloser being tested:

https://www.youtube.com/watch?v=3JxvwmQs0Fg

[edit] My patent for a recloser test set:
http://www.google.com/patents/US4307345

A competitor's recloser test set (I did some work for them):
http://www.phenixtech.com/Files/Admin/PDF/30305_Recloser_Test_Sets.pdf

The original Ortmaster as marketed by AVO/Megger:
http://assets.tequipment.net/assets/1/26/Documents/ORTMasterDataSheet.pdf

The TCC software that was used to verify current/time curve data:
http://www.statesproducts.com/common/documents/TCC_DS_en_V10.pdf
« Last Edit: April 15, 2017, 06:32:49 am by PStechPaul »

SunyD

  • Guest
This programm looks like easy to convert.
I would say 4-5 days for the programm itself, and a couple of weeks to make it error-free and perfect. (Except hardware connection)
I would put most of the sub forms in the mainform.
In lazarus you have all tools what do you need for your program LazReport for your report(similar to your Quickreport).
For database you can use TDBF (Dbase iv) or better Firebird.
With Firebird your customer will love your program :-)
They can on one machine use data from usbport and on all other computers work with collected data.
Don't use "autoconvert delphi project future" from lazarus tools-menu. Convert it form by form it is easier.
Also my first Delphi version was Delphi 4 Pro.
Good luck.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
I have a rather large project written in Delphi Pro V4 which I purchased in 1998, and started using around 2002 for an application that reads data from a USB serial port for analysis and report generation. It uses the Borland BDE and originally the SerialNG component. But that did not work on Windows 10
I would also like to try using the TLzComPort component to see if it works on Win10.
I'd recommend to start with the aspect of communicating with the device.

1) is USB = Serial Port? I've never heard about usb being referenced as a serial port actually. External devices are typically using Serial Ports and I'd think this is the one you're using. From the software perspective, working with USB and Serial ports are typically done via separate libraries.

2) is communication part not working on Windows 10?
You mentioned Borland BDE so I was wondering if the app doesn't work due to the old database engine, rather than SerialNG.
According to SerialNG it's based of WinAPI calls, so I'd think that MS could provide the backward compatibility support for those.

If you've both Delphi 4 and SerialNG, you could probably write a simple stand-alone test to see if the communication part is working on Windows 10.
and If it's not working and you have source codes of SerialNG you could probably diagnose the problem.

Yet another aspect of SerialNG sources. It sounds like they could be ported to Lazarus easily (since they don't have any external libraries dependency and use WinAPI and Delphi functions only).
It could be helpful as the first step, since some parts of your code will not have to change, if you decide to port the code to Lazarus.

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
The SerialNG component seems to be no longer supported:
http://www.domis.de/cms/index.php?module=ContentExpress&func=display&ceid=7

I have tried the basic demo and it also does not work on Win10. I don't have the capability of debugging the code to make it work. I think the error is simply that it cannot open the COM port.

The ComDrv32 component seems to work with Win10 for a simple demo, but causes access violations in the Ortmaster. It seems that a background task or thread is exceeding the bounds for the COMM buffer. Perhaps this would be fairly easy to fix, but I would rather have a fully debugged, tested, and supported serial component. That's why I thought TLazSerial may be a good choice.
ComDrv32: http://torry.net/pages.php?s=89

I may also consider paying for a commercial product. I found a ComPort v5.5 on the page above which is a $55 shareware recently updated. But it seems to support only Delphi 5 and above. It does support Lazarus.

Here is a commercial product for $115:
http://www.marshallsoft.com/wsc4d.htm

It would probably be most cost-effective to try a commercial product so that future maintenance would be more straightforward.

I am using a design with a Microchip PIC18F2550 USB device configured as CDC and a custom driver INF using Microsoft usbser such that it enumerates as "Ortmaster Comm Port (COMnn)". I had previously tried USB-Serial dongles but some did not work reliably. I also have a custom USB version that communicates directly via USB, but I had some problems.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Looking for programmer to review and maintain mature Delphi D4 project
« Reply #10 on: April 15, 2017, 08:07:05 pm »
The fact that you've tests ready, sounds promising.
Did you have a change to try TLazSerial already?

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
Re: Looking for programmer to review and maintain mature Delphi D4 project
« Reply #11 on: April 15, 2017, 08:44:19 pm »
I'm trying to install Lazarus on my Win8 laptop, and the ppc386.exe installer just brings up a command box with various help topics. Maybe I have the wrong version? I have Lazarus installed on my new Win10 laptop but I haven't transferred things there yet. Probably time to do so.

BTW, how does one insert an image in a post? I tried using [ img] tags with a URL, and no joy. I tried uploading but my image is 300k and limit is 250k.

[edit] I was confusing the compiler with the IDE. I now have the IDE running and the TLazSerial component installed, and I built the sertest application. It opens the USB Com Port but I don't see activity.
« Last Edit: April 15, 2017, 09:38:10 pm by PStechPaul »

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
Re: Looking for programmer to review and maintain mature Delphi D4 project
« Reply #12 on: April 15, 2017, 11:03:47 pm »
I have made a simple test project using Lazarus and TLazSerial component. I can send a control character to my device and I can receive part of the expected string of characters. Now I need to learn how to use the component, but that will be discussed in a separate thread. Thanks.

 

TinyPortal © 2005-2018