The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Formatted display output of xAP messages


  • Subject: Formatted display output of xAP messages
  • From: Stuart Booth
  • Date: Thu, 18 Dec 2003 18:45:00 +0000

James,

This one's for you, but greatly improves an area of xFx whilst I was
at it.

You asked a while back about outputting messages from the new
Hub/Viewer without indenting the inner text of each block or header.
The default, for screen display, looks like this:

Stock.MI4
{
price=63.40
company=mi4 Home Automation
change=+3.50
}

I've just changed the way xFx formats its xAP messages for output. You
can now customise this display, allowing you to adjust the indent as
you see fit. Other parameters could be added in later.

{
xAPStockReportMessage msg = new xAPStockReportMessage ();
xAPStockReportBlock block = new xAPStockReportBlock ("MI4",
"mi4 Home
Automation", 63.40F, 3.50F);

msg.AddMessageBlock(block);

xAPMessageFormatInfo mfi = new xAPMessageFormatInfo ();
mfi.IndentSize = 0;

Console.WriteLine(msg.ToString(mfi));
}

Now you end up with this, which is what I think you're after:

Stock.MI4
{
price=63.40
company=mi4 Home Automation
change=+3.50
}

I tidied the code up and it now uses this same system to format a
message for network transmission (getting the \n and \r's correct
between display and network <waves at Kevin and James, bug finders
extraordinaire>). I think it could fit neatly into the serial
transmission protocol very well too, but I have not looked at that at
all yet so I don't know how that works. Some day, for sure.

Anyway, I'll make this indentation size an option in Viewer. I like it
with 4 characters as it makes it more presentable. Send seems to cope
with these saved files ("message received" text excepted) just
fine.
James, would you want a build of this sooner rather than later?

You know, I've just realised I've lost the ability in the new Viewer
to see the raw data bytes in hex format that we added to Listener
fairly recently. Kevin, was that a useful enough feature that you'd
like to see that return in a future build of Viewer???

S
// Hopefully not making too much of a dog's dinner of the xFx
// source whilst he's suffering from a manky head cold.
--
Stuart Booth <<a
href="/group/xAP_developer/post?postID=5e5Hysc3YMXQUEYarIbLvastQnF4WB3Q4cowuGEZsADOYUnDbTFQ5VYX1ZS8OgQvhbkM6EnfGrOq3hbxMw">stuart@x...</a>>
xAPFramework.net - a xAP software development framework for .net

<a href="http://www.xapautomation.org/";>http://www.xapautomation.org/</a>
<a href="http://www.xapframework.net/";>http://www.xapframework.net/</a>





xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.