Check-in [60cc7895bd]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1: 60cc7895bdf48d19b120779f939eba67af55c5a4
User & Date: chw 2019-06-20 05:47:16.886
Context
2019-06-20
06:02
merge with trunk check-in: 00c1373454 user: chw tags: wtf-8-experiment
05:47
merge with trunk check-in: 60cc7895bd user: chw tags: wtf-8-experiment
05:44
cleanup twv and examples check-in: 71419c4d08 user: chw tags: trunk
2019-06-18
18:28
merge with trunk check-in: 208b46aad8 user: chw tags: wtf-8-experiment
Changes
Unified Diff Ignore Whitespace Patch
Changes to undroid/build-vanilla-linux32.sh.
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
      TCL_LDFLAGS="-L${PFX_HERE}/lib -ltclstub8.6" || exit 1
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 libtwv.so ${PFX_HERE}/lib/twv0.1
  else
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 prebuilt/Linux/i386/libtwv.so ${PFX_HERE}/lib/twv0.1
  fi
  install -m 644 pkgIndex.tcl ${PFX_HERE}/lib/twv0.1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1







|







1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
      TCL_LDFLAGS="-L${PFX_HERE}/lib -ltclstub8.6" || exit 1
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 libtwv.so ${PFX_HERE}/lib/twv0.1
  else
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 prebuilt/Linux/i386/libtwv.so ${PFX_HERE}/lib/twv0.1
  fi
  install -m 644 pkgIndex.tcl.embed ${PFX_HERE}/lib/twv0.1/pkgIndex.tcl
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
Changes to undroid/build-vanilla-linux64.sh.
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
      TCL_LDFLAGS="-L${PFX_HERE}/lib -ltclstub8.6" || exit 1
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 libtwv.so ${PFX_HERE}/lib/twv0.1
  else
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 prebuilt/Linux/x86_64/libtwv.so ${PFX_HERE}/lib/twv0.1
  fi
  install -m 644 pkgIndex.tcl ${PFX_HERE}/lib/twv0.1
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1







|







1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
      TCL_LDFLAGS="-L${PFX_HERE}/lib -ltclstub8.6" || exit 1
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 libtwv.so ${PFX_HERE}/lib/twv0.1
  else
    install -d ${PFX_HERE}/lib/twv0.1
    install -m 755 prebuilt/Linux/x86_64/libtwv.so ${PFX_HERE}/lib/twv0.1
  fi
  install -m 644 pkgIndex.tcl.embed ${PFX_HERE}/lib/twv0.1/pkgIndex.tcl
  touch build-stamp
  echo >&3 "done"
) || fail

echo -n "strip binaries ... "
(
  exec 3>&1
Added undroid/tsb/examples/mqtt.tsb.


















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1 {h2 "MQTT Demo"} 2 {#HTML
<p>Preparation: load Schelte Bron's mqtt package</p>} 3 {package require mqtt} 4 {#HTML
<p>Define a callback function which is invoked on reception
of a subscription/topic. The callback stores the received data
with a timestamp in an array indexed by the so called topic,
i.e. the item(s) the subscription refers to.</p>} 5 {proc callback {topic content retain} {
    set content [encoding convertfrom utf-8 $content]
    set now [clock seconds]
    set date [clock format $now -format "%Y-%m-%d"]
    set time [clock format $now -format "%H:%M:%S"]
    # cut "de.wsv/pegel/cm" prefix from topic
    set topic [join [lrange [split $topic /] 3 end] /]
    set ::DATA($topic) [list $date $time $content]
}} 6 {#HTML
<p>Create an MQTT client and connect it to the Mosquitto test server.</p>} 7 {set MQTT_CLIENT [mqtt new]
$MQTT_CLIENT connect test-client test.mosquitto.org 1883} 8 {#HTML
<p>Subscribe to topic(s), here we choose the river levels published by
the GWDS/WSV.</p>} 9 {$MQTT_CLIENT subscribe "de.wsv/pegel/cm/#" callback} 10 {#HTML
<p>From now on, periodic updates should be written into the DATA array.</p>} 11 {table {topic data} [array get DATA]} 12 {#HTML
<p>Refresh the table above each minute.</p>} 13 {proc refresh {} {
    after cancel refresh
    after 60000 refresh
    tsb::eval 11
}
refresh} 14 {tsb::save mqtt.tsb}
Added undroid/tsb/examples/northwind.tsb.










































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
1 {h2 "Northwind Sample With SQLite3"} 2 {#HTML
<p>Some helper code to fetch data from an URL ...</p>} 3 {package require TclCurl

proc curl_get {url} {
    set handle [curl::init]
    $handle configure -url $url -bodyvar result
    catch {$handle perform} code
    if {$code != 0} {
        return -code error [curl::easystrerror $code]
    }
    $handle cleanup
    return $result
}} 4 {#HTML
<p>The Northwind Sample data is on github, here's the base URL</p>} 5 {set BASEURL https://raw.githubusercontent.com/jpwhite3/northwind-SQLite3/master} 6 {#HTML
<p>Let's retrieve the schema diagram of the Northwind database ...</p>} 7 {img_from_binary [curl_get ${BASEURL}/Northwind_ERD.png] image/png 0} 8 {#HTML
<p>Now we create an in-memory SQLite3 database,
fill it with the NorthWind data from SQL source,
and finally list data from the [Categories] table.</p>} 9 package\ require\ sqlite3\n\nsqlite3\ DB\ :memory:\n\nDB\ eval\ \[encoding\ convertfrom\ iso8859-15\ \\\n\ \ \ \ \[curl_get\ \$\{BASEURL\}/Northwind.Sqlite3.create.sql\]\]\n\ntable\ \{CategoryID\ CategoryName\ Description\}\ \\\n\ \ \ \ \[DB\ eval\ \{select\ CategoryID,\ CategoryName,\ Description\ from\ \[Categories\]\}\] 10 {#HTML
<p>Display the images from table [Categories].</p>} 11 {foreach img [DB eval {select Picture from [Categories]}] {
    img_from_binary $img image/jpeg 0
}} 12 {tsb::save northwind.tsb}
Changes to undroid/tsb/examples/topcua.tsb.
1
2
3
4
5
6
7
8
9
10
11
12
13
8 {tsb::save topcua.tsb} 4 {# get the namespace of the webcam demo
set ns [opcua namespace C LilWebCam]

# name of image variable in address space
set iname "ns=${ns};Image"} 5 {# read the image variable (we know that it's a PNG image)
img_from_binary [opcua read C $iname] image/png 0} 1 {h3 "topcua Demonstration"} 6 {# refresh the image every 5 seconds
catch {after cancel $timer}
set timer [after 5000 {tsb::eval 5 ; tsb::eval 6}]} 2 {# prereqs
package require topcua} 7 {after cancel $timer} 3 {# create client
if {![catch {opcua info C}]} {
    opcua destroy C
}
opcua new client C
<
<
|
<
<
|









1


2
3
4
5
6
7
8
9


8 {tsb::save topcua.tsb} 4 #\ get\ the\ namespace\ of\ the\ webcam\ demo\nset\ ns\ \[opcua\ namespace\ C\ LilWebCam\]\n\n#\ name\ of\ image\ variable\ in\ address\ space\nset\ imgname\ \"ns=\$\{ns\}\;s=Image\"\n\n#\ dump\ parts\ of\ the\ OPCUA\ address\ space\ntable\ \{browsepath\ nodeid\ nodeclasspath\ refnodeid\ typenodid\}\ \\\n\ \ \ \ \[opcua\ ptree\ C\ \\\n\ \ \ \ \ \ \ \ \[lindex\ \[opcua\ translate\ C\ \[opcua\ root\]\ /\ Objects\ /\ \$\{ns\}:LilWebCam\]\ 0\]\] 5 {# read the image variable (we know that it's a PNG image)


img_from_binary [opcua read C $imgname] image/png 0} 1 {h3 "topcua Demonstration"} 6 {# refresh the image every 5 seconds
catch {after cancel $timer}
set timer [after 5000 {tsb::eval 5 ; tsb::eval 6}]} 2 {# prereqs
package require topcua} 7 {after cancel $timer} 3 {# create client
if {![catch {opcua info C}]} {
    opcua destroy C
}
opcua new client C
Changes to undroid/twv/pkgIndex.tcl.
1














2

package ifneeded twv 0.1 \














    [list load [file join $dir libtwv[info sharedlibextension]] twv]

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package ifneeded twv 0.1 [apply {dir {
    if {$::tcl_platform(platform) eq "windows"} {
	if {$::tcl_platform(pointerSize) > 4} {
	    set dir [file join $dir prebuilt win64]
	} else {
	    set dir [file join $dir prebuilt win32]
	}
    } else {
	set dir [file join $dir prebuilt $::tcl_platform(os)]
	if {[string match "i*86" $::tcl_platform(machine)]} {
	    set dir [file join $dir i386]
	} else {
	    set dir [file join $dir $::tcl_platform(machine)]
	}
    }
    tailcall load [file join $dir libtwv[info sharedlibextension]] twv
}} $dir]
Added undroid/twv/pkgIndex.tcl.embed.




>
>
1
2
package ifneeded twv 0.1 \
    [list load [file join $dir libtwv[info sharedlibextension]] twv]
Added undroid/twv/prebuilt/Darwin/x86_64/libtwv.dylib.

cannot compute difference between binary files

Added undroid/twv/prebuilt/win32/libtwv.dll.

cannot compute difference between binary files

Added undroid/twv/prebuilt/win64/libtwv.dll.

cannot compute difference between binary files