💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › Srcs › cutter.p.txt captured on 2024-06-16 at 14:27:50.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

{
DISCLAIMER

Copyright (C) 1997 by Adrian Philip Whichello. All rights reserved.

I, Adrian Philip Whichello, MAKE NO WARRANTY ON THIS SOFTWARE, EITHER EXPRESS
OR IMPLIED, WITH RESPECT TO QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR
A PARTICULAR PURPOSE.

IN NO EVENT WILL I BE HELD RESPONSIBLE FOR DIRECT, INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OF THE SOFTWARE.

I RELEASE THIS PROGRAM AS FREEWARE. YOU MAY COPY, GIVE AWAY AND USE THIS
PROGRAM, PROVIDED THIS NOTICE REMAINS ATTACHED AT ALL TIMES.

}

program cutter_speed;
const
  pi = 3.14159265358979323;
  mm_per_in = 25.4;
  metal_lim = 12;
type
  metal_range = 1..metal_lim;
  metal_rec = record
    name, lubricant : string;
    lo, hi : real
  end;
  metal_array = array [metal_range] of metal_rec;
var
  metal : array [1..metal_lim] of metal_rec;
  choice : integer;
  diameter : real;
  
procedure make_rec(var metal : metal_rec;
                   n, lube : string;
                   l, h : real);
begin
  with metal do begin
    name := n;
    lubricant := lube;
    lo := l;  hi := h
  end
end;

procedure init_recs;
begin
  make_rec(metal[1], 'Aluminium & alloys', 'Soluble oil, paraffin', 200, 300);
  make_rec(metal[2], 'Bakelite, vulcanite', 'None needed', 100, 150);
  make_rec(metal[3], 'Brass', 'None needed', 150, 200);
  make_rec(metal[4], 'Brass (leaded)', 'None needed', 200, 300);
  make_rec(metal[5], 'Bronze', 'Soluble oil, lard oil', 70, 200);
  make_rec(metal[6], 'Cast Iron', 'None needed', 80, 90);
  make_rec(metal[7], 'Cast Iron - chilled', 'Soluble oil', 25, 35);
  make_rec(metal[8], 'Copper', 'Soluble oil, lard oil', 100, 200);
  make_rec(metal[9], 'Monel', 'Soluble oil, Sulphurised oil', 40, 50);
  make_rec(metal[10], 'Free cutting mild steel', 'Sulphurised oil', 100, 200);
  make_rec(metal[11], 'High Tensile Steel', 'Sulphurised oil', 15, 100);
  make_rec(metal[12], 'Steel - Manganese', 'Sulphurised oil', 15, 20)
end;
  
procedure show_metals;
var
  i : metal_range;
begin
  clearscreen;
  for i := 1 to metal_lim do with metal[i] do writeln(i:2, ') ', name)
end;
  
function speed(feet_per_min, d : real) : real;
begin
  if d = 0 then
    speed := 0
  else
    speed := 12.0 * mm_per_in * feet_per_min / (pi * d)
end;

begin
  init_recs;
  repeat
    show_metals;
    write('Enter choice number (0 to exit) ');
    readln(choice);
    if (choice < 1) or (choice > metal_lim) then exit(program);
    write('Enter cutter diameter (mm) ');
    readln(diameter);
    with metal[choice] do begin
      writeln;
      writeln(name);
      writeln(diameter:5:2, 'mm cutter speed from ',
        speed(lo, diameter):5:1, ' to ', speed(hi, diameter):5:1 ,' rpm.');
      writeln('Lubricant: ', lubricant);
      writeln
    end;
    writeln('Press <RETURN> to continue, <CTRL-C> to exit');
    readln
  until eof
end.