Jump to content
Software FX Community

JuanC

Staff
  • Posts

    863
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by JuanC

  1. If you are getting that error and the colors are not red,yellow and green then you do not have our most recent build. I just sent you an email with details on how to get it. JuanC
  2. We have already fixed this issue and the fix is scheduled to appear in our next service pack. Thank you for reporting this. JuanC
  3. All PGF files are capable of holding more than 1 gadget. Run Creator Select Chart in the "Add First Gadget" dialog and click Next Select "Do not connect to data..." and click Finish Select "Edit - Add Item" or click the plus button in the toolbar (fourth button) Select Radial Gauge in the "Add a Gadget" dialog and click Next Select "Do not connect to data..." and click Finish You now have a PGF with a chart and a radial gauge, you can move between these items using "Edit - Next/Previous" or clicking the arrows next to the "1 of 2" label at the bottom. Note that you can add as many gauges as wanted and each can be connected to any data source. If you already have PGFs you created you can use Copy and Paste to copy the gadgets to a separate PGF holding 2 or more. Regards, JuanC
  4. Just to provide context for others reading this thread, these were our scripts to try to answer the original question DataLicense.ps1 (fake script that returns Purchased and InUse licenses)----------------------------function buildObject($product,$purchased,$inuse){ $obj = new-object System.Object add-member -inputobject $obj -membertype NoteProperty -Name Product -value $product add-member -inputobject $obj -membertype NoteProperty -Name Purchased -value $purchased add-member -inputobject $obj -membertype NoteProperty -Name InUse -value $inuse $obj} buildObject "Flash" 12 7buildObject "Word" 20 18buildObject "Excel" 15 2buildObject "FreeHand" 7 4 LicenseChart1.ps1----------------------------$condition = { $ratio = $_.InUse/$_.Purchased; if ($ratio -le 0.25) { 0; } else { if ($ratio -le 0.65) { 1; } else { 2; } }} DataLicense | out-chart -label Product -values InUse,Purchased -conditionalattributes_0_color green -conditionalattributes_0_text "Low Use" -conditionalattributes_1_color blue -conditionalattributes_1_text "Medium Use" -conditionalattributes_2_color red -conditionalattributes_2_text "High Use"-condition $condition -conditionalattributes_0_series 1 -conditionalattributes_1_series 1 -conditionalattributes_2_series 1 -series_0_color "#70404040" -galleryattributes_overlap true -legendbox_itemattributes_-series_visible false Interesting points about this script 1) Note that the condition does not return a boolean but instead it returns an integer. We will use the conditional_attribute returned by this function 2) We are assigning a color, label and affected series to each conditional attribute 3) Because we wanted to show both the number of purchased licenses and how many are in use, we are setting the overlap property to true to get one series on top of the other. Note that we are setting a transparent color to show the InUse series 4) We are using a hack to hide both series (InUse and Purchased) from the legend box as the colors are not in a per-series basis. 1 and 4 will only work if you are using a newer PowerGadgets build. This funtionality will be supported in our next service pack and we can make it available to anyone interested in this scenario. LicenseChart2.ps1 (modified according to valdezdj last post)----------------------------$condition = { $left = $_.Purchased - $_.InUse; if ($left -ge 10) { 0; } else { if ($left -ge 5) { 1; } else { 2; } }} DataLicense | out-chart -label Product -values Purchased -conditionalattributes_0_color green -conditionalattributes_0_text "More than 10" -conditionalattributes_1_color yellow -conditionalattributes_1_text "Between 5 and 10" -conditionalattributes_2_color red -conditionalattributes_2_text "Less than 5"-condition $condition -legendbox_itemattributes_-series_visible falseChanges from previous script 1) We are only charting the Purchased column although the condition still uses both Purchased and InUse 2) We removed the setting for all conditional attributes because the chart now has only 1 series Hope this helps JuanC
  5. Can you reproduce this problem consistently?Does it only occurs on certain gadgets? Regards, JuanC
  6. We have found a couple of bugs that will restrict you from creating a gantt chart. It is likely you will have to use out-chart although there is also a trick (see clipboard support in this post) that will allow you to end up with a PGF you can double click and run. I will let you know as soon as we have a build we can provide to test the bug fixes and new functionality. Regards, JuanC
  7. Can you post or send us (support at powergadgets dot com) your WSDL? We added support for datasets so you should not be getting the errors you described. Regards, JuanC
  8. I am not sure I completely understand your scenario. Can you post what your data looks like and a picture/description of the chart you are trying to achieve? JuanC
  9. The bug with $limit is not handling white space correctly for a datetime variable, we've fixed this in our internal build and future service packs will include the fix. You can workaround this by setting $limit = (get-date).AddDays(-30).ToShortDateString() The reason why this fails even though you are not doing refresh is the use of grouping. You could also work around this by using -modal in your chart. This has an additional performance advantage when your command might take some time (gci . -rec) as you are not executing it twice. Obviously -modal has some drawbacks because of its modality. Regards, JuanC ChartFXTest.zip
  10. >> I'd wind up re-implementing much of the functionality that's in the PowerGadgets layer Can you specify which of the functionality in the PowerGadgets layer you would need in your WinForms app? >> It doesn't seem like it should be that hard if for example out-chart would allow us to specify its container I am not sure this model would be friendly to work with if you are building a WinForms app in Visual Studio. If you want to describe in detail what you are trying to do, feel free to send us an email so that we can discuss it offline. Send your email to support at powergadgets.com. Regards, JuanC
  11. Are each one of these gadgets a PGF you created using the PowerGadgets creator? If so, they should remember their locations from run to run, (see this post for more details) so theoretically once you run them an manually adjust their position/size, they should use the same in future runs. If you do not get this behavior it is a bug and we will need more info, e.g. Are you running Vista or XP, is this a multi-monitor configuration, etc. One-click execution of multiple gadgets is something we do not support right out-of-the-box in our current version although is something in our radar for future versions, in the meantime you can use the following workarounds 1) If you have powershell installed, you can create a PowerShell script (PS1 file) with the following invoke-item C:\MyGadgets\Map.pgf invoke-item C:\MyGadgets\Commited.pgf invoke-item C:\MyGadgets\VLMCommited.pgf 2) If you do not have powershell, you can achieve the same writing a batch file (BAT or CMD) with the following "C:\Program Files\PowerGadgets\PowerGadgets.Presenter.exe" C:\MyGadgets\Map.pgf "C:\Program Files\PowerGadgets\PowerGadgets.Presenter.exe" C:\MyGadgets\Commited.pgf "C:\Program Files\PowerGadgets\PowerGadgets.Presenter.exe" C:\MyGadgets\VLMCommited.pgf In my machine I was also able to remove the PowerGadgets Presenter reference from the BAT file and just supplying the PGF name seems to be enough to get the OS to open it. The only tricky issue is that you want to maintain a certain Z-ordering - gauges on top of the map - and I am not sure if you will be able to get this consistently as each gadget being displayed is esentially independent. Also each gadget can be moved independently so moving the map will not move the gauges. Regards, JuanC
  12. Anybody who wants to run your gadgets needs to install PowerGagdets and a PowerGadgets Client License. If they additionally want to modify these gadgets or create new ones then they would need a Creator License. Note that if you are using Vista you can also select "File-Package Sidebar Gadget" and distribute your gadget specifically for the Vista Sidebar. In this case your coworkers also need to have PowerGadgets installed and a Client license. We do not support Google sidebar or desktopsidebar but this is something we have discussed and will be determined based on customer feedback. Regards, JuanC
  13. It works in both. When I use powershell, I tested it using the following command PS C:\Temp> invoke-sql -ConnectionString "odbc;dsn=mysqltest;driver=MySQL ODBC 3.51 Driver;server=mysql;database=test" -sql "SELECT * FROM TestData" Name Value---- -----Name1 10Test2 14 When using Creator I used the same statement in the ODBC connection string and provided NO user or password. I guess this works because I provided the credentials when I created the DSN. I also tried removing the credentials from the ODBC DSN settings and it still worked but I am not sure if this depends on the MYSQL security settings I used when setting up the server. Regards, JuanC
  14. This configuration works, I include the version numbers just for reference as I am sure other versions will work as well Server:- MySql 5.0.37 Client:- MySql ODBC Driver 3.51.14- Create a DSN using the Control Panel-Data Sources (ODBC) applet. We used a System DSN but I suspect it would work the same with a User DSN. In this DSN we specified the following: Data Source Name, Server, User, Password and Database.- Use the following connection string"odbc;dsn=mysqltest;driver=MySQL ODBC 3.51 Driver;server=mysql;database=test"Note that in the connection string we had to specify again the driver, server and database, we tried other combinations and got errors from MySql. I think the ODBC spec force you to specify the DSN and driver but we don't know why server and database are required here if they are set in the DSN configuration. Regards, JuanC
  15. David, We added the "native" ODBC connection for this purpose, allowing connections not supported by OleDB. We have not tested MySql yet (we did test access to Excel files as well as connecting to MYOB). We will post here as soon as we finish our tests. JuanC
  16. The default behavior of our chart control is to use columns in your SQL (or properties if you bind to a powershell script that returns objects) as series and records (or objects in powershell) as points. This works most of the time, e.g. if you select 2 columns and receive 10 records in your SQL and create a line chart you will get 2 lines with 10 points each, I am afraid you found a simple case where our default does not work as well. In a pie chart with only one point we should have automatically transposed this data resulting in a chart with 1 series and 2 points so that you would get a single pie composed of 2 slices. If you are creating your chart in the command line/script you should be able to do the following invoke-sql ..... | out-chart -datasourcesettings_style +transpose -gallery pie Unfortunately there is no way to achieve this if you are using the PowerGadgets creator. We understand this a common scenario so we added a menu item that allows you to transpose the data. This will be included in our next service pack, if you want to test this functionality before the service pack is released please drop an email to support at powergadgets dot com. JuanC PS: Note that we treat all slices in a pie chart as parts of the whole, you will have to modify your SQL so that it returns 9 and 3, we will then add them up (12) and show that InUse is 25% of the total.
  17. It seems like you are trying to execute these scripts on a PowerShell console that does not have our snapin added. You have several options - Use the shortcut created when you installed PowerGadgets to run a console where our snapin is included by default - When using normal PowerShell you can type "add-pssnapin PowerGadgets" without the quotes to add our snapin. - You could also modify your profile.ps1 to add our snapin automatically every time you run powershell Regards, JuanC
  18. Do you get an error icon on top of the gauge when trying to refresh? If so clicking on it will show more details (on Vista). Can you tell us the File Version for PowerGadgets.Commands.dll ? Regards, JuanC
  19. In order to refresh independently from the PowerShell session that created the gadget (so that you can close it and keep the gadget alive) we are hosting powershell and it seems we are not loading the functions in your profile. We will check if we can fix this bug in our next service pack. In the meantime you will have to create a script that returns the required data, e.g. Contents of logstamp.ps1 (get-date).toString('yyyMMddhhmmss') To make this workaround independent of your folder location you may also have to save this ps1 in a directory in your path. We apologize for the inconvenience. JuanC
  20. Unfortunately the mechanism we use to get the command being executed only returns information about the current line, so in your test, out-gauge sees no previous command. The problem can get worse if you do something like get-date -uformat `"%S" | out-gauge -refresh 0:0:15 In this case out-gauge thinks the command needed to refresh is "%S" so that's what we will show when the refresh timer fires (or in a non-refresh chart if you right-click and select Refresh). We are already doing some innecessary parsing because of limitations of the cmdlet invocation info exposed by PowerShell and we discussed that with the PowerShell team. This bug just highlights the hack we had to do in order to support refresh. JuanC
  21. Most of the PowerGadgets components including the Presenter is written on .NET, so to compare the working set numbers I wrote the following tests: 1) Empty .NET WinForm app with no extra code = 25MB2) .NET WinForm app connected to a SQL database = 32MB3) .NET WinForm app able to host PowerShell = 31MB4) .NET WinForm app using a chart: WorkingSet = 32MB5) .NET WinForm app using a chart and connected to a SQL database = 39MB6) .NET WinForm app using a chart and able to host PowerShell = 39MB Note that in 1, 2 and 3 we are not using any of our code so it seems that a .NET Windows Form app with almost any useful functionality will get to use 32MB workingset rather quickly. I do not know which percent of this working set may be reclaimed if the OS is low on memory. From 4, 5 and 6 you can see that adding a graphical component (chart, gauge, etc.) will add about 7MB to the required working set which is consistent with the impact of connecting to a database or hosting powershell. Code used for testing extra functionality Connect to databaseSqlConnection sqlConn = new SqlConnection("server=serverName;database=dbName;Trusted_Connection=true");sqlConn.Open(); Host PowerShellobject obj = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(); Using a ChartChart chart = new Chart(); One of the things we do when you create powergadgets from powershell is that we reuse the presenter process for multiple gadgets. This means that if do out-chart twice you will not end up with 2 Presenter processes but instead the impact of the second chart should be quite small. This technique is not used when you create PGF files and double click them but it is something we are actively investigating. Regards, JuanC
  22. Although I agree both NetCmdlets and PSCX are the right choice if you want to resolve the specific ping issue (you get better performance as the functionality you need is executed in-proc instead of launching a separate process + you can more easily pipe these cmdlets to other cmdlets), there is still a huge number of apps out there that will probably never have a cmdlet replacement so it is important for people to be aware of ways to invoke those apps without the flashing window. JuanC
  23. As always the key is first to come up with a script that returns the data you want in your gadget, in the following script I am using a powershell feature that allows you to add properties to any object. Contents of DualProcData.ps1 $loadPerc = (get-wmiObject win32_Processor | measure-object -average LoadPercentage).Average $procCount = (ps).Count $obj = new-object system.object add-member -inputobject $obj -membertype NoteProperty -Name LoadPercentage -value $loadPerc add-member -inputobject $obj -membertype NoteProperty -Name ProcessCount -value $procCount $obj Note that I changed how you are getting the LoadPercentage so that it works in multi-proc systems, also I used ps instead of get-wmi to get the processes count. Now you can use the fact that our gadgets support scriptblocks in many properties (read more here and here) dualprocdata | out-gauge -value LoadPercentage -innergauges_add digital -innergauges_0_digitalpanel_value {$_.ProcessCount} -InnerGauges_0_Layout_Target AnchorPoint -InnerGauges_0_Layout_AnchorPoint 0,-0.6 -float -refresh 0:0:10 And before anybody complain about typing all this , remember, copy and paste it in a ps1 file and you will never have to type it again JuanC
  24. You can get a title by doing this (ps).count | out-gauge -type digital -float -style 10 -refresh 0:0:2 -size 64,64 -titles_0_text "#Proc" -titles_0_layout_target AnchorPoint -titles_0_layout_anchorpoint 0.2,0.7 The key here is that by setting the target layout to be AnchorPoint you can control exactly where the title is located (coordinates a from 0 to 1) JuanC
  25. We know it is a hack and we spoke to one of the PowerShell team members about this, what we need is for them to allow apps hosting PowerShell to have control over how processes are run. If they supported this, it would just be a matter of setting some properties such as CreateNoWindow If you (and others) could request this through the connect site, it will increase the chance they would consider it for V2 :-) JuanC
×
×
  • Create New...