Visit Gigasoft's Web Site
ProEssentials v8 Help

Chapter 1: Pedo Asp.Net Data Control

 

Cloud to Client-side real-time simplicity. Pedo stands for ProEssentials Data Object and is used to simplify producing Internet Aware EXEs and websites...

  1. server-to-client-EXE (WPF, WinForm, MFC, DLL, ActiveX [Access Excel VB6], VCL [Delphi Builder].) Your EXEs can retrieve and or real-time append/shift data from the cloud.
  2. server-to-client-browser. Your IE website rendering our ActiveX can retrieve and or real-time append/shift data from the cloud.

General reference information can be found at: Pego.PeData.Pedo and ProEssentialsWeb.Pedo

 

Below are brief explainations of common methods of using a Pedo WebForm and/or Pedo ActiveX Server Object within your application.

 

Using Pedo with a client-side EXE to append new data.

The calling EXE uses the AppendFromURL function to point to a server page to make the request. Depending upon the interface used to create the EXE, there are various AppendFromURL formats...

Interface used to create EXE

use client side Function

WinForms and WPFs applications

Pego.PeData.Pedo.AppendFromUrl(fileNameURL)

ActiveX development, IE, Access, Excel, VB6

Pego.AppendFromUrl(fileNameURL)

SDK/DLL development with VC++ / MFC

PEappendfromURL(hPE, szURL)

VCL development with Delphi or Builder

PEappendfromURL(PEGraph1.hObject, szURL)

 

The fileName URL pointed to is usually an ASPX page such as Webform1.aspx which contains a Pedo asp.net control with its RenderingType property set to BinaryDataStream. ProEssentials also includes a Pedo ActiveX control which can also be created within a simple ASP page to serve the new data. So both .NET and oldschool ASP server side solutions are possible.

 

The AppendFromUrl call is used much like AppendYData and other append type properties as discussed in Chapter 6. However, instead of requiring multiple append type calls, AppendFromURL passes all data and types of data in one process/request.


We recommend using the ExtraStringData property to pass a date-time stamp along with the new data. Then use a simple QueryString to pass this date-time stamp back to the server upon next data request. This way, the server logic knows how to send all data currently un-sent to this particular chart.

 

Below examples:

 

1) Client-Side EXE calling Server for new data to Append

2) Asp.Net Web based Pego Strip-Chart renders and updates within Internet Explorer
3)
Using Pedo within ASP.NET as a simple method of generic data transfers without requiring a page refresh

4) Using Pedo within HTML/ASP as a simple method of generic data transfers

 

1: Client-Side EXE calling Server for new data to Append

 

Within a new Asp.Net web project called "AppendApp". On a blank WebForm, insert a Pedo WebForm control. Then switch to the HTML view and remove all HTML so the file only contains 3 lines at the top, with the last line containing your Pedo control. WebForm1.aspx should look something like... (Note, it's important no additional ascii characters, even spaces, exist before or after the .NET tags.)

 

WebForm1.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="AppendApp.WebForm1"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<cc1:Pedo id="Pedo1" runat="server" RenderingType="BinaryDataStream"></cc1:Pedo>


Next insert the code below (Page_Load event) which is similar to code from the OnTimer event from example 017 of our PeDemo.

 

WebForm1.aspx.vb

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
Dim r As System.Random
   r = New System.Random
   Pedo1.Subsets = 2 ' Preparing data for a chart with 2 subsets
   Pedo1.Points = 1 ' Prepare one new piece of data per subset
   Pedo1.Y(0, 0) = 5 + (r.NextDouble * 95.0F) ' setting new data for first subset
   Pedo1.Y(1, 0) = 5 + (r.NextDouble * 35.5F) ' setting new data for second subset
   'setting new data for PointLabels
   Pedo1.PointLabels(0) = Now.Hour().ToString + ":" + Now.Minute().ToString + ":" + Now.Second.ToString
End Sub


Now, depending on the demo version you are working with, change example 017 OnTimer event handler to the following. You will have to adjust the URL to point to the project/filename used above.

.NET WinForm or Wpf Example Project: Replace all code within Timer event, to....

Pego1.PeData.Pedo.AppendFromURL("http://localhost/appendapp/webform1.aspx")


VB6 ActiveX Example Project: Replace all code within Timer event, to...

Pego1.AppendFromURL("http://localhost/appendapp/webform1.aspx")


MFC VC Example Project: Replace all code within OnTimer, section 17 with...

PEappendfromURL(m_hPE, TEXT("http://localhost/appendapp/webform1.aspx"));


The included PeDemo example projects, either within VC, VB.NET, or C#.NET flavors, the timer related code for example 017 has a commented section that can be un-commented to receive data from included Pe8WebDemo example project IEStripChart/WebForm3.aspx. See the ReadMe or Asp.NetReadMe file for info on first creating a virtual directory so the included web project runs as a server based application.

 

2: Asp.Net Web based Pego Strip-Chart renders and updates within Internet Explorer

Within your web project, you will need three pages. WebForm1 contains a ProEssentials WebForm (usually a Pego or Pesgo) with its RenderingType = ActiveX and ImageUrl = WebForm2. When this page is rendered, it sends ascii HTML to the client browser representing an <OBJECT> tag to create a (Pego or Pesgo) ActiveX on the client's browser instantiated in a default state from bits prepared via WebForm2 which contains a similar ProEssentials WebForm control with its RenderingType = BinaryActiveXStream. Within WebForm1 is embedded DHTML and/or Script that runs client-side to call the embedded ActiveX AppendFromURL method pointing to a third WebForm (WebForm3) containing a Pedo WebForm control with its RenderingType = BinaryDataStream.

 

Below are instruction on creating a simple stip-chart implementation within Internet Explorer.

 

To see a similar pre-built example within the included ASP.NET_WebDemo project. See example 5, with related files within the IEStripChart folder.

 

The following information replicates example 017 from our PeDemo.exe within a web application. For the timer mechanism, it uses DHTML which consists of...

 

a) The Following HTML attributes...

<HTML xmlns:t= "urn:schemas-microsoft-com:time" xmlns:control>

b) The following tags within the <HEAD> section ...

<?IMPORT namespace = "t" implementation = "#default#time2">
<STYLE> .time{behavior:url(#default#time2)} </STYLE>
<SCRIPT language=vbscript >
     Sub OnMyTimer()
           Form1.PegoWeb1.AppendFromURL("http://localhost/IEStripChart/WebForm3.aspx")
     End Sub
</SCRIPT>

c) The following attributes added to the PegoWeb1 object tag...

CLASS="time" DUR=".5" REPEATCOUNT="indefinite" onrepeat="OnMyTimer"

 

Within a new VB type ASP.NET web project called" IEStripChart".

  • On a blank WebForm1, insert a PegoWeb WebForm control.
  • Set RenderingType to ActiveX and ImageURL to WebForm2.aspx.
  • Switch to the HTML view and make the changes as noted above. Your WebForm1.aspx should look like... Note there is no code necessary in WebForm1.aspx.vb. Also note, adding the <?IMPORT namespace html may cause IE to refuse to show this page in design view. You can wait to add this line last after your page is designed as needed.
WebForm1.aspx

<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="IEStripChart.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:t= "urn:schemas-microsoft-com:time" xmlns:control>
<HEAD>

<?IMPORT namespace = "t" implementation = "#default#time2">
<STYLE> .time{behavior:url(#default#time2)} </STYLE>

<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

<script language=vbscript >
Sub OnMyTimer()
Form1.PegoWeb1.AppendFromURL("http://localhost/IEStripChart/WebForm3.aspx")
End Sub

</script>

</HEAD>
<body>
<form id="Form1" method="post" runat="server">
  <P>IE Browser app replicating example 017 from PeDemo.exe</P>
  <P>View HTML source to see references of the time class which handles timing
     aspects of this page.</P>
     <cc1:PegoWeb id="PegoWeb1" name="PegoWeb1" runat="server" Width="640px" RenderingType="ActiveX"      ImageUrl="WebForm2.aspx" CLASS="time" DUR=".5" REPEATCOUNT="indefinite" onrepeat="OnMyTimer" ></cc1:PegoWeb>
</form>
</body>
</HTML>

  • Add a second WebForm2 to the project.
  • Insert a PegoWeb WebForm control, set RenderingType to BinaryActiveXStream.
  • Switch to the HTML view and remove all HTML so the file only contains 3 lines at the top, with the last line containing your PegoWeb control. WebForm2.aspx should look something like...

WebForm2.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="IEStripChart.WebForm2"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<cc1:PegoWeb id="PegoWeb1" runat="server" Width="640px" RenderingType="BinaryActiveXStream"></cc1:PegoWeb>


WebForm2.aspx.vb contains the following code... (Add "Imports Gigasoft.ProEssentials.Enums" at top of this file)

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'// No Flicker //
PegoWeb1.PeConfigure.PrepareImages = True
PegoWeb1.PeConfigure.CacheBmp = True

 

'// Set Subsets and Points //
PegoWeb1.PeData.Subsets = 2 '// set number of subsets
PegoWeb1.PeData.Points = 200 '// number of data points

PegoWeb1.PeUserInterface.Scrollbar.PointsToGraph = 20
PegoWeb1.PeUserInterface.Scrollbar.PointsToGraphInit = PointsToGraphInit.Last


'// Set Titles //
PegoWeb1.PeString.MainTitle = "Graph Real Time Example"
PegoWeb1.PeString.SubTitle = "" '// no subtitle


'// Manually configure scales //
PegoWeb1.PeGrid.Configure.ManualScaleControlY = ManualScaleControl.MinMax

PegoWeb1.PeGrid.Configure.ManualMinY = 1.0
PegoWeb1.PeGrid.Configure.ManualMaxY = 100.0
PegoWeb1.PeGrid.Configure.ManualMinY = 1.0
PegoWeb1.PeGrid.Configure.ManualMaxDataString = "000.000"
PegoWeb1.PeGrid.Configure.ManualMaxPointLabel = "00:00:00xx"


'// Set Various Properties //
PegoWeb1.PePlot.Method = GraphPlottingMethod.Area
PegoWeb1.PePlot.Allow.StackedData = False
PegoWeb1.PeUserInterface.Dialog.PointsToGraph = False
PegoWeb1.PePlot.Allow.Histogram = False
PegoWeb1.PeUserInterface.Allow.FocalRect = False
PegoWeb1.PeGrid.LineControl = GridLineControl.None
PegoWeb1.PeData.Precision = 1


'// Needed to allocate point labels so append logic works //
'// Set last point label, Points - 1 //
PegoWeb1.PeString.PointLabels(199) = ""


'// Reset first four default data points
PegoWeb1.PeData.Y(0, 0) = 0
PegoWeb1.PeData.Y(0, 1) = 0
PegoWeb1.PeData.Y(0, 2) = 0
PegoWeb1.PeData.Y(0, 3) = 0


'// Set Various Properties //
PegoWeb1.PeColor.BitmapGradientMode = False
PegoWeb1.PeColor.QuickStyle = QuickStyle.LightShadow
PegoWeb1.PeFont.Fixed = True
PegoWeb1.PeFont.MainTitle.Bold = True
PegoWeb1.PeFont.SubTitle.Bold = True
PegoWeb1.PeFont.Label.Bold = True
PegoWeb1.PeConfigure.TextShadows = TextShadows.BoldText
PegoWeb1.PeFont.FontSize = FontSize.Large
PegoWeb1.PeColor.SubsetColors(0) = Color.FromArgb(128, 0, 198, 0)
PegoWeb1.PeColor.SubsetColors(1) = Color.FromArgb(128, 255, 255, 255)

PegoWeb1.PeColor.Desk = Color.FromArgb(255, 255, 255, 255)

'// Enable Smooth Graphics and Text //

PegoWeb1.PeConfigure.RenderEngine = RenderEngine.GdiPlus
PegoWeb1.PeConfigure.AntiAliasGraphics = True
PegoWeb1.PeConfigure.AntiAliasText = True


End Sub

  • Add a third WebForm3 to the project.
  • Insert a Pedo WebForm control, set RenderingType to BinaryDataStream.
  • Switch to the HTML view and remove all HTML so the file only contains 3 lines at the top, with the last line containing your Pedo control. WebForm3.aspx should look something like...

WebForm3.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb" Inherits="IEStripChart.WebForm3"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<cc1:Pedo id="Pedo1" runat="server"></cc1:Pedo>


WebForm3.aspx.vb contains the following code...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs
Dim r As System.Random
r = New System.Random
Pedo1.Subsets = 2 ' Preparing data for a chart with 2 subsets
Pedo1.Points = 1 ' Prepare one new piece of data per subset
Pedo1.Y(0, 0) = 5 + (r.NextDouble * 95.0F) ' setting new data for first subset
Pedo1.Y(1, 0) = 5 + (r.NextDouble * 35.5F) ' setting new data for second subset
' setting new data for PointLabels
Pedo1.PointLabels(0) = Now.Hour().ToString + ":" + Now.Minute().ToString + ":" + Now.Second.ToString
End Sub


3: Using Pedo within ASP.NET as a simple method of generic data transfers

 

Within your web project, you will need two or three pages. WebForm1 contains a ProEssentials Pedo Webform control with its RenderingType = ActiveX and ImageUrl = WebForm2. When this page is rendered, it sends ascii HTML to the client browser representing an <OBJECT> tag to create a Pedo ActiveX on the client's browser instantiated in a default state from bits prepared via WebForm2 which contains a similar Pedo WebForm control with its RenderingType = BinaryActiveXStream. When page loads you can read the embedded Pedo ActiveX to learn about the data it conains. Within WebForm1 you can optionally embed VB or Java Script that runs client-side to call LoadFromURL pointing to a third WebForm (WebForm3) containing a Pedo WebForm control with its RenderingType = BinaryDataStream.

 

Note that in a production app, WebForm1's Pedo control's CodebaseURL property should be set to a CAB file containing the Pedo ActiveX and this CAB file exist on same server in same dir. Pedo.cab is found in the ProEssentials7/WebDevelopment dir.

 

Below are instruction on creating a simple application that uses a Pedo WebForm control to render an invisible Pedo ActiveX on the client. The Pedo ActiveX is instantiated with initial data via ImageUrl, and then receives addtional data via a button press without causing a page refresh.

 

To see a similar pre-built example within the included ASP.NET_WebDemo project. See example 6, with related files within the GenericData folder.

 

Within a new VB type ASP.NET web project called" GenericData".

  • On a blank WebForm1, insert a Pedo WebForm control.
  • Set RenderingType to ActiveX and ImageURL to WebForm2.aspx.
  • Insert two additional HTML Input controls and name them Label1, and Label2.
  • Next insert one HTML Button control.
  • Next switch to the HTML view for this page and add the bold script sections and onload setting shown below.. Your WebForm1.aspx should look like... (Note there is no code necessary in WebForm1.aspx.vb)

WebForm1.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="GenericData.WebForm1"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language="vbscript">
  Sub Page_Initialize()
    Label1.Value = Pedo1.PointLabels(0)
    Label2.Value = Pedo1.PointLabels(1)
  End Sub
  Sub Refresh_Data
    Pedo1.LoadFromURL("http://localhost/GenericData/WebForm3.aspx")
    Label1.value = Pedo1.PointLabels(0)
    Label2.value = Pedo1.PointLabels(1)
  End Sub
</script>
</HEAD>
<body onload="Page_Initialize">
<cc1:Pedo id="Pedo1" runat="server" RenderingType="ActiveX" ImageUrl="WebForm2.aspx"></cc1:Pedo>
<P></P>
<P>Invisible Pedo control receives data on initial page load, and then
changes data via button press.</P>
<P><INPUT id="Label1" type="text"></P>
<P><INPUT id="Label2" type="text"></P>
<P><INPUT id="Button1" style="WIDTH: 136px; HEIGHT: 24px" type="button" value="Button" onclick="Refresh_Data"></P>
</body>
</HTML>

  • Add a second WebForm2 to the project.
  • Insert a Pedo WebForm control, set RenderingType to BinaryActiveXStream.
  • Switch to the HTML view and remove all HTML so the file only contains 3 lines at the top, with the last line containing your Pedo control. WebForm2.aspx should look something like...

WebForm2.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="GenericData.WebForm2"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<cc1:Pedo id="Pedo1" runat="server" RenderingType="BinaryActiveXStream"></cc1:Pedo>


WebForm2.aspx.vb contains the following code...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
Pedo1.PointLabels(0) = "Initially"
   Pedo1.PointLabels(1) = "Loaded"
End Sub

  • Add a third WebForm3 to the project.
  • Insert a Pedo WebForm control, set RenderingType to BinaryDataStream.
  • Switch to the HTML view and remove all HTML so the file only contains 3 lines at the top, with the last line containing your Pedo control. WebForm3.aspx should look something like...

WebForm3.aspx

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb" Inherits="GenericData.WebForm3"%>
<%@ Register TagPrefix="cc1" Namespace="Gigasoft.ProEssentials" Assembly="Gigasoft.ProEssentialsWeb" %>
<cc1:Pedo id="Pedo1" runat="server"></cc1:Pedo>


WebForm3.aspx.vb contains the following code...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs
   Pedo1.PointLabels(0) = "Hello"
   Pedo1.PointLabels(1) = "World"
End Sub


4: Using Pedo within HTML/ASP as a simple method of generic data transfers

 

Below are instruction on creating a simple application that uses a Pedo ActiveX control to render an invisible Pedo ActiveX on the client. The Pedo ActiveX is instantiated with initial data via DATA attribute of object tag, and then receives addtional data via a button press without causing a page refresh.

 

To see a similar pre-built example within the included ASP.NET_WebDemo project. See example 7, with related files within the GenericData2 folder.

 

Note, using ASP and Pedo ActiveX technology on the server requires the Pedo ActiveX to be registered on the server. Best approach is to copy Pedo.ocx to the system32 dir and use RegSvr32 to register Pedo.ocx. No need to do this on your development machine, this has already been done as part of our setup.

 

Similar to the above example (3), instead of a Pedo WebForm on WebForm1, you can simply place an object tag.

 

<OBJECT CLASSID ="clsid:426A5096-1269-46F1-9C07-CBA2D27CD208"
   DATA="http://localhost/GenericData2/GetInitData.asp" ID="Pedo1"></OBJECT>

 

within an HTMLPage1.htm ...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>HTMLPage1</title>
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="ProgId" content="VisualStudio.HTML">
<meta name="Originator" content="Microsoft Visual Studio.NET 7.0">


<script language="vbscript">
  Sub Page_Initialize()
    Label1.Value = Pedo1.PointLabels(0)
    Label2.Value = Pedo1.PointLabels(1)
  End Sub
  Sub Refresh_Data
    Pedo1.LoadFromURL("http://localhost/Pe6WebDemo/GenericData2/GetNewData.asp")
    Label1.value = Pedo1.PointLabels(0)
    Label2.value = Pedo1.PointLabels(1)
  End Sub
</script>

</head>
<body onload="Page_Initialize">

<OBJECT CLASSID ="clsid:426A5096-1269-46F1-9C07-CBA2D27CD208"
DATA="http://localhost/Pe6WebDemo/GenericData2/GetInitData.asp" ID="Pedo1" VIEWASTEXT></OBJECT>


<P></P>
<P>Invisible Pedo control receives data on initial page load, and then
changes data via button press.</P>
<P><INPUT id="Label1" type="text" NAME="Label1"></P>
<P><INPUT id="Label2" type="text" NAME="Label2"></P>
<P><INPUT id="Button1" style="WIDTH: 136px; HEIGHT: 24px" type="button" value="Button" onclick="Refresh_Data" NAME="Button1"></P>

</body>
</html>

 

Then on the server, GetInitData.asp would contain (for example) ....

<%
dim myobj
Set myobj = server.CreateObject("PEDO.PedoCtrl.1")

myobj.PointLabels(0) = "Initially"
myobj.PointLabels(1) = "Loaded"

Response.BinaryWrite (myobj.SerializeToStream())

Set myobj = Nothing
%>

 

The call to LoadFromURL could point to a page GetNewData.asp similar to....

<%
dim myobj
Set myobj = server.CreateObject("PEDO.PedoCtrl.1")

myobj.PointLabels(0) = "Hello"
myobj.PointLabels(1) = "World"

Response.BinaryWrite (myobj.SaveToStream())

Set myobj = Nothing
%>