通道配置增加曝光补偿的设置

serial
Matthew 1 year ago
parent ab4425a319
commit 168419f08b

@ -164,6 +164,11 @@ public class ChannelActivity extends AppCompatActivity {
binding.exposuretime.setText(Integer.toString(jsonObject.optInt("exposureTime", 0)));
binding.sensitivity.setText(Integer.toString(jsonObject.optInt("sensibility", 0)));
binding.btnZoom.setChecked(jsonObject.optInt("zoom", 0) == 1);
if (jsonObject.has("compensation")) {
binding.compensation.setText(Integer.toString(jsonObject.optInt("compensation", 0)));
} else {
binding.compensation.setText("");
}
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(1);
@ -272,6 +277,12 @@ public class ChannelActivity extends AppCompatActivity {
} else {
jsonObject.put("zoomRatio", 0f);
}
String text = binding.compensation.getText().toString();
if (TextUtils.isEmpty(text)) {
jsonObject.remove("compensation");
} else {
jsonObject.put("compensation", Integer.parseInt(text));
}
if (!TextUtils.isEmpty(binding.resolutionCX.getText().toString())) {
jsonObject.put("resolutionCX", Integer.parseInt(binding.resolutionCX.getText().toString()));
} else {

@ -246,6 +246,27 @@
app:layout_constraintStart_toEndOf="@+id/btnZoom"
app:layout_constraintTop_toTopOf="@+id/btnZoom" />
<TextView
android:id="@+id/textViewCompensation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/channel_cfg_compensation"
android:layout_marginStart="@dimen/activity_horizontal_margin"
app:layout_constraintStart_toEndOf="@+id/zoomRatio"
app:layout_constraintTop_toTopOf="@+id/btnZoom"
app:layout_constraintBottom_toBottomOf="@+id/btnZoom" />
<EditText
android:id="@+id/compensation"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="none|numberDecimal"
android:layout_marginStart="@dimen/activity_horizontal_margin"
app:layout_constraintStart_toEndOf="@+id/textViewCompensation"
app:layout_constraintTop_toTopOf="@+id/textViewCompensation"
app:layout_constraintBottom_toBottomOf="@+id/textViewCompensation" />
<EditText
android:id="@+id/osdLeftTop"
android:layout_width="match_parent"

@ -46,6 +46,7 @@
<string name="channel_cfg_quality">压缩率(50-100)</string>
<string name="channel_cfg_usb_camera">USB Camera</string>
<string name="channel_cfg_video_duration">短视频时长(秒)</string>
<string name="channel_cfg_compensation">曝光补偿</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="record">Record</string>

Loading…
Cancel
Save