public static bool IsEquals(this PeripheralsLocation self, UseablePeripheral peripheral) { return((((peripheral.FirstSenderSN.Split('-')[0] == self.FirstSenderSN.Split('-')[0]) && (peripheral.FuncCardIndex == self.FuncCardIndex)) && ((peripheral.PortIndex == self.PortIndex) && (peripheral.SenderIndex == self.SenderIndex))) && ((peripheral.SensorIndex == self.SensorIndex) && (peripheral.SensorType == self.SensorType))); }
private static string GetPositionViewData(PeripheralsLocation opticalProbeItem) { string positionViewData = string.Empty; if (opticalProbeItem.SensorType == PeripheralsType.LightSensorOnSender) { positionViewData = opticalProbeItem.FirstSenderSN + "-" + (opticalProbeItem.SenderIndex + 1); } else if (opticalProbeItem.SensorType == PeripheralsType.LightSensorOnFuncCardInPort) { positionViewData = opticalProbeItem.FirstSenderSN + "-" + (opticalProbeItem.SenderIndex + 1) + "-" + (opticalProbeItem.PortIndex + 1) + "-" + (opticalProbeItem.FuncCardIndex + 1) + "-" + (opticalProbeItem.SensorIndex + 1); } return(positionViewData); }
private DisplaySmartBrightEasyConfig GetConfig() { DisplaySmartBrightEasyConfig config = new DisplaySmartBrightEasyConfig(); config.DisplayUDID = "0123456789"; config.OneDayConfigList = new List<OneSmartBrightEasyConfig>(); OneSmartBrightEasyConfig oneItem = new OneSmartBrightEasyConfig() { ScheduleType = SmartBrightAdjustType.FixBright, StartTime = DateTime.Now.AddMinutes(1), BrightPercent = 60, CustomDayCollection = new List<DayOfWeek>() { DayOfWeek.Monday, DayOfWeek.Tuesday } }; //config.OneDayConfigList.Add(oneItem); oneItem = new OneSmartBrightEasyConfig() { ScheduleType = SmartBrightAdjustType.AutoBright, StartTime = DateTime.Now.AddMinutes(1), BrightPercent = 60, CustomDayCollection = new List<DayOfWeek>() { DayOfWeek.Monday, DayOfWeek.Tuesday } }; config.OneDayConfigList.Add(oneItem); oneItem = new OneSmartBrightEasyConfig() { ScheduleType = SmartBrightAdjustType.FixBright, StartTime = DateTime.Now.AddMinutes(11), BrightPercent = 40, CustomDayCollection = new List<DayOfWeek>() { DayOfWeek.Monday, DayOfWeek.Tuesday } }; config.OneDayConfigList.Add(oneItem); List<PeripheralsLocation> locateList = new List<PeripheralsLocation>(); PeripheralsLocation location = new PeripheralsLocation() { FirstSenderSN = "abc", SenderIndex = 0, SensorType = PeripheralsType.LightSensorOnSender }; locateList.Add(location); location = new PeripheralsLocation() { FirstSenderSN = "acb", SenderIndex = 0, PortIndex = 0, FuncCardIndex = 0, SensorIndex = 1, SensorType = PeripheralsType.LightSensorOnFuncCardInPort }; locateList.Add(location); List<DisplayAutoBrightMapping> maplist = new List<DisplayAutoBrightMapping>(); DisplayAutoBrightMapping map = new DisplayAutoBrightMapping() { EnvironmentBright = 50, DisplayBright = 30 }; maplist.Add(map); map = new DisplayAutoBrightMapping() { EnvironmentBright = 300, DisplayBright = 60 }; maplist.Add(map); AutoBrightExtendData autoData = new AutoBrightExtendData() { CalcType = AutoBrightCalcType.AllAverage, UseLightSensorList = locateList, AutoBrightMappingList = maplist }; config.AutoBrightSetting = autoData; return config; }