[EXAMPLES]

* NEW: SerialPort: Remove the old example.


git-svn-id: svn://localhost/gambas/trunk@6015 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-12-23 18:15:19 +00:00
parent c0dd9ba625
commit c12d048912
12 changed files with 0 additions and 724 deletions

View file

@ -1,2 +0,0 @@
[Desktop Entry]
Icon=./.icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View file

@ -1,163 +0,0 @@
# Catalan translation of SerialPort
# Copyright (C) 2000-2010 Benoît Minisini.
# This file is distributed under the same license as the SerialPort package.
# Jordi Sayol <g.sayol@yahoo.es>, 2007-2010.
#
#
msgid ""
msgstr ""
"Project-Id-Version: SerialPort\n"
"POT-Creation-Date: 2002-11-01 04:27+0100\n"
"PO-Revision-Date: 2010-12-17 01:10+0100\n"
"Last-Translator: Jordi Sayol <g.sayol@yahoo.es>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-Language: Catalan\n"
#: FSerialPort.class:211
msgid "1"
msgstr "-"
#: FSerialPort.class:175
msgid "1200"
msgstr "-"
#: FSerialPort.class:175
msgid "19200"
msgstr "-"
#: FSerialPort.class:211
msgid "2"
msgstr "-"
#: FSerialPort.class:175
msgid "2400"
msgstr "-"
#: FSerialPort.class:175
msgid "38400"
msgstr "-"
#: FSerialPort.class:204
msgid "5"
msgstr "-"
#: FSerialPort.class:204
msgid "6"
msgstr "-"
#: FSerialPort.class:204
msgid "7"
msgstr "-"
#: FSerialPort.class:204
msgid "8"
msgstr "-"
#: FSerialPort.class:175
msgid "9600"
msgstr "-"
#: FSerialPort.class:233
msgid "CR"
msgstr "-"
#: FSerialPort.class:280
msgid "CRTSCTS"
msgstr "-"
#: FSerialPort.class:280
msgid "CRTSCTS + XON/XOFF"
msgstr "-"
#: FSerialPort.class:258
msgid "CTS"
msgstr "-"
#: FSerialPort.class:185
msgid "Data Bits :"
msgstr "Bits de dades"
#: FSerialPort.class:263
msgid "DCD"
msgstr "-"
#: FSerialPort.class:163
msgid "/dev/ttyS0"
msgstr "-"
#: FSerialPort.class:243
msgid "DSR"
msgstr "-"
#: FSerialPort.class:248
msgid "DTR"
msgstr "-"
#: FSerialPort.class:197
msgid "Even"
msgstr "Parell"
#: FSerialPort.class:273
msgid "Flow control :"
msgstr "Control de flux:"
#: FSerialPort.class:197
msgid "None"
msgstr "No"
#: FSerialPort.class:280
msgid "NONE"
msgstr "Cap"
#: FSerialPort.class:197
msgid "Odd"
msgstr "Senar"
#: FSerialPort.class:216
msgid "Open"
msgstr "Obre"
#: FSerialPort.class:180
msgid "Parity :"
msgstr "Paritat:"
#: FSerialPort.class:158
msgid "Port Name :"
msgstr "Nom del port:"
#: FSerialPort.class:268
msgid "RNG"
msgstr "-"
#: FSerialPort.class:253
msgid "RTS"
msgstr "-"
#: FSerialPort.class:154
msgid "Serial Port"
msgstr "Port sèrie"
#: .project:1
msgid "Serial port example"
msgstr "Exemple de port sèrie"
#: FSerialPort.class:168
msgid "Speed :"
msgstr "Velocitat:"
#: FSerialPort.class:190
msgid "Stop Bits :"
msgstr "Bits d'aturada:"
#: FSerialPort.class:227
msgid "Write data then press \"CR\""
msgstr "Escriu dades i després premeu \"CR\""
#: FSerialPort.class:280
msgid "XON/XOFF"
msgstr "-"

View file

@ -1,156 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-11-01 04:27+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .project:1
msgid "Serial port example"
msgstr "Příklad serial portu"
#: FSerialPort.form:31
msgid "Serial Port"
msgstr "-"
#: FSerialPort.form:35
msgid "Port Name :"
msgstr "Název portu :"
#: FSerialPort.form:40
msgid "/dev/ttyS0"
msgstr "-"
#: FSerialPort.form:45
msgid "Speed :"
msgstr "Rychlost :"
#: FSerialPort.form:51
msgid "1200"
msgstr "-"
#: FSerialPort.form:51
msgid "19200"
msgstr "-"
#: FSerialPort.form:51
msgid "2400"
msgstr "-"
#: FSerialPort.form:51
msgid "38400"
msgstr "-"
#: FSerialPort.form:51
msgid "9600"
msgstr "-"
#: FSerialPort.form:56
msgid "Parity :"
msgstr "Parita :"
#: FSerialPort.form:61
msgid "Data Bits :"
msgstr "Počet Bitů :"
#: FSerialPort.form:66
msgid "Stop Bits :"
msgstr "Stop Bity :"
#: FSerialPort.form:72
msgid "Even"
msgstr "Sudá"
#: FSerialPort.form:72
msgid "None"
msgstr "Žádná"
#: FSerialPort.form:72
msgid "Odd"
msgstr "Lichý"
#: FSerialPort.form:78
msgid "5"
msgstr "-"
#: FSerialPort.form:78
msgid "6"
msgstr "-"
#: FSerialPort.form:78
msgid "7"
msgstr "-"
#: FSerialPort.form:78
msgid "8"
msgstr "-"
#: FSerialPort.form:84
msgid "1"
msgstr "-"
#: FSerialPort.form:84
msgid "2"
msgstr "-"
#: FSerialPort.form:89
msgid "Open"
msgstr "Otevřít"
#: FSerialPort.form:99
msgid "Write data then press \"CR\""
msgstr "Zapiš data zmáčknutím \"CR\""
#: FSerialPort.form:105
msgid "CR"
msgstr "-"
#: FSerialPort.form:114
msgid "DSR"
msgstr "-"
#: FSerialPort.form:119
msgid "DTR"
msgstr "-"
#: FSerialPort.form:124
msgid "RTS"
msgstr "-"
#: FSerialPort.form:129
msgid "CTS"
msgstr "-"
#: FSerialPort.form:134
msgid "DCD"
msgstr "-"
#: FSerialPort.form:139
msgid "RNG"
msgstr "-"
#: FSerialPort.form:144
msgid "Flow control :"
msgstr "Řízení toku :"
#: FSerialPort.form:150
msgid "CRTSCTS"
msgstr "-"
#: FSerialPort.form:150
msgid "CRTSCTS + XON/XOFF"
msgstr "-"
#: FSerialPort.form:150
msgid "NONE"
msgstr "-"
#: FSerialPort.form:150
msgid "XON/XOFF"
msgstr "-"

View file

@ -1,156 +0,0 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2002-11-01 04:27+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: FSerialPort.class:213
msgid "1"
msgstr "1"
#: FSerialPort.class:177
msgid "1200"
msgstr "1200"
#: FSerialPort.class:177
msgid "19200"
msgstr "19200"
#: FSerialPort.class:213
msgid "2"
msgstr "2"
#: FSerialPort.class:177
msgid "2400"
msgstr "2400"
#: FSerialPort.class:177
msgid "38400"
msgstr "38400"
#: FSerialPort.class:206
msgid "5"
msgstr "5"
#: FSerialPort.class:206
msgid "6"
msgstr "6"
#: FSerialPort.class:206
msgid "7"
msgstr "7"
#: FSerialPort.class:206
msgid "8"
msgstr "8"
#: FSerialPort.class:177
msgid "9600"
msgstr "9600"
#: FSerialPort.class:235
msgid "CR"
msgstr "CR"
#: FSerialPort.class:282
msgid "CRTSCTS"
msgstr "CRTSCTS"
#: FSerialPort.class:282
msgid "CRTSCTS + XON/XOFF"
msgstr "CRTSCTS + XON/XOFF"
#: FSerialPort.class:260
msgid "CTS"
msgstr "CTS"
#: FSerialPort.class:187
msgid "Data Bits :"
msgstr "Bits de datos :"
#: FSerialPort.class:265
msgid "DCD"
msgstr "DCD"
#: FSerialPort.class:165
msgid "/dev/ttyS0"
msgstr "/dev/ttyS0"
#: FSerialPort.class:245
msgid "DSR"
msgstr "DSR"
#: FSerialPort.class:250
msgid "DTR"
msgstr "DTR"
#: FSerialPort.class:199
msgid "Even"
msgstr "Even"
#: FSerialPort.class:275
msgid "Flow control :"
msgstr "Control de flujo :"
#: FSerialPort.class:199
msgid "None"
msgstr "Ninguno"
#: FSerialPort.class:282
msgid "NONE"
msgstr "Ninguno"
#: FSerialPort.class:199
msgid "Odd"
msgstr "Odd"
#: FSerialPort.class:218
msgid "Open"
msgstr "Abrir"
#: FSerialPort.class:182
msgid "Parity :"
msgstr "Paridad :"
#: FSerialPort.class:160
msgid "Port Name :"
msgstr "Nombre de puerto :"
#: FSerialPort.class:270
msgid "RNG"
msgstr "RNG"
#: FSerialPort.class:255
msgid "RTS"
msgstr "RTS"
#: FSerialPort.class:156
msgid "Serial Port"
msgstr "Puerto Serial"
#: .project:1
msgid "Serial port example"
msgstr "Ejemplo de puerto Serial"
#: FSerialPort.class:170
msgid "Speed :"
msgstr "Velocidad :"
#: FSerialPort.class:192
msgid "Stop Bits :"
msgstr "Detener Bits :"
#: FSerialPort.class:229
msgid "Write data then press \"CR\""
msgstr "Escriba los datos y luego presione \"CR\""
#: FSerialPort.class:282
msgid "XON/XOFF"
msgstr "XON/XOFF"

View file

@ -1,18 +0,0 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.5.90
Title=Serial port example
Startup=FSerialPort
Icon=serialport.png
Version=3.5.90
VersionFile=1
Component=gb.image
Component=gb.gui
Component=gb.net
TabSize=2
Translate=1
Language=fr
Maintainer=benoit
Vendor=Princeton
Address=benoit@desnouettes
License=General Public Licence
Packager=1

View file

@ -1,122 +0,0 @@
' Gambas class file
'PRIVATE Sport AS SerialPort
'PUBLIC SUB Form_Open()
' Sport=NEW SerialPort AS "Sport"
'END
Public Sub Form_Close()
If Sport.Status = Net.Active Then Close Sport
End
Public Sub Check_Status()
ChkDSR.Value = Sport.DSR
ChkDTR.Value = Sport.DTR
ChkCTS.Value = Sport.CTS
ChkRTS.Value = Sport.RTS
ChkDCD.Value = Sport.DCD
ChkRNG.Value = Sport.RNG
End
Public Sub Button1_Click()
If Sport.Status = Net.Active Then
Close Sport
Button1.Text = "Open"
Else
' Line parameters
Sport.PortName = TxtPort.Text
Sport.Speed = CmbSpeed.Text
Sport.Parity = CmbParity.Index
Sport.DataBits = CmbData.Text
Sport.StopBits = CmbStop.Text
' keep DTR on
Sport.FlowControl = ComboBox1.Index
Sport.Open()
Check_Status()
TextArea1.Text = "Port Opened : " & Sport.PortName & " Settings : " &
Sport.Speed & "," & Sport.Parity & "," & Sport.DataBits & "," &
Sport.StopBits & Chr(13) & Chr(10)
Button1.Text = "Close"
End If
End
Public Sub SPort_Read()
Dim s As String
Read #Sport, s, Lof(Sport)
TextArea1.Text = TextArea1.Text & s
End
Public Sub SPort_RNGChange(iVal As Boolean)
ChkRng.Value = iVal
End
Public Sub SPort_DTRChange(iVal As Boolean)
ChkDTR.Value = iVal
End
Public Sub SPort_DSRChange(iVal As Boolean)
ChkDSR.Value = iVal
End
Public Sub SPort_CTSChange(iVal As Boolean)
ChkCTS.Value = iVal
End
Public Sub SPort_DCDChange(iVal As Boolean)
ChkDCD.Value = iVal
End
Public Sub SPort_RTSChange(iVal As Boolean)
ChkRTS.Value = iVal
End
Public Sub Button2_Click()
If Sport.Status = Net.Inactive Then
Message("Open port first!")
Else
'WRITE #Sport,TxtSend.Text & Chr(13) & Chr(10), txtSend.Length + 2
Print #Sport, txtSend.Text; Chr$(13); Chr$(10);
End If
End
Public Sub ChkDTR_Click()
Sport.DTR = ChkDTR.Value
Check_Status
End
Public Sub ChkRTS_Click()
Sport.RTS = ChkRTS.Value
Check_Status
End
Public Sub ComboBox1_Click()
Sport.FlowControl = ComboBox1.Index
End
Public Sub Form_Open()
cmbSpeed.Index = cmbSpeed.Find("19200")
End

View file

@ -1,107 +0,0 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(70,26.5714,52,60)
Text = ("Serial Port")
{ TextLabel1 TextLabel
MoveScaled(1,1,21,4)
Text = ("Port Name :")
}
{ TxtPort TextBox
MoveScaled(23,1,15,4)
Text = ("/dev/ttyS0")
}
{ TextLabel2 TextLabel
MoveScaled(1,6,21,4)
Text = ("Speed :")
}
{ CmbSpeed ComboBox
MoveScaled(23,6,15,4)
ReadOnly = True
List = [("1200"), ("2400"), ("9600"), ("19200"), ("38400")]
}
{ TextLabel3 TextLabel
MoveScaled(1,11,21,4)
Text = ("Parity :")
}
{ TextLabel4 TextLabel
MoveScaled(1,16,21,4)
Text = ("Data Bits :")
}
{ TextLabel5 TextLabel
MoveScaled(1,21,21,4)
Text = ("Stop Bits :")
}
{ CmbParity ComboBox
MoveScaled(23,11,15,4)
ReadOnly = True
List = [("None"), ("Even"), ("Odd")]
}
{ CmbData ComboBox
MoveScaled(23,16,15,4)
ReadOnly = True
List = [("8"), ("7"), ("6"), ("5")]
}
{ CmbStop ComboBox
MoveScaled(23,21,15,4)
ReadOnly = True
List = [("1"), ("2")]
}
{ Button1 Button
MoveScaled(40,26,11,4)
Text = ("Open")
}
{ TxtSend TextBox
MoveScaled(1,37,43,4)
}
{ TextLabel6 TextLabel
MoveScaled(1,32,50,4)
Foreground = &H030303&
Text = ("Write data then press \"CR\"")
Alignment = Align.Center
}
{ Button2 Button
MoveScaled(45,37,6,4)
Text = ("CR")
}
{ TextArea1 TextArea
MoveScaled(1,42,50,17)
}
{ ChkDSR CheckBox
MoveScaled(40,17,11,4)
Text = ("DSR")
}
{ ChkDTR CheckBox
MoveScaled(40,1,11,4)
Text = ("DTR")
}
{ ChkRTS CheckBox
MoveScaled(40,5,11,4)
Text = ("RTS")
}
{ ChkCTS CheckBox
MoveScaled(40,9,11,4)
Text = ("CTS")
}
{ ChkDCD CheckBox
MoveScaled(40,13,11,4)
Text = ("DCD")
}
{ ChkRNG CheckBox
MoveScaled(40,21,11,4)
Text = ("RNG")
}
{ Label1 Label
MoveScaled(1,26,15,4)
Text = ("Flow control :")
}
{ ComboBox1 ComboBox
MoveScaled(23,26,15,4)
ReadOnly = True
List = [("NONE"), ("CRTSCTS"), ("XON/XOFF"), ("CRTSCTS + XON/XOFF")]
Text = (" ")
}
{ SPort #SerialPort
#MoveScaled(4,30)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB