From fdc47d950498e088260a3b04028703adc0f878e0 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 三月 2020 10:54:27 +0800
Subject: [PATCH] 2020-03-30-1
---
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs | 231 +++++++++++++++------------------------------
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 13 +
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 2
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs | 1
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide | 0
ZigbeeApp/Shared/Phone/Device/Logic/Method.cs | 12 ++
7 files changed, 100 insertions(+), 161 deletions(-)
diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
index 939e28c..34c29ec 100644
--- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
+++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,7 +1,13 @@
锘�<Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default">
<MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.5c86e4357d63" />
<MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" />
- <MonoDevelop.Ide.Workbench>
+ <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/MemberList.cs">
+ <Files>
+ <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs" Line="64" Column="10" />
+ <File FileName="Shared/Phone/Device/Logic/Method.cs" Line="721" Column="7" />
+ <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs" Line="327" Column="62" />
+ <File FileName="Shared/Phone/Device/Logic/MemberList.cs" Line="1" Column="1" />
+ </Files>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
@@ -17,9 +23,8 @@
<Node name="Category" expanded="True" />
<Node name="Device" expanded="True">
<Node name="Logic" expanded="True">
- <Node name="DoorLockLogic" expanded="True">
- <Node name="LockLogicList.cs" selected="True" />
- </Node>
+ <Node name="DoorLockLogic" expanded="True" />
+ <Node name="MemberList.cs" selected="True" />
</Node>
</Node>
</Node>
diff --git a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
index 43c674a..9b139ba 100644
--- a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
+++ b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index 061dbcc..1efe402 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -126,97 +126,41 @@
/// <summary>
/// 閫夋嫨鏌愪釜鐢ㄦ埛
/// </summary>
- /// <param name="membershipIfon">瑙﹀彂婧愬垪琛�</param>
- public void SelectedUserID(Send.MembershipIfon membershipIfon)
+ /// <param name="user">瑙﹀彂婧愬垪琛�</param>
+ public void SelectedUserID(Send.MembershipIfon user)
{
- var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
- this.AddChidren(flMain);
-
- flMain.MouseUpEventHandler += (sender1, e1) =>
+ //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+ VerticalScrolViewLayout vV = null;
+ int count = user.UserIdMode.Count;
+ if (count > 9)
{
- flMain.RemoveFromParent();
- };
-
-
-
- var lockcolorfra1 = new FrameLayout
- {
-
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(530),
- Y = Application.GetRealHeight(1920 - 530),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
- };
- flMain.AddChidren(lockcolorfra1);
- lockcolorfra1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+ ///鍏冪礌瓒呭嚭9涓�;
+ count = 6;
+ //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+ vV = new VerticalScrolViewLayout
+ {
+ Y = Application.GetRealHeight(140 + 20),
+ Height = Application.GetRealHeight(160 * count),
+ };
+ //娓呴櫎涔嬪墠鐨勬帶浠�;
+ vV.RemoveAll();
+ }
#region -------鍙栨秷 瀹屾垚
- var lockRow = new RowLayout
+ var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
+ this.AddChidren(flMain);
+ CompleteView completeView = new CompleteView();
+ flMain.AddChidren(completeView.Show(count));
+ completeView.Btntitle.Text = user.UserName;
+ EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
{
- Height = Application.GetRealHeight(140),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
- };
- lockcolorfra1.AddChidren(lockRow);
- var Btncancel = new Button
- {
- TextID = MyInternationalizationString.cancel,
- TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- X = Application.GetRealWidth(80),
- TextAlignment = TextAlignment.CenterLeft,
- TextSize = 14,
- };
- lockRow.AddChidren(Btncancel);
- Btncancel.MouseUpEventHandler += (sender16, e16) =>
- {
- flMain.RemoveFromParent();
UserView.HomePage.Instance.ScrollEnabled = true;
+ flMain.RemoveFromParent();
};
-
- var Btntitle = new Button
- {
- TextID = MyInternationalizationString.security,
- TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(320),
- TextAlignment = TextAlignment.Center,
- X = Btncancel.Right + Application.GetRealWidth(100),
- TextSize = 16,
- Text = membershipIfon.UserName,
- };
- lockRow.AddChidren(Btntitle);
- var Btncomplete = new Button
- {
- TextID = MyInternationalizationString.complete,
- TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
- Height = Application.GetRealHeight(140),
- Width = Application.GetRealWidth(200),
- TextAlignment = TextAlignment.CenterRight,
- X = Btntitle.Right + Application.GetRealWidth(100),
- TextSize = 14,
-
- };
- lockRow.AddChidren(Btncomplete);
+ flMain.MouseUpEventHandler += clickcancel;
+ completeView.Btncancel.MouseUpEventHandler += clickcancel;
#endregion
-
-
- lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * membershipIfon.UserIdMode.Count) - 20 - 50);
- lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * membershipIfon.UserIdMode.Count) + 20 + 50);
- if (membershipIfon.UserIdMode.Count > 9)
- {
- ///鍏冪礌瓒呭嚭10涓紝鏆傛椂榛樿鏄剧ず10;
- lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50);
- lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50);
- }
- string SelectedLockStatus = "";
- ///瀹氫箟涓や釜鍙橀噺璁板綍閫変腑鐘舵�侊紱
- string attriButeId = "";
- string attriButeData2 = "";
- string modeName = "";
///瀹氫袱涓彉閲忚褰曚箣鍓嶇殑鍙�硷紱
string userId = "";
@@ -224,71 +168,44 @@
string accountName = "";
string SelectedDeviceStatuscondition = "";
- for (int j = 0; j < membershipIfon.UserIdMode.Count; j++)
+ for (int i = 0; i < user.UserIdMode.Count; i++)
{
- var userIdmode = membershipIfon.UserIdMode[j];
- var doorlockfra = new FrameLayout
- {
- Height = Application.GetRealHeight(160),
- Y = lockRow.Bottom + Application.GetRealHeight(20 + 160 * j),
- };
- lockcolorfra1.AddChidren(doorlockfra);
+ var userifon = user.UserIdMode[i];
- var doorlockRow = new RowLayout
+ mFunView lockView = new mFunView();
+ if (user.UserIdMode.Count > 9)
{
- Y = Application.GetRealHeight(30),
- Width = Application.GetRealWidth(920),
- Height = Application.GetRealHeight(130),
- X = Application.GetRealWidth(80),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
- };
- doorlockfra.AddChidren(doorlockRow);
-
- var doorlockBtn = new Button
- {
- Width = Application.GetRealWidth(600),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
- Text = userIdmode.ModeName,
- TextSize = 14,
- };
- doorlockRow.AddChidren(doorlockBtn);
-
- var doorlockSelected = new Button
- {
- X = Application.GetRealWidth(860),
- Width = Application.GetMinRealAverage(60),
- Height = Application.GetMinRealAverage(60),
- UnSelectedImagePath = "ZigeeLogic/selected.png",
- Visible = false,
- Gravity = Gravity.CenterVertical,
-
- };
- doorlockRow.AddChidren(doorlockSelected);
- if ((membershipIfon.UserIdMode.Count - 1) == j)
- {
- doorlockRow.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
+ //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+ completeView.Show(count).AddChidren(vV);
+ vV.AddChidren(lockView.Show());
}
- EventHandler<MouseEventArgs> doorlockclick = (sender2, e2) =>
+ else
{
- SelectedLockStatus = "DoorLock";
- selectedIcon.Visible = false;
- selectedIcon = doorlockSelected;
- doorlockSelected.Visible = true;
- //doorlockBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- attriButeId = userIdmode.OpenMode.ToString();
- attriButeData2 = userIdmode.UserId;
- modeName = userIdmode.ModeName;
- };
- doorlockRow.MouseUpEventHandler += doorlockclick;
- doorlockBtn.MouseUpEventHandler += doorlockclick;
- doorlockSelected.MouseUpEventHandler += doorlockclick;
- doorlockfra.MouseUpEventHandler += doorlockclick;
+ lockView.frameLayout.Y = Application.GetRealHeight(140 + 20 + 160 * i);
+ completeView.Show(count).AddChidren(lockView.Show());
+ }
+ lockView.titleBtn.Text = userifon.ModeName;
- if (string.IsNullOrEmpty(doorlockBtn.Text))
+ if ((user.UserIdMode.Count - 1) == i)
+ {
+ lockView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+ }
+ lockView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ SelectedDeviceStatuscondition = "DoorLock";
+ selectedIcon.Visible = false;
+ selectedIcon = lockView.selectedIconBtn;
+ lockView.selectedIconBtn.Visible = true;
+ userId = userifon.UserId;
+ openMode = userifon.OpenMode.ToString();
+ accountName = completeView.Btntitle.Text + lockView.titleBtn.Text;
+ };
+
+
+ if (string.IsNullOrEmpty(lockView.titleBtn.Text))
{
string strname = "";
- switch (userIdmode.OpenMode)
+ switch (userifon.OpenMode)
{
case 0:
{
@@ -306,25 +223,31 @@
}
break;
}
- doorlockBtn.Text = userIdmode.UserId + strname;
+ lockView.titleBtn.Text = userifon.UserId + strname;
}
- ///鏄剧ず涔嬪墠鐨勭姸鎬�
+
if (conditionsIndex != -1)
{
- var s = Common.Logic.CurrentLogic.Conditions[conditionsIndex];
- if (s["AttriButeId"] == userIdmode.OpenMode.ToString() && s["AttriButeData2"] == userIdmode.UserId)
+
+ ///鏄剧ず涔嬪墠鐨勭姸鎬�
+ if (conditionsIndex != -1)
{
- selectedIcon.Visible = false;
- selectedIcon = doorlockSelected;
- doorlockSelected.Visible = true;
+ var s = Common.Logic.CurrentLogic.Conditions[conditionsIndex];
+ if (s["AttriButeId"] == userifon.OpenMode.ToString() && s["AttriButeData2"] == userifon.UserId)
+ {
+ selectedIcon.Visible = false;
+ selectedIcon = lockView.selectedIconBtn;
+ lockView.selectedIconBtn.Visible = true;
+ }
+
}
-
}
+
}
- Btncomplete.MouseUpEventHandler += (sender, e) =>
+ completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
{
var lockConditionsInfo = new Dictionary<string, string>();
lockConditionsInfo.Add("Type", "1");
@@ -332,16 +255,16 @@
lockConditionsInfo.Add("MacAddr", Send.CurrentDoorLock.DeviceAddr);
lockConditionsInfo.Add("Epoint", Send.CurrentDoorLock.DeviceEpoint.ToString());
lockConditionsInfo.Add("Cluster_ID", "64529");
- lockConditionsInfo.Add("AttriButeId", attriButeId);
- lockConditionsInfo.Add("AttriButeData2", attriButeData2);
+ lockConditionsInfo.Add("AttriButeId", openMode);
+ lockConditionsInfo.Add("AttriButeData2", userId);
lockConditionsInfo.Add("AttriButeData1", "2");
lockConditionsInfo.Add("Range", "0");
var accounts = new Dictionary<string, string>();
accounts.Add("Type", "1");
accounts.Add("Account", Config.Instance.Guid);
- accounts.Add("AccountName", membershipIfon.UserName + modeName);
- accounts.Add("UserId", attriButeData2);
- if (SelectedLockStatus != "")
+ accounts.Add("AccountName",accountName);
+ accounts.Add("UserId", userId);
+ if (SelectedDeviceStatuscondition != "")
{
if (conditionsIndex == -1)
{
@@ -366,7 +289,7 @@
{
if (Common.Logic.CurrentLogic.Accounts[i]["Type"] == "1")
{
- if (Common.Logic.CurrentLogic.Accounts[i]["UserId"] == attriButeData2)
+ if (Common.Logic.CurrentLogic.Accounts[i]["UserId"] == userId)
{
addAccount = true;
break;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index b55fb3b..8f4a3b9 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -612,6 +612,7 @@
}
public void AddCondition(int value)
{
+ Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
var addCondition = new AddCondition();
addCondition.conditionsIndex = value;
UserView.HomePage.Instance.AddChidren(addCondition);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index 93da7fd..0d0e1fc 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -38,7 +38,7 @@
Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑
Common.Logic.CurrentLogic.LogicType = 1;//鏍囪鑷姩鍖栫被鍨�
Common.Logic.CurrentLogic.Relationship = 1;
- Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
+ Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.linkageevent);
var lockLogicCommunalPage = new LockLogicCommunalPage();
UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
UserView.HomePage.Instance.PageIndex += 1;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index 1ffb2b7..0eeee0b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -146,7 +146,7 @@
//鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
VerticalScrolViewLayout vV = null;
int count = user.UserIdMode.Count;
- if (user.UserIdMode.Count > 9)
+ if (count > 9)
{
///鍏冪礌瓒呭嚭9涓�;
count = 6;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index 559e42f..d3cd0e4 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -757,7 +757,17 @@
{
succeed = true;
CurrentLogic.LogicId = logicifon.LogicId;
- Common.Logic.LogicList.Add(CurrentLogic);
+ if (LogicView.IfString._LockLogic == if_logic)
+ {
+ //闂ㄩ攣鑱斿姩浜嬩欢閫昏緫鍒楄〃
+ Common.Logic.LockLogicList.Add(CurrentLogic);
+ }
+ else
+ {
+ //鑷姩鍖栭�昏緫鍒楄〃
+ Common.Logic.LogicList.Add(CurrentLogic);
+
+ }
if (tag)
{
Send.Zj(tag, CurrentLogic);
--
Gitblit v1.8.0