我正在编写一个可以在车床和加工中心上运行的程序。在加载期间不做的情况下如何最好地初始化 API。我应该为每种机器类型调用一个类,还是可以在同一个类中调用每个(并关闭它们)?
为车床添加了当前方法的示例...
using Okuma.CLDATAPI.DataAPI;
using Okuma.CLDATAPI.Enumerations;
using Okuma.CLDATAPI.Structures;
using Okuma.CLDATAPI.DataAPI.MacMan;
public class LatheDutyOnline
{
private CMachine Objl;
private CVariables Objlv;
private CIO IO;
private CATC ObjAtc;
private CAxis objaxis;
private CBallScrew objBS;
private CProgram objProgram;
private CSpec objSpec;
private CSpindle objSpindle;
private void Form1_Load(System.Object sender, System.EventArgs e)
{
Objl = new CMachine();
Objl.Init();
Objlv = new CVariables();
IO = new CIO();
ObjAtc = new CATC();
objaxis = new CAxis();
objBS = new CBallScrew();
objProgram = new CProgram();
objSpec = new CSpec();
objSpindle = new CSpindle();
}