public void Tiling(e_bool e = e_bool.manual) { var a = new ObservableCollection <ChartData>(vm.Vms); vm.Vms.Clear(); if ((istile == true && e == e_bool.manual) || e == e_bool.True) { FrameworkElementFactory factory = new FrameworkElementFactory(typeof(StackPanel)); ItemsPanelTemplate template = new ItemsPanelTemplate(); template.VisualTree = factory; listBox.ItemsPanel = template; istile = false; } else if ((istile == false && e == e_bool.manual) || e == e_bool.False) { FrameworkElementFactory factory = new FrameworkElementFactory(typeof(WrapPanel)); factory.SetValue(WrapPanel.OrientationProperty, Orientation.Horizontal); ItemsPanelTemplate template = new ItemsPanelTemplate(); template.VisualTree = factory; listBox.ItemsPanel = template; istile = true; } foreach (var item in a) { item.ReFresh(); vm.Vms.Add(item); } }
public void SetData(SearchData s) { searchmode = e_bool.Single; ID_DANJI.Text = s.DANJI_ID; ID_BUILD.Text = s.BUILD_ID; ID_HOUSE.Text = s.HOUSE_ID; ID_ROOM.Text = s.ROOM_ID; ID_DANJI.IsEnabled = true; ID_BUILD.IsEnabled = true; ID_HOUSE.IsEnabled = true; ID_ROOM.IsEnabled = true; min = Convert.ToDouble(s.mintime); max = Convert.ToDouble(s.maxtime); if (min != -1) { startdap.SelectedDate = TimeConverter.ConvertTimestamp(min); } if (max != -1) { enddatp.SelectedDate = TimeConverter.ConvertTimestamp(max); } _searchData = s; }
public void SetData() { searchmode = e_bool.Reuse; ID_DANJI.Text = " - "; ID_DANJI.IsEnabled = false; ID_BUILD.Text = " - "; ID_BUILD.IsEnabled = false; ID_HOUSE.Text = " - "; ID_HOUSE.IsEnabled = false; ID_ROOM.Text = " - "; ID_ROOM.IsEnabled = false; }
public void ACTUALIZE_registerBinding(byte addressByte) { // after change in register this is called // react only on high bytes // -> as I always send command to actualize both L and H // -> I only need to react on the second one written to register (H) switch (addressByte) { case (C_DynAdd.PRESENT_POS_H): ACTUALIZE_valueAndLogIt(ref angleSeen, C_DynAdd.PRESENT_POS_L, C_DynAdd.PRESENT_POS_H, e_regByteType.seenValue); break; case (C_DynAdd.GOAL_POS_H): ACTUALIZE_valueAndLogIt(ref angleSent, C_DynAdd.GOAL_POS_L, C_DynAdd.GOAL_POS_H, e_regByteType.sentValue); break; case (C_DynAdd.PRESENT_SPEED_H): ACTUALIZE_valueAndLogIt(ref speedSeen, C_DynAdd.PRESENT_SPEED_L, C_DynAdd.PRESENT_SPEED_H, e_regByteType.seenValue); break; case (C_DynAdd.MOV_SPEED_H): ACTUALIZE_valueAndLogIt(ref speedSent, C_DynAdd.MOV_SPEED_L, C_DynAdd.MOV_SPEED_H, e_regByteType.sentValue); break; case (C_DynAdd.LED_ENABLE): LedValue = (e_ledValue)(reg.GET(C_DynAdd.LED_ENABLE, e_regByteType.sentValue).Val); LOG_reg("[LED sent] actualized form motor!"); LedValueSeen = (e_ledValue)(reg.GET(C_DynAdd.LED_ENABLE, e_regByteType.seenValue).Val); LOG_reg("[LED seen] actualized form motor!"); break; case (C_DynAdd.STATUS_RETURN_LEVEL): statusReturnLevel = (e_statusReturnLevel)(ACTUALIZE_byteAndLogIt(C_DynAdd.STATUS_RETURN_LEVEL, e_regByteType.sentValue)); break; case (C_DynAdd.TORQUE_ENABLE): torqueEnable = (e_enabled)(ACTUALIZE_byteAndLogIt(C_DynAdd.TORQUE_ENABLE, e_regByteType.sentValue)); break; case (C_DynAdd.IS_MOVING): isMoving = (e_bool)(ACTUALIZE_byteAndLogIt(C_DynAdd.TORQUE_ENABLE, e_regByteType.sentValue)); break; case (C_DynAdd.RETURN_DELAY_TIME): returnDelayTime = ACTUALIZE_byteAndLogIt(C_DynAdd.RETURN_DELAY_TIME, e_regByteType.sentValue); break; } }
public void SetData(List <SearchData> searchDatas) { searchmode = e_bool.Multi; ID_DANJI.IsEnabled = false; ID_BUILD.IsEnabled = false; ID_HOUSE.IsEnabled = false; ID_ROOM.IsEnabled = false; SearchData first = searchDatas[0]; SearchData last = searchDatas[searchDatas.Count - 1]; ID_DANJI.Text = $"{first.DANJI_ID} - {last.DANJI_ID}"; ID_BUILD.Text = $"{first.BUILD_ID} - {last.BUILD_ID}"; ID_HOUSE.Text = $"{first.HOUSE_ID} - {last.HOUSE_ID}"; ID_ROOM.Text = $"{first.ROOM_ID} - {last.ROOM_ID}"; startdap.SelectedDate = DateTime.Now.AddDays(-1); enddatp.SelectedDate = DateTime.Now; _searchDatas = searchDatas; }