Pads 9.3 버젼의 Decal wizard 의 창이 잘리는 문제 해결을 위한 방안

 

1. reshack.exe 파일을 인터넷에서 다운로드 (https://blog.naver.com/insist20/10111136179 )

 

Reshack 리소스해커 (무설치) - 프로그램 한글화

Reshack 리소스해커 (무설치) - 프로그램 한글화 각종 게임이나 프로그램등을 사용함에 ...

blog.naver.com

2. 실행 후 C:\MentorGraphics\9.3PADS\SDD_HOME\Programs\enu\powerpcbres.dll 파일을 좌측편에 드래그하여 넣기.

3. Dialog 의 10010\1033 번 Dialog 열기.

4. 해당 다이얼로그의 크기를 짤리는 부분이 없을 정도로 늘림.

5. 스크립트 컴파일 및 저장 후 Pads 실행하여 확인. 끝.

오래전에 원문을 가져와 번역을 했는데, 시간이 지난 후에 링크를 찾으니 어디있는지 도저히 못 찾겠네요
(찾으신 분 알려주시면 링크걸겠습니다.)

원문제목 : DataGridView in Windows Forms – Tips, Tricks and Frequently Asked Questions(FAQ))


  DataGridView컨트롤은 표로 작성된 데이터를 수정하고 커스터마이징하는 기능을 제공한다. 이 컨트롤은 겉모습과 동작을 입맛대로 바꿔주는 수많은 이벤트와 메소드, 속성을 제공한다. 이 글에서 우리는 자주 올라오는 질문과 그 해결책들에 대해 논의해볼 것이다. 질문은 뉴스그룹과 MSDN사이트, 그리고 MSDN 포럼에서 내가 답변했던 것 등을 포함한 다양한 출처에서 수집되었다.

Tip 1 – DataGridView로 데이터 불러오기
 
In this short snippet, we will populate a DataGridView using the LoadData() method. This method uses the SqlDataAdapter to populate a DataSet. The table ‘Orders’ in the DataSet is then bound to the BindingSource component which gives us the flexibility to choose/modify the data location.

Public Class Form1
    Inherits Form
    Private da As SqlDataAdapter
    Private conn As SqlConnection
    Private bsource As BindingSource = New BindingSource()
    Private ds As DataSet = Nothing
    Private sql As String

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub btnLoad_Click(ByVal sender As Object, ByVal e As EventArgs)
        LoadData()
    End Sub

    Private Sub LoadData()
        Dim connectionString As String = "Data Source=localhost;Initial Catalog=Northwind;" & _
        "Integrated Security=SSPI;"
        conn = New SqlConnection(connectionString)
        sql = "SELECT OrderID, CustomerID, EmployeeID, OrderDate, Freight," & "ShipName, ShipCountry FROM Orders"
        da = New SqlDataAdapter(sql, conn)
        conn.Open()
        ds = New DataSet()
        Dim commandBuilder As SqlCommandBuilder = New SqlCommandBuilder(da)
        da.Fill(ds, "Orders")
        bsource.DataSource = ds.Tables("Orders")
        dgv.DataSource = bsource
    End Sub
End Class

 

Tip 2 – DataGridView를 수정하고 데이터베이스에 저장하기
 
After editing the data in the cells, if you would like to update the changes permanently in the database, use the following code:

Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs)
                  Dim dt As DataTable = ds.Tables("Orders")
                  Me.dgv.BindingContext(dt).EndCurrentEdit()
                  Me.da.Update(dt)
      End Sub


Tip 3 – DataGridView 레코드(row)삭제하기 전에 물어보기
 
Handle the UserDeletingRow event to display a confirmation box to the user. If the user confirms the deletion, delete the row. If the user clicks cancel, set e.cancel = true which cancels the row deletion.

Private Sub dgv_UserDeletingRow(ByVal sender As Object, ByVal e As DataGridViewRowCancelEventArgs)
                  If (Not e.Row.IsNewRow) Then
                        Dim res As DialogResult = MessageBox.Show("Are you sure you want to delete this row?", "Delete confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                        If res = DialogResult.No Then
                              e.Cancel = True
                        End If
                  End If
End Sub

 
Tip 4 – Column 폭 자동조절하기
 
The snippet shown below, first auto-resizes the columns to fit its content. Then the AutoSizeColumnsMode is set to the ‘DataGridViewAutoSizeColumnsMode.AllCells’ enumeration value which automatically adjust the widths of the columns when the data changes.

Private Sub btnResize_Click(ByVal sender As Object, ByVal e As EventArgs)
                  dgv.AutoResizeColumns()
                  dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
 
End Sub

 
Tip 5 - Select and Highlight an entire row in DataGridView

Dim rowToBeSelected As Integer = 3 ' third row
If dgv.Rows.Count >= rowToBeSelected Then
         ' Since index is zero based, you have to subtract 1
            dgv.Rows(rowToBeSelected - 1).Selected = True
End If


Tip 6 - 맨 마지막 행으로 스크롤하기 

The DataGridView has a property called FirstDisplayedScrollingRowIndex that can be used in order to scroll to a row programmatically.

Dim jumpToRow As Integer = 5 '이동시킬 최소 레코드 갯수
If dgv.Rows.Count >= jumpToRow AndAlso jumpToRow >= 1 Then
            dgv.FirstDisplayedScrollingRowIndex = jumpToRow
            dgv.Rows(jumpToRow).Selected = True
End If


Tip 7 - 필드합계를 계산하고 textbox에 출력하기

A common requirement is to calculate the total of a currency field and display it in a textbox. In the snippet below, we will be calculating the total of the ‘Freight’ field. We will then display the data in a textbox by formatting the result (observe the ToString("c")) while displaying the data, which displays the culture-specific currency.

Private Sub btnTotal_Click(ByVal sender As Object, ByVal e As EventArgs)
                  If dgv.Rows.Count > 0 Then
                   txtTotal.Text = Total().ToString("c")
                  End If
End Sub
 
Private Function Total() As Double
                  Dim tot As Double = 0
                  Dim i As Integer = 0
                  For i = 0 To dgv.Rows.Count - 1
                        tot = tot + Convert.ToDouble(dgv.Rows(i).Cells("Freight").Value)
                  Next i
                  Return tot
End Function


Tip 8 - 헤더 이름 바꾸기
 
If the columns being retrieved from the database do not have meaningful names, we always have the option of changing the header names as shown in this snippet:

Private Sub btnChange_Click(ByVal sender As Object, ByVal e As EventArgs)
                  dgv.Columns(0).HeaderText = "MyHeader1"
                  dgv.Columns(1).HeaderText = "MyHeader2"
End Sub


Tip 9 - DataGridView 필드, 레코드, 테두리 색상 바꾸기
 
Private Sub btnCellRow_Click(ByVal sender As Object, ByVal e As EventArgs)
                  ' Change ForeColor of each Cell
                  Me.dgv.DefaultCellStyle.ForeColor = Color.Coral
                  ' Change back color of each row
                  Me.dgv.RowsDefaultCellStyle.BackColor = Color.AliceBlue
                  ' Change GridLine Color
                  Me.dgv.GridColor = Color.Blue
                  ' Change Grid Border Style
                  Me.dgv.BorderStyle = BorderStyle.Fixed3D
End Sub

 
Tip 10 - DataGridView 필드 숨기기
 
If you would like to hide a column based on a certain condition, here’s a snippet for that.

Private Sub btnHide_Click(ByVal sender As Object, ByVal e As EventArgs)
                  Me.dgv.Columns("EmployeeID").Visible = False
End Sub


Tip 11 - DataGridView에 포함된 ComboBox의
              
SelectedIndexChanged 이벤트 다루기
 
To handle the SelectedIndexChanged event of a DataGridViewComboBox, you need to use the DataGridView.EditingControlShowing event as shown below. You can then retrieve the selected index or the selected text of the combobox.

Private Sub dataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs)
                  Dim editingComboBox As ComboBox = CType(e.Control, ComboBox)
                  If Not editingComboBox Is Nothing Then
                        AddHandler editingComboBox.SelectedIndexChanged, AddressOf editingComboBox_SelectedIndexChanged
                  End If
End Sub
 
Private Sub editingComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
                  Dim comboBox1 As ComboBox = CType(sender, ComboBox)
                  ' Display index
                  MessageBox.Show(comboBox1.SelectedIndex.ToString())
                  ' Display value
                  MessageBox.Show(comboBox1.Text)
End Sub

 
Tip 12 - DataGridView 레코드 색상 번갈아서 바꾸기

Private Sub btnAlternate_Click(ByVal sender As Object, ByVal e As EventArgs)
                  Me.dgv.RowsDefaultCellStyle.BackColor = Color.White
                  Me.dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine
End Sub


Tip 13 - 문자열 포맷 바꾸기
 
The DataGridView exposes properties that enable you to format data such as displaying a currency column in the culture specific currency or displaying nulls in a desired format and so on.


Private Sub btnFormat_Click(ByVal sender As Object, ByVal e As EventArgs)
                  ' display currency in culture-specific currency for
                  Me.dgv.Columns("Freight").DefaultCellStyle.Format = "c"
                  ' display nulls as 'NA'
                  Me.dgv.DefaultCellStyle.NullValue = "NA"
End Sub


Tip 14 – DataGridView 필드 순서바꾸기
 
In order to change the order of columns, just set the DisplayIndex property of the DataGridView to the desired value. Remember that the index is zero based.

Private Sub btnReorder_Click(ByVal sender As Object, ByVal e As EventArgs)
                   dgv.Columns("CustomerID").DisplayIndex = 5
                   dgv.Columns("OrderID").DisplayIndex = 3
                   dgv.Columns("EmployeeID").DisplayIndex = 1
                   dgv.Columns("OrderDate").DisplayIndex = 2
                   dgv.Columns("Freight").DisplayIndex = 6
                   dgv.Columns("ShipCountry").DisplayIndex = 0
                   dgv.Columns("ShipName").DisplayIndex = 4
End Sub


3상 3선식 혹은 3상 4선식의 전원을 검침 할 수 있는 솔루션 개발이 금번 프로젝트의 목표 였습니다.


처음에는 계량기 솔루션으로 많이 사용되며, 일전 변압기 감시용 솔루션에 사용 하였던 테리디안의 71M6511 혹은 71M6513을 사용하려 하였습니다.


테리디안의 칩셋은 8051 core와 전력 검침을 위한 dsp가 같이 결합되어 있는 파워 미터 전용 ic로 제품군에 따라 매우 정밀한 측정이 가능 한 장점을 가지고 있습니다.


하지만 앞서 말씀드린바와 같이 시대에 뒤떨어진 8051 core와 작은 메모리 사이즈로 인해, 외부 확장 메모리를 붙이거나, 심지어 별도의 mcu를 붙여 제어하는 형태로 개발이 이루어지고 있습니다. 또한 개발 툴 역시 최소 100만원 이상의 장비를 별도 구매하여야 합니다.


이러한 단점으로 인해 효율적인 개발과 시간 단축을 위해 새로운 솔루션을 찾게 되었으며, MAX78630이 이러한 대안 이었습니다.


MAX78630에 대해 간단히 설명 드리면 아래와 같습니다.

MAX78630은 여러 상의 전원을 측정 하는 모니터링 시스템을 위한 chipset으로 자체 내장된 24-bit 검침 코어와 펌웨어가 내장되어 있습니다. 또한 설정값들을 자체 저장 할 수 있는 비휘발성 메모리 역시 내장되어 사용자가 별도로 설정 데이터를 관리할 필요가 없습니다.


저희는 LCD 및 기타 여러 기능들을 위한 I/O가 다수 필요하여, ST사의 STM32F103VB mcu를 선정하여 인터페이스 하였으며, 한정된 SPI 로 인해 usart 를 이용하여 chipset과 인터페이스 하였습니다.


hardware의 구성은 따로 아래 포스트를 통해 연재 하도록 하겠습니다.


여기서는 interface 만을 집중적으로 보도록 하겠습니다.


'ARM > Software' 카테고리의 다른 글

대표적 ASCII 정리  (0) 2010.06.07
C언어를 이용한 CGI 웹 프로그래밍 Intro...  (0) 2010.01.12
리눅스 rpm명령어  (0) 2009.11.10
부트로더 란?  (0) 2009.11.10
리눅스 FTP 명령어 정리  (0) 2009.11.10

DEC HEX 기호
0 0x00 NUL (NULL Character)
1 0x01 SOH (Start of Header)
2 0x02 STX (Start of Text)
3 0x03 ETX (End of Text)
4 0x04 EOT (End of Transmission)
5 0x05 ENQ (Enquiry)
6 0x06 ACK (Acknowledgement)
7 0x07 BEL (Bell)
8 0x08 BS (Backspace)
9 0x09 HT (Horizontal Tab)
10 0x0A LF (Line feed)
11 0x0B VT (Vertical Tab)
12 0x0C FF (Form feed)
13 0x0D CR (Carriage return)
14 0x0E SO (Shift Out)
15 0x0F SI (Shift In)
16 0x10 DLE (Data link escape)
17 0x11 DC1 (Device control 1)
18 0x12 DC2 (Device control 2)
19 0x13 DC3 (Device control 3)
20 0x14 DC4 (Device control 4)
21 0x15 NAK (Negative acknowledgement)
22 0x16 SYN (Synchronous idle)
23 0x17 ETB (End of transmission block)
24 0x18 CAN (Cancel)
25 0x19 EM (End of medium)
26 0x1A SUB (Substitute)
27 0x1B ESC (Escape)
28 0x1C FS (File separator)
29 0x1D GS (Group separator)
30 0x1E RS (Record separator)
31 0x1F US (Unit separator)
32 0x20 SPC (Space)
- falinux forum에서 발췌..

'ARM > Software' 카테고리의 다른 글

전력 검침 칩셋 MAX78630 인터페이스  (0) 2016.07.13
C언어를 이용한 CGI 웹 프로그래밍 Intro...  (0) 2010.01.12
리눅스 rpm명령어  (0) 2009.11.10
부트로더 란?  (0) 2009.11.10
리눅스 FTP 명령어 정리  (0) 2009.11.10
aesop-2440 3차 보드에서 ssh server(dropbear) 를 돌려보았습니다. 잘 됩니다.

minicom 없이 putty 같은거 써서 네트웍으로 여러번 접속이 가능합니다.

1. HOST 작업

우선 dropbear 패키지를 받습니다.

wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.49.tar.gz

압축을 풀고 다음과 같이 configure 명령을 내립니다.

tar -zxvf dropbear-0.49.tar.gz

./configure --host=arm-linux --disable-shadow

options.h 파일을 열고 DROPBEAR_RANDOM_DEV 항목에서
/dev/random 을 /dev/urandom 으로 고쳐줍니다.

make 를 실행시켜 컴파일 합니다.

실행파일이 네개 생기는데 dbclient 는 ssh client 프로그램이고 dropbear 가 ssh server 프로그램입니다. dropbearkey 는 dropbear 를 구동할때 필요한 키를 생성하는 프로그램이고 dropbearconvert 는 openssh-server 에서 생성한 키를 dropbear에 맞게 변환하는 프로그램입니다.

2. TARGET 작업

네개의 실행파일을 aesop-2440 타겟보드로 복사합니다.

두개의 키를 생성합니다.

./dropbearkey -t rsa -f dropbear_rsa_host_key
./dropbearkey -t dss -f dropbear_dss_host_key

다음 디렉토리를 만들고 복사합니다.

mkdir -p /etc/dropbear
cp dropbear_rsa_host_key /etc/dropbear
cp dropbear_dss_host_key /etc/dropbear

/etc/inittab 파일을 열고 /sbin/autologin 부분을 /bin/login 으로 고쳐줍니다.
init 를 재구동 시킵니다.

passwd root 명령을 내려서 암호를 설정합니다.

./dropbear -E 옵션을 주어 ssh server 를 구동합니다.

3. 접속 테스트

리눅스에서 ssh root@192.168.??.??
혹은 Windows 에서 putty 를 써서 여러번 접속해 봅니다.
이번에 회사에서 맡은 프로젝트는 웹 프로그램입니다...
제품은 IP 전화기 및 중앙 단말기와 연동되는 키폰 입니다..
제가 맡은 부분은 하드웨어나 펌웨어가 아닌... 웹 입니다 ...
그것도 임베디드 상에서의 웹... 공유기에서나 사용될 줄 알았는데 이렇게 맡게 되네요...
문제는... 이겁니다.. CGI... Perl 이나 java를 이용한 것이 아닌.. C를 이용한 CGI 웹 프로그래밍 이죠..

구현해야 할 내용은 다음과 같습니다..

1. 로그인 부분 구현
2. 키폰의 LCD 부분에 표기될 정보를 사용자로부터 입력받아 장비에 세팅
3. 네트워크 설정 세팅부
4. 웹을 통한 펌웨어 업그레이드
5. 웹을 통한 환경설정 업데이트 부분
등 입니다..

프로젝트는 이제 막바지에 다다르고 있으며 차후 같은 프로젝트의 진행시 도움 및 현재 유사한 프로젝트로 인해 날밤을 세우시는 개발자 분들을 위해 이 글을 남기고자 합니다..
진행 될 강좌는 크게 아래와 같이 나누고자 합니다..

1. CGI란 무엇인가
2. CGI 구동을 위한 아파치 서버의 설정
3. HTML FORM을 이용하여 서버로 데이터 전송 방법
4. FORM으로부터 데이터를 입력받아 처리하는 법
5. 한글 처리 방법
6. 기타...

'ARM > Software' 카테고리의 다른 글

전력 검침 칩셋 MAX78630 인터페이스  (0) 2016.07.13
대표적 ASCII 정리  (0) 2010.06.07
리눅스 rpm명령어  (0) 2009.11.10
부트로더 란?  (0) 2009.11.10
리눅스 FTP 명령어 정리  (0) 2009.11.10

변류기 2차 개방 검출 및 보호장치 카탈로그 입니다.



'Datasheet' 카테고리의 다른 글

MMBT1815 DATASHEET  (0) 2009.10.19
AP4890 DATASHEET  (0) 2009.10.07
LTC3217 DATASHEET  (0) 2009.10.07
CAT3224 DATASHEET  (0) 2009.10.07
BAV99 DATASHEET  (0) 2009.09.16
rpm 명령어
간단한 rpm 명령어를 정리해 보려 한다.

나중에 기회되면 이 옵션들이 멀 뜻하는지 정리해야지

- 패키지 설치하기
$rpm -Uvh <패키지 이름>

- 패키지가 설치되어 있는지 확인
$rpm -qa | grep <패키지 이름>

- 패키지 제거하기
$rpm -e --nodeps <패키지 이름>
(--nodeps는 rpm패키지를 삭제할 때 의존성을 무시하라는 옵션)

'ARM > Software' 카테고리의 다른 글

대표적 ASCII 정리  (0) 2010.06.07
C언어를 이용한 CGI 웹 프로그래밍 Intro...  (0) 2010.01.12
부트로더 란?  (0) 2009.11.10
리눅스 FTP 명령어 정리  (0) 2009.11.10
LN2440SBC 메모리 맵  (0) 2009.11.10

부트로더(Boot Loader)

부트로더란 위키페디아에 이렇게 정의되어 있다.

"부트로더(Boot loader)란 운영 체제가 시동되기 이전에 미리 실행되면서 커널이 올바르게 시동되기 위해 필요한 모든 관련 작업을 마무리하고 최종적으로 운영 체제를 시동시키기 위한 목적을 가진 프로그램을 말한다."

이게 첫번째 부트로더의 정의이다.

이어서 위키페디아에는 '두 번째 단계의 부트로더'로 이렇게 정의되어 있다.

"시동을 위한 프로그램은 운영 체제 그 자체가 아니라, 두 번째 부트 로더로, 이를테면 NTLDR, 리눅스 로더, GRUB을 들 수 있다. 운영 체제를 적절하게 불러들이고 끝내 실행할 수 있는 상황으로 만들어 준다. 시스템은 그 자체를 초기화하며 운영 체제의 동작에 일반적으로 필요한 장치 드라이버와 다른 프로그램들을 불러들인다. 여러 개의 운영 체제를 선택할 수 있다는 뜻의 듀얼 부팅도 참조하라."

즉, 단순하게 말해 부트로더는 컴퓨터에 전원이 들어왔을 때(혹은 리셋 버튼이 눌러졌을 때) 가장 먼저 시작되는 프로그램이다. 데스탑PC의 BIOS와 역할이 비슷하다. 데스크탑에서 Del이나 F2키를 누르면 BIOS Setup에 들어가지는데 부트로더에도 이런 Setup과 같은 기능들이 있다. Command Mode에서(임베디드를 하면 보드에 처음에 부트로더를 올리게 되는데, 보드에 부트로더가 올라가게 되면 여러 명령어를 칠 수 있는 Command Mode가 나타난다. ) 호스트 컴퓨터로부터 커널 이미지나 루트파일 시스템(램디스크 이미지)을 다운로드하거나 커널 파라미터를 세팅하는 등의 기능을 제공한다. 부트로더는 사용하고자하는 시스템에 맞게 작성해서 사용해야만 한다.

그럼 부트로더가 가장 먼저 실행되서 구체적으로 무슨 일을 할까?
- 하드웨어에 대한 초기화(cpu speed, 메모리, 인터럽트, 시리얼)를 해준다.
- OS의 커널(kernel) 로드  
- 그 밖에 커널(kernel) 이미지나 루트(root) 이미지를 다운로딩 할 수 있는 기능
- 몇몇 파라미터를 커널에 넘겨주는 일

부트로더의 종류는 여러가지다. 여기서는 임베디드에서 사용하는 부트로더의 종류를 살펴보면
Samsung - ArmBoot
ATMEL - SAMBoot
WinCE - eboot
Linux - uboot
등 여러가지가 있는데, 내부적으로부터 거의 동일하다. 만약 하드웨어 스팩이 같은데 다른 부트로더를 쓰고 싶으면 사용해도 된다. 하지만 그 하드웨어의 메모리 구조에 맞게 부트로더를 수정하거나 다시 작성해야만 한다.


※ 참고
호스트상에서 컴파일된 커널이나 Root이미지를 시리얼을 이용하여 SDRAM에 다운로딩이 가능하다. 이렇게 다운로드한 이미지를 플래쉬 디스크에 쓸 수 있어야 한다. 왜냐하면, SDRAM에 존재하는 것은 전원을 껏다 키게 되면, 다운로드한 이미지는 날아가 버린다. 즉 다시 또 다운로딩을 해야 한다. 그래서 부트로더에는 SDRAM에 있는 이미지를 플래쉬 디스크에 쓸 수 있는 기능이 필수 적이다.

'ARM > Software' 카테고리의 다른 글

C언어를 이용한 CGI 웹 프로그래밍 Intro...  (0) 2010.01.12
리눅스 rpm명령어  (0) 2009.11.10
리눅스 FTP 명령어 정리  (0) 2009.11.10
LN2440SBC 메모리 맵  (0) 2009.11.10
리눅스 시리얼 프로그래밍 예제  (0) 2009.11.10
ftp 명령어 정리
ls : 현재 접속된 서버에 있는 파일의 목록을 확인

cd : 디렉토리 이동

mkdir : 디렉토리 생성

pwd : 현재 디렉토리 확인

get : FTP 서버에 있는 파일 1개를 클라이언트로 다운로드

put : 클라이언트에 있는 파일 1개를 서버로 업로드

mget : FTP 서버에 있는 파일 여러 개를 클라이언트로 다운로드

mput : 클라이언트에 있는 파일 여러 개를 서버로 업로드

ascii : 업로드/다운로드하는 파일이 아스키 파일(텍스트 파일)이라는 것을 미리 지정

bin : 업로드/다운로드하는 파일이 바이너리 파일(텍스트 파일 외 나머지)이라는 것을 미리 지정

'ARM > Software' 카테고리의 다른 글

리눅스 rpm명령어  (0) 2009.11.10
부트로더 란?  (0) 2009.11.10
LN2440SBC 메모리 맵  (0) 2009.11.10
리눅스 시리얼 프로그래밍 예제  (0) 2009.11.10
RTC 없이 보드 시간 동기화  (0) 2009.11.10

+ Recent posts