분류 전체보기
-
[WPF] Datagrid 내에서 항목 삭제하기C# 2024. 5. 28. 11:55
DataGrid 내에 삭제 버튼을 포함하고, 각 행의 항목을 삭제하는 기능을 구현하려면, DataGrid의 각 행에 버튼을 추가하여 해당 버튼을 클릭했을 때 해당 행을 삭제하는 방법을 사용합니다. 이를 위해 DataGridTemplateColumn을 사용하여 각 행에 삭제 버튼을 추가하고, 버튼 클릭 이벤트를 ViewModel의 Command로 바인딩합니다.1. DataGrid에 삭제 버튼 추가먼저 DataGrid의 각 행에 삭제 버튼을 추가하고, 버튼 클릭 이벤트를 Command로 바인딩하는 XAML을 작성합니다.View (XAML) xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:..
-
STM32Cube Programmer 설치STM32 2022. 12. 29. 13:07
ST-LINK/V2 나 V3 등을 사용하여 flash에 program하는 프로그램 1. 설치 파일 찾기 - st.com 에서 stm32cubeprog 찾기. - List에 나온 것 click 하고 download 화면으로 이동. (https://www.st.com/en/development-tools/stm32cubeprog.html) - [Get Last] click 하여 최종 version 선택. 2. 다운로드와 설치하기 - Download 를 누르면 license agreement 확인하고 - 이름과 email 주소를 입력한다. - 적은 email 주소로 download link 가 전달되니까 email 주소는 정확하게 해야됨. - Download 받은 압축파일을 풀어서 실행하면 설치 완료.
-
STM32CubeIDE 설치STM32 2022. 12. 29. 12:58
1. 설치 파일 찾기 - st.com 에서 stm32cubeide 로 찾기해서 나온 것 click. (https://www.st.com/en/development-tools/stm32cubeide.html) - STM32CubeIDE-Win 에서 version 선택. - 잘 모를 경우에는 마지막 버젼으로. 2. 다운로드와 설치하기 - Download 를 누르면 license agreement 확인하고 - 이름과 email 주소를 입력한다. - 적은 email 주소로 download link 가 전달되니까 email 주소는 정확하게 해야됨. - Download 받은 압축파일을 풀어서 실행하면 설치 완료.
-
SWV로 printf 나오게 하기. (STM32CubeIDE 사용)STM32 2021. 11. 29. 15:41
0. Hardware에서 TRACESWO를 ST-Link에 연결. 1. Trace and Debug 에서 "Trace Asynchronous Sw"를 선택. 2. main.c 에 다음 내용을 추가. int __io_putchar(int ch) { ITM_SendChar((uint8_t)ch); return ch; } int _write(int32_t file, uint8_t *ptr, int32_t len) { /* Implement your write code here, this is used by puts and printf for example */ /* return len; */ int i; for(i=0; i
-
자마린에서 블루투스 연결하기Xamarin 2021. 10. 14. 12:39
1. Nuget 에서 Plugin.BLE 설치하기. 2. 블루투스 연결 가능인지 확인하기. public bluetooth() { IBluetoothLE ble; ble = CrossBluetoothLE.Current; var state = ble.State; //state 는 여러가지가 있으니 확인. if (state.ToString() != "On") { displayNotice(); } ble.StateChanged += (s, e) => { if(e.NewState.ToString() != "On") { displayNotice(); } }; } private async void displayNotice() { await DisplayAlert("알림", "블루투스가 꺼져 있습니다. 블루투스를 켜주..
-
문자열 예제C# 2021. 10. 2. 17:35
Substring - 일부분 가져오기 string s3 = "Visual C# Express"; System.Console.WriteLine(s3.Substring(7, 2)); // Output: "C#" String[] pairs = { "Color1=red", "Color2=green", "Color3=blue", "Title=Code Repository" }; foreach (var pair in pairs) { int position = pair.IndexOf("="); if (position
-
Stream 에서 한줄씩 읽기C# 2021. 10. 2. 17:10
int counter = 0; string line; // Read the file and display it line by line. System.IO.StreamReader file = new System.IO.StreamReader(@"c:\test.txt"); while((line = file.ReadLine()) != null) { System.Console.WriteLine(line); counter++; } file.Close(); System.Console.WriteLine("There were {0} lines.", counter); // Suspend the screen. System.Console.ReadLine();