Gauge control are giving the error

Gauge for WPF Forum

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Version: 4.5.0471
Platform: .NET 3.5
Environment: Windows XP (32-bit)
Avatar
Hello,

i am evaluating gauge controls for the our project. when i used it in control template, it giving me the design times error. i am binding the values from the code behind dependency properties.

Error message :

Layout measurement override of element 'ActiproSoftware.Windows.Controls.Gauge.CircularScale' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.

I am not able get the problem with this. please look at the xaml also.

<UserControl x:Class="Moog.FCS.FTS.Client.SmartClient.Controls.Meters.Gauge"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:gauge="http://schemas.actiprosoftware.com/winfx/xaml/gauge"
Height="200" Width="202" >
<UserControl.Resources>
<shared:StringFormatConverter x:Key="StringFormatConverter" />
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

<ControlTemplate x:Key="gaugeHalfTachometer" TargetType="{ x:Type Control }">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="SemicircularRoundedRectangle" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">

<gauge:CircularGauge.Items>

<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />

<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>

<gauge:CircularScale Radius="85" StartAngle="180" SweepAngle="180" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>

<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />

<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />




<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>

</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>

<ControlTemplate x:Key="gaugeTachometer" TargetType="{x:Type Control}">
<gauge:CircularGauge x:Name="gaugeFrame" FrameType="CircularTopGradient" Radius="99" Background="#444444"
RimBrush="#444444" Margin="0,0,0,0">

<gauge:CircularGauge.Items>

<gauge:DigitalGauge gauge:CircularGauge.X="0" gauge:CircularGauge.Y="-30"
Width="80" Height="25"
Background="{Binding ElementName =gaugeFrame, Path = Background}"
RimBrush="{Binding ElementName =gaugeFrame, Path = RimBrush}"
CharacterType="Segment7Trapezoid" CharacterCount="7" CharacterSpacing="2"
Foreground="White" CharacterHeight="10"
Value="{Binding ElementName=needle, Path=Value,
Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:###.###0}'}" OpacityMask="Sienna" />

<TextBlock x:Name="txtTitle" gauge:CircularGauge.X="0" gauge:CircularGauge.Y="14" Text="{ Binding Path = Title}" Foreground="WhiteSmoke"
FontSize="6" />
<TextBlock x:Name="txtUnit" gauge:CircularGauge.X="37" gauge:CircularGauge.Y="60" Text="{ Binding Path = Unit}" Foreground="WhiteSmoke"
FontSize="6" />
</gauge:CircularGauge.Items>
<gauge:CircularGauge.Scales>

<gauge:CircularScale Radius="85" StartAngle="135" SweepAngle="270" BarExtent="2" IsBarVisible="False"
Background="{shared:LinearGradientBrush Gray, DarkGray, GradientType=TopToBottom}">
<gauge:CircularScale.TickSets>
<gauge:CircularTickSet Minimum="{Binding Path = Minimum }" Maximum="{Binding Path = Maximum }"
MajorInterval="{Binding Path = MajorInterval }"
MinorInterval="{Binding Path = MinorInterval }">
<gauge:CircularTickSet.Ticks>

<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="White" ScalePlacement="Inside" EndValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor x:Name="scaleSafeMajorRange" TickMarkExtent="6" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" EndValue="6.5" />

<gauge:CircularTickMarkMinor TickMarkExtent="4" TickMarkAscent="0.5"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />
<gauge:CircularTickMarkMajor TickMarkExtent="6" TickMarkAscent="1"
Background="DarkRed" ScalePlacement="Inside" StartValue="{Binding Path = LastIntervalStart }" />




<gauge:CircularTickLabelMajor FontFamily="Verdana" FontSize="8" Foreground="White"
TextOrientation="Rotated" ScalePlacement="Inside" ScaleOffset="7"
/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
<gauge:CircularPointerNeedle x:Name="needle" Value="{Binding Path = Value }"
Background="{shared:LinearGradientBrush #DB0707, #FF0404, GradientType=TopToBottom}"
PointerExtent="100%" PointerAscent="3%" />
<gauge:CircularPointerCap CapType="CircleConvex"
Background="{shared:LinearGradientBrush #751515, #990E0E, GradientType=TopToBottom}"
PointerExtent="25%" />
</gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>
</gauge:CircularScale.TickSets>
</gauge:CircularScale>


</gauge:CircularGauge.Scales>
</gauge:CircularGauge>
</ControlTemplate>

<ControlTemplate x:Key="gaugeThermometer" TargetType="{ x:Type Control }">
<gauge:LinearGauge Orientation="{Binding Path = Orientation }"
Width="Auto" Height="Auto" HorizontalAlignment="Left"
Background="{shared:LinearGradientBrush #AEA498, #5E5448,
GradientType=TopLeftToBottomRight}" RimBrush="#630320" FrameType="RectangleGradient">



<gauge:LinearGauge.Scales>
<gauge:LinearScale BarExtent="80%" BarAscent="15" IsBarVisible="True">
<gauge:LinearScale.TickSets>
<gauge:LinearTickSet Maximum="{ Binding Path = Maximum }" Minimum="{ Binding Path = Minimum }"
MajorInterval="{ Binding Path = MajorInterval }" MinorInterval="{ Binding Path = MinorInterval }">
<gauge:LinearTickSet.Ticks>
<gauge:LinearTickMarkMinor x:Name="minorTickMark" TickMarkAscent="5"
TickMarkExtent="2"
Background="Black"
Visibility="Visible" />
<gauge:LinearTickMarkMajor x:Name="majorTickMark" TickMarkAscent="10"
TickMarkExtent="3"
Background="Black" />
<gauge:LinearTickMarkCustom x:Name="customTickMark" Value="{ Binding Path = Value }" TickMarkAscent="19"
TickMarkExtent="1" Background="DarkRed"
/>
<gauge:LinearTickLabelMinor x:Name="minorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black" FontSize="8"
/>
<gauge:LinearTickLabelMajor x:Name="majorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black"
/>
<gauge:LinearTickLabelCustom x:Name="customTickLabel" Value="{ Binding Path = Value }"
ScalePlacement="Inside" ScaleOffset="8" Foreground="DarkRed"
/>
</gauge:LinearTickSet.Ticks>
<gauge:LinearTickSet.Pointers>
<gauge:LinearPointerBar x:Name="bar" BarType="CircleBulbRoundedRectangle"
PointerAscent="11" PointerExtent="12" Value="{ Binding Path = Value }"
Background="{shared:LinearGradientBrush #C40000, #820000, GradientType=TopLeftToBottomRight}" />
</gauge:LinearTickSet.Pointers>
</gauge:LinearTickSet>
</gauge:LinearScale.TickSets>
</gauge:LinearScale>
</gauge:LinearGauge.Scales>
</gauge:LinearGauge>
</ControlTemplate>

</UserControl.Resources>

<Grid Height="Auto" Width="Auto" >
<Grid.RowDefinitions>
<RowDefinition ></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition> </ColumnDefinition>
</Grid.ColumnDefinitions>
<Control x:Name="ctrlGauge" Width="Auto" Height="Auto" Template="{StaticResource gaugeHalfTachometer }" Grid.Column="0" Grid.Row="0" >
</Control>
</Grid>
</UserControl>

[Modified at 10/14/2008 11:37 PM]

[Modified at 10/16/2008 10:13 AM]

Comments (24)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ravindra,

There was an issue with the measure code for the CircularScale (and LinearScale), which we have fixed for the next maintenance release.

Also, keep in mind that you will need to set an explicit Width/Height on the gauge control at some point. The Grid can be used with the * size, but Auto cannot be used. The gauge controls are not able to determine how much space is needed to fit it's content at this time.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Hi,

Thanks for reply. Actually I want resize the gauge control depend upon the size of user control. or i want to bind the height, width properties with user control height and width.
How this can be possible.

Also i have other queries like when i can accept your maintenance release, if buy the licenses. Also we need gauge control like switch, LED etc. When that can be available?

thanks and regards,
Ravindra Kore

[Modified at 10/14/2008 11:36 PM]
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
What you posted above should work fine because the Width and Height are set on the UserControl. If you have any specific problems though, please let us know.

The maintenance release with the measure fix will be out sometime this week (possibly today). We have another release that we are working on for the gauge product, which will include switch and LED controls among other things. We are not sure when that release will be out yet, but we have a majority of the code finished.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
where will be maintenance release available for the download ?
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can always get the latest full maintenance releases of anything you own from your Organization Purchases page. The latest build numbers are listed on the download links there as well as on our Products page and other places on our site.

If you do not currently own our products, you will can get it from the Download / Download Evaluations page once it's released. The build number will be 4.5.0475 once it's out. Uninstall the version you have first before installing the new one.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Hello,

I am serious problem with VS2008 after installing the actipro controls. it is getting closed abruptly in between. When uninstall the controls it works fine. Can you please tell how can i handle it.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi,

This is the first we've heard of such a thing, and we have many hundreds of developers using our products in Visual Studio 2008. I doubt there is anything our controls do that would cause a problem with VS 2008. Our controls are just libraries that use the core WPF framework. If VS 2008 is crashing out without any error messages, then it's more likely that you have a corrupt installation of VS 2008.

Are you sure there is no additional information available such as an exception message, or an event log entry? Does it consistently happen in a certain scenario? If so, what?


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Hello,

The visual gives error message. this happens when i don't set the size to gauge control.
As you said issue of this resolved new maintainence release. i tried to install the new version. is started with me other error in property grid.
error message: can not convert value attribute to object of type to system.dependencyPropert. Error atthe 'system.windows.setter' in makeup file 'ActiproSoftware.ProprtyGrid.Wpf30 v 4.5.475.

Can you please guide me which stable version should i use. Also i need extend evaluation's period.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh, we found the problem here. It was an enhancement for PropertyGrid when using virtualization (new in .NET 3.5 SP1) but the problem is that on systems that don't have SP1 installed, it will throw an error. We are correcting this immediately so that everything will still work on non-SP1 (and even just .NET 3.0) systems. We will have a new build with the fix for this out sometime today. Sorry for the inconvenience.

For the evaluation extension, just follow the steps here:
http://www.actiprosoftware.com/Support/Customer/RequestEvaluationExtension.aspx


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Thanks. after the installation of 3.5 ps1 it started working. But linear gauge has the problem it not showing the bar.

please below xaml for it. The middle bar is not working at all. Please give me the resolution ASAP.


<gauge:LinearGauge Orientation="{Binding Path = Orientation }"
HorizontalAlignment="Left"
Height="{Binding ElementName=pnlMain, Path=ActualHeight, Converter= {StaticResource arithConverter}, ConverterParameter=-20}"
Width="{Binding ElementName=pnlMain, Path=ActualWidth}"
Background="{shared:LinearGradientBrush #AEA498, #5E5448,
GradientType=TopLeftToBottomRight}" RimBrush="#630320" FrameType="RectangleGradient">

<gauge:LinearGauge.LayoutTransform>
<ScaleTransform ScaleX="{Binding Path=ZoomX}"
ScaleY="{Binding Path=ZoomY}" />
</gauge:LinearGauge.LayoutTransform>
<gauge:LinearGauge.Items>
<TextBlock x:Name="txtUnit" gauge:LinearGauge.X="0" gauge:LinearGauge.Y="-60"
gauge:LinearGauge.Origin="Center" HorizontalAlignment="Left" VerticalAlignment="Top"
Text="{Binding Path = Unit }" FontFamily="Tahoma" Foreground="Bisque" FontSize="16" />
</gauge:LinearGauge.Items>
<gauge:LinearGauge.Scales>
<gauge:LinearScale BarExtent="80%" BarAscent="15" IsBarVisible="True">
<gauge:LinearScale.TickSets>
<gauge:LinearTickSet Maximum="{ Binding Path = Maximum }" Minimum="{ Binding Path = Minimum }"
MajorInterval="{ Binding Path = MajorInterval }" MinorInterval="{ Binding Path = MinorInterval }">
<gauge:LinearTickSet.Ticks>
<gauge:LinearTickMarkMinor x:Name="minorTickMark" TickMarkAscent="5"
TickMarkExtent="2"
Background="Black"
Visibility="Visible" />
<gauge:LinearTickMarkMajor x:Name="majorTickMark" TickMarkAscent="10"
TickMarkExtent="3"
Background="Black" />
<gauge:LinearTickMarkCustom x:Name="customTickMark" Value="{ Binding Path = Value }" TickMarkAscent="19"
TickMarkExtent="1" Background="DarkRed"
/>

<gauge:LinearTickLabelMajor x:Name="majorTickLabel" ScalePlacement="Outside"
ScaleOffset="8" Foreground="Black"
/>
<gauge:LinearTickLabelCustom x:Name="customTickLabel" Value="{ Binding Path = Value }" Text="{ Binding Path = Value }"
ScalePlacement="Inside" ScaleOffset="8" Foreground="DarkRed"
/>
</gauge:LinearTickSet.Ticks>
<gauge:LinearTickSet.Pointers>
<gauge:LinearPointerBar x:Name="bar" BarType="CircleBulbRoundedRectangle"
PointerAscent="11" PointerExtent="12" Value="{ Binding Path = Value }"
Background="{shared:LinearGradientBrush #C40000, #820000, GradientType=TopLeftToBottomRight}" />
</gauge:LinearTickSet.Pointers>
</gauge:LinearTickSet>
</gauge:LinearScale.TickSets>
</gauge:LinearScale>
</gauge:LinearGauge.Scales>
</gauge:LinearGauge>
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I'm assuming you are talking about the pointer bar not changing value. I tried it here using your code and it works fine. But I suspect it has to do with how you are binding the value.

Try looking in the Visual Studio Output and see if there are any binding errors. These will help you determine if your binding statement is valid.

If the bindings look ok, then please send over a sample project that shows the issue. Since we can't see what the value is being bound to in the code above, we won't be able to tell from just that. With a sample project, we'll be able to debug this alot quicker.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Hello there,

I don't see any problem in binding because the custom label is showing the value. but the middle bar which length is equivalent is not working. also the linear scale is not show in control. every thing gets wrapped at the origin only.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Again we would need a sample project to debug this. But you have both the height/width and zoom x/y bound to values we cannot see. If either of these is 0 (or a small number for the height/width) then the entire linear gauge would be very small or invisible.

If you would like us to take a look, we would need a sample project though.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
where to send the sample project, here i dont see any location to upload.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Please send it to our support email address. You can find links to the address here:
http://www.actiprosoftware.com/Company/Contact.aspx


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
it does allow add attachment in you site. can plz give your mail id, so i can send you sample project?
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Click the "Customer Support" link on the upper left part of that page I indicated. It will open an email to our support, which you can include attachments to.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
really sorry. but i am not able ti find any where the link you are saying. can please give mail id aor link directly that can help?
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We don't post email addresses in the forums because other companies grab them for mailing lists.

Again, please go to this page:
http://www.actiprosoftware.com/Company/Contact.aspx

There is a section on the upper left main content area of that page that has a header in blue saying "E-mail". Click the link right under that which says "Customer Support". It's very easy to find.


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Hi

After the installation of build 477 it working. but got introduced another problem of cpu/memory utilization. It is taking very high utilization of them. my VS2008 is not working as used before. Please provide some guide line for this.
Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
i am continuing to above post. Other observations like..
1) The control that uses gauge controls is taking too much time to generate the design view. Taking full resources of the system.
2) other page do use gauge control works fine.

Please provide me the fix for the same.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We are not seeing any issues on our side. Are you experiencing this when using our Sample Browser? Does it happen for all the Gauge samples?


Actipro Software Support

Posted 16 years ago by Ravindra - Sr. Software Engineer, Persistent Systems Ltd
Avatar
Yes. This happening with sample browser application also. In design mode it giving very slow response.

[Modified at 10/22/2008 09:01 AM]
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We ran some tests on a Virtual Machine with 256MB of RAM, but didn't see anything out of the ordinary. Keep in mind that the first time Visual Studio loads up the XAML designer it will take more time (since it needs to load up some additional DLLs). Afte the first load of the XAML designer, subsequent loads will be much faster. So if you open one item, close it, then open it again, then the second load would be much faster. The first load would also increase memory, but neither of these items are unique to the Gauge product.

[Modified at 10/22/2008 12:46 PM]


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.