Skip to content

Prajuab Riabroy's Blog

Survey Application – GNSS – UAV – Programing – Python – Dart&Flutter – Rust

Menu
  • Home
  • About Us
  • Survey Application
    • Surveyor Pocket Tools
    • Traverse Pro
    • XSection Plot
    • Geoid Height Pro
    • Spot Fire
    • โปรแกรมงานสำรวจสำหรับเครื่องคิดเลข Casio fx-5800P
    • โปรแกรมงานสำรวจสำหรับเครื่องคิดเลข Casio fx-9860G II SD
  • Download
  • Privacy Policy
Menu

ก้าวไปอีกหนึ่งก้าวกับ XSection Plot

Posted on 12/11/2017

สวมวิญญานใหม่ด้วย PySide2

หลังจากผมคอมไพล์ XSection Plot ใหม่ด้วยสภาวะแวดล้อมพัฒนาของ Qt5 platform ด้วย PySide2 ผมเปลี่ยนลิขสิทธิ์ของโปรแกรมเดิมที่กำกวมออกมาฟรีสมบูรณ์แบบเหมือนกันกับ Surveyor Pocket Tools สามารถนำไปทำซ้ำแจกจ่ายได้ตามอัธยาศัย แต่ห้ามดัดแปลง ห้ามนำไปจำหน่ายหรือให้เช่า

XSection Plot
Copyright (C) Prajuab Riabroy. All Rights Reserved.

XSection Plot is free for use in any environment, including but not necessarily limited to: personal, academic, commercial, government, business, non-profit, and for-profit. "Free" in the preceding sentence means that there is no cost or charge associated with the installation and use of XSection Plot. 
Permission is hereby granted, free of charge, to any person obtaining a copy of this software (the "Software"), to use the Software without restriction, including the rights to use, copy, publish, and distribute the Software, and to permit persons to whom the Software is furnished to do so.

You may not modify, adapt, rent, lease, loan, sell, or create derivative works based upon the Software or any part thereof. 

The above copyright notice and this permission notice shall be included in all copies of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

แก้ไข bugs

นอกจากย้ายโค้ดมาใช้ PySide2 แล้ว ผมเลยถือโอกาสแก้บั๊กเล็กน้อยไปหลายอย่าง เช่น

  • เวลาคลิกขวาเพื่อเรียกเมนูในช่องป้อนข้อมูล โปรแกรมจะ terminate ทันที
  • ใน Section Layout ตรง Horizontal Grid เมื่อปรับ Distance from CL to left ไปแล้ว โปรแกรมไม่จำค่าใหม่
  • อื่นๆอีกเล็กน้อยประมาณสิบกว่าอย่าง

คอมไพล์และสร้างไฟล์ execute binary ด้วย PyInstaller

ตอนนี้โปรแกรมสนับสนุนทั้ง 32 บิตและ 64 บิต ผมใช้ PyCharm เป็นทูลส์ในการพัฒนา และเลือกได้ว่าจะใช้ 32 บิตหรือ 64 บิต เมื่อโปรแกรม stable แล้ว ก็จะสร้าง execute binary file ด้วย PyInstaller ตามสภาวะแวดล้อม ต้องทำสองครั้ง ครั้งแรก 32 บิตและครั้งที่สอง 64 บิต โดยแต่ละครั้งจะได้ไฟล์ exe, pyd, dll รวมถึงไลบรารีของไพทอนที่เราเรียกใช้ และที่สำคัญคือไลบรารีของ PySide2

ทำไฟล์ Setup ด้วย Inno Setup

ไฟล์ที่ได้จาก PyInstaller ทั้งหมด ผมจะนำมาสร้างไฟล์ Setup ด้วย Inno Setup เพื่อนเก่าที่ใช้กันมานมนาน มีดีเพียงพอที่จะสร้างไฟล์ Setup ได้ง่ายๆ มี options ให้เลือกพอสมควร สุดท้ายจะได้ไฟล์ Setup ที่เป็น Execute file ไฟล์เดียวพร้อมจะนำไปอัพโหลดให้ผู้ใช้นำไปใช้งานได้

ทดสอบโปรแกรมด้วยแบบรูปตัดตามยาว

ผมจะลองทดสอบโปรแกรมจากข้อมูล ความจริง XSection Plot คือโปรแกรมสร้างหรือช่วยเขียนรูปตัดตามขวาง แต่ยังพอเอามาประยุกต์ใช้กับ Long Profile ได้ แต่ไฟล์ข้อมูลส่วนใหญ่จะมีข้อมูลเพียงหนึ่ง Section เท่านั้นจะเริ่มจากไฟล์ข้อมูลของ Existing Ground Section ก่อนครับ ข้อมูลดังในกรอบข้างล่าง สามารถ copy ไป paste ในโปรแกรม text file editor เช่น Notepad ได้จากนั้น save ตั้ง extension เป็น gxml (ตัวอย่างผมตั้งชื่อว่า lake-road.gxml)

<root version="1.0">
  <!--Generated by XSection Plot-->
  <!--This data file is Existing ground section-->
  <Header>
    <AppName>XSection Plot</AppName>
    <Developer>Prajuab Riabroy</Developer>
    <Version>4.1.512</Version>
    <SectionType>Ground</SectionType>
    <DateCreated>2017-11-18 18:57:18.700532</DateCreated>
  </Header>
  <ProjectInfo>
    <ProjectName>Cantonment Lake</ProjectName>
    <ClientName></ClientName>
    <ContractorName></ContractorName>
    <DrawingTitle></DrawingTitle>
    <DrawnName></DrawnName>
    <ApprovedName></ApprovedName>
    <ClientApprovedName></ClientApprovedName>
    <CheckedName></CheckedName>
    <SurveyorName></SurveyorName>
    <SurveyedDate></SurveyedDate>
    <DrawingNo></DrawingNo>
    <SheetNo></SheetNo>
    <DrawingDate></DrawingDate>
    <Revision></Revision>
    <UseLocaleLanguage>False</UseLocaleLanguage>
    <MapTexts>
      <MapText Label="Client" Locale="เจ้าของโครงการ"/>
      <MapText Label="Contractor" Locale="ผู้รับจ้าง"/>
      <MapText Label="Drawn" Locale="เขียน"/>
      <MapText Label="Design" Locale="ออกแบบ"/>
      <MapText Label="Surveyor" Locale="ผู้สำรวจ"/>
      <MapText Label="Surveyed Date" Locale="วันที่สำรวจ"/>
      <MapText Label="Checked" Locale="ตรวจสอบ"/>
      <MapText Label="Approved" Locale="อนุมัติ"/>
      <MapText Label="Client Approved" Locale="ผู้คุมงานอนุมัติ"/>
      <MapText Label="Drawing No." Locale="แบบเลขที่"/>
      <MapText Label="Plotted Date" Locale="แบบวันที่"/>
      <MapText Label="Project" Locale="โครงการ"/>
      <MapText Label="Drawing Title" Locale="แผนที่แสดง"/>
      <MapText Label="Sheet No." Locale="แบบเลขที่"/>
      <MapText Label="Scale" Locale="มาตราส่วน"/>
      <MapText Label="Vertical" Locale="ทางดิ่ง"/>
      <MapText Label="Horizontal" Locale="ทางราบ"/>
      <MapText Label="Vertical Scale" Locale="มาตราส่วนทางดิ่ง"/>
      <MapText Label="Horizontal Scale" Locale="มาตราส่วนทางราบ"/>
      <MapText Label="Legend" Locale="สัญลักษณ์"/>
      <MapText Label="Note" Locale="หมายเหตุ"/>
      <MapText Label="Geodetic Information" Locale="ข้อมูลระบบพิกัด"/>
      <MapText Label="No." Locale="ครั้งที่"/>
      <MapText Label="Amendments" Locale="ความเห็น"/>
      <MapText Label="By" Locale="โดย"/>
      <MapText Label="Date" Locale="วันที่"/>
      <MapText Label="Revision" Locale="ครั้งที่แก้ไข"/>
    </MapTexts>
  </ProjectInfo>
  <SectionOptions>
    <VerticalScale>500.0</VerticalScale>
    <HorizontalScale>1000.0</HorizontalScale>
    <HozGridSpace>10.0</HozGridSpace>
    <VertGridSpace>2.0</VertGridSpace>
    <GridLineType>0</GridLineType>
    <CalcIntersection>True</CalcIntersection>
    <CalcArea>True</CalcArea>
    <TrimTypical>False</TrimTypical>
    <NumDecimalElev>3</NumDecimalElev>
    <NumDecimalDist>3</NumDecimalDist>
    <UseIntervalText>True</UseIntervalText>
    <IntervalDist>10.0</IntervalDist>
    <PrefixText>MSL</PrefixText>
    <PostfixText>MSL</PostfixText>
    <UsePostPrefix>1</UsePostPrefix>
    <UseOffsetElevFormat>2</UseOffsetElevFormat>
    <CalcPlotAreaCut>True</CalcPlotAreaCut>
    <CalcPlotAreaFill>True</CalcPlotAreaFill>
    <NumVertCLLeft>1</NumVertCLLeft>
    <NumVertCLRight>90</NumVertCLRight>
    <NumHozTopBottom>10</NumHozTopBottom>
    <LeftSideText>LT.</LeftSideText>
    <RightSideText>RT.</RightSideText>
    <StationText>Km.</StationText>
    <SelectedTBlock>2</SelectedTBlock>
    <NumSectionRows>1</NumSectionRows>
    <NumSectionColumns>1</NumSectionColumns>
    <SurveyType>0</SurveyType>
    <PlotTBlock>True</PlotTBlock>
    <SwapLeftAndRight>False</SwapLeftAndRight>
  </SectionOptions>
  <PageSetup>
    <Size>Custom</Size>
    <Width>930.0</Width>
    <Height>200.0</Height>
  </PageSetup>
  <Sections>
    <NumSections>1</NumSections>
    <Section Name="0+000">
      <XPositionOnPaper>47.2</XPositionOnPaper>
      <YPositionOnPaper>11.7</YPositionOnPaper>
      <TopGridElev>14.0</TopGridElev>
      <NumPoints>29</NumPoints>
      <Points>
        <Point Elevation="5.741" Offset="0.0"/>
        <Point Elevation="5.802" Offset="29.5"/>
        <Point Elevation="4.186" Offset="44.5"/>
        <Point Elevation="1.955" Offset="66.778"/>
        <Point Elevation="1.04" Offset="84.5"/>
        <Point Elevation="1.017" Offset="114.5"/>
        <Point Elevation="0.895" Offset="144.5"/>
        <Point Elevation="1.162" Offset="174.5"/>
        <Point Elevation="1.012" Offset="234.5"/>
        <Point Elevation="1.145" Offset="264.5"/>
        <Point Elevation="1.16" Offset="316.642"/>
        <Point Elevation="1.317" Offset="339.5"/>
        <Point Elevation="1.619" Offset="386.947"/>
        <Point Elevation="1.518" Offset="409.5"/>
        <Point Elevation="1.311" Offset="454.5"/>
        <Point Elevation="1.261" Offset="484.5"/>
        <Point Elevation="1.065" Offset="544.5"/>
        <Point Elevation="1.113" Offset="574.5"/>
        <Point Elevation="2.799" Offset="634.5"/>
        <Point Elevation="1.664" Offset="664.5"/>
        <Point Elevation="1.442" Offset="694.5"/>
        <Point Elevation="1.108" Offset="724.5"/>
        <Point Elevation="1.099" Offset="754.5"/>
        <Point Elevation="1.854" Offset="784.5"/>
        <Point Elevation="1.549" Offset="814.5"/>
        <Point Elevation="8.402" Offset="844.5"/>
        <Point Elevation="8.555" Offset="866.792"/>
        <Point Elevation="8.68" Offset="889.5"/>
        <Point Elevation="8.58" Offset="916.9"/>
      </Points>
    </Section>
  </Sections>
</root>

ต่อไปเป็น Typical Section ขนาดเล็กกว่า ผมตั้งชื่อว่า lake-typical.txml

<root version="1.0">
  <!--Generated by XSection Plot-->
  <!--This data file is Typical section-->
  <Header>
    <AppName>XSection Plot</AppName>
    <Developer>Prajuab Riabroy</Developer>
    <Version>4.1.512</Version>
    <SectionType>Typical</SectionType>
    <DateCreated>2017-11-18 18:57:26.689154</DateCreated>
  </Header>
  <Sections>
    <NumSections>1</NumSections>
    <Section Name="">
      <XPositionOnPaper>47.2</XPositionOnPaper>
      <YPositionOnPaper>11.7</YPositionOnPaper>
      <TopGridElev>0.0</TopGridElev>
      <NumPoints>4</NumPoints>
      <Points>
        <Point Elevation="5.0" Offset="36.944"/>
        <Point Elevation="5.0" Offset="695.0"/>
        <Point Elevation="8.4" Offset="845.0"/>
        <Point Elevation="8.44" Offset="900.0"/>
      </Points>
    </Section>
  </Sections>
</root>

เปิดไฟล์ข้อมูลทดสอบบน XSection Plot

จากนั้นนำสองไฟล์มาเปิดด้วย XSection Plot เวลาเปิดไฟล์ให้เลือกรูปแบบของไฟล์ด้วยจะได้เปิดง่าย  มีชื่อ extension ตามลำดับดังนี้ gxml, txml

จะได้ข้อมูลปรากฎขึ้นบนโปรแกรมดังนี้

ตั้งหน้ากระดาษ (Page Setup)

ผมลองเลือกใช้หน้ากระดาษที่ไม่มาตรฐานเพื่อให้ฟิตกับขนาดรูปตัดตามยาว ยาว 940 มม. และกว้าง 200 มม.

ตั้งค่า (Settings)

ผมตั้งสเกลทางราบเป็น 1:1000 และสเกลทางดิ่ง 1:250 อย่างอื่นดูรูปด้านล่าง

จัดวางรูปตัดบนกระดาษ (Section Layout)

จะเห็นกระดาษขนาด 200 มม. x 940 มม. แล้วเลือกพารามิเตอร์ดังรูปด้านล่าง

ดูรูปตัด (Section Viewer)

จะเห็นรูปตัดตามยาวที่ประกอบไปด้วย Existing Ground และ Typical

ลองซูมดู ก็ได้แบบ drawing มาพอถูๆไถๆ ที่สามารถนำไปเขียนเพิ่มเติมได้ในโปรแกรมด้านเขียนแบบทั้งหลายเช่น Autocad, Microstation, Draftsight

Save to DXF

จัดเก็บไฟล์ในรูป Autocad DXF เพื่อสามารถนำไปเปิดในโปรแกรมอื่นได้

เปิดไฟล์แบบรูปตัดตามยาว

ผมใช้ Microstation เปิดแบบรูปตัดตามยาวได้ผลลัพธ์ดังนี้และพร้อมจะนำแบบไปเขียนเพิ่มเติมตามความต้องการ

ครับคงอีกไม่นานก็จะคงจะปล่อยเวอร์ชั่นเสถียรให้สามารถดาวน์โหลดได้ พบกันใหม่ครับ

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Sep    

Blog Stats

There was an issue retrieving stats. Please try again later.

Recent Posts

  • เร็วแรงทะลุนรกกับ POCUT (POint Cloud UTils)
  • อัพเดทแอพ “SurveyStar LDP Thailand” เพื่อรับกับยกร่างมาตรฐาน “TH-LDP”
  • ออกแอพใหม่ SurveyStar Traverse Pro สืบสานงานคำนวณวงรอบ ตอนที่ 2
  • ออกแอพใหม่ SurveyStar Traverse Pro สืบสานงานคำนวณวงรอบ ตอนที่ 1
  • โปรแกรมอรรถประโยชน์ Pocut (POint Cloud Utils)
  • โปรแกรมแปลงไฟล์แคดข้ามระบบพิกัด (Drawing Transformer)
  • มาตรฐานระบบพิกัดแผนที่แบบแอลดีพีของประเทศไทยสำหรับงานวิศวกรรมและการก่อสร้าง (Thailand Low Distortion Map Coordinate System for Engineering and Construction)
  • ประสบการณ์ใช้งาน Kimi K3 Code เขมือบแบบสยอง
  • สร้างแพลตฟอร์มดู Point Cloud บนเว็บด้วย Potree + CesiumJS — เรื่องเล่าจากสนามบินอู่ตะเภา
  • เมื่อวิศวกรสำรวจคำนวณเรื่องน้ำ – วิเคราะห์ระบบระบายน้ำบริเวณ RESA
  • แนะนำหนังสือ “จีออเดซี” ที่ยอดเยี่ยมของดร.พุทธิพล
  • ESPrtk ทำให้ ESP32 ใช้ไม่ได้? วิธีกู้คืน
  • กรณีศึกษา – คืนชีพ SDL30 ปี 2000 ด้วย ESP32 และแอพทำเอง SDL30 Collector
  • DIY RTK Base Station (survey-grade) รุ่น V3.21 ด้วย Raspberry Pi 2B + UM980 เมื่อคุณปู่กลับมาเป็นฮีโร่ ตอนที่ 4
  • รีวิวกูปรี (CoPre2) โปรแกรมประมวลผลไลดาร์จากค่าย CHCNav
  • DIY RTK Base Station (survey-grade) รุ่น V3.2 ด้วย Orange Pi 3 Zero + UM980 ตอนที่ 3
  • DIY RTK Base Station (survey-grade) รุ่น V3 ด้วย Orange Pi 3 Zero + UM980 ตอนที่ 2
  • เส้นทางและไทม์ไลน์ของใบรับรองความรู้ความชำนาญในการประกอบอาชีพวิศวกรรม(สำรวจ)ระดับวิศวกรวิชาชีพ
  • มัดแหนมรวมสามโปรแกรมไปใช้บนสโตร์ Snap ฝั่งลีนุกซ์
  • ปัดฝุ่น Traverse Pro เพิ่มรายละเอียดรายการคำนวณใหม่แบบแนวนอน (Landscape) และธีมมืด
  • DIY RTK Base Station (Survey-Grade) ด้วยชิป UM980 และบอร์ด ESP32 ตอนที่ 1
  • สร้าง NTRIP Caster ด้วย BNC บนคลาวด์แบบ DIY สำหรับ RTK Base Station ใช้ CHCNav P5
  • จับ AI มาไตรกรีฬา สร้างตัวติดตั้ง Snap สำหรับ Surveyor Pocket Tools กับประเด็นแฝงเร้นความเป็นส่วนตัวของผู้ใช้
  • ทดสอบรีด QGIS แบบโหดสัสด้วยชุดข้อมูล Open Building V3 โพลีกอน 74 ล้านหลัง
  • เมื่อ AI เป็นพิษชักจูงผู้ใช้ด้วยข้อมูลผิดๆ

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 122 other subscribers

Archives

  • October 2026
  • September 2026
  • August 2026
  • July 2026
  • May 2026
  • April 2026
  • March 2026
  • January 2026
  • December 2025
  • November 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • July 2024
  • May 2024
  • April 2024
  • January 2024
  • November 2023
  • October 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • March 2023
  • February 2023
  • January 2023
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • May 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • May 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • July 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • January 2018
  • November 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • August 2016
  • November 2015
  • March 2015
  • August 2014
  • March 2014
  • January 2014
  • December 2013
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • August 2011
  • April 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • June 2010
  • April 2010
  • March 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009

Recent Comments

  • priabroy on ออกแอพใหม่ SurveyStar Traverse Pro สืบสานงานคำนวณวงรอบ ตอนที่ 1
  • Konexana Yomleuangsa on ออกแอพใหม่ SurveyStar Traverse Pro สืบสานงานคำนวณวงรอบ ตอนที่ 1
  • เฟือง เถา on DIY RTK Base Station (survey-grade) รุ่น V3.21 ด้วย Raspberry Pi 2B + UM980 เมื่อคุณปู่กลับมาเป็นฮีโร่ ตอนที่ 4
  • priabroy on DIY RTK Base Station (survey-grade) รุ่น V3.21 ด้วย Raspberry Pi 2B + UM980 เมื่อคุณปู่กลับมาเป็นฮีโร่ ตอนที่ 4
  • ตรันฟองนาม on DIY RTK Base Station (survey-grade) รุ่น V3.21 ด้วย Raspberry Pi 2B + UM980 เมื่อคุณปู่กลับมาเป็นฮีโร่ ตอนที่ 4
©2026 Prajuab Riabroy's Blog | Design: Newspaperly WordPress Theme