static public void SetMemFullOp(int deviceId, LJV7IF_FULL_MEM_OP data) { try { byte category = 0; byte item = 2; var setting = new LJSetting((byte)SettingDepth.Running, (byte)SettingType.Common, category, item, (byte)0, (byte)0, (byte)0, (byte)0, (byte)data); SetSetting(deviceId, setting); } catch (Exception) { throw; } }
static public void SetMemAllocation(int deviceId, LJV7IF_MEM_ALLOCATION data) { try { byte category = 0; byte item = 1; var setting = new LJSetting((byte)SettingDepth.Running, (byte)SettingType.Common, category, item, (byte)0, (byte)0, (byte)0, (byte)0, (byte)data); SetSetting(deviceId, setting); } catch (Exception) { throw; } }
static public void SetOpMode(int deviceId, LJV7IF_OP_MODE data) { try { byte category = 0; byte item = 0; var setting = new LJSetting((byte)SettingDepth.Running, (byte)SettingType.Common, category, item, (byte)0, (byte)0, (byte)0, (byte)0, (byte)data); SetSetting(deviceId, setting); } catch (Exception) { throw; } }
static public void SetBatchMode(int deviceId, LJV7IF_BATCH_MODE data) { try { byte category = 0; byte item = 3; var settingType = SettingType.Program00; var setting = new LJSetting((byte)SettingDepth.Running, (byte)settingType, category, item, (byte)0, (byte)0, (byte)0, (byte)0, (byte)data); SetSetting(deviceId, setting); } catch (Exception) { throw; } }
static public void SetTriggerFreq(int deviceId, LJV7IF_FREQUENCY data) { try { byte category = 0; byte item = 2; var settingType = SettingType.Program00; var setting = new LJSetting((byte)SettingDepth.Running, (byte)settingType, category, item, (byte)0, (byte)0, (byte)0, (byte)0, (byte)data); SetSetting(deviceId, setting); } catch (Exception) { throw; } }
static public LJV7IF_OP_MODE GetOpMode(int deviceId) { try { byte category = 0; byte item = 0; byte[] data = new byte[1]; var setting = new LJSetting((byte)SettingDepth.Running, (byte)SettingType.Common, category, item, (byte)0, (byte)0, (byte)0, (byte)0, data); data = GetSetting(deviceId, setting); return((LJV7IF_OP_MODE)(data[0])); } catch (Exception) { throw; } }
static byte[] GetSetting(int deviceId, LJSetting lJSetting) { try { LJV7IF_TARGET_SETTING targetSetting = lJSetting.TargetSetting; byte[] data = new byte[lJSetting.DataLength]; using (PinnedObject pin = new PinnedObject(data)) { int rc = NativeMethods.LJV7IF_GetSetting(deviceId, lJSetting.Depth, targetSetting, pin.Pointer, (uint)lJSetting.DataLength); } return(data); } catch (Exception) { throw; } }
static public LJV7IF_FREQUENCY GetTriggerFreq(int deviceId) { try { byte category = 0; byte item = 2; var settingType = SettingType.Program00; byte[] data = new byte[1]; var setting = new LJSetting((byte)SettingDepth.Running, (byte)settingType, category, item, (byte)0, (byte)0, (byte)0, (byte)0, data); data = GetSetting(deviceId, setting); return((LJV7IF_FREQUENCY)data[0]); } catch (Exception) { throw; } }