Skip to content

Commit

Permalink
Add initial Minicam-Mono5 behavior camera support.
Browse files Browse the repository at this point in the history
  • Loading branch information
daharoni committed Jul 8, 2020
1 parent f2d9bf8 commit 30d9807
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 0 deletions.
187 changes: 187 additions & 0 deletions deviceConfigs/behaviorCams.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,192 @@
"isColor": true,
"controlSettings": {
}
},

"Minicam-Mono5": {
"qmlFile": "qrc:/behaviorCam.qml",
"sensor": "MT9P031",
"frameRate": "adjustable",
"width": 1296,
"height": 972,
"headOrientation": false,
"isColor": false,
"controlSettings": {
"gain": {
"displaySpinBoxValues":["Low", "Medium", "High"],
"displayTextValues": [1, 4, 8],
"outputValues":[8,32,96],
"startValue": "Low",
"sendCommand": [
{
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x35",
"dataLength": "2",
"data0": "valueH",
"data1": "valueL"
}
]
},
"frameRate": {
"displaySpinBoxValues":["10FPS", "15FPS", "20FPS"],
"displayTextValues": [10, 15, 20],
"outputValues":[2048,1536,1024],
"startValue": "30FPS",
"sendCommand": [
{
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x09",
"dataLength": "2",
"data0": "valueH",
"data1": "valueL"
}
]
},
"led0": {
"startValue": 0,
"min": 0,
"max": 100,
"stepSize": 1,
"displayValueScale": 0.31,
"displayValueOffset": 0,
"sendCommand": [
{
"protocol": "I2C",
"addressW": "0x6C",
"regLength": "1",
"reg0": "0b10100000",
"dataLength": "1",
"data0": "value"
}
]
}
},
"initialize": [
{
"description": "Speed up i2c bus timer to 50us max",
"protocol": "I2C",
"addressW": "0xC0",
"regLength": "1",
"reg0": "0x22",
"dataLength": "1",
"data0": "0b00000010"
},
{
"description": "Decrease BCC timeout, units in 2ms XX",
"protocol": "I2C",
"addressW": "0xC0",
"regLength": "1",
"reg0": "0x20",
"dataLength": "1",
"data0": "0b00001010"
},
{
"description": "Make sure DES has SER ADDR",
"protocol": "I2C",
"addressW": "0x07",
"regLength": "1",
"reg0": "0x07",
"dataLength": "1",
"data0": "0xB0"
},
{
"description": "Speed up I2c bus timer to 50u Max",
"protocol": "I2C",
"addressW": "0xB0",
"regLength": "1",
"reg0": "0x0F",
"dataLength": "1",
"data0": "0b00000010"
},
{
"description": "Decrease BCC timeout, units in 2ms",
"protocol": "I2C",
"addressW": "0xB0",
"regLength": "1",
"reg0": "0x1E",
"dataLength": "1",
"data0": "0b00001010"
},
{
"description": "sets allowable i2c addresses to send through serializer",
"protocol": "I2C",
"addressW": "0xC0",
"regLength": "1",
"reg0": "0x08",
"dataLength": "2",
"device0": "MT9P031",
"data0": "0xBA",
"device1": "Digital LED Driver",
"data1": "0x6C"

},
{
"description": "sets sudo allowable i2c addresses to send through serializer",
"protocol": "I2C",
"addressW": "0xC0",
"regLength": "1",
"reg0": "0x10",
"dataLength": "2",
"device0": "MT9P031",
"data0": "0xBA",
"device1": "Digital LED Driver",
"data1": "0x6C"

},
{
"description": "2x subsamp and binning 1",
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x22",
"dataLength": "2",
"data0": "0x00",
"data1": "0b00010001"
},
{
"description": "2x subsamp and binning 2",
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x23",
"dataLength": "2",
"data0": "0x00",
"data1": "0b00010001"
},
{
"description": "Set column binning to summing instead of averaging",
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x20",
"dataLength": "2",
"data0": "0x00",
"data1": "0b01100000"
},
{
"description": "Change shutter width",
"protocol": "I2C",
"addressW": "0xBA",
"regLength": "1",
"reg0": "0x09",
"dataLength": "2",
"data0": "0b00000100",
"data1": "0x00"
},
{
"description": "LED Driver LM3509",
"protocol": "I2C",
"addressW": "0x6C",
"regLength": "1",
"reg0": "0x10",
"dataLength": "1",
"data0": "0b11010111"

}
]
}
}
14 changes: 14 additions & 0 deletions source/behaviorCam.qml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ Item {

}

VideoSliderControl {
id: led0
objectName: "led0"
max: 100
startValue: 0
iconPath: "img/icon/led.png"
textColor: "black"
visible: false
}

VideoSliderControl{
id: alpha
objectName: "alpha"
Expand All @@ -361,6 +371,10 @@ Item {
}


Connections{
target: led0
onValueChangedSignal: vidPropChangedSignal(led0.objectName, displayValue, i2cValue, i2cValue2)
}
Connections{
target: alpha
onValueChangedSignal: vidPropChangedSignal(alpha.objectName, displayValue, i2cValue, i2cValue2)
Expand Down
1 change: 1 addition & 0 deletions source/behaviorcam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ void BehaviorCam::configureBehavCamControls() {

keys = values.keys();
if (controlItem) {
controlItem->setVisible(true);
for (int j = 0; j < keys.size(); j++) { // Set min, max, startValue, and stepSize in order found in 'format'
if (keys[j] == "sendCommand") {
// m_controlSendCommand[controlName[i]] = parseSendCommand(values["sendCommand"].toArray());
Expand Down

0 comments on commit 30d9807

Please sign in to comment.