Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/26/2017 in all areas

  1. Since monoceres has released I searched for a way to map the 2D image of the earth to a 3D sphere with rotation. Here the result (after 9 years of research ^^) as a non realistic physical animation: ==> Due to the fact that AutoIt / GDI+ are not that fast I couldn't add a moon animation additionally. Thanks to one of Eukalyptus' code to pointing me to the right direction. U rock man. Source code extract only - not working because of missing binary data (images): ;coded by UEZ build 2017-03-18 #pragma compile(x64, false) #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global Const $iW = 800, $iW2 = ($iW - 100) / 2, $iH = 500, $fRad = ACos(-1) / 180, $sTitle = "GDI+ Rotating Earth v1.7 coded by UEZ 2017" AutoItSetOption("GUIOnEventMode", 1) GDIPlus_RotatingEarth() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_RotatingEarth() $bExit = False $hGUI = GUICreate($sTitle, $iW, $iH) GUISetState(@SW_SHOW, $hGUI) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetInterpolationMode($hCanvas, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HALF) Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFF000000), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xFFF0F0F0), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 60, 16), _ $hImage_Earth = _GDIPlus_BitmapCreateFromMemory(_Earth()), _ $hImage_Galaxy = _GDIPlus_BitmapCreateFromMemory(_Galaxy()), _ $hImage_Clouds = _GDIPlus_BitmapCreateFromMemory(_Clouds()), _ $hImage_Moon = _GDIPlus_BitmapCreateFromMemory(_Moon()), _ $hImage_USSE = _GDIPlus_BitmapCreateFromMemory(_USSE()), _ $hMatrix = _GDIPlus_MatrixCreate(), $hMatrix2 = _GDIPlus_MatrixCreate(), _ $hPath = _GDIPlus_PathCreate(), $hPath2 = _GDIPlus_PathCreate(), _ $hPen = _GDIPlus_PenCreate(0xC0FFFFFF, 1) _GDIPlus_ImageRotateFlip($hImage_USSE, 4) Local $aDim = _GDIPlus_ImageGetDimension($hImage_Earth) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage_Earth) _GDIPlus_GraphicsDrawStringEx($hGfx, "Coded by UEZ 2017 ^^", $hFont_FPS, _GDIPlus_RectFCreate(0, $aDim[1] / 2 - 4, 120, 12), $hFormat_FPS, $hBrush_FPS) _GDIPlus_ImageDispose($hGfx) Local Const $hTexture_Earth = _GDIPlus_TextureCreate($hImage_Earth), $hTexture_Clouds = _GDIPlus_TextureCreate($hImage_Clouds) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Earth, "float", -200, "float", 0, "long", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Clouds, "float", -100, "float", 0, "long", 0) Local $iDiameter = $aDim[0] < $aDim[1] ? $aDim[0] : $aDim[1], _ $fDiameter2 = $iDiameter / 2, _ $fDX = ($iW - $iDiameter) / 2, $fDY = ($iH - $iDiameter) / 2 _GDIPlus_PathAddEllipse($hPath, $fDX - 1, $fDY - 1, $iDiameter + 2, $iDiameter + 2) Local Const $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, 0x02000008) _GDIPlus_PathBrushSetCenterPoint($hBrush, $fDX + $fDiameter2 + 1, $fDY + $fDiameter2 + 1) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xF8000000) _GDIPlus_PathBrushSetGammaCorrection($hBrush, 1) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.50, 0.50) _GDIPlus_PathAddEllipse($hPath2, -1, -1, 201, 201) Local Const $hBrush2 = _GDIPlus_PathBrushCreateFromPath($hPath2) _GDIPlus_PathBrushSetCenterColor($hBrush2, 0x0800000) _GDIPlus_PathBrushSetCenterPoint($hBrush2, 100, 100) _GDIPlus_PathBrushSetSurroundColor($hBrush2, 0xFF000000) _GDIPlus_PathBrushSetGammaCorrection($hBrush2, 1) _GDIPlus_PathBrushSetFocusScales($hBrush2, 0.50, 0.50) $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage_Moon) _GDIPlus_GraphicsFillEllipse($hGfx, -1, -1, 201, 201, $hBrush2) _GDIPlus_ImageDispose($hGfx) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") AdlibRegister("CalcFPS", 1000) Local $fTimer1, $fTimer2, $fScale, $fTmp, $fX, $fSin, $fZ, $fS, $zz, $z = 90, $iStep = 4 ;the higher $iStep is the faster the animation but lower the quality. Local $fPosX, $fPosY, $fSize, $fSpeed, $aMeteor[4] = [0, 10 + Random() * ($iH - 20), 5 + Random() * 10, 5 + Random() * 10] $fPosX = $iW + 60 $fPosY = Random() * ($iH - 100) + 50 $fSize = 0.5 + Random() * 2 $fSpeed = Random() * 3 + 1 $fTimer1 = TimerInit() $fTimer2 = TimerInit() Do DllCall($__g_hGDIPDll, "int", "GdipDrawImageRect", "handle", $hCanvas, "handle", $hImage_Galaxy, "float", 0, "float", 0, _ "float", $iW, "float", $iH) DllCall($__g_hGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hCanvas, "int", 4) If TimerDiff($fTimer1) > 10000 Then DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, "float", $aMeteor[0], "float", $aMeteor[1], _ "float", $aMeteor[0] + $aMeteor[2] * 3, "float", $aMeteor[1] + $aMeteor[3] * 3) $aMeteor[0] += $aMeteor[2] $aMeteor[1] += $aMeteor[3] If BitOR($aMeteor[0] > $iW, $aMeteor[1] > $iH, $aMeteor[0] < 0, $aMeteor[1] < 0) Then $aMeteor[0] = 0 $aMeteor[1] = Random() * ($iH * 0.75) $aMeteor[2] = 8 + Random() * 12 $aMeteor[3] = 7 + Random() * 10 $fTimer1 = TimerInit() EndIf EndIf If TimerDiff($fTimer2) > 30000 Then DllCall($__g_hGDIPDll, "int", "GdipDrawImageRect", "handle", $hCanvas, "handle", $hImage_USSE, "float", $fPosX, "float", $fPosY, _ "float", 50 * $fSize, "float", 12 * $fSize) $fPosX -= $fSpeed If $fPosX < -100 Then $fPosX = $iW + 30 $fPosY = Random() * ($iH - 100) + 50 $fSize = Random() * 2 $fSpeed = Random() * 3 + 1 $fTimer2 = TimerInit() EndIf EndIf $zz = $z * $fRad $fX = $iW2 - Cos($zz) * 345 $z -= 0.5 $fZ = Sin($zz) $fS = 100 - $fZ * 50 DllCall($__g_hGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hCanvas, "int", 1) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Earth, "float", 0.75, "float", 0, "long", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Clouds, "float", 1.25, "float", 0, "long", 0) If $fZ > 0 Then _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage_Moon, $fX, 110, $fS, $fS) For $i = 1 To $fDiameter2 Step $iStep $fScale = 1 + $i / $fDiameter2 DllCall($__g_hGDIPDll, "int", "GdipSetMatrixElements", "handle", $hMatrix, "float", 1.0, "float", 0.0, "float", 0.0, "float", 1.0, "float", 0.0, "float", 0.0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fDX + $fDiameter2, "float", $fDY + $fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipScaleMatrix", "handle", $hMatrix, "float", $fScale, "float", $fScale, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", -$fDiameter2, "float", -$fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipSetWorldTransform", "handle", $hCanvas, "handle", $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Earth, _ "float", $i, "float", $i, "float", $iDiameter -2 * $i, "float", $iDiameter - 2 * $i) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Clouds, _ "float", $i, "float", $i, "float", $iDiameter -2 * $i, "float", $iDiameter - 2 * $i) Next _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", $fDX, "float", $fDY, "float", $iDiameter, "float", $iDiameter) Else For $i = 1 To $fDiameter2 Step $iStep $fScale = 1 + $i / $fDiameter2 DllCall($__g_hGDIPDll, "int", "GdipSetMatrixElements", "handle", $hMatrix, "float", 1.0, "float", 0.0, "float", 0.0, "float", 1.0, "float", 0.0, "float", 0.0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fDX + $fDiameter2, "float", $fDY + $fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipScaleMatrix", "handle", $hMatrix, "float", $fScale, "float", $fScale, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", -$fDiameter2, "float", -$fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipSetWorldTransform", "handle", $hCanvas, "handle", $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Earth, _ "float", $i, "float", $i, "float", $iDiameter - 2 * $i, "float", $iDiameter - 2 * $i) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Clouds, _ "float", $i, "float", $i, "float", $iDiameter - 2 * $i, "float", $iDiameter - 2 * $i) Next _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", $fDX, "float", $fDY, "float", $iDiameter, "float", $iDiameter) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage_Moon, $fX, 110, $fS, $fS) EndIf _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS, $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) ;draw background message text _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) ;blit drawn bitmap to GUI $iFPS += 1 If $bExit Then ExitLoop Until False ;Not Sleep(10) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_PathDispose($hPath) _GDIPlus_PathDispose($hPath2) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_MatrixDispose($hMatrix2) _GDIPlus_ImageDispose($hImage_Earth) _GDIPlus_ImageDispose($hImage_Galaxy) _GDIPlus_ImageDispose($hImage_Clouds) _GDIPlus_ImageDispose($hImage_Moon) _GDIPlus_ImageDispose($hImage_USSE) _GDIPlus_BrushDispose($hTexture_Earth) _GDIPlus_BrushDispose($hTexture_Clouds) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) GUIDelete($hGUI) EndFunc ;==>GDIPlus_RotatingEarth Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2016-12-01 ... Download: Rotating Earth v1.7.au3 In line 92 you can modify the $iStep variable -> the higher $iStep is the faster the animation & lower the quality. So long...
    2 points
  2. Merged the SciTE 3.7.3 source into our version and several other changes and fixes to the supporting utilities. Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 24-2-2017 *** Merged the SciTE v 3.7.3 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.2 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.3 Added warning for #AutoIt3Wrapper_UseX64 in case #pragma(out,..)  is used. *** Updated Au3Stripper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed issue which sometimes was stripping a global const incorrectly     - 16.612.1119.2 Fixed /maxiterations parameter not recognised     - 16.612.1119.3 Fixed increased the max #Au3Stripper_Ignore_Variables to 500 and for #Au3Stripper_Ignore_Funcs to 200     - 16.612.1119.4 Fixed regression introduced in 16.612.1119.1 *** Updated SciTEConfig v17.224.935.0 (Jos)     - 16.306.1119.1 ... *** Updated Tidy v17.224.935.0 (Jos)     - 16.612.1119.1: Fixed Sort_Func function bug when the source contains a BOM. *** Updated CodewiZard v1.5.4.0 (Cyberyeye)     - Fix Icon Ressource Number for Messagebox Tab & ToolTip Tab     - Check/Fix missing includes using AutoIt3Wrapper_Add_Constants=y     - Added Opt("MustDeclareVars", 1) to fix undeclared variables     - Replaced msgbox() magic number by constant name     - Added GUISetIcon var (au3.ico)     - Removed unusefull old AutoIt3Wrapper directive *** Updated Abbreviations (mLipok)     - Updated au3abbrev.properties and helpfile page. -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the online documentation for an overview of all extra's you get with this installer.
    1 point
  3. You can store the file list to array, then copy and log at the same time with a progress bar.
    1 point
  4. This function decodes the NMEA position reports (e.g. type 1,2,3) from a ships AIS system and returns a 2D array with labels. ;~ nmea #include<array.au3> #include<file.au3> $sData = "100NtTwP00JVkTPFit5irww@2>`<" _ArrayDisplay(_NMEA_Position_Decoder($sData) , $sData) Func _NMEA_Position_Decoder($sEncString) $aAsc = StringToASCIIArray($sData) ; any ASCII over 119 is invalid , ascii 64-87 and 88-95 are not used for $i = 0 to ubound($aAsc) - 1 If $aAsc[$i] < 48 Then msgbox(0, $aAsc[$i] , $aAsc[$i] & " asc less than 48" & @LF & chrw($aAsc[$i]) & " is not a valid char" ) exit EndIF If $aAsc[$i] > 88 And $aAsc[$i] < 95 Then msgbox(0, $aAsc[$i] , $aAsc[$i] & " asc in invalid range 88-95") exit EndIF If $aAsc[$i] > 119 Then msgbox(0, $aAsc[$i] , $aAsc[$i] & " asc above 119") exit EndIF next ;~ _ArrayDisplay($aAsc , 'ASCII values') ;check ASCII conversion ;subtract 48 from each for $i = 0 to ubound($aAsc) - 1 $aAsc[$i] = number($aAsc[$i] - 48) $aAsc[$i] = $aAsc[$i] > 40 ? $aAsc[$i] - 8 : $aAsc[$i] ; if still over 40 subtract 8 Next ;~ _ArrayDisplay($aAsc, 'armored payload') ;check armored payload for $i = 0 to UBound($aAsc) - 1 If $aAsc[$i] = "0" Then $aAsc[$i] = "000000" If $aAsc[$i] = "1" Then $aAsc[$i] = "000001" If $aAsc[$i] = "2" Then $aAsc[$i] = "000010" If $aAsc[$i] = "3" Then $aAsc[$i] = "000011" If $aAsc[$i] = "4" Then $aAsc[$i] = "000100" If $aAsc[$i] = "5" Then $aAsc[$i] = "000101" If $aAsc[$i] = "6" Then $aAsc[$i] = "000110" If $aAsc[$i] = "7" Then $aAsc[$i] = "000111" If $aAsc[$i] = "8" Then $aAsc[$i] = "001000" If $aAsc[$i] = "9" Then $aAsc[$i] = "001001" If $aAsc[$i] = "10" Then $aAsc[$i] = "001010" If $aAsc[$i] = "11" Then $aAsc[$i] = "001011" If $aAsc[$i] = "12" Then $aAsc[$i] = "001100" If $aAsc[$i] = "13" Then $aAsc[$i] = "001101" If $aAsc[$i] = "14" Then $aAsc[$i] = "001110" If $aAsc[$i] = "15" Then $aAsc[$i] = "001111" If $aAsc[$i] = "16" Then $aAsc[$i] = "010000" If $aAsc[$i] = "17" Then $aAsc[$i] = "010001" If $aAsc[$i] = "18" Then $aAsc[$i] = "010010" If $aAsc[$i] = "19" Then $aAsc[$i] = "010011" If $aAsc[$i] = "20" Then $aAsc[$i] = "010100" If $aAsc[$i] = "21" Then $aAsc[$i] = "010101" If $aAsc[$i] = "22" Then $aAsc[$i] = "010110" If $aAsc[$i] = "23" Then $aAsc[$i] = "010111" If $aAsc[$i] = "24" Then $aAsc[$i] = "011000" If $aAsc[$i] = "25" Then $aAsc[$i] = "011001" If $aAsc[$i] = "26" Then $aAsc[$i] = "011010" If $aAsc[$i] = "27" Then $aAsc[$i] = "011011" If $aAsc[$i] = "28" Then $aAsc[$i] = "011100" If $aAsc[$i] = "29" Then $aAsc[$i] = "011101" If $aAsc[$i] = "30" Then $aAsc[$i] = "011110" If $aAsc[$i] = "31" Then $aAsc[$i] = "011111" If $aAsc[$i] = "32" Then $aAsc[$i] = "100000" If $aAsc[$i] = "33" Then $aAsc[$i] = "100001" If $aAsc[$i] = "34" Then $aAsc[$i] = "100010" If $aAsc[$i] = "35" Then $aAsc[$i] = "100011" If $aAsc[$i] = "36" Then $aAsc[$i] = "100100" If $aAsc[$i] = "37" Then $aAsc[$i] = "100101" If $aAsc[$i] = "38" Then $aAsc[$i] = "100110" If $aAsc[$i] = "39" Then $aAsc[$i] = "100111" If $aAsc[$i] = "40" Then $aAsc[$i] = "101000" If $aAsc[$i] = "41" Then $aAsc[$i] = "101001" If $aAsc[$i] = "42" Then $aAsc[$i] = "101010" If $aAsc[$i] = "43" Then $aAsc[$i] = "101011" If $aAsc[$i] = "44" Then $aAsc[$i] = "101100" If $aAsc[$i] = "45" Then $aAsc[$i] = "101101" If $aAsc[$i] = "46" Then $aAsc[$i] = "101110" If $aAsc[$i] = "47" Then $aAsc[$i] = "101111" If $aAsc[$i] = "48" Then $aAsc[$i] = "110000" If $aAsc[$i] = "49" Then $aAsc[$i] = "110001" If $aAsc[$i] = "50" Then $aAsc[$i] = "110010" If $aAsc[$i] = "51" Then $aAsc[$i] = "110011" If $aAsc[$i] = "52" Then $aAsc[$i] = "110100" If $aAsc[$i] = "53" Then $aAsc[$i] = "110101" If $aAsc[$i] = "54" Then $aAsc[$i] = "110110" If $aAsc[$i] = "55" Then $aAsc[$i] = "110111" If $aAsc[$i] = "56" Then $aAsc[$i] = "111000" If $aAsc[$i] = "57" Then $aAsc[$i] = "111001" If $aAsc[$i] = "58" Then $aAsc[$i] = "111010" If $aAsc[$i] = "59" Then $aAsc[$i] = "111001" If $aAsc[$i] = "60" Then $aAsc[$i] = "111100" If $aAsc[$i] = "61" Then $aAsc[$i] = "111101" If $aAsc[$i] = "62" Then $aAsc[$i] = "111110" If $aAsc[$i] = "63" Then $aAsc[$i] = "111111" next ;~ _ArrayDisplay($aAsc , 'bitstream') ;check bit stream $sBitStream = _ArrayToString($aAsc , "") $sMsgType = stringleft($sBitStream , 6) $sRptIndicator = stringmid($sBitStream , 7 , 2) $sMMSI = StringMid($sBitStream , 9 , 30) $sNavStatus = StringMid($sBitStream , 39 , 4) $sRateOfTurn = StringMid($sBitStream , 43 , 8) $sSpeedOverGrnd = StringMid($sBitStream , 51 , 10) $sPositionAccuracy = StringMid($sBitStream , 61 , 1) $slongitude = StringMid($sBitStream , 62 , 28) $slatitude = StringMid($sBitStream , 90 , 27) $sCourseOverGround = StringMid($sBitStream , 117 , 12) $sHeading = StringMid($sBitStream , 129 , 9) $sTimeStamp = StringMid($sBitStream , 138 , 6) $sManeuverIndicator = StringMid($sBitStream , 144 , 2) $sSpare = StringMid($sBitStream , 146 , 3) ;unused $sRAIMflag = StringMid($sBitStream , 149 , 1) $sRadioStatus = StringMid($sBitStream , 150 , 19) ;ending at 168 (or 28 blocks of 6) ;~ local $aBitStream[1][2] = [["message" , $sMsgType]] local $aBitStream[16][2] = [["msg_type" , _BinaryToDec($sMsgType)] , ["Repeat Ind" , _BinaryToDec($sRptIndicator)] , ["MMSI" , _BinaryToDec($sMMSI)] , ["Nav Status" , _BinaryToDec($sNavStatus)] , ["Turn Rate" , _BinaryToDec($sRateOfTurn) / 10] , _ ["Speed" , _BinaryToDec($sSpeedOverGrnd) / 10] , ["Accuracy" , _BinaryToDec($sPositionAccuracy)] , ["longitude" , $slongitude] , ["latitude" , $slatitude], ["Course" , _BinaryToDec($sCourseOverGround) / 10] , ["Heading" , _BinaryToDec($sHeading)] , ["TimeStamp" , _BinaryToDec($sTimeStamp)] , _ ["Maneuver Ind" , _BinaryToDec($sManeuverIndicator)] , ["Spare" , $sSpare] , ["RAIM flag" , _BinaryToDec($sRAIMflag)] , ["Radio Status" , _BinaryToDec($sRadioStatus)]] Return $aBitStream EndFunc ;NMEA Position Decoder ;~ ;-------------Binary To Dec----------------- Func _BinaryToDec($strBin) Local $Return Local $lngResult Local $intIndex If StringRegExp($strBin,'[0-1]') then $lngResult = 0 For $intIndex = StringLen($strBin) to 1 step -1 $strDigit = StringMid($strBin, $intIndex, 1) Select case $strDigit="0" ; do nothing case $strDigit="1" $lngResult = $lngResult + (2 ^ (StringLen($strBin)-$intIndex)) case else ; invalid binary digit, so the whole thing is invalid $lngResult = 0 $intIndex = 0 ; stop the loop EndSelect Next $Return = $lngResult Return $Return Else MsgBox(0,"Error","Wrong input, try again ...") Return EndIf EndFunc
    1 point
  5. You could simplify and optimize the code - something like this. for $i = 0 to UBound($aAsc) - 1     $aAsc[$i] = StringFormat('%06i', DecToBase($aAsc[$i], 2))     #cs     If $aAsc[$i] = "0" Then $aAsc[$i] = "000000"     If $aAsc[$i] = "1" Then $aAsc[$i] = "000001"     If $aAsc[$i] = "2" Then $aAsc[$i] = "000010"     If $aAsc[$i] = "3" Then $aAsc[$i] = "000011"     If $aAsc[$i] = "4" Then $aAsc[$i] = "000100"     If $aAsc[$i] = "5" Then $aAsc[$i] = "000101"     If $aAsc[$i] = "6" Then $aAsc[$i] = "000110"     If $aAsc[$i] = "7" Then $aAsc[$i] = "000111"     If $aAsc[$i] = "8" Then $aAsc[$i] = "001000"     If $aAsc[$i] = "9" Then $aAsc[$i] = "001001"     If $aAsc[$i] = "10" Then $aAsc[$i] = "001010"     If $aAsc[$i] = "11" Then $aAsc[$i] = "001011"     If $aAsc[$i] = "12" Then $aAsc[$i] = "001100"     If $aAsc[$i] = "13" Then $aAsc[$i] = "001101"     If $aAsc[$i] = "14" Then $aAsc[$i] = "001110"     If $aAsc[$i] = "15" Then $aAsc[$i] = "001111"     If $aAsc[$i] = "16" Then $aAsc[$i] = "010000"     If $aAsc[$i] = "17" Then $aAsc[$i] = "010001"     If $aAsc[$i] = "18" Then $aAsc[$i] = "010010"     If $aAsc[$i] = "19" Then $aAsc[$i] = "010011"     If $aAsc[$i] = "20" Then $aAsc[$i] = "010100"     If $aAsc[$i] = "21" Then $aAsc[$i] = "010101"     If $aAsc[$i] = "22" Then $aAsc[$i] = "010110"     If $aAsc[$i] = "23" Then $aAsc[$i] = "010111"     If $aAsc[$i] = "24" Then $aAsc[$i] = "011000"     If $aAsc[$i] = "25" Then $aAsc[$i] = "011001"     If $aAsc[$i] = "26" Then $aAsc[$i] = "011010"     If $aAsc[$i] = "27" Then $aAsc[$i] = "011011"     If $aAsc[$i] = "28" Then $aAsc[$i] = "011100"     If $aAsc[$i] = "29" Then $aAsc[$i] = "011101"     If $aAsc[$i] = "30" Then $aAsc[$i] = "011110"     If $aAsc[$i] = "31" Then $aAsc[$i] = "011111"     If $aAsc[$i] = "32" Then $aAsc[$i] = "100000"     If $aAsc[$i] = "33" Then $aAsc[$i] = "100001"     If $aAsc[$i] = "34" Then $aAsc[$i] = "100010"     If $aAsc[$i] = "35" Then $aAsc[$i] = "100011"     If $aAsc[$i] = "36" Then $aAsc[$i] = "100100"     If $aAsc[$i] = "37" Then $aAsc[$i] = "100101"     If $aAsc[$i] = "38" Then $aAsc[$i] = "100110"     If $aAsc[$i] = "39" Then $aAsc[$i] = "100111"     If $aAsc[$i] = "40" Then $aAsc[$i] = "101000"     If $aAsc[$i] = "41" Then $aAsc[$i] = "101001"     If $aAsc[$i] = "42" Then $aAsc[$i] = "101010"     If $aAsc[$i] = "43" Then $aAsc[$i] = "101011"     If $aAsc[$i] = "44" Then $aAsc[$i] = "101100"     If $aAsc[$i] = "45" Then $aAsc[$i] = "101101"     If $aAsc[$i] = "46" Then $aAsc[$i] = "101110"     If $aAsc[$i] = "47" Then $aAsc[$i] = "101111"     If $aAsc[$i] = "48" Then $aAsc[$i] = "110000"     If $aAsc[$i] = "49" Then $aAsc[$i] = "110001"     If $aAsc[$i] = "50" Then $aAsc[$i] = "110010"     If $aAsc[$i] = "51" Then $aAsc[$i] = "110011"     If $aAsc[$i] = "52" Then $aAsc[$i] = "110100"     If $aAsc[$i] = "53" Then $aAsc[$i] = "110101"     If $aAsc[$i] = "54" Then $aAsc[$i] = "110110"     If $aAsc[$i] = "55" Then $aAsc[$i] = "110111"     If $aAsc[$i] = "56" Then $aAsc[$i] = "111000"     If $aAsc[$i] = "57" Then $aAsc[$i] = "111001"     If $aAsc[$i] = "58" Then $aAsc[$i] = "111010"     If $aAsc[$i] = "59" Then $aAsc[$i] = "111001"     If $aAsc[$i] = "60" Then $aAsc[$i] = "111100"     If $aAsc[$i] = "61" Then $aAsc[$i] = "111101"     If $aAsc[$i] = "62" Then $aAsc[$i] = "111110"     If $aAsc[$i] = "63" Then $aAsc[$i] = "111111"     #ce next Obviously you need to include the missing function: Func DecToBase($iInt, $iBase) ; for bases 2 to 9 Local $iRem, $sRet = '' While $iInt > $iBase -1 $iRem = Mod($iInt, $iBase) $sRet = $iRem & $sRet $iInt = Int(($iInt - $iRem) /$iBase) WEnd Return $iInt & $sRet EndFunc ;==> DecToBase I always find it interesting to see miscellaneous real world applications of encoded binary information. Thanks for sharing.
    1 point
  6. @NewKid4 , Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos
    1 point
  7. You do it this way: ; LegacyIAccessible object Local $pLegacyIAccessible, $oLegacyIAccessible $oUIAutomationElement.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pLegacyIAccessible ) $oLegacyIAccessible = ObjCreateInterface( $pLegacyIAccessible, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oLegacyIAccessible ) Then Return ConsoleWrite( "$oLegacyIAccessible ERR" & @CRLF ) ConsoleWrite( "$oLegacyIAccessible OK" & @CRLF ) ; IAccessible object Local $pIAccessible, $oIAccessible $oLegacyIAccessible.GetIAccessible( $pIAccessible ) $oIAccessible = ObjCreateInterface( $pIAccessible, $sIID_IAccessible, $dtagIAccessible ) If Not IsObj( $oIAccessible ) Then Return ConsoleWrite( "$oIAccessible ERR" & @CRLF ) ConsoleWrite( "$oIAccessible OK" & @CRLF ) Here is an example with Chrome: Open Chrome Enter this in address bar: chrome://accessibility Click off in this line: Global accessibility mode: off off should switch to on: Global accessibility mode: on Run this code: #include "CUIAutomation2.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Chrome window handle Local $hChrome = WinGetHandle( "[CLASS:Chrome_WidgetWin_1]", "" ) ; Chrome If Not $hChrome Then Return ConsoleWrite( "$hChrome ERR" & @CRLF ) ConsoleWrite( "$hChrome OK" & @CRLF ) ; UI Automation object Local $oUIAutomation $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; UI Automation element Local $pChrome, $oChrome $oUIAutomation.ElementFromHandle( $hChrome, $pChrome ) $oChrome = ObjCreateInterface( $pChrome, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oChrome ) Then Return ConsoleWrite( "$oChrome ERR" & @CRLF ) ConsoleWrite( "$oChrome OK" & @CRLF ) ; LegacyIAccessible object Local $pLegacyIAccessible, $oLegacyIAccessible $oChrome.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pLegacyIAccessible ) $oLegacyIAccessible = ObjCreateInterface( $pLegacyIAccessible, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oLegacyIAccessible ) Then Return ConsoleWrite( "$oLegacyIAccessible ERR" & @CRLF ) ConsoleWrite( "$oLegacyIAccessible OK" & @CRLF ) ; IAccessible object Local $pIAccessible, $oIAccessible $oLegacyIAccessible.GetIAccessible( $pIAccessible ) $oIAccessible = ObjCreateInterface( $pIAccessible, $sIID_IAccessible, $dtagIAccessible ) If Not IsObj( $oIAccessible ) Then Return ConsoleWrite( "$oIAccessible ERR" & @CRLF ) ConsoleWrite( "$oIAccessible OK" & @CRLF ) EndFunc Output in SciTE: $hChrome OK $oUIAutomation OK $oChrome OK $oLegacyIAccessible OK $oIAccessible OK The code works for Chrome. But there is no guarantee that it works for other windows/controls. If it doesn't work, there is probably not much to do.
    1 point
  8. @benners Like your layout, very nice, however I noticed it uses static information and also if you only select 2 of a Patient Block and then re-run it, it will redo the first 2 users on that list even though they have already been assigned. Personally I would have used the attached, although could be cleaned up, basically LastSkysChance would only have to update the spreadsheet and the Ini without recompiling the script again. Anyway Just my 2cents Clinic.ini Clinic.v1.au3
    1 point
  9. The old version created the recipient with the session object and tried to resolve it. When successful it was added to the mails object. The new version creates the recipient with the mail object and tries to resolve it. When unsuccessful the recipient is removed again. I don't know why the old version did'nt work in some rare cases, but the new seems to be more reliable
    1 point
  10. Try making a new topic for you issue instead of bumping a thread that was resolved 2 years ago. You will get much better results.
    1 point
  11. SmOke_N

    Require a Serial

    Which is a reason it's not an option for my deployments. Would be nice to "require" specific things to run "your" software on "their" systems. But the truth is, we're slaves to the client side system setup.
    1 point
×
×
  • Create New...