Visit Captain Sim web site  
  Welcome, Guest. Please Login or Register

 

Page Index Toggle Pages: 1 [2] 3  Send TopicPrint
 25 SDK (Read 8807 times)
Captain Sim
CS Team
*
Offline



Posts: 4215
Joined: Nov 7th, 2005
Re: SDK
Reply #15 - May 11th, 2020 at 3:40pm
Print Post  
Kees wrote on May 9th, 2020 at 10:04pm:
is there a picture with the MCP's buttons and switches available?

Thanks, updated https://drive.google.com/open?id=1enMcTxYPyCwTxiRmpKTmLZPce7PDShdp
  
Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #16 - May 11th, 2020 at 10:09pm
Print Post  
Great! Thanks
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
write to LVar of an IND
Reply #17 - May 16th, 2020 at 3:57pm
Print Post  
Why is it not possible to write to the LVAR L:G03_001_IND? The reason I would like this to do is, that I have an own MCP. This is programmed with SIOC from Open Cockpits. When I turn the knob of my speed on my MCP, open cockpits reads (via a LUA script) the value of G03_001_IND, changes it and writes is to a free offset in FSUIPC.
Now I would like to write the value of that offset to G03_001_IND in a LUA script with:
ipc.writeLvar("L:G03_001_IND", value)

But that doesn't anything.

Kind regards,
Kees
  
Back to top
 
IP Logged
 
EY
CS Team
*
Offline



Posts: 347
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: write to LVar of an IND
Reply #18 - May 16th, 2020 at 9:15pm
Print Post  
Kees wrote on May 16th, 2020 at 3:57pm:
Why is it not possible to write to the LVAR L:G03_001_IND?
Kees


Kees, you can not set G03_001_IND, because the aircraft systems (MCP, electrical) refresh it continuously.
To change the value of this particular indicator of IAS/Mach, you can use the (L:klid) variable with the values:
1703010  //IAS/Mach Knob Increase
-1703010 //IAS/Mach Knob Decrease
1703110  //IAS/Mach Selector Button
  

Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #19 - May 16th, 2020 at 9:30pm
Print Post  
This is indeed the way I have programmed it now. However, this doesn't work as smoothly as the way I expressed in my question. That is why I would still like it if I could write directly to the IND. I think that with me, many who also used the another company first and now switch to Captain Sim, would certainly appreciate this opportunity.

Kees
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #20 - May 16th, 2020 at 9:37pm
Print Post  
In short, what is the difference between turning the knob to change the IND and writing the Lvar of the IND directly to change it.
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #21 - May 17th, 2020 at 7:44pm
Print Post  
I cannot find the lights (LT1 and LT2) of the airplane lightning panel.

These Lvars don't seem to exist:
O20_001_LT1 (+ LT2)
O20_002_LT1 (+ LT2)
O20_003_LT1 (+ LT2)
O20_004_LT1 (+ LT2)

I want to read them so I can light the corresponding lights in my homepit.
  
Back to top
 
IP Logged
 
EY
CS Team
*
Offline



Posts: 347
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: SDK
Reply #22 - May 18th, 2020 at 2:35pm
Print Post  
Kees wrote on May 17th, 2020 at 7:44pm:
I cannot find the lights (LT1 and LT2) of the airplane lightning panel.

These Lvars don't seem to exist:
O20_001_LT1 (+ LT2)
O20_002_LT1 (+ LT2)
O20_003_LT1 (+ LT2)
O20_004_LT1 (+ LT2)


Use
O20_001_BUT
O20_002_BUT
O20_003_BUT
O20_004_BUT
  

Back to top
IP Logged
 
EY
CS Team
*
Offline



Posts: 347
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: SDK
Reply #23 - May 18th, 2020 at 2:44pm
Print Post  
Kees wrote on May 16th, 2020 at 9:37pm:
In short, what is the difference between turning the knob to change the IND and writing the Lvar of the IND directly to change it.


The status of the indicator depends on several conditions, not only from the knob.
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity.

I don't think this is the expected result
  

Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #24 - May 22nd, 2020 at 9:57am
Print Post  
EY wrote on May 18th, 2020 at 2:35pm:
Use
O20_001_BUT
O20_002_BUT
O20_003_BUT
O20_004_BUT


Thanks, this did the trick
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #25 - May 22nd, 2020 at 10:01am
Print Post  
EY wrote on May 18th, 2020 at 2:44pm:
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity.


Well, i can program my hompeit to do blank the displays in case that occurs  Smiley.
So writing to the IND's still stays on my wishlist, because turning the knobs in my own made MCP would give a more realistic feeling then the workaround that I have mad now.  Wink
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #26 - Jun 3rd, 2020 at 8:45pm
Print Post  
Kees wrote on May 22nd, 2020 at 10:01am:
EY wrote on May 18th, 2020 at 2:44pm:
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity. 

Well, i can program my hompeit to do blank the displays in case that occurs  Smiley.
So writing to the IND's still stays on my wishlist, because turning the knobs in my own made MCP would give a more realistic feeling then the workaround that I have mad now. 


No reaction? I would like my homepit as realistic as possible. With no possibility, writing to the IND's, the encoders do absolutely not feel as real. There will be not much people who shall write to the IND's, but I am for sure that all former another company pilots who have their own homepit, would greatly appreciate this possibility. This their chance top swicth over to P3d in combination with the CS767 and will not be stuck with the old FSX with the old another company.

I hope you will reconsider this option.
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4215
Joined: Nov 7th, 2005
Re: SDK
Reply #27 - Jun 4th, 2020 at 2:55pm
Print Post  
Kees wrote on Jun 3rd, 2020 at 8:45pm:
I hope you will reconsider this option.

Well, you are asking us to re-build the entire 767 code from scratch (which is years of work) just to make it fit better one particular homepit needs.
The answer is no, sorry.
  
Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #28 - Jun 4th, 2020 at 3:18pm
Print Post  
Thanks for your reply. Of course I do not know how the code of the 767 is written. But it looks to me (as a amateur programmer) that you don”t have To rewrite the entirely code just to be able to write to a few var”s.
And it is not just one person with a 767 homepit, but some more. As I already mentioned, much another company simmers with a homepit are now stuck to the FSX and see now the chance to jump over to 64 bits p3d. Good chance that that will be the CS767 because all the other functions needed for a homepit are already in your model. This is the only thing that I really mis.

Kind regards,
Kees
  
Back to top
 
IP Logged
 
flyingjayaraj
New Member
Offline



Posts: 3
Joined: Aug 3rd, 2020
767 - SDK - Scripting Issues FSX / Mobiflight
Reply #29 - Aug 17th, 2020 at 7:43pm
Print Post  
Hello everone, i am stuck at a point where i am unable to program my MCP, due to limited knowledge in coding and deciphering the 757/767 SDK.

CS-767 & 757 - FSX - FSUIPC - Mobiflight

At present, i have used the Lvar for the MCP airspeed written it to a free offset and displaying it on the 7-segment successfully, below is the code that i used.

-----------------------------------------------------
while true do
        n=ipc.readLvar("L:MCP_IAS_Disp")
        ipc.writeUD(0x66C8,n)
        ipc.sleep(100)
        end
------------------------------------------------------------

To increase or decrease the airspeed value - i followed the instructions from the SDK

I created a lua file - CS757SPEEDDEC.LUA

ipc.writeLvar(“L:klid",-1703010)

and another - CS757SPEEDINC.LUA

ipc.writeLvar(“L:klid", 1703010)

These lua files now show up in my FSUIPC list.

Now the next step is to add an entry to auto-run the lua, i have made that entry too.

[Auto]
1=Lua CS757SPEEDINC
2=Lua CS757SPEEDDEC

Now in the macro file, what is the entry that i have to have ?
i tried different entry but none seem to work.

Could anyone please share some script that has worked ? or the steps, assigning the ID to a variable has got me stuck for weeks now, been searching for the forms but unable to find any definite answer.  Cry
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send TopicPrint
 
  « Board Index ‹ Board  ^Top