using System;
|
using System.Collections.Generic;
|
using Shared.Common;
|
using Shared.R;
|
using ZigBee.Device;
|
|
namespace Shared.Phone.UserCenter.DeviceBind
|
{
|
/// <summary>
|
/// 空气质量传感器的时间设置
|
/// </summary>
|
public class AirQualitySensorLogic : BindCommonLayout
|
{
|
/// 构造函数
|
/// </summary>
|
/// <param name="doorLock"></param>
|
public AirQualitySensorLogic(ZigBee.Device.TemperatureSensor sensor, TemperatureSensor.LedTimeData ledTimeData = null)
|
{
|
this.sensor = sensor;
|
if (ledTimeData == null)
|
{
|
curLedTimeData = new TemperatureSensor.LedTimeData();
|
}
|
else
|
{
|
curLedTimeData = ledTimeData;
|
}
|
setLedTimeData.enable= curLedTimeData.enable;
|
setLedTimeData.endHour = curLedTimeData.endHour;
|
setLedTimeData.endMin = curLedTimeData.endMin;
|
setLedTimeData.remark = curLedTimeData.remark;
|
setLedTimeData.serialNum = curLedTimeData.serialNum;
|
setLedTimeData.startHour = curLedTimeData.startHour;
|
setLedTimeData.startMin = curLedTimeData.startMin;
|
this.curNum = curNum;
|
}
|
|
#region 变量申明
|
/// <summary>
|
/// 当前空气质量传感器对象
|
/// </summary>
|
TemperatureSensor sensor;
|
/// <summary>
|
/// 当前序号
|
/// </summary>
|
int curNum = -1;
|
/// <summary>
|
/// 灯设置灯数据
|
/// </summary>
|
TimeData setLedTimeData = new TimeData();
|
/// <summary>
|
/// 当前存在的灯数据
|
/// </summary>
|
TemperatureSensor.LedTimeData curLedTimeData;
|
/// <summary>
|
/// 文本名称编辑
|
/// </summary>
|
EditText nameLed;
|
public Action refreshAction;
|
/// <summary>
|
/// 当前操作索引
|
/// </summary>
|
private int curOperateIndex = 0;
|
#endregion
|
|
/// <summary>
|
/// 显示
|
/// </summary>
|
public void Show()
|
{
|
TopFrameLayout();
|
MiddleFrameLayout();
|
}
|
|
/// <summary>
|
/// Top布局
|
/// </summary>
|
void TopFrameLayout()
|
{
|
string topicStr = "";
|
if (curLedTimeData.serialNum != -1)
|
{
|
topicStr = Language.StringByID(R.MyInternationalizationString.editautomation);
|
}
|
else
|
{
|
topicStr = Language.StringByID(R.MyInternationalizationString.newautomation);
|
}
|
this.TopFrameLayout(this, topicStr);
|
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
this.btnBack.MouseUpEventHandler += eHandlerBack;
|
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
|
}
|
|
/// <summary>
|
/// Middle布局
|
/// </summary>
|
void MiddleFrameLayout()
|
{
|
this.MidFrameLayout(this);
|
|
#region 自动化名称
|
var logicnamefl = new FrameLayout
|
{
|
Height = Application.GetRealHeight(130),
|
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
|
};
|
this.midFrameLayout.AddChidren(logicnamefl);
|
|
var text = new Button
|
{
|
Width = Application.GetRealWidth(270),
|
Height = Application.GetRealHeight(60),
|
X = Application.GetRealWidth(58),
|
TextAlignment = TextAlignment.CenterLeft,
|
Text = Language.StringByID(MyInternationalizationString.automationname) + ":",
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
Y = Application.GetRealHeight(35),
|
TextSize = 15,
|
};
|
logicnamefl.AddChidren(text);
|
|
nameLed = new EditText
|
{
|
Y = Application.GetRealHeight(35),
|
Width = Application.GetRealWidth(1080 - 58 - 300),
|
Height = Application.GetRealHeight(60),
|
X = text.Right - Application.GetRealWidth(7),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
|
TextSize = 14,
|
PlaceholderText = Language.StringByID(MyInternationalizationString.LEDSet),
|
PlaceholderTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
|
};
|
logicnamefl.AddChidren(nameLed);
|
if (string.IsNullOrEmpty(curLedTimeData.remark))
|
{
|
nameLed.Text = Language.StringByID(MyInternationalizationString.LEDSet);
|
}
|
else
|
{
|
nameLed.Text = curLedTimeData.remark;
|
}
|
#endregion
|
|
#region 没有点击事件的布局
|
var contentFrameLayout = new FrameLayout
|
{
|
Height = Application.GetRealHeight(1282),
|
Y = Application.GetRealHeight(150),
|
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
|
};
|
this.midFrameLayout.AddChidren(contentFrameLayout);
|
|
var conditionBtn = new Button
|
{
|
Width = Application.GetRealWidth(965),
|
Height = Application.GetRealHeight(127),
|
X = Application.GetRealWidth(58),
|
Y = Application.GetRealHeight(20),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.ifcondition,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
TextSize = 15,
|
};
|
contentFrameLayout.AddChidren(conditionBtn);
|
var conditionLine = new Button
|
{
|
Width = Application.GetRealWidth(965),
|
Height = 1,
|
X = Application.GetRealWidth(58),
|
Y = Application.GetRealHeight(20 + 127),
|
BackgroundColor = ZigbeeColor.Current.XMRowLine,
|
};
|
contentFrameLayout.AddChidren(conditionLine);
|
|
var conditionPic = new Button
|
{
|
Width = Application.GetMinRealAverage(69),
|
Height = Application.GetMinRealAverage(69),
|
X = Application.GetRealWidth(89),
|
Y = Application.GetRealHeight(204),
|
UnSelectedImagePath = "AirQualitySensor/LEDLogic1.png",
|
};
|
contentFrameLayout.AddChidren(conditionPic);
|
|
var executeBtn = new Button
|
{
|
Width = Application.GetRealWidth(965),
|
Height = Application.GetRealHeight(127),
|
X = Application.GetRealWidth(58),
|
Y = Application.GetRealHeight(536),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.execute,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
TextSize = 15,
|
};
|
contentFrameLayout.AddChidren(executeBtn);
|
var executeLine = new Button
|
{
|
Width = Application.GetRealWidth(965),
|
Height = 1,
|
X = Application.GetRealWidth(58),
|
Y = Application.GetRealHeight(536 + 127),
|
BackgroundColor = ZigbeeColor.Current.XMRowLine,
|
TextSize = 15,
|
};
|
contentFrameLayout.AddChidren(executeLine);
|
|
var executePic = new Button
|
{
|
Width = Application.GetMinRealAverage(69),
|
Height = Application.GetMinRealAverage(69),
|
X = Application.GetRealWidth(89),
|
Y = Application.GetRealHeight(717),
|
UnSelectedImagePath = "AirQualitySensor/LED72.png",
|
};
|
contentFrameLayout.AddChidren(executePic);
|
|
var closeFrameLayout = new FrameLayout
|
{
|
Width = Application.GetRealWidth(867),
|
Height = Application.GetRealHeight(127),
|
X = Application.GetRealWidth(156),
|
Y = executeBtn.Bottom + Application.GetRealHeight(29),
|
};
|
contentFrameLayout.AddChidren(closeFrameLayout);
|
|
var closeRightText = new Button
|
{
|
Width = Application.GetRealWidth(204 + 100),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(23),
|
Y = Application.GetRealHeight(32),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.DeviceLED,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
TextSize = 15,
|
};
|
closeFrameLayout.AddChidren(closeRightText);
|
|
var closeLeftText = new Button
|
{
|
Width = Application.GetRealWidth(81 + 100),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(629),
|
Y = Application.GetRealHeight(32),
|
TextAlignment = TextAlignment.CenterRight,
|
TextID = MyInternationalizationString.Close,
|
TextColor = ZigbeeColor.Current.XMGray3,
|
TextSize = 15,
|
};
|
closeFrameLayout.AddChidren(closeLeftText);
|
#endregion
|
|
timeFrameLayoutUI(contentFrameLayout);
|
|
var btnFinifh = new Button()
|
{
|
Width = Application.GetRealWidth(907),
|
Height = Application.GetRealHeight(127),
|
X = Application.GetRealWidth(86),
|
Y = Application.GetRealHeight(1476),
|
Gravity = Gravity.CenterHorizontal,
|
Radius = (uint)Application.GetRealHeight(120) / 2,
|
TextID = R.MyInternationalizationString.Save,
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
|
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
|
TextSize = 16,
|
IsBold = true,
|
};
|
this.midFrameLayout.AddChidren(btnFinifh);
|
|
btnFinifh.MouseDownEventHandler += async (sender, e) =>
|
{
|
try
|
{
|
if (setLedTimeData.startHour == -1)
|
{
|
Application.RunOnMainThread(() =>
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.StartTimeEmpty), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
});
|
return;
|
}
|
if (setLedTimeData.endHour == -1)
|
{
|
Application.RunOnMainThread(() =>
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.EndTimeEmpty), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
});
|
return;
|
}
|
|
if (!CheckValidTime(setLedTimeData.startHour, setLedTimeData.startMin, setLedTimeData.endHour, setLedTimeData.endMin))
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.LedBindTip1), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
return;
|
}
|
|
Application.RunOnMainThread(() =>
|
{
|
CommonPage.Loading.Start("");
|
});
|
if (string.IsNullOrEmpty(nameLed.Text))
|
{
|
setLedTimeData.remark = nameLed.PlaceholderText;
|
}
|
else
|
{
|
setLedTimeData.remark = nameLed.Text;
|
}
|
|
if (!string.IsNullOrEmpty(setLedTimeData.remark))
|
{
|
var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(setLedTimeData.remark);
|
if (36 < reamarkGwBytes.Length)
|
{
|
Application.RunOnMainThread(() =>
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.LedNameTooLong), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
});
|
return;
|
}
|
}
|
|
setLedTimeData.enable = 1;
|
if (curLedTimeData.serialNum != -1)
|
{
|
//修改
|
setLedTimeData.serialNum = curLedTimeData.serialNum;
|
}
|
else
|
{
|
//新增
|
for (int key = 0; key < 5; key++)
|
{
|
if (sensor.AirQualitySensorLedTimeList.ContainsKey(key) == false)
|
{
|
setLedTimeData.serialNum = key;
|
break;
|
}
|
}
|
}
|
TemperatureSensor.LedTimeData ledTimeDataTemp = new TemperatureSensor.LedTimeData();
|
ledTimeDataTemp.enable = setLedTimeData.enable;
|
ledTimeDataTemp.endHour = setLedTimeData.endHour;
|
ledTimeDataTemp.endMin = setLedTimeData.endMin;
|
ledTimeDataTemp.remark = setLedTimeData.remark;
|
ledTimeDataTemp.serialNum = setLedTimeData.serialNum;
|
ledTimeDataTemp.startHour = setLedTimeData.startHour;
|
ledTimeDataTemp.startMin = setLedTimeData.startMin;
|
var result = await sensor.SetAirQualitySensorLedTime(ledTimeDataTemp);
|
if (result != null && result.responseData != null)
|
{
|
if (result.responseData.status == 0)
|
{
|
if (sensor.AirQualitySensorLedTimeList.ContainsKey(setLedTimeData.serialNum))
|
{
|
sensor.AirQualitySensorLedTimeList[setLedTimeData.serialNum] = ledTimeDataTemp;
|
}
|
else
|
{
|
sensor.AirQualitySensorLedTimeList.Add(setLedTimeData.serialNum, ledTimeDataTemp);
|
}
|
Application.RunOnMainThread(() =>
|
{
|
refreshAction?.Invoke();
|
RemoveFromParent();
|
});
|
}
|
else
|
{
|
Application.RunOnMainThread(() =>
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AddFailed), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
});
|
}
|
}
|
else
|
{
|
Application.RunOnMainThread(() =>
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
});
|
}
|
}
|
catch { }
|
finally
|
{
|
Application.RunOnMainThread(() =>
|
{
|
CommonPage.Loading.Hide();
|
});
|
}
|
};
|
}
|
|
/// <summary>
|
/// 有点击的布局,时间布局
|
/// </summary>
|
void timeFrameLayoutUI(FrameLayout contentFrameLayout)
|
{
|
Action okAction = null;
|
for (int i = 0; i < 2; i++)
|
{
|
int curIndex = i;
|
var timeFrameLayout = new FrameLayout
|
{
|
Width = Application.GetRealWidth(867),
|
Height = Application.GetRealHeight(127),
|
X = Application.GetRealWidth(156),
|
Y = Application.GetRealHeight(176),
|
};
|
contentFrameLayout.AddChidren(timeFrameLayout);
|
|
var timeLeftText = new Button
|
{
|
Width = Application.GetRealWidth(204 + 100),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(23),
|
Y = Application.GetRealHeight(32),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.starttime,
|
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
|
TextSize = 15,
|
};
|
timeFrameLayout.AddChidren(timeLeftText);
|
|
var timeRightText = new Button
|
{
|
Width = Application.GetRealWidth(81 + 300),
|
Height = Application.GetRealHeight(58),
|
X = Application.GetRealWidth(429),
|
Y = Application.GetRealHeight(32),
|
Tag = curIndex,
|
TextAlignment = TextAlignment.CenterRight,
|
TextID = MyInternationalizationString.LEDSetTime,
|
TextColor = ZigbeeColor.Current.XMGray3,
|
TextSize = 14,
|
};
|
timeFrameLayout.AddChidren(timeRightText);
|
|
var line2 = new Button()
|
{
|
Y = timeFrameLayout.Height - 1,
|
Width = Application.GetRealWidth(867),
|
Height = 1,
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
|
};
|
timeFrameLayout.AddChidren(line2);
|
|
if (i == 1)
|
{
|
timeFrameLayout.Y = Application.GetRealHeight(331);
|
timeLeftText.TextID = MyInternationalizationString.endtime;
|
if (curLedTimeData.endHour != -1)
|
{
|
string em = curLedTimeData.endMin.ToString();
|
if (curLedTimeData.endMin < 10)
|
{
|
em = "0" + curLedTimeData.endMin;
|
}
|
timeRightText.Text = curLedTimeData.endHour + ":" + em;
|
}
|
}
|
else
|
{
|
if (curLedTimeData.startHour != -1)
|
{
|
string sm = curLedTimeData.startMin.ToString();
|
if (curLedTimeData.startMin < 10)
|
{
|
sm = "0" + curLedTimeData.startMin;
|
}
|
timeRightText.Text = curLedTimeData.startHour + ":" + sm;
|
}
|
}
|
|
EventHandler<MouseEventArgs> hander = (sender, e) =>
|
{
|
ClickHandle(curIndex, timeRightText);
|
};
|
timeLeftText.MouseDownEventHandler += hander;
|
timeFrameLayout.MouseDownEventHandler += hander;
|
timeRightText.MouseDownEventHandler += hander;
|
}
|
}
|
|
#region 公共事件处理
|
/// <summary>
|
/// 事件处理
|
/// </summary>
|
private void ClickHandle(int curIndex, Button timeRightText)
|
{
|
this.midFrameLayout.AddChidren(this.shadowRadiusFrameLayout);
|
this.bottomRadiusFrameLayout.Height = Application.GetRealHeight(806 - 127);
|
this.bottomRadiusFrameLayout.Y = Application.GetRealHeight(930 + 127);
|
this.bottomRadiusFrameLayout.RemoveAll();
|
this.BottomRadiusFrameLayout(this);
|
curOperateIndex = curIndex;
|
var mUIPickerView = new UIPickerView()
|
{
|
X = Application.GetRealWidth(0),
|
Height = Application.GetRealHeight(440),
|
};
|
this.bottomRadiusFrameLayout.AddChidren(mUIPickerView);
|
|
if (curIndex == 0)
|
{
|
this.btnBottomTitle.TextID = R.MyInternationalizationString.starttime;
|
}
|
else
|
{
|
this.btnBottomTitle.TextID = R.MyInternationalizationString.endtime;
|
}
|
|
mUIPickerView.Y = Application.GetRealWidth(245);
|
|
var mList1 = new List<string>();
|
var mList2 = new List<string>();
|
var mList3 = new List<string>();
|
|
int cur1 = 0;
|
int cur2 = 0;
|
int cur3 = 0;
|
if (curIndex == 0)
|
{
|
if (curLedTimeData.startHour > 12)
|
{
|
cur1 = 1;
|
}
|
else
|
{
|
if (curLedTimeData.startHour ==0)
|
{
|
cur1 = 1;
|
}
|
}
|
if (curLedTimeData.startHour != 0)
|
{
|
cur2 = curLedTimeData.startHour - 1;
|
if (cur1 == 1)
|
{
|
cur2 = curLedTimeData.startHour - 13;
|
}
|
}
|
else
|
{
|
cur2 = 11;
|
}
|
|
cur3 = curLedTimeData.startMin;
|
}
|
else
|
{
|
if (curLedTimeData.endHour > 12)
|
{
|
cur1 = 1;
|
}
|
else
|
{
|
if (curLedTimeData.endHour == 0)
|
{
|
cur1 = 1;
|
}
|
}
|
if (curLedTimeData.endHour != 0)
|
{
|
cur2 = curLedTimeData.endHour - 1;
|
if (cur1 == 1)
|
{
|
cur2 = curLedTimeData.endHour - 13;
|
}
|
}
|
else
|
{
|
cur2 = 11;
|
}
|
|
cur3 = curLedTimeData.endMin;
|
}
|
|
mList1.Add(Language.StringByID(R.MyInternationalizationString.Morning));
|
mList1.Add(Language.StringByID(R.MyInternationalizationString.Afternoon));
|
for (int m = 1; m < 13; m++)
|
{
|
mList2.Add(m.ToString());
|
}
|
for (int d = 0; d < 60; d++)
|
{
|
mList3.Add(d.ToString());
|
}
|
|
mUIPickerView.setNPicker(mList1, mList2, mList3);
|
mUIPickerView.setCurrentItems(cur1, cur2, cur3);
|
|
mUIPickerView.OnSelectChangeEvent += (y, m, d) =>
|
{
|
int h = m + 1;
|
if (y > 0)
|
{
|
h += 12;
|
}
|
|
if (curIndex == 0)
|
{
|
setLedTimeData.startHour = h;
|
setLedTimeData.startMin = d;
|
}
|
else
|
{
|
setLedTimeData.endHour = h;
|
setLedTimeData.endMin = d;
|
}
|
};
|
|
btnCancel.MouseUpEventHandler += (sender1, e1) =>
|
{
|
this.shadowRadiusFrameLayout.RemoveFromParent();
|
};
|
btnFinish.MouseUpEventHandler += (sender1, e1) =>
|
{
|
if (curOperateIndex == 0)
|
{
|
if (setLedTimeData.startHour == -1)
|
{
|
setLedTimeData.startHour = 1;
|
}
|
if (setLedTimeData.startHour == 24)
|
{
|
setLedTimeData.startHour = 0;
|
}
|
|
string sm = setLedTimeData.startMin.ToString();
|
if (setLedTimeData.startMin < 10)
|
{
|
sm = "0" + setLedTimeData.startMin;
|
}
|
|
if (int.Parse(timeRightText.Tag.ToString()) == curOperateIndex)
|
{
|
timeRightText.Text = setLedTimeData.startHour + ":" + sm;
|
}
|
}
|
else
|
{
|
if (setLedTimeData.endHour == -1)
|
{
|
setLedTimeData.endHour = 1;
|
}
|
if (setLedTimeData.endHour == 24)
|
{
|
setLedTimeData.endHour = 0;
|
}
|
|
string em = setLedTimeData.endMin.ToString();
|
if (setLedTimeData.endMin < 10)
|
{
|
em = "0" + setLedTimeData.endMin;
|
}
|
if (int.Parse(timeRightText.Tag.ToString()) == curOperateIndex)
|
{
|
timeRightText.Text = setLedTimeData.endHour + ":" + em;
|
}
|
}
|
|
if (setLedTimeData.endHour != -1)
|
{
|
//首次输入
|
if (curOperateIndex == 0)
|
{
|
if (!CheckValidTime(setLedTimeData.startHour, setLedTimeData.startMin, setLedTimeData.endHour, setLedTimeData.endMin))
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.LedBindTip1), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
return;
|
}
|
this.shadowRadiusFrameLayout.RemoveFromParent();
|
}
|
else
|
{
|
if (!CheckValidTime(setLedTimeData.startHour, setLedTimeData.startMin, setLedTimeData.endHour, setLedTimeData.endMin))
|
{
|
new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.LedBindTip2), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance);
|
return;
|
}
|
this.shadowRadiusFrameLayout.RemoveFromParent();
|
}
|
}
|
else
|
{
|
this.shadowRadiusFrameLayout.RemoveFromParent();
|
}
|
};
|
this.shadowRadiusFrameLayout.MouseUpEventHandler += (sender1, e1) =>
|
{
|
this.shadowRadiusFrameLayout.RemoveFromParent();
|
};
|
}
|
#endregion
|
|
/// <summary>
|
/// 检查时间
|
/// </summary>
|
/// <returns></returns>
|
private bool CheckValidTime(int st, int sm, int et, int em)
|
{
|
//开始时间
|
string nowValue1 = "";
|
nowValue1 = st.ToString().PadLeft(2, '0') + sm.ToString().PadLeft(2, '0');
|
//结束时间
|
string nowValue2 = "";
|
nowValue2 = et.ToString().PadLeft(2, '0') + em.ToString().PadLeft(2, '0');
|
if (nowValue1.CompareTo(nowValue2) == 1)
|
{
|
return false;
|
}
|
return true;
|
}
|
|
public class TimeData
|
{
|
/// <summary>
|
/// 序号(正常序号0~4,共5个)
|
/// </summary>
|
public int serialNum = -1;
|
/// <summary>
|
/// 使能位
|
/// <para>0-无效 1--有效</para>
|
/// </summary>
|
public int enable = 0;
|
/// <summary>
|
/// 起始时
|
/// </summary>
|
public int startHour = -1;
|
/// <summary>
|
/// 起始分
|
/// </summary>
|
public int startMin;
|
/// <summary>
|
/// 结束时
|
/// </summary>
|
public int endHour = -1;
|
/// <summary>
|
/// 结束分
|
/// </summary>
|
public int endMin;
|
/// <summary>
|
/// 备注
|
/// </summary>
|
public string remark;
|
}
|
}
|
}
|