1 |
# Purpose: FreeRIDE databus adapter test |
# Purpose: FreeBASE databus adapter test |
2 |
# |
# |
3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# Authors: Rich Kilmer <rich@infoether.com> |
# Authors: Rich Kilmer <rich@infoether.com> |
6 |
# Contributors: |
# Contributors: |
7 |
# |
# |
8 |
# This file is part of the FreeRIDE project |
# This file is part of the FreeBASE project |
9 |
# |
# |
10 |
# This application is free software; you can redistribute it and/or |
# This application is free software; you can redistribute it and/or |
11 |
# modify it under the terms of the Ruby license defined in the |
# modify it under the terms of the Ruby license defined in the |
14 |
# Copyright (c) 2001 Rich Kilmer. All rights reserved. |
# Copyright (c) 2001 Rich Kilmer. All rights reserved. |
15 |
# |
# |
16 |
|
|
17 |
require 'freeride/databus' |
require 'freebase/databus' |
18 |
|
|
19 |
db = FreeRIDE::DataBus.new |
db = FreeBASE::DataBus.new |
20 |
|
|
21 |
slots = [ db["/FirstName"], db["/MiddleName"], db["/LastName"], db["/FullName"] ] |
slots = [ db["/FirstName"], db["/MiddleName"], db["/LastName"], db["/FullName"] ] |
22 |
|
|
23 |
FreeRIDE::DataBus::Adapter.new(slots) do |msg, slot| |
FreeBASE::DataBus::Adapter.new(slots) do |msg, slot| |
24 |
if slot.name=="FullName" |
if slot.name=="FullName" |
25 |
slot["/FirstName"].data, slot["/MiddleName"].data, slot["/LastName"].data = slot["/FullName"].data.split |
slot["/FirstName"].data, slot["/MiddleName"].data, slot["/LastName"].data = slot["/FullName"].data.split |
26 |
else |
else |