Jump to content

Christian

Members
  • Content Count

    13
  • Joined

  • Last visited

  • Days Won

    2

Christian last won the day on May 29

Christian had the most liked content!

About Christian

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Christian

    Treeview

    Hi, i'm currently working on a media project which is caused by its nature partially browser based. 95% of it are made in lazarus and 5% (probably less) is running in a browser. Since i am not quite familiar with javascript it takes longer to achieve everything using js, so my second attempt is to use sms instead. The application itself is a analyzer for ATSC 3 and it streams the tv signal as DASH transmission via an embedded web server. It also offers tuner related informations and statistics in json format. What i try to achieve is to load the json response from the server and to assemble a tree view with the data i received. The idea is to have the same tree structure like in the original server application). Does somebody have a suggestion how to create such a tree view display? I honestly did not thought that it is easier to play a video back, than building a tree with data Christian OPERATING MODE "2" FREQUENCY (HZ) "599000000" BANDWIDTH (HZ) "6000000" INTERMEDIATE FREQUENCY (HZ) "6000000" RSSI (dBm) "-59" MASTER LOCK "1" SNR (dB * 100) "1500" SIGNAL QUALITY (%) "30" BOOTSTRAP DONE "1" BOOTSTRAP EASINFO "0" BOOTSTRAP MAJOR "0" BOOTSTRAP MINOR "0" BOOTSTRAP PREAMBLE STRUCTURE "5" BOOTSTRAP BSR COEFFICIENT "2" LLS VALID BITMASK "1" PLP VALID BITMASK "1" L1B LOCK "1" L1D LOCK "1" BASEBAND FRAMES "66832" BASEBAND FRAME RF ERRORS "0" BASEBAND FRAME CC ERRORS "1" BASEBAND FRAME UNCORRECTED RF ERRORS "96" BER "0" OFFSET (HZ) "24" PACKET ERROR "0" L1B_FRAME_LENGTH_MODE "1" L1B_NUM_SUBFRAMES "1" L1B_PREAMBLE_NUM_SYMBOLS "2" L1B_L1_DETAIL_FEC_TYPE "1" L1B_FIRST_SUB_FFT_SIZE "0" L1B_FIRST_SUB_NUM_OFDM_SYMBOLS "71" L1B_FIRST_SUB_REDUCED_CARRIERS "0" L1B_FIRST_SUB_SCATTERED_PILOT_PATTERN "2" L1B_FIRST_SUB_SCATTERED_PILOT_BOOST "0" L1B_FIRST_SUB_SBS_FIRST "1" L1B_FIRST_SUB_SBS_LAST "1" REQUESTED PLP#0 "0" L1D_GUARD_INTERVAL (PLP#0) "0" L1D_PLP_MOD (PLP#0) "0" L1D_PLP_COD (PLP#0) "0" L1D_FREQUENCY_INTERLEAVER (PLP#0) "0" L1D_PLP_TI_MODE (PLP#0) "0" PLP0_LAYER_TYPE "0" PLP1_LAYER_TYPE "0" PLP2_LAYER_TYPE "0" PLP3_LAYER_TYPE "0"
  2. Christian

    TIniFile Question

    omg, sorry i suppose i found the problem. ini := TIniFile.Create; ini.loadFromUrl('res/apps.ini', procedure() begin writeln(ini.ReadString('0','Url','')) end); ini.free Ini.free is executed before the value has been loaded. Sorry for the circumstances.
  3. Christian

    TIniFile Question

    If i create a copy of the Systems.IniFile Unit and go through it, then i see that it crashes here: procedure TCustomInifile.Clear; begin if FData.Count > 0 then FData.Clear(); end; Christian
  4. Christian

    TIniFile Question

    Thanks for the quick response. I do get "Uncaught TypeError: Cannot read property 'length' of undefined [line #1198]" when i try to read the context to self.FromString(Sender.ResponseText); type TIniFileHelper = class helper for TIniFile procedure LoadFromUrl(aUrl:String;Callback: TProcedureRef = nil); end; procedure TIniFileHelper.LoadFromUrl(AUrl:String; Callback:TProcedureRef); var mRequest: TW3HttpRequest; begin mRequest := TW3HttpRequest.Create; mRequest.OnDataReady := procedure (Sender:TW3HttpRequest) begin showmessage(inttostr(Sender.ResponseText.length)); ParseContent(Sender.ResponseText); if assigned(Callback) then Callback; TW3Dispatch.SetTimeout(Sender.free,100); end; mRequest.Get(aUrl); end; Showmessage shows the correct size of the Response string. ParseContent fails and the rest is not executed afterwards.
  5. Christian

    TIniFile Question

    Hi, i have question concerning tinifile and how to load the content. My code looks like this: type TIniFileHelper = class helper for TIniFile procedure LoadFromUrl(const AUrl:String); end; procedure TIniFileHelper.LoadFromUrl(const AUrl:String); var mRequest: TW3HttpRequest; begin mRequest := TW3HttpRequest.Create; mRequest.OnDataReady:=procedure (Sender:TW3HttpRequest) begin self.FromString(Sender.ResponseText); TW3Dispatch.SetTimeout(Sender.free,100); end; mRequest.Get(AUrl); end; and i do something like this: ini := tinifile.create; ini.LoadFromUrl('res/apps.ini') If i put a showmessage( into the onDataReady i see the content, but it does not seem to be loaded into the ini class. Christian
  6. Christian

    Providing Credentials to a Frame

    Hi, is there a way to set username and password to a W3IFrameHTMLElement, or how should i solve the following issue: I want to open a website running in a W3IFrameHTMLElement and this page requests credentials which i want to enter automatically. Christian
  7. Christian

    TW3Chart and TFloatArray issue

    I mean this: procedure TSeriesData.Refresh; begin asm (@Self.FHandle).values=((@FValues)); end; asm (@Self.FHandle).labels=((@FLabels)); end; asm (@Self.FHandle).colors=((@FColors)); end; //asm (@Self.FHandle).x=((@FX)); end; end; So Serie.Data.X.Add does not update the chart component, because Refresh ignores the X values. If you know it, it is not a big deal to work around this issue. I just wonder why this has been disabled. Christian
  8. Christian

    TW3Chart and TFloatArray issue

    Hi, today i thought i try to get in touch with the Tw3Chart. To do so i made a small example: const // Stefan-Boltzmann constant, and has the value 5.67 x 10-8(Wm-2K -4) cBoltzman = 0.0000000567; // 30% of the short wave radiation that hits the earth is bounced back into space. cAlbedo = 0.3; // A solar constant is the amount of radiation given off by the sun. // Over a long period of time this may change, but for this model we can // assume that it will stay at 1370. S is expressed in W / m2 or Watt per square meter cSolarConstant = 1370; procedure TForm1.InitializeForm; var carbon, atmosphere: single; Serie: TSeries; begin inherited; // this is a good place to initialize components W3Chart1.Title.Text := 'Simple Climate Model'; W3Chart1.Axes.Left.Title.Text := 'Temperature in °C'; W3Chart1.Axes.Bottom.Title.Text := 'Atmospherical absorbation'; Serie := TLineSeries.Create; W3Chart1.AddSeries(Serie); carbon := 0; while carbon < 1 do begin atmosphere := Power(((1 - cAlbedo) * cSolarConstant) / (4 * cBoltzman * (1 - carbon / 2)), 0.25) - 273; Serie.Data.Values.Add(atmosphere); Serie.Data.X.Add(Carbon); carbon := carbon + 0.1; end; Serie.RefreshData; end; The formula is based on this lecture: https://www.e-education.psu.edu/meteo469/node/198 Is there a reason why X is not updated and excluded in TSeriesData.Refresh? This work around does run okay, but has another annoying issue. It seem to be that you can not use 0.1 steps for the x axis. procedure TForm1.InitializeForm; var carbon, atmosphere: single; Serie: TSeries; X, Y: TFloatArray; begin inherited; // this is a good place to initialize components W3Chart1.Title.Text := 'Simple Climate Model'; W3Chart1.Axes.Left.Title.Text := 'Temperature in °C'; W3Chart1.Axes.Bottom.Title.Text := 'Atmospherical absorbation'; W3Chart1.Legend.Visible := false; Serie := TLineSeries.Create; W3Chart1.AddSeries(Serie); carbon := 0; while carbon < 1 do begin atmosphere := Power(((1 - cAlbedo) * cSolarConstant) / (4 * cBoltzman * (1 - carbon / 2)), 0.25) - 273; Y.Add(atmosphere); X.Add(Carbon*10);//somehow 0..1 does not work? carbon := carbon + 0.1; end; Serie.Data.X := X; Serie.Data.Values := Y; end; Christian
  9. Christian

    [3.0.0.12] IDE related issues

    The second exception is more annoying. If you create a new Project: Start a new Project -> Canvas Project -> Main->File->Save as.. then rename your Unit1.pas into e.h. UMain.pas and select in the combo box under Project Manager Unit1.pas. You will get an exception like this:
  10. Christian

    [3.0.0.12] IDE related issues

    Hi, i did not found the problems posted here, so i hope i'm the first one who does list them. If you change the Theme under Tools->IDE Settings->Appearance more than one time it crashes:
  11. Christian

    Pixelbuffer

    The gameplay is simple. Just click on a part of the map and your player moves to this position. By pressing the space bar you place a bomb (max. 10 bombs can be placed at a time). If you are in Range of the bomb you activate the timer by right mouse click. Aim is to bomb the builders and the building. I skip 2 frames in order to have at least 22fps. The performance can be increased by minimizing the for loops in the render procedure and the access to the arrays. It was just a proof of concept how to paint and i'm happy to figured it out. Christian
  12. Christian

    Pixelbuffer

    Hi, to be honest i already answered myself yesterday while studying the RTL code. It took a while to fiddle out how to deal with TW3ImageData. The result is attached to this post. Feel free to do whatever you want with this code. The render routine is extremely slow, but this is also the case in the original. You could drastically speed it up by replacing the tons of for loops. The gameplay is easy: Move your little buddy with the mouse and place bombs at the buildings while the constructors are assembling them. They will run away if they do not work. The right mouse button will activate the timer if you are nearby. Don't blow up yourself if you are in range. Before you ask: It is a remake of an very old java game. blowit.zip
  13. Christian

    Pixelbuffer

    Hi, i'm currently try to get familiar with Smart and to do so i started creating a small game in order to get familiar with the language. The game itself is based on an old tech demo i made and uses voxel graphics and porting it from Delphi 7 worked surprisingly well. I only got stuck in rendering the output. My Backbuffer looks like this: TBackBuffer = array[0..WorldHeight - 1, 0..WorldWidth - 1] of TColor; and i would like to paint the scene with the proper aspect ratio to the canvas as fast as possible. Under Windows i would use StretchDIBits for this. If everything works fine, i post the source.
×