public void AddCmm(int cmmNo, string cmmName) { var use = LogicUnits.Any(p => p.LogicUnit.CmmNo == cmmNo); if (use) { return; } ICMMControl cmmCtrl = null; bool connected = false; if (string.Compare(cmmName, "Pcdmis", true) == 0) { cmmCtrl = PcdmisClient.Inst; } else { cmmCtrl = CalypsoClient.Inst; } connected = cmmCtrl.Online(); LogicUnitViewModel luVm = new LogicUnitViewModel(cmmNo, cmmName, cmmCtrl); luVm.CanOnline = !connected; luVm.CanOffline = connected; luVm.LogicUnit.CmmOnline = connected; LogicUnits.Add(luVm); }
public void Online() { if (CmmOnline) { return; } _actCtrl.IsOffline = false; if (!CmmOnline) { CmmOnline = _cmmControl.Online(); } }