New Cnc/Mazak/ machine integration mirroring the Fagor/Mitsubishi FTP pattern: MazakConnectionConfig, IMazakFtpClient, MazakFtpClient, MazakMachine (ICncMachine). Transfers EIA/ISO G-code text over FTP to Smooth-family controllers. Mazatrol CMT (proprietary binary) out of scope. Design (verified against Mazak Matrix EIA manual + field reports): - Filenames preserved verbatim; no O#### rename, no extension append. - Symmetric ResolvePath for Read/Write/Delete (avoids ISS-020 class; Delete resolved too, unlike copied Mitsubishi source). - Validator = full passthrough for Mazak (EIA permits ';' EOB, '[ ]', '#'; restrictive Fanuc checks would false-reject valid programs). - Port 21 default, -porta=23 for Smooth Ai IIS variant. - ProgramDirectory site-specific, no default. Wiring: CncManufacturer.Mazak, ArgParser 'mazak' token, CncMachineFactory. Tests: MazakMachineTests (unit), MazakMachineIntegrationTests (FTP-stub roundtrip + symmetry guard), Mazak cases in validator/factory tests. Docs: README Controller Mazak section + table row; ISS-021 (constraints, EIA-option requirement), ISS-022 (Mitsubishi delete asymmetry logged). NOT build-verified (no .NET toolchain in build env) — verify on Windows. Projects: NcProgramManager, NcProgramManager.Tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
82 lines
3.3 KiB
C#
82 lines
3.3 KiB
C#
using System;
|
|
using NcProgramManager.Cnc.Fagor;
|
|
using NcProgramManager.Cnc.Fanuc;
|
|
using NcProgramManager.Cnc.Heidenhain;
|
|
using NcProgramManager.Cnc.Mazak;
|
|
using NcProgramManager.Cnc.Mitsubishi;
|
|
using NcProgramManager.Cnc.Models;
|
|
using NcProgramManager.Cnc.Siemens;
|
|
|
|
namespace NcProgramManager.Cnc
|
|
{
|
|
internal static class CncMachineFactory
|
|
{
|
|
internal static ICncMachine Create(InputArgs args)
|
|
{
|
|
switch (args.manufacturer)
|
|
{
|
|
case CncManufacturer.Heidenhain:
|
|
return new HeidenhainMachine(new HeidenhainConnectionConfig
|
|
{
|
|
Name = "Heidenhain",
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? 19000 : int.Parse(args.porta),
|
|
Username = args.username,
|
|
Password = args.password,
|
|
ConnectTimeout = TimeSpan.FromSeconds(5)
|
|
});
|
|
|
|
case CncManufacturer.Siemens:
|
|
return new SiemensMachine(new SiemensConnectionConfig
|
|
{
|
|
Name = "Siemens",
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? 21 : int.Parse(args.porta),
|
|
Username = args.username,
|
|
Password = args.password
|
|
});
|
|
|
|
case CncManufacturer.Mitsubishi:
|
|
return new MitsubishiMachine(new MitsubishiConnectionConfig
|
|
{
|
|
Name = "Mitsubishi",
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? 21 : int.Parse(args.porta),
|
|
Username = args.username,
|
|
Password = args.password
|
|
});
|
|
|
|
case CncManufacturer.Fagor:
|
|
return new FagorMachine(new FagorConnectionConfig
|
|
{
|
|
Name = "Fagor",
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? 21 : int.Parse(args.porta),
|
|
Username = args.username,
|
|
Password = args.password
|
|
});
|
|
|
|
case CncManufacturer.Mazak:
|
|
return new MazakMachine(new MazakConnectionConfig
|
|
{
|
|
Name = "Mazak",
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? 21 : int.Parse(args.porta),
|
|
Username = args.username,
|
|
Password = args.password
|
|
});
|
|
|
|
default: // Fanuc
|
|
return new FanucMachine(new FanucConnectionConfig
|
|
{
|
|
Name = "Fanuc",
|
|
Transport = args.nodoHssb >= 0 ? FanucTransport.Hssb : FanucTransport.Ethernet,
|
|
IpAddress = args.ip,
|
|
Port = string.IsNullOrEmpty(args.porta) ? (ushort)8193 : ushort.Parse(args.porta),
|
|
HssbNode = args.nodoHssb,
|
|
ConnectTimeout = TimeSpan.FromSeconds(4)
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|