better ui for zoom & icon
This commit is contained in:
@@ -22,6 +22,9 @@ namespace robospot_camera_finder
|
||||
string password = "RoboSpot10";
|
||||
string cam_ip = "";
|
||||
|
||||
int max_zoom_pulse = 9999;
|
||||
int min_zoom_pulse = 10;
|
||||
|
||||
public StreamViewer(string name, string ip)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -56,13 +59,13 @@ namespace robospot_camera_finder
|
||||
private void sendZoomValue(string zoom_pulse)
|
||||
{
|
||||
// clamp values to allowed range
|
||||
if (int.Parse(zoom_pulse) < 10)
|
||||
if (int.Parse(zoom_pulse) < min_zoom_pulse)
|
||||
{
|
||||
zoom_pulse = "10";
|
||||
zoom_pulse = min_zoom_pulse.ToString();
|
||||
}
|
||||
if (int.Parse(zoom_pulse) > 9999)
|
||||
if (int.Parse(zoom_pulse) > max_zoom_pulse)
|
||||
{
|
||||
zoom_pulse = "9999";
|
||||
zoom_pulse = max_zoom_pulse.ToString();
|
||||
}
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://" + cam_ip + "/stw-cgi/ptzcontrol.cgi?msubmenu=absolute&action=control&ZoomPulse=" + zoom_pulse);
|
||||
@@ -91,5 +94,17 @@ namespace robospot_camera_finder
|
||||
{
|
||||
updateZoomSlider();
|
||||
}
|
||||
|
||||
private void btnZoomMax_Click(object sender, EventArgs e)
|
||||
{
|
||||
tbZoom.Value = max_zoom_pulse;
|
||||
sendZoomValue(tbZoom.Value.ToString());
|
||||
}
|
||||
|
||||
private void btnZoomMin_Click(object sender, EventArgs e)
|
||||
{
|
||||
tbZoom.Value = min_zoom_pulse;
|
||||
sendZoomValue(tbZoom.Value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user