From 96e9ff2e5a54f54cdbb6b8b2f049fdf6a837de3c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 23 八月 2023 14:28:22 +0800 Subject: [PATCH] 备份1 --- OnPro/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs | 372 ++++++++++++++++++++++++++-------------------------- 1 files changed, 186 insertions(+), 186 deletions(-) diff --git a/OnPro/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs b/OnPro/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs index ca7ce90..f0fb777 100644 --- a/OnPro/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs +++ b/OnPro/HDL-ON_Android/FengLinVideo/Form/MonitorFragment.cs @@ -1,210 +1,210 @@ 锘� -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using Android.App; -using Android.Content; -using Android.Icu.Text; -using Android.OS; -using Android.Runtime; -using Android.Util; -using Android.Views; -using Android.Widget; -using Com.ETouchSky; -using Com.Tool; -using HDL_ON.DAL.Server; -using HDL_ON_Android.FengLinVideo.Interface; -using Java.Util; -using Org.Json; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading; +//using Android.App; +//using Android.Content; +//using Android.Icu.Text; +//using Android.OS; +//using Android.Runtime; +//using Android.Util; +//using Android.Views; +//using Android.Widget; +//using Com.ETouchSky; +//using Com.Tool; +//using HDL_ON.DAL.Server; +//using HDL_ON_Android.FengLinVideo.Interface; +//using Java.Util; +//using Org.Json; -namespace HDL_ON_Android.FengLinVideo.Form -{ - public class MonitorFragment : Fragment, View.IOnClickListener, VideoState - { +//namespace HDL_ON_Android.FengLinVideo.Form +//{ +// public class MonitorFragment : Fragment, View.IOnClickListener, VideoState +// { - private View mView; - private VideoPhone mPhone; +// private View mView; +// private VideoPhone mPhone; - // 鎴浘 - private LinearLayout screenshotLayout; - private ImageView screenImage; - private TextView ScreenText; +// // 鎴浘 +// private LinearLayout screenshotLayout; +// private ImageView screenImage; +// private TextView ScreenText; - //寮�閿� - private LinearLayout unlockLayout; - private ImageView unlockImag; - private TextView unlockText; +// //寮�閿� +// private LinearLayout unlockLayout; +// private ImageView unlockImag; +// private TextView unlockText; - // 鏇存柊绾跨▼ - public static Thread thread = null; +// // 鏇存柊绾跨▼ +// public static Thread thread = null; - public MonitorFragment(VideoPhone phone) - { - this.mPhone = phone; - } +// public MonitorFragment(VideoPhone phone) +// { +// this.mPhone = phone; +// } - public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) - { - mView = inflater.Inflate(Resource.Layout.fragment_monitor, container, false); +// public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) +// { +// mView = inflater.Inflate(Resource.Layout.fragment_monitor, container, false); - IniView(); +// IniView(); - return mView; - } +// return mView; +// } - private void IniView() - { - screenshotLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_sceenshotLayout); - screenImage = (ImageView)mView.FindViewById(Resource.Id.icon_sceenshotImg); - ScreenText = (TextView)mView.FindViewById(Resource.Id.icon_sceenshotText); +// private void IniView() +// { +// screenshotLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_sceenshotLayout); +// screenImage = (ImageView)mView.FindViewById(Resource.Id.icon_sceenshotImg); +// ScreenText = (TextView)mView.FindViewById(Resource.Id.icon_sceenshotText); - unlockLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_unlockLayout); - unlockImag = (ImageView)mView.FindViewById(Resource.Id.icon_unlockImg); - unlockText = (TextView)mView.FindViewById(Resource.Id.icon_unlockText); +// unlockLayout = (LinearLayout)mView.FindViewById(Resource.Id.icon_unlockLayout); +// unlockImag = (ImageView)mView.FindViewById(Resource.Id.icon_unlockImg); +// unlockText = (TextView)mView.FindViewById(Resource.Id.icon_unlockText); - unlockLayout.SetOnClickListener(this); - screenshotLayout.SetOnClickListener(this); - } +// unlockLayout.SetOnClickListener(this); +// screenshotLayout.SetOnClickListener(this); +// } - /// <summary> - /// 寮�閿� - /// </summary> - private void Unlock() - { - if (mPhone != null) - { - try - { - unlockImag.Selected = true; - JSONObject ht = new JSONObject(); - ht.Put("command", "open");//鍥哄畾鍙傛暟 - ht.Put("room_id", VideoActivity.Roomno); - ht.Put("devType", 7); - mPhone.SendCustomData(ht.ToString()); - } - catch { } - } - } +// /// <summary> +// /// 寮�閿� +// /// </summary> +// private void Unlock() +// { +// if (mPhone != null) +// { +// try +// { +// unlockImag.Selected = true; +// JSONObject ht = new JSONObject(); +// ht.Put("command", "open");//鍥哄畾鍙傛暟 +// ht.Put("room_id", VideoActivity.Roomno); +// ht.Put("devType", 7); +// mPhone.SendCustomData(ht.ToString()); +// } +// catch { } +// } +// } - /// <summary> - /// 鏇存柊寮�閿佹寜閽姸鎬� - /// </summary> - private void UpdataUnlockState() - { - try - { - //寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� - unlockLayout.Enabled = false; - if (thread != null) - { - try - { - thread.Interrupt(); - } - catch { } - thread = null; - } +// /// <summary> +// /// 鏇存柊寮�閿佹寜閽姸鎬� +// /// </summary> +// private void UpdataUnlockState() +// { +// try +// { +// //寮�閿佹垚鍔燂紝15绉掑唴涓嶇粰鍐嶇偣鍑绘寜閽� +// unlockLayout.Enabled = false; +// if (thread != null) +// { +// try +// { +// thread.Interrupt(); +// } +// catch { } +// thread = null; +// } - thread = new Thread(() => - { - try - { - Thread.Sleep(15 * 1000); +// thread = new Thread(() => +// { +// try +// { +// Thread.Sleep(15 * 1000); - Activity.RunOnUiThread(() => - { - if (unlockLayout != null) - unlockLayout.Enabled = true; - }); - } - catch { } - }); +// Activity.RunOnUiThread(() => +// { +// if (unlockLayout != null) +// unlockLayout.Enabled = true; +// }); +// } +// catch { } +// }); - thread.Start(); - } - catch { } - } +// thread.Start(); +// } +// catch { } +// } - public void OnClick(View v) - { - // - if (v.Equals(unlockLayout)) - { - if (mPhone != null) - Unlock(); - } - else if (v.Equals(screenshotLayout)) - { +// public void OnClick(View v) +// { +// // +// if (v.Equals(unlockLayout)) +// { +// if (mPhone != null) +// Unlock(); +// } +// else if (v.Equals(screenshotLayout)) +// { - //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� - if (mPhone != null) - { - // 鍐呴儴鍌ㄥ瓨/DCIM/Camera/.....jpg - screenImage.Selected = true; - SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); - string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; - string path = ss + "/" + time + ".jpg"; - mPhone.Snap(path); - //2021-09-01 澧炲姞鍙戦�佸箍鎾紝閫氱煡鍒锋柊鍥惧簱鐨勬樉绀� - HDLONUtils.SendBroadcastScanFile(this.Context, path); - } - } - } +// //鏈夎棰戣繃鏉ュ彲璋冪敤姝ゆ帴鍙h繘琛屾媿鐓� +// if (mPhone != null) +// { +// // 鍐呴儴鍌ㄥ瓨/DCIM/Camera/.....jpg +// screenImage.Selected = true; +// SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); +// string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); +// string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; +// string path = ss + "/" + time + ".jpg"; +// mPhone.Snap(path); +// //2021-09-01 澧炲姞鍙戦�佸箍鎾紝閫氱煡鍒锋柊鍥惧簱鐨勬樉绀� +// HDLONUtils.SendBroadcastScanFile(this.Context, path); +// } +// } +// } - /// <summary> - /// 閫氳瘽鐘舵�佸洖璋冩柟娉� - /// </summary> - /// <param name="msg"></param> - public void OnPhoneEvent(string msg) - { - try - { - // - TextProtocol tp = new TextProtocol(); - tp.Parse(msg); - string event1 = tp.GetString("event"); +// /// <summary> +// /// 閫氳瘽鐘舵�佸洖璋冩柟娉� +// /// </summary> +// /// <param name="msg"></param> +// public void OnPhoneEvent(string msg) +// { +// try +// { +// // +// TextProtocol tp = new TextProtocol(); +// tp.Parse(msg); +// string event1 = tp.GetString("event"); - switch (event1) - { - case "EVT_HangUp"://鎸傛柇 - Activity.Finish(); - break; - case "EVT_RECV_CUSTOM_DATA": - UpdataUnlockState(); - break; - case "EVT_SnapAck": - int error = tp.GetInt("error"); - string filePath = tp.GetString("filePath"); - if (error == 0) - { - screenImage.Selected = true; - } - else - { - screenImage.Selected = false; - } - break; - } - } - catch { } - } +// switch (event1) +// { +// case "EVT_HangUp"://鎸傛柇 +// Activity.Finish(); +// break; +// case "EVT_RECV_CUSTOM_DATA": +// UpdataUnlockState(); +// break; +// case "EVT_SnapAck": +// int error = tp.GetInt("error"); +// string filePath = tp.GetString("filePath"); +// if (error == 0) +// { +// screenImage.Selected = true; +// } +// else +// { +// screenImage.Selected = false; +// } +// break; +// } +// } +// catch { } +// } - public override void OnDestroy() - { - base.OnDestroy(); +// public override void OnDestroy() +// { +// base.OnDestroy(); - if (thread != null) - { - try - { - thread.Interrupt(); - } - catch { } - thread = null; - } - } - } -} \ No newline at end of file +// if (thread != null) +// { +// try +// { +// thread.Interrupt(); +// } +// catch { } +// thread = null; +// } +// } +// } +//} \ No newline at end of file -- Gitblit v1.8.0