supplierdeeply

Dryos Basic scripting

  • 64 Replies
  • 25605 Views
*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: Dryos Basic scripting
« Reply #50 on: 25 / August / 2010, 17:57:31 »
Advertisements
Tested OpLog (OPERATION LOG) on SD4000.

extend.m
Code: (c) [Select]
private sub Initialize()
    UI.CreatePublic()
    a=LCDMsg_Create()
    LCDMsg_SetStr(a,"OpLog")
    System.Create()
    OpLog.Create()
    OpLog.WriteToSD("A/oplog.txt",1)
    LCDMsg_SetStr(a,"done")
end sub

oplog.txt
Code: [Select]
#OPERATION LOG
#VERSION=0104
#COMMENT=
[OCCUR]
PRODUCT_ID= 31F7
TIME= 2010:08:25 23:49:40
DATALOST= 0
[START]
00000120,0x80000905,0,0x00410000,0x00000002,0x0000C000
00000120,0x80000909,0,0x00410000,0x00000002,0x0000C000
00000120,0x80000C00,0,0x00410000,0x00000002,0x0000C000
00000120,0xC0000700,0,0x00410000,0x00000002,0x0000C000
[DATA]
00000150,0x00000601,0,0x00410000,0x00000002,0x00008000
00001660,0x80001003,0,0x00410000,0x00000402,0x00008000
00001700,0x80000008,0,0x00410000,0x00000442,0x00008000
00001820,0x00000008,0,0x00410000,0x00000002,0x00008000
00001820,0x00001003,0,0x00410000,0x00000002,0x00008000

I'm not shure what this actually means.

*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: Dryos Basic scripting
« Reply #51 on: 25 / August / 2010, 19:41:16 »
I've added Canon_Basic/Reference.

i've played around with LCDMsg. Maybe somebody could test Canon_Basic/Scripts/HelloWorld2 if LCDMsg_ChangeColor(a,3) Text Color setting is camera specific. If it's not camera specific, maybe scripts should do white text output.
« Last Edit: 25 / August / 2010, 20:38:19 by pixeldoc2000 »

*

Offline reyalp

  • ******
  • 11583
Re: Dryos Basic scripting
« Reply #52 on: 25 / August / 2010, 21:46:27 »
I've added Canon_Basic/Reference.

i've played around with LCDMsg. Maybe somebody could test Canon_Basic/Scripts/HelloWorld2 if LCDMsg_ChangeColor(a,3) Text Color setting is camera specific. If it's not camera specific, maybe scripts should do white text output.
FWIW, this could equally be called Event Procedure reference. The problem is, there's a LOT of them, and they vary between OSes, OS version and camera.

It's not clear to me that we can usefully document them in wiki format. See also my list for A540. I was going to use this as the start of an event proc reference page, but I couldn't find any way to organize it that would fit all the permutations. It really seems more suited to a database of some kind. Edit: an alternative would be to give each one it's own page.

It's still a good idea to document the most common/interesting/useful ones, like LCDMsg, GetLogToFile etc.

All of these are also accessible from lua using the native call interface. e.g. http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Romlog or CHDK itself with ExecuteEventProcedure
Don't forget what the H stands for.

Re: Dryos Basic scripting
« Reply #53 on: 26 / August / 2010, 09:02:54 »
Hallo reyalp,
I've also generate a List of possible Canon Basic Functions based on my a610 (VxWorks).

Some differences:
Code: [Select]
Movie.HiCompressionRateMode
Movie.NormalCompressionRateMode
SS_PrintState
CreateLanguageMenu
DeleteLanguageMenu
ShowLanguageNameList
SaveLanguageNameList
RegisterLanguageName
LanguageMenu
SetUSBToDCPMode
RefreshUSBMode
SetUSBToPTPMode
DisableNotificationPTP
EnableNotificationPTP
NotifyConnectPictBridge
NotifyDisconnectPictBridge
InitializeDCPClassFunctions
TerminateDCPClassFunctions
CreateVcomUart
DeleteVcomUart
COMFACHK_StartService
COMFACHK_StopService
COMFACHK_StartSendData
COMFACHK_StartSendLargeData
COMFACHK_GetTransferTime
COMFACHK_SetSendDataSize
DPSitcher
StopDPService
StartDPService
CreateDPSwitchTask
StartCameraLog
ShowCameraLog
ShowCameraLogInfo
StopCameraLog
PutsCameraLogEvent
NewTaskShell
EngineDriver.Delete
TerminateDpofUI
StartPrintOrderMenu
StartTransferOrderMenu
InstallRecMenu
InstallPlayMenu
InstallSetupMenu
InstallMyCameraMenu
IsCalledStopEVF
PTPRspnd.ShowRemoteStg
EnableOBClampField
DisableOBClampField
taskcreate_ImageSensorTask
VirtualImageTimeOut
StoptDtConfirmMenu
StoptDtExecuteMenu
PTM_SaveCustomSetting
StartDpDpofPrinting
StartDpDpofStopReconfirm
StartDpsIdPhotoMenu
GetAdChValue
GetAdVBattBottom
BeepTest
SetZoomActuatorLimitAmpere
MoveIrisActuatorFullOpenEvent
MoveIrisActuatorFullCloseEvent
EnableIrisActuatorEvent
DisableIrisActuatorEvent
ResetIrisActuatorEvent
SetIrisGainRegisterEvent
MoveIrisWithAvAndSpeedWithoutBacklashEvent
MoveFocusLensWithPositionWithoutBacklash
CdsDrv.Create
CdsDrv.Create
CdsDrv.SetCdsCalibration
CdsDrv.ReloadCdsTable
CdsDrv.GetCdsOBForAdjustment
CdsDrv.SetCdsOBForAdjustment
CdsDrv.GetCdsGainForAdjustment
CdsDrv.SetCdsGainForAdjustment
CdsDrv.SetCdsGainApexForAdjustment
CdsDrv.SetCdsNormalMode
CdsDrv.SetCdsAdjustmentMode
CdsDrv.Delete
MaxTv
TgTool.Create
TgTool.Create
TgTool.Delete
TgTool.SetSubNumber
TgTool.GetSubNumber
TgTool.SetTgSubPosition
TgTool.GetTgCurrentSubPosition
TgTool.SetPhase
TgTool.ChangePhaseHi
TgTool.ChangePhaseLo
TgTool.GetPhase
TgTool.SetDuty
TgTool.ChangeDutyHi
TgTool.ChangeDutyLo
TgTool.GetDuty
TgTool.SetPhaseADLogical
TgTool.GetPhaseADLogical
TgTool.SetHDriverbility
TgTool.GetHDriverbility
TgTool.SetStbMode
TgTool.GetStbMode
TgTool.SetRegisterImage
TgTool.GetRegisterImage
TgTool.StartSmoothSubNumber
TgTool.StopSmoothSubNumber
TgTool.ImgTest.SetPhase
TgTool.ImgTest.GetPhase
TgTool.ImgTest.SetDuty
TgTool.ImgTest.GetDuty
TgTool.ImgTest.SetADDegree
TgTool.ImgTest.GetADDegree
TgTool.ImgTest.SetDriverbility
TgTool.ImgTest.GetDriverbility
PTPRspnd.StartUpPTPFrameworkClient
PTPRspnd.ShutDownPTPFrameworkClient
PTPRspnd.EnableStorage
PTPRspnd.EnableGetTreeInfo
PTPRspnd.ResetTable
SetNormalAdjTableWritingMode
SetFastAdjTableWritingMode
EraseFRomShadingArea
WRITESHADINGDATATOFROM
LoadDataFromAdjTableBin
LoadParamDataFromAdjTableBin
StartSoundPlay
FreeBufferForSoundRec
StartSoundRecord
TerminateSoundRec
InitializeSoundRec
GetZoomLensCurrent
PrePro.GetDarkSetUp
PrePro.SetDarkSetUp
PrePro.GetDarkSubSetUp
PrePro.SetDarkSubSetUp
PrePro.LiveImage
PrePro.Capture
PrePro.MemoryCrw
PrePro.HybridCrw

I can't post the full sorted list, because it's too long for this board.

CHDKLover


Re: Dryos Basic scripting
« Reply #54 on: 26 / August / 2010, 18:18:10 »
I've got Hello World working on both my DryOS cameras (S90 and G9) but it doesn't run at all on the VxWorks cameras (G7 and Ixus 70). Any ideas on what's wrong?

I think the documentation is important and would happily add if I actually knew anything :-)  A repository of examples would be good too - I have the impression that people have done lots of things that aren't easy for the rest of us - did somebody say they'd done a Capture?

*

Offline reyalp

  • ******
  • 11583
Re: Dryos Basic scripting
« Reply #55 on: 26 / August / 2010, 19:06:22 »
I've got Hello World working on both my DryOS cameras (S90 and G9) but it doesn't run at all on the VxWorks cameras (G7 and Ixus 70). Any ideas on what's wrong?
As mentioned in this thread, LCDMsg does not exist on (most ?) vxworks cams.

@CHDKLover
You can post on the wiki like I did if you want :)
Don't forget what the H stands for.

Re: Dryos Basic scripting
« Reply #56 on: 26 / August / 2010, 19:22:21 »
OK that I understand, but I can't get any script, even just a BeepDrive, to run. It's not like there's a syntax error and shutdown, the scripts just don't run.

I suppose I could add the syntax for BeepDrive() - I know that pretty well by now :-)  Sadly it really is about all I know but I suppose one's got to start somewhere...

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: Dryos Basic scripting
« Reply #57 on: 27 / August / 2010, 01:14:34 »
I've got Hello World working on both my DryOS cameras (S90 and G9) but it doesn't run at all on the VxWorks cameras (G7 and Ixus 70). Any ideas on what's wrong?
As mentioned in this thread, LCDMsg does not exist on (most ?) vxworks cams.
They do exist on later VxWorks cameras, Ixus 70 in particular. It is the *.Create functions that are missing. So, instead of UI.CreatePublic() and System.Create() use UI_RegistDebugEventProc() & SystemEventInit(), respectively.


*

Offline reyalp

  • ******
  • 11583
Re: Dryos Basic scripting
« Reply #58 on: 27 / August / 2010, 02:18:34 »

They do exist on later VxWorks cameras, Ixus 70 in particular. It is the *.Create functions that are missing. So, instead of UI.CreatePublic() and System.Create() use UI_RegistDebugEventProc() & SystemEventInit(), respectively.
Good to know. At least some of those older names used for vxworks are carried over into dryos as aliases for the new ones, e.g. on D10, the same function is called for both UI_RegistDebugEventProc and UI.Create
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 11583
Re: Dryos Basic scripting
« Reply #59 on: 12 / September / 2010, 23:01:38 »
function syntax
Code: [Select]
private function twoplus(arg)
twoplus = arg + 2
end function

...
if twoplus(2) = 4 then
LCDMsg_SetStr(b, "twoplus(2) = 4")
end if
...
It appears that "function" may not be fully functional. In my testing, the function keyword must be lower case (unlike other keywords), and "exit function" is not recognized.

you can return a value from a SUB by assigning to the name, so function would be redundant.

D10 /  DryOS r31
Don't forget what the H stands for.

 

Related Topics