CHBTheDoctor Posted January 28, 2009 Report Posted January 28, 2009 Hi Pete, is FSUIPC.ini a regular Windows INI-file ? To be more detailed, do you use GetPrivateProfileString() and WritePrivateProfileString() for access, or do you manage the file yourself ? Im asking because I think about writing a small application to make FSUIPC.ini editing a little easier (for me, and if you allow it, for everyone else). I have some INI-file handling classes that I could use, but these rely on GetPrivateProfileString() and WritePrivateProfileString(). Seeing my rapidly growing FSUIPC.ini I´m really tempted to make my life easier. Regards, Christian
Pete Dowson Posted January 28, 2009 Report Posted January 28, 2009 is FSUIPC.ini a regular Windows INI-file ? To be more detailed, do you use GetPrivateProfileString() and WritePrivateProfileString() for access Yes and yes. Im asking because I think about writing a small application to make FSUIPC.ini editing a little easier (for me, and if you allow it, for everyone else). That would be excellent! The Macro (.mcro) files are also to the same standard with the same access methods. I have some INI-file handling classes that I could use, but these rely on GetPrivateProfileString() and WritePrivateProfileString(). You should be okay. I'd certainly be interested in seeing the results! Regards Pete
CHBTheDoctor Posted January 28, 2009 Author Report Posted January 28, 2009 Fine :D I'm thinking about a treeview representation, maybe a bit of reordering with renumbering, and most interesting: scannning of selected aircraft.cfg for "title=...." entries. I'm a repaint packrat, and building the [profile. .....] sections is a pain. I'm normally out of programming for private matters, I´m programming C++ for a living, so at home I prefer to SimFly or whatever... :mrgreen: I'll try something, will take a little time and I'll show you when it's presentable. Regards, Christian
Pete Dowson Posted January 28, 2009 Report Posted January 28, 2009 I'm thinking about a treeview representation, maybe a bit of reordering with renumbering, and most interesting: scannning of selected aircraft.cfg for "title=...." entries. I'm a repaint packrat, and building the [profile. .....] sections is a pain. Why do you need to rebuild Profile sections anyway? Surely it is either only a metter of assigning the profile you need when you load the aircraft, or -- better if the re-paints all have a common part of the aircraft title (like "B737") -- using the ShortaircraftNameOk=Substring facility, and declaring the B737 short name in the Profile section, once only. Tell me what you don't understand about this, as I find your "pain" comment worrying. it should be dead easy now with the Profile facilities. That's why I spent so long sorting it out! :-( Regards Pete
CHBTheDoctor Posted January 29, 2009 Author Report Posted January 29, 2009 Ahhh, I understand. The ShortaircraftNameOk=Substring facility is still in place even for the profiles :oops: So THIS: [Profile.B377 Stratocruiser] 0 =Boeing 377 Pregnant Guppy, Paint 1 1 =Boeing Stratocruiser, PAN AM 2 =Boeing Stratocruiser, BOAC 3 =Boeing Stratocruiser, AOA 4 =Boeing Stratocruiser, NWA 5 =Boeing Stratocruiser, QEA 6 =Boeing Stratocruiser, Transocean 7 =Boeing Stratocruiser, UNITED AIR LINES 8 =Boeing Stratocruiser, TWA 9 =Boeing Stratocruiser, USAF 10 =Boeing Stratocruiser, USAF1 11 =Boeing Stratocruiser, MATS 12 =Boeing Stratocruiser, CATHAY 13 =Boeing Stratocruiser, USCG 14 =Boeing Stratocruiser, PAN AM 1 15 =Boeing Stratocruiser, Early BOAC will be equivalent to [Profile.B377 Stratocruiser] ShortaircraftNameOk =Boeing Stratocruiser 0 =Boeing 377 Pregnant Guppy, Paint 1 this ? Anyway, my TwinProp profile looks like this, so some Aircraft.cfg scanning wouldn't be a total waste of time :) [Profile.Twin Prop] 0 =Douglas DC-3A UAL 1 =Douglas DC-3 Lufthansa D-CADE 2 =Douglas DC-3 Bavaria Airways D-CADE 3 =Douglas C-47 RAF KG374 4 =Douglas C-47 Operation Vittels 5 =Douglas C-47 6 =Douglas C-47 Sugarpuss 7 =Douglas C-47 RAF KG444 8 =Douglas C-47_BBMF 9 =MAAM-SIM Douglas C-47A Delivery 10 =MAAM-SIM Douglas C-47A RAAF A65-34 11 =Douglas C-47A 224046 12 =MAAM-SIM Douglas C-47B CNAC 13 =MAAM-SIM Douglas C-47B 'Hump' 14 =Douglas DC-3 BEA 15 =MAAM-SIM Douglas DC-3 BPB 16 =R4D NATS BM 17 =R4D NATS CC 18 =Douglas XC-47C 19 =Douglas DC-3 20 =Douglas DC-3 Paint1 21 =Douglas DC-3 Paint2 22 =Douglas DC-3 Paint3 23 =Douglas DC-3 Paint4 24 =Douglas DC-3 Paint5 25 =Douglas DC-3 Warbirds 26 =Douglas DC-3 N.A.C 27 =Douglas DC-3 N.A.C - PIWAKAWAKA 28 =Douglas DC-3 AEROCOR 29 =Douglas DC-3 SPANZ 30 =Douglas DC-3 N.A.C Freighter 31 =Douglas DC-3 LC47 - Metal 32 =Douglas DC-3 LC47 - 17221 33 =Douglas DC-3 LC47 - 0008 34 =Douglas DC-3 LC47 - TA 05 35 =Douglas DC-3 WB 36 =Douglas DC-3 Viewmaster - Metal 37 =Douglas DC-3 Passenger - Metal 38 =Douglas DC-3 Freighter - Metal 39 =Douglas DC-3 N.A.C Fieldair 40 =Douglas DC-3 United 41 =Douglas DC-3 Passenger - Metal SDT 42 =Douglas DC-3 Paint Alaska ANG 43 =Douglas DC-3 Lufthansa (frühes Farbschema) 44 =Douglas DC-3 Lufthansa (spätes Farbschema) 45 =Beech Baron 58 Paint1 46 =Beech Baron 58 Paint2 47 =Beech Baron 58 Paint3 48 =Beech Baron 58 w G1000 49 =Beech Baron 58 50 =Heinkel He219 A-0/R2 51 =Heinkel He219 A-0/R6 52 =Heinkel He219 A-2/R1 TH 53 =Heinkel He219 A-2/R1 HK 54 =Heinkel He219 A-5 CZE 55 =Heinkel He219 A-7/R2 CL RAF In any case I'll try to concentrate on the parts which are not dealt with in FSUIPC itself and there on the boring things like copying, rearranging, building insane lists of repaints :mrgreen: It's just for convenience and fun, but I will listen carefully for your remarks, because in the end it should be usefull. Regards, Christian
Pete Dowson Posted January 29, 2009 Report Posted January 29, 2009 Ahhh, I understand.The ShortaircraftNameOk=Substring facility is still in place even for the profiles Yes. didn't I say that in the documentation? will be equivalent to [Profile.B377 Stratocruiser] ShortaircraftNameOk =Boeing Stratocruiser 0 =Boeing 377 Pregnant Guppy, Paint 1 No, no, no! The "ShortAircraftnameOK=Substring" parameter is still as it was, a parameter in the [General] section which sets the mode where FSUIPC will match aircraft names by the longest substring it can find! The only change the Profile system provides is the listing of those aircraft names, whether full, short or substring, in a [Profile] section, instead of being used directly in the [buttons], [Axes], [Keys] and [JoystickCalibration] section names. You are assuming that EVERYTHING has changed, when it hasn't. Profiles are merely an indirect way of doing Aircraft Specific assignments, making it all more convenient. Anyway, my TwinProp profile looks like this, so some Aircraft.cfg scanning wouldn't be a total waste of time :) [Profile.Twin Prop] 0 =Douglas DC-3A UAL ... There's that 0= line again. Are you editing that in manually? I've double-checked my code now and still cannot see that being generated, nor working. I think the line will be ignored. Anyway, with "ShortAircraftNameOK=Sunstring" set (in General), that long list could be shortened to: [Profile.Twin Prop] 1 =Douglas DC-3 2 =Douglas C-47 3 =R4D NATS 4 =Douglas XC-47C 5 =Beech Baron 58 6 =Heinkel He219 Regards Pete
CHBTheDoctor Posted January 29, 2009 Author Report Posted January 29, 2009 The ShortaircraftNameOk=Substring facility is still in place even for the profiles Yes. didn't I say that in the documentation? To be honest, I can´t say, but it is not really necessary, it's global. I misunderstood it´s meaning. Silly me :oops: Yes it´s perfectly clear now... ...and easy of course. I´m thinking overcomplicated some times. 0=.... line is easy to explain: Yes I edit the file manually and when I´m handling INI-files in my own projects I´m used to count from zero on (it´s bits and bytes of PLC communication and within my files it´s much easier to do "machine-centric counting", on the user interface it´s all nice and friendly counting from one). Thanks, this will help me a lot. Regards, Christian
CHBTheDoctor Posted January 29, 2009 Author Report Posted January 29, 2009 Hi Pete, I took a look at the numbering problem. I renamed FSUIPC4.ini and let it be regenerated from scratch. Then I put in some axis and buttons and keypresses. These are (numbered) sections that where generated: [JoyNames] AutoAssignLetters=No 0=Saitek X52 Flight Controller 1=Saitek Pro Gamer Command Unit 2=Saitek Pro Flight Rudder Pedals 3=CH Throttle Quadrant USB [Buttons] ButtonRepeat=20,10 1=P3,11,C66224,0 2=P3,10,C66531,0 [LuaFiles] 1=display vals 2=liar 3=reverse [Axes] 0=0X,256,D,1,0,0,0 1=0Y,256,D,2,0,0,0 2=3U,256,D,4,0,0,0 [Keys] 1=220,8,66224,0 2=123,8,66531,0 So it´s a mix of numbering starting from zero and others from one. Don´t get me wrong, this is no problem for me, but I think this made me assume that zero would be ok in the [Keys] and [buttons] section as well. BTW: how do you handle comments at the end of a line like 56 =P0,9,C66080,0 ;Gear 57 =P0,8,C66079,0 58 =P0,11,C65758,0 ;Flaps 59 =P0,10,C65759,0 60 =P0,13,C66243,0 ;Cowl Flaps 61 =P0,12,C66244,0 ;Comment this ? I happily used them (and it did no harm) but today I tried it with a INI-value at work and found, looking at the string that was read in with the debugger, that such a line is completely read, including the ";"separated part. If a line starts with ";" it´s of course completely ignored when reading INI-values. Regards, Christian
Pete Dowson Posted January 29, 2009 Report Posted January 29, 2009 So it´s a mix of numbering starting from zero and others from one. Don´t get me wrong, this is no problem for me, but I think this made me assume that zero would be ok in the [Keys] and [buttons] section as well. I think they are. And omitted numbers are handled too. but not in the [Profile...] sections -- no omissions, start at 1. Sorry, the rules are stiffer for Profiles because they need to be accessed more frequently. All the others are loaded once and converted to tables internally, only reloaded when explicitly requested. BTW: how do you handle comments at the end of a line like Only the Buttons section handles comments (well, probably Macros too) because it is only there that I expected things might get complex enough that folks would want to comment. The "handling" used to be easy, because the last filed was always numeric so any non-numeric stopped the conversion -- though I remember when commas in the comment would mess things up if a comma was missing in the parameter. However, these days I have to retain comments and their positions eve when re-writing the section (for ease of programming, including numbered lines with comments only as in "n = ;xxxx...."), so I have to scan for the ";" and store away the comment when i'm building the tables. Regards Pete
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now