public DeviceInstance CreateInstance(DeviceConfig devconf, Guid class_id, DeviceProperty devp) { /* クラスIDからクラスを検索 */ var devd = FindClass(class_id); if (devd == null) { return(null); } /* インスタンス作成 */ var devi = devd.CreateInstance(devconf, devp); if (devi == null) { return(null); } /* インスタンス登録 */ lock (devi_list_) { devi_list_.Add(devi); DebugManager.MessageOut(DebugMessageSender.Device, DebugMessageType.ControlEvent, String.Format("Device Instance Added. count = {0}", devi_list_.Count)); /* 各インスタンスのリダイレクト先を更新 */ UpdateRedirectMap(); } /* デバイス処理開始 */ devi.DeviceStart(); return(devi); }
public DeviceInstance(DeviceConfig devconf, DeviceClass devd, DeviceProperty devp) { devconf_ = devconf; devd_ = devd; devp_ = devp; data_rate_timer_.Restart(); /* イベント初期化 */ device_poll_events_ = new WaitHandle[Enum.GetValues(typeof(DevicePollEventID)).Length]; device_poll_events_[(int)DevicePollEventID.ActiveRequest] = active_request_event_; device_poll_events_[(int)DevicePollEventID.DataRateSampling] = data_rate_sampling_request_event_; }
internal DeviceInstance CreateInstance(DeviceConfig devconf, DeviceProperty devp) { if (devp == null) { return(null); } if (devp.GetType() != GetPropertyType()) { return(null); } return(OnCreateInstance(devconf, devp)); }
protected virtual DeviceInstance OnCreateInstance(DeviceConfig devconf, DeviceProperty devp) { return(null); }
public DeviceInstance CreateDeviceObject(DeviceConfig devconf, Guid class_id, DeviceProperty devp) { return(CreateInstance(devconf, class_id, devp)); }