Skip to content

Commit

Permalink
Merge pull request #261 from AllenNeuralDynamics:feat-add-repeater-to…
Browse files Browse the repository at this point in the history
…-rig-schema

Feat-add-repeater-to-rig-schema
  • Loading branch information
bruno-f-cruz authored Jun 27, 2024
2 parents e73de3c + deb8f59 commit 8f2b36c
Show file tree
Hide file tree
Showing 4 changed files with 496 additions and 236 deletions.
1 change: 1 addition & 0 deletions src/DataSchemas/aind_behavior_vr_foraging/rig.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AindVrForagingRig(AindBehaviorRigModel):
harp_olfactometer: rig.HarpOlfactometer = Field(..., description="Harp olfactometer")
harp_lickometer: rig.HarpLickometer = Field(..., description="Harp lickometer")
harp_clock_generator: rig.HarpClockGenerator = Field(..., description="Harp clock generator")
harp_clock_repeaters: List[rig.HarpClockGenerator] = Field(default=[], description="Harp clock repeaters")
harp_analog_input: Optional[rig.HarpAnalogInput] = Field(default=None, description="Harp analog input")
harp_treadmill: HarpTreadmill = Field(..., description="Harp treadmill")
harp_sniff_detector: Optional[rig.HarpSniffDetector] = Field(None, description="Sniff detector settings")
Expand Down
19 changes: 14 additions & 5 deletions src/DataSchemas/aind_vr_foraging_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,18 +867,18 @@
"type": "string"
},
"brightness": {
"default": 1,
"default": 0,
"description": "Brightness",
"maximum": 1.0,
"minimum": 0.0,
"minimum": -1.0,
"title": "Brightness",
"type": "number"
},
"contrast": {
"default": 1,
"description": "Contrast",
"maximum": 1.0,
"minimum": 0.0,
"minimum": -1.0,
"title": "Contrast",
"type": "number"
}
Expand Down Expand Up @@ -1065,7 +1065,7 @@
"type": "string"
},
"output_arguments": {
"default": "-c:v h264_nvenc -vsync 0 -2pass 1 -bf:v 0 -qp 13 -preset medium -b:v 20M -rc:v cbr",
"default": "c:v hevc_nvenc -pix_fmt x2rgb10le -color_range full -tune hq -preset p3 -rc vbr -cq 16 -rc-lookahead 56 -temporal-aq 1 -qmin 0 -qmax 10",
"description": "Output arguments",
"title": "Output Arguments",
"type": "string"
Expand Down Expand Up @@ -1381,6 +1381,15 @@
],
"description": "Harp clock generator"
},
"harp_clock_repeaters": {
"default": [],
"description": "Harp clock repeaters",
"items": {
"$ref": "#/definitions/HarpClockGenerator"
},
"title": "Harp Clock Repeaters",
"type": "array"
},
"harp_analog_input": {
"default": null,
"description": "Harp analog input",
Expand Down Expand Up @@ -1428,7 +1437,7 @@
"target_update_frequency": 120.0,
"calibration_directory": "Calibration\\Monitors\\",
"texture_assets_directory": "Textures",
"brightness": 1.0,
"brightness": 0.0,
"contrast": 1.0
},
"description": "Screen settings"
Expand Down
26 changes: 24 additions & 2 deletions src/Extensions/AindVrForagingRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ public partial class Screen

private string _textureAssetsDirectory = "Textures";

private double _brightness = 1D;
private double _brightness = 0D;

private double _contrast = 1D;

Expand Down Expand Up @@ -2832,7 +2832,7 @@ public partial class VideoWriterFfmpeg : VideoWriter

private string _containerExtension = "mp4";

private string _outputArguments = "-c:v h264_nvenc -vsync 0 -2pass 1 -bf:v 0 -qp 13 -preset medium -b:v 20M -rc:v cbr";
private string _outputArguments = "c:v hevc_nvenc -pix_fmt x2rgb10le -color_range full -tune hq -preset p3 -rc vbr -cq 16 -rc-lookahead 56 -temporal-aq 1 -qmin 0 -qmax 10";

public VideoWriterFfmpeg()
{
Expand Down Expand Up @@ -3576,6 +3576,8 @@ public partial class AindVrForagingRig

private HarpClockGenerator _harpClockGenerator = new HarpClockGenerator();

private System.Collections.Generic.List<HarpClockGenerator> _harpClockRepeaters = new System.Collections.Generic.List<HarpClockGenerator>();

private HarpAnalogInput _harpAnalogInput;

private HarpTreadmill _harpTreadmill = new HarpTreadmill();
Expand All @@ -3601,6 +3603,7 @@ protected AindVrForagingRig(AindVrForagingRig other)
_harpOlfactometer = other._harpOlfactometer;
_harpLickometer = other._harpLickometer;
_harpClockGenerator = other._harpClockGenerator;
_harpClockRepeaters = other._harpClockRepeaters;
_harpAnalogInput = other._harpAnalogInput;
_harpTreadmill = other._harpTreadmill;
_harpSniffDetector = other._harpSniffDetector;
Expand Down Expand Up @@ -3763,6 +3766,24 @@ public HarpClockGenerator HarpClockGenerator
}
}

/// <summary>
/// Harp clock repeaters
/// </summary>
[System.Xml.Serialization.XmlIgnoreAttribute()]
[Newtonsoft.Json.JsonPropertyAttribute("harp_clock_repeaters")]
[System.ComponentModel.DescriptionAttribute("Harp clock repeaters")]
public System.Collections.Generic.List<HarpClockGenerator> HarpClockRepeaters
{
get
{
return _harpClockRepeaters;
}
set
{
_harpClockRepeaters = value;
}
}

/// <summary>
/// Harp analog input
/// </summary>
Expand Down Expand Up @@ -3874,6 +3895,7 @@ protected virtual bool PrintMembers(System.Text.StringBuilder stringBuilder)
stringBuilder.Append("harp_olfactometer = " + _harpOlfactometer + ", ");
stringBuilder.Append("harp_lickometer = " + _harpLickometer + ", ");
stringBuilder.Append("harp_clock_generator = " + _harpClockGenerator + ", ");
stringBuilder.Append("harp_clock_repeaters = " + _harpClockRepeaters + ", ");
stringBuilder.Append("harp_analog_input = " + _harpAnalogInput + ", ");
stringBuilder.Append("harp_treadmill = " + _harpTreadmill + ", ");
stringBuilder.Append("harp_sniff_detector = " + _harpSniffDetector + ", ");
Expand Down
Loading

0 comments on commit 8f2b36c

Please sign in to comment.