Sign in to follow this  
Followers 0
slaughter

Server load, MSSQL user connections Display

1 post in this topic

Draw 3D Procesor load with Au3GlPlugin_T2

Posted Image

#include "GlPluginUtils.au3"
#include <array.au3>

;hide icon!!!!!!
AutoItSetOption( "TrayIconHide", 1 )
$Title = "Procesor load"
EmbedGlWindow( $hGUI, 400, 300, 100, 20 )
;~ DefineGlWindow( $Title, 200, 100 )
SetClearColor( 0, 0, 0 )

CreateLight( 0, 600, 1000, 600 )
SetLightAmbient( 0, 0.2, 0.2, 0.2 )
SetLightDiffuse( 0, 0.7, 0.7, 0.7 )
SetLightSpecular( 0, 0, 0, 0 )


    $Red = 1
    $Green = 1
    $Blue = 0.5
    $Alpha = 1


$Box = ObjectCreate( )
;~ 0 percent
AddLine( $Box, -250, 0, 0, 250, 0, 0, $Red, $Green, $Blue, $Alpha )

;~ 50 percent
AddLine( $Box, -250, 50, 0, 250, 50, 0, $Red, $Green, $Blue, $Alpha )

;~ 100 percent
AddLine( $Box, -250, 100, 0, 250, 100, 0, $Red, $Green, $Blue, $Alpha )



AddLine( $Box, -250, 0, 0, -250, 100, 0, 1, 0.5, 1, 1 )
AddLine( $Box, 250, 0, 0, 250, 100, 0, 1, 0.5, 1, 1 )

SetPrint( $Box )


SetCamera( 0, 50, 300, 0, 50, 0 )


$ObjId = ObjectCreate( )
    Dim $Xv1[2]
    Dim $Yv1[2]
    Dim $Zv1[2]
    Dim $Xv2[2]
    Dim $Yv2[2]
    Dim $Zv2[2]
    
    $Xv1[0] = 250
    $Yv1[0] = 0
    $Zv1[0] = 0
    $Xv2[0] = 250
    $Yv2[0] = 0
    $Zv2[0] = 0
    
    $Xv1[1] = 250
    $Yv1[1] = 0
    $Zv1[1] = 0
    $Xv2[1] = 250
    $Yv2[1] = 0
    $Zv2[1] = 0
    
    $Dx = 0
    $Dy = 0
    $Dz = 0
    
    $Red = 1
    $Green = 1
    $Blue = 0.5
    $Alpha = 1


SetPrint( $ObjId )
Opt( "WinTitleMatchMode", 3 )
WinWait( $Title )
$CheckWindowTimer = TimerInit( )
$Scale = 0.5
$ReducingScale = 0
$Y_Axis = 0







While 1
    
    SceneDraw( )
    sleep( 500 )

    
    

Dim $aRecords


InetGet("http://192.168.1.1/load.txt", "load.txt", 1, 0)
$line = FileReadLine("load.txt")


    ReDim $Xv1[UBound($Xv1)+1]
    ReDim $Yv1[UBound($Yv1)+1]

    ReDim $Xv2[UBound($Xv2)+1]
    ReDim $Yv2[UBound($Xv2)+1]



$Xv1[UBound($Xv1)-1] = $Xv2[UBound($Xv1)-2]
$Yv1[UBound($Yv1)-1] = $Yv2[UBound($Yv1)-2]
$Zv1 = 0
$Xv2[UBound($Xv2)-1] = $Xv1[UBound($Xv1)-1]+2
$Yv2[UBound($Xv2)-1] = $line
$Zv2 = 0


ConsoleWrite($Xv1[UBound($Xv1)-1]&" "& $Yv1[UBound($Xv1)-1]&" "& 0&" "& $Xv2[UBound($Xv1)-1]&" "& $Yv2[UBound($Xv1)-1] & @CRLF)
    
    
    AddLine( $ObjId, $Xv1[UBound($Xv1)-1], $Yv1[UBound($Xv1)-1], 0, $Xv2[UBound($Xv1)-1], $Yv2[UBound($Xv1)-1], 0, $Red, $Green, $Blue, $Alpha)
    
    $Dx = $Dx - 2
    $Dy = 10
    $Dz = 0
    
    
    ObjectTranslate( $ObjId, $Dx, $Dy, $Dz )
    
    
;check if window exist... (using a timer to reduce CPU usage by WinExists function)
    If TimerDiff( $CheckWindowTimer ) > 1000 Then
        If WinExists( $Title ) = 0 Then ExitLoop
        $CheckWindowTimer = TimerInit( )
    EndIf
Wend

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0