Jump to content

Disk Manager - V2 with source code!


James
 Share

Recommended Posts

Alright, I have given up on the export function for a little bit right now :) Maybe later I can work on it. I have currently fixed some settings and config issues.

There is a RAM function, which you can turn on to make it update every 10 seconds or turn it off. The settings are wrote to a file which are looked through at the beginning :blink:

You can also turn warnings off properly now, which are also wrote to the config file. I found the MemGetStats function so will be using that now as well. I was showing screenshots to my MSN friends who program in other languages and they said it looked brilliant. I hope it does!

I am trying to set the progress bar styles now.

At the time of posting, the code was running at: 415 lines. Hopefully I can trim this down :P (Plus comments)

Edited by JamesB
Link to comment
Share on other sites

  • Replies 130
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Very nice James... what a great program can be created from stupid idea like disk monitoring :P (I like My Computer best for that occasions)

I would add renaming/labeling disk and more information in special panel. :)

I can do signature me.

Link to comment
Share on other sites

Update:

At the moment, I am working on the export function :) Unfortunatley it's not so easy. Martin provided me with some code:

Func _ExportData()
    $io_file = FileOpen(@ScriptDir & '\Export.DMA', 2)
    If FileExists(@ScriptDir & '\Export.DMA') Then FileDelete(@ScriptDir & '\Export.DMA') ; Delete the file if it exists
    FileWrite($io_file, "// Export data for computer: " & @ComputerName & @CRLF)
    FileWrite($io_file, "// Exported on: " & @MDAY & "/" & @MON & "/" & @YEAR & @CRLF)
    FileWrite($io_file, "// Exported by: " & @UserName & @CRLF)
    For $n = 0 To UBound($Data) - 1
        FileWrite($io_file, $Data[$n] & @CRLF)
        ;_ArrayDisplay($Data[$n]);each element is an array so specify the element
    Next
    FileClose($io_file)

    If @error Then
        _GUICtrlEdit_AppendText($ConsoleBox, "Error exporting data!" & @CRLF)
    Else
        _GUICtrlStatusBar_SetText($StatusBar, "Data was exported" & @CRLF)
    EndIf
    ; Export the data into a specified file ~ Martin edited by Me
EndFunc   ;==>_ExportData

Yet, it doesn't work how I need it to, which is, to write all the data in a "list" for each drive. Well if anyone can make it work please tell me :P

After the export function I will start work on an Import function so that you can import other peoples drive data into the program. Once the export is done, this will be really simple!

Do you mean like this? (not tested)

Func _ExportData()
    $io_file = FileOpen(@ScriptDir & '\Export.DMA', 2)
    If FileExists(@ScriptDir & '\Export.DMA') Then FileDelete(@ScriptDir & '\Export.DMA'); Delete the file if it exists
    FileWrite($io_file, "// Export data for computer: " & @ComputerName & @CRLF)
    FileWrite($io_file, "// Exported on: " & @MDAY & "/" & @MON & "/" & @YEAR & @CRLF)
    FileWrite($io_file, "// Exported by: " & @UserName & @CRLF)
    For $n = 0 To UBound($Data) - 1
        $sd = ''
        $tempArray = $data[$n]
        For $p = 0 to UBound($tempArray) - 1
            $sd & = $tempArray[$p]
            if $p < UBound($tempArray)-1 then $sd &= '|';or ',' etc
        Next    
        FileWrite($io_file, $sd & @CRLF)
    Next
    FileClose($io_file)

    If @error Then
        _GUICtrlEdit_AppendText($ConsoleBox, "Error exporting data!" & @CRLF)
    Else
        _GUICtrlStatusBar_SetText($StatusBar, "Data was exported" & @CRLF)
    EndIf
   ; Export the data into a specified file ~ Martin edited by Me and then by me
EndFunc  ;==>_ExportData
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Not quite, the data is exported like so:

// Export data for computer: ***
// Exported on: 31/12/2007
// Exported by: James
0
74308.46875
18684.94140625
0
244.84375

I need it to export all data with all values.

Don't quite see what you want. Can you give an example of what you want for just 2 drives? What are the values in your code box? Are they $data[0] ?
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Example:

// PC Name

// Date

// Username

Drive:Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space

Drive:|Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space

Replace with data. The Drive represents the drive letter followed by colon which specifies data will be shown.

Link to comment
Share on other sites

Example:

// PC Name

// Date

// Username

Drive:Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space

Drive:|Label|Type|Status|File System|Serial Number|Free Space|Used Space|Total Space

Replace with data. The Drive represents the drive letter followed by colon which specifies data will be shown.

Why not just read the item lines from the listview and save them? (_GUICtrlListView_GetItemTextArray) Then when you read back you can just write the item lines easily? Well, fairly easily.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

FIXED IT!

You added a space with &=:

$sd & = $tempArray[$p]

So at first I removed the and, then figured it would be needed. Well it works and returns the data like so:

// Export data for computer: ***
// Exported on: 31/12/2007
// Exported by: James
9|A:|[None]|Removable|NOTREADY|[None]|[None]|0|0|0
9|C:|Local Disk|Fixed|READY|NTFS|2285454394|37351|36957|74308.46875
9|D:|SHARED|Fixed|READY|NTFS|879192402|17222|1463|18684.94140625
9|E:|[None]|CDROM|NOTREADY|[None]|[None]|0|0|0
9|F:|JBROOKS|Removable|READY|FAT|554207151|25|220|244.84375

I don't know about the random 9| though :)

Link to comment
Share on other sites

FIXED IT!

You added a space with &=:

$sd & = $tempArray[$p]

So at first I removed the and, then figured it would be needed. Well it works and returns the data like so:

// Export data for computer: ***
// Exported on: 31/12/2007
// Exported by: James
9|A:|[None]|Removable|NOTREADY|[None]|[None]|0|0|0
9|C:|Local Disk|Fixed|READY|NTFS|2285454394|37351|36957|74308.46875
9|D:|SHARED|Fixed|READY|NTFS|879192402|17222|1463|18684.94140625
9|E:|[None]|CDROM|NOTREADY|[None]|[None]|0|0|0
9|F:|JBROOKS|Removable|READY|FAT|554207151|25|220|244.84375

I don't know about the random 9| though :)

Well done, I haven't been keeping up with this. Sorry about the space, I said it wasn't tested so now you know it really wasn't!

The random 9 is not random at all, it's the number of items. So you could start the $p = loop from 1 instead of 0. That would be better for when you read it back as well.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Thanks Martin! Yeah, it wasn't tested at all :)

I fixed the "random" 9. Thanks for all your help Martin!

No worries, I'm pleased to have helped. After all, when you come from such a strange country as you do you need all the help you can get! Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi JamesB,

i'm impressed

Some bug reports/Improvements :

- When using DriveGetDrive("ALL") and have 6 or more drives the memory information isn't visible

- After Minimizing the GUI you are unable to show the GUI again

- In Func About the GUI size isn't correct should be 350, 130 instead of 300, 200

- In Func About change GUICtrlSetCursor(-1, 2) to GUICtrlSetCursor(-1, 0) this will give the pointing finger just like a real link

- Help command in console is not complete

Will give some more later

Emiel

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

- Drive information, it worked for me when I had 7 drives

- Left click the icon in the task tray

- Sorry which func are you on about?

- Fixed the cursor for next release

- I never finished it :)

Can't wait for more problems or suggestions, they make me have something to do :P

Edited by JamesB
Link to comment
Share on other sites

@JamesB

Maybe your code in your first post isn't as far as you are

Your code in first post has the following

$GUI = GUICreate("Disk Manager - James Brooks", 520, 400 + $_AllD[0] * 2)

I believe it must be

$GUI = GUICreate("Disk Manager - James Brooks", 520, 350 + $_AllD[0] * 17) (17 could also be 20 depends on what you use in you labels etc)

Because you have 7 drives, i have 9 someone else has 12 and another has 4 so your entire GUI must adapt... to display rights. If i were you i would install daemon tools which allows you to create virtual cd/dvd so you can check yourself and you could also change ALL to FIXED which gives you a different view.

You should use the var from $_AllD[0] as a pointer for all your labels so if the amount of drives increases it should change the vertical position of the Disk listing/RAM/Console/ProgressBars etc

I hope you understand what i'm trying to say

Good Luck

Emiel

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

Thanks Emiel. I know exactly what you mean. I did try to get it to do what you are suggesting, but obvioulsy it didn't work!

Thanks for the daemon tool suggestion!

What if it was a company which has 10+ different network drives, the GUI would go off screen..

Edited by JamesB
Link to comment
Share on other sites

Thanks Emiel. I know exactly what you mean. I did try to get it to do what you are suggesting, but obvioulsy it didn't work!

Thanks for the daemon tool suggestion!

What if it was a company which has 10+ different network drives, the GUI would go off screen..

The listview would just scroll.(should)
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...