Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP

Size: px
Start display at page:

Download "Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP"

Transcription

1 Hak cipta dan penggunaan kembali: Lisensi ini mengizinkan setiap orang untuk menggubah, memperbaiki, dan membuat ciptaan turunan bukan untuk kepentingan komersial, selama anda mencantumkan nama penulis dan melisensikan ciptaan turunan dengan syarat yang serupa dengan ciptaan asli. Copyright and reuse: This license lets you remix, tweak, and build upon work non-commercially, as long as you credit the origin creator and license it on your new creations under the identical terms. Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP

2 //Form1.cs or Main_form using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; //serial communication using System.IO.Ports; //sleep using System.Threading; //time using System.Diagnostics; //maps using System.IO; using AxMapWinGIS; using MapWinGIS; LAMPIRAN 1 SOURCE CODE SOURCE CODE namespace ZLeAp_New public partial class Form1 : Form //For covers all the serial ports that appear on the machine SerialPort ComPort = new SerialPort(); internal delegate void SerialDataReceivedEventHandlerDelegate(object sender, SerialDataReceivedEventArgs e); delegate void SetTextCallback(string text); string InputData = String.Empty; string temp = ""; string mapfilename = String.Empty; int answer = 0; // the handle of the layer with markers private int m_layerhandle = -1; private string respon; public Form1() //Configure serial data receive ComPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(port_DataReceived_1); //load map when apps start MessageBox.Show("Please select map first!"); loadmap(); //control database private void nodeinfobindingnavigatorsaveitem_click(object sender, EventArgs e) this.alidate(); this.nodeinfobindingsource.endedit(); this.tableadaptermanager.updateall(this.nodedataset1); catch (Exception ex)

3 MessageBox.Show(ex.Message); //counting time for not instant reply private void time(int test) int d = 0, panjang = 0; Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); while (d == 0) panjang = temp.length; if (panjang > test) stopwatch.stop(); d = 1; else d = 0; MessageBox.Show("Time elapsed : " + stopwatch.elapsed + " Second"); panjang = temp.length; Console.WriteLine(panjang); //load map for isualization void loadmap() OpenFileDialog dlg = new OpenFileDialog(); // Set filter options and filter index. dlg.filter = "Shapefile (.shp) *.shp All Files (*.*) *.*"; dlg.filterindex = 1; if (dlg.showdialog() == DialogResult.OK) //Define the data source for MapWinGIS.Shapefile instance mapfilename = dlg.filename; //mapfilename = foreach( string s in Directory.EnumerateFiles("../../IDN_adm0.shp")); //create a new instance for MapWinGIS.Shapefile (var sf) //MapWinGIS.Shapefile is a data provider for ESRI Shapefile var sf = new Shapefile(); if (!sf.open(mapfilename)) MessageBox.Show("Failed to open: " + mapfilename); return; //display the layer on the map m_layerhandle = axmap1.addlayer(sf, true); //set first position on map to banten //axmap1.latitude = -6; //axmap1.longitude = 106; //axmap1.currentzoom = 7; //basic setup private void Form1_Load(object sender, EventArgs e) // TODO: This line of code loads data into the 'nodedataset1.nodeinfo' table. You can move, or remove it, as needed. this.nodeinfotableadapter.fill(this.nodedataset1.nodeinfo); //Disable all ZigBee Setup Button btnstate.enabled = false; btnsend.enabled = false; btnabout.enabled = false; btnannounce.enabled = false;

4 btnclear.enabled = false; btncreate.enabled = false; btnpower.enabled = false; btnscan.enabled = false; btnsetpower.enabled = false; btnstatus.enabled = false; btnload.enabled = false; btnsendmsg.enabled = false; //handle serial communication public void port_datareceived_1(object sender, SerialDataReceivedEventArgs e) InputData = ComPort.ReadExisting(); if (InputData!= String.Empty) this.begininvoke(new SetTextCallback(SetText), new object[] InputData ); temp = temp + InputData; private void SetText(string text) this.rtbin.text += text; //Node Setting //add data to database private void btnadd_click(object sender, EventArgs e) this.nodeinfobindingsource.addnew(); //save data to database private void btnsave_click(object sender, EventArgs e) this.alidate(); this.nodeinfobindingsource.endedit(); this.tableadaptermanager.updateall(this.nodedataset1); catch (Exception ex) MessageBox.Show(ex.Message); //delete data from database private void btndelete_click(object sender, EventArgs e) this.nodeinfobindingsource.removecurrent(); //ZigBee Setup //Read Com Port Connect to Application private void btndetect_click(object sender, EventArgs e) string[] ArrayComPortsNames = null; int index = -1; string ComPortName = null; ArrayComPortsNames = SerialPort.GetPortNames(); do index += 1; cbports.items.add(arraycomportsnames[index]); while (!((ArrayComPortsNames[index] == ComPortName) (index == ArrayComPortsNames.GetUpperBound(0))));

5 Array.Sort(ArrayComPortsNames); //want to get first out if (index == ArrayComPortsNames.GetUpperBound(0)) ComPortName = ArrayComPortsNames[0]; cbports.text = ArrayComPortsNames[0]; //add baud rate option cbbaudrate.items.add(300); cbbaudrate.items.add(600); cbbaudrate.items.add(1200); cbbaudrate.items.add(2400); cbbaudrate.items.add(9600); cbbaudrate.items.add(14400); cbbaudrate.items.add(19200); cbbaudrate.items.add(38300); cbbaudrate.items.add(57600); cbbaudrate.items.add(115200); cbbaudrate.items.tostring(); //Show as default baud rate option cbbaudrate.text = cbbaudrate.items[6].tostring(); //add data bits option cbdatabits.items.add(7); cbdatabits.items.add(8); //Show 8 as default data bits option cbdatabits.text = cbdatabits.items[1].tostring(); //add flow control option cbflowcontrol.items.add("none"); cbflowcontrol.items.add("xonxoff"); //show disable as default flow control option cbflowcontrol.text = cbflowcontrol.items[0].tostring(); //add parity opotion cbparity.items.add("none"); cbparity.items.add("odd"); cbparity.items.add("even"); //show none as default parity option cbparity.text = cbparity.items[0].tostring(); //add stop bits option cbstopbits.items.add("one"); cbstopbits.items.add("onepointfive"); cbstopbits.items.add("two"); //get the first item print in the text cbstopbits.text = cbstopbits.items[0].tostring(); btnstate.backcolor = Color.LimeGreen; btnstate.enabled = true; btnsend.enabled = true; power(); btnabout.enabled = true; btnannounce.enabled = true; btnclear.enabled = true; btncreate.enabled = true; btnpower.enabled = true; btnscan.enabled = true; btnsetpower.enabled = true; btnstatus.enabled = true; btnload.enabled = true; catch (Exception) //MessageBox.Show(ex.Message); MessageBox.Show("No Communication Port Detect"); //Change state serial communication private void btnstate_click(object sender, EventArgs e)

6 if (btnstate.text == "Connect") btnstate.text = "Disconnect"; btnstate.backcolor = Color.OrangeRed; ComPort.PortName = Convert.ToString(cbPorts.Text); ComPort.BaudRate = Convert.ToInt32(cbBaudRate.Text); ComPort.DataBits = Convert.ToInt16(cbDataBits.Text); ComPort.Handshake = (Handshake)Enum.Parse(typeof(Handshake), cbflowcontrol.text); ComPort.Parity = (Parity)Enum.Parse(typeof(Parity), cbparity.text); ComPort.StopBits = (StopBits)Enum.Parse(typeof(StopBits), cbstopbits.text); ComPort.Open(); //rtbin.appendtext("\nconnected\n"); else if (btnstate.text == "Disconnect") btnstate.text = "Connect"; btnstate.backcolor = Color.LimeGreen; ComPort.Close(); //rtbin.appendtext("\ndisconnected\n"); btndetect.enabled = true; catch (Exception) MessageBox.Show("Can't open communication port!"); btnstate.text = "Connect"; btnstate.backcolor = Color.LimeGreen; //send serial command private void btnsend_click(object sender, EventArgs e) string Command1 = txtcommand.text; string CommandSent; int Length, j = 0; ///clear ritch text box rtbin.clear(); Length = Command1.Length;!"); for (int i = 0; i < Length; i++) CommandSent = Command1.Substring(j, 1); ComPort.Write(CommandSent); j++; ComPort.Write("\r\n"); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //see temp value //MessageBox.Show(temp); //clear temporary variable temp = ""; //read information about ZigBee device private void btnabout_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable

7 !"); temp = ""; answer = 63; ComPort.Write("ATI\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //read status device on network private void btnstatus_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 21;!"); ComPort.Write("AT+N\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again!"); //announce device in PAN private void btnannounce_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 13; ComPort.Write("AT+ANNCE\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //search other device connected on same PAN private void btnscan_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = "";!"); ComPort.Write("AT+SN\r\n"); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again

8 //delete device PAN configuration & status private void btnclear_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 19;!"); ComPort.Write("AT+DASSL\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //read device transmit power level private void btnpower_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 17;!"); ComPort.Write("ATS01?\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //create a PAN private void btncreate_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 16;!"); ComPort.Write("AT+EN\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //Transmit power level value for ETRX2 private void power() cbpower.items.add(4); cbpower.items.add(3); cbpower.items.add(2); cbpower.items.add(1); cbpower.items.add(-1); cbpower.items.add(-2); cbpower.items.add(-3);

9 cbpower.items.add(-4); cbpower.items.add(-5); cbpower.items.add(-6); cbpower.items.add(-7); cbpower.items.add(-8); cbpower.items.add(-9); cbpower.items.add(-11); cbpower.items.add(-12); cbpower.items.add(-14); cbpower.items.add(-17); cbpower.items.add(-20); cbpower.items.add(-26); cbpower.items.add(-43); cbpower.text = cbpower.items[18].tostring(); //set device transmit power level private void btnsetpower_click(object sender, EventArgs e) ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; answer = 12; string powerout = ""; powerout = cbpower.selecteditem.tostring();!"); ComPort.Write("ATS01=" + powerout + "\r\n"); time(answer); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again //MAPWINGIS GUI //change map private void toolchangemap_click(object sender, EventArgs e) OpenFileDialog dlg = new OpenFileDialog(); // Set filter options and filter index. dlg.filter = "Shapefile (.shp) *.shp All Files (*.*) *.*"; dlg.filterindex = 1; if (dlg.showdialog() == DialogResult.OK) //Define the data source for MapWinGIS.Shapefile instance mapfilename = dlg.filename; loadmap(); //cursor private void toolcursor_click(object sender, EventArgs e) axmap1.cursormode = MapWinGIS.tkCursorMode.cmNone; //zoom in private void toolzoomin_click(object sender, EventArgs e) axmap1.cursormode = MapWinGIS.tkCursorMode.cmZoomIn; //zoom Out private void toolzoomout_click(object sender, EventArgs e)

10 axmap1.cursormode = MapWinGIS.tkCursorMode.cmZoomOut; //zoom extents private void toolzoomextents_click(object sender, EventArgs e) axmap1.zoomtomaxextents(); //pan private void toolpan_click(object sender, EventArgs e) axmap1.cursormode = MapWinGIS.tkCursorMode.cmPan; //show device on map private void btnshow_click(object sender, EventArgs e) //clear map axmap1.cleardrawings(); drawnodes(); ; //draw nodes on map void drawnodes() // it's default setting but just in case var gs = new GlobalSettings() AllowLayersWithoutProjections = true //axmap1.projection = tkmapprojection.projection_google_mercator; axmap1.projection = tkmapprojection.projection_wgs84; axmap1.tileprovider = tktileprovider.openstreetmap; var sf = new Shapefile(); 20); // use empty string to create in-memory shapefile sf.createnewwithshapeid("", ShpfileType.SHP_POINT); int fieldindex = sf.editaddfield("name", FieldType.STRING_FIELD, 0, double Lat = 0.00, Lng = 0.00; string name;//,eui64; for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with how you create the datagrid if (Convert.ToBoolean(nodeInfoDataGridiew.Rows[i].Cells[5].alue.ToString()))//if checked (showed) Lat = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[3].alue.ToString()); Lng = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[4].alue.ToString()); name = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); //eui64 = nodeinfodatagridiew.rows[i].cells[1].alue.tostring(); //MessageBox.Show("Lat: " +Lat + " Lng: " +Lng+ " Id: "+name+ "EUI64: "+eui64 ); // convert our degrees to meters in map projection double projx = 0.0, projy = 0.0; axmap1.degreestoproj(lng, Lat, ref projx, ref projy); // create shapes for each location var shape = new Shape(); shape.create(shpfiletype.shp_point); shape.addpoint(projx, projy); // add it to shapefile along with name int shapeindex = sf.editaddshape(shape); sf.editcellalue(fieldindex, shapeindex, name);

11 // check that everything went smooth //MessageBox.Show("Number of points added: " + sf.numshapes); // let's display labels sf.labels.generate("[name]", tklabelpositioning.lpcenter, true); // -1 will be returned on failure // draw point on map int layerhandle = axmap1.addlayer(sf, true); // needed in case it's not the first layer axmap1.zoomtolayer(layerhandle); ; //draw the mesh network //drawmnet(); //draw mesh network void drawmnet() // it's default setting but just in case var gs = new GlobalSettings() AllowLayersWithoutProjections = true axmap1.projection = tkmapprojection.projection_wgs84; axmap1.grabprojectionfromdata = true; var sf = new Shapefile(); 20); // use empty string to create in-memory shapefile sf.createnewwithshapeid("", ShpfileType.SHP_POINT); int fieldindex = sf.editaddfield("name", FieldType.STRING_FIELD, 0, double Lat = 0.00, Lng = 0.00; string name; for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with create the datagrid if (Convert.ToBoolean(nodeInfoDataGridiew.Rows[i].Cells[5].alue.ToString()))//if checked (showed) Lat = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[3].alue.ToString()); Lng = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[4].alue.ToString()); name = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); // convert our degrees to meters in map projection double projx = 0.0, projy = 0.0; axmap1.degreestoproj(lng, Lat, ref projx, ref projy); // create shapes for each location var shape = new Shape(); shape.create(shpfiletype.shp_point); shape.addpoint(projx, projy); // add it to shapefile along with name int shapeindex = sf.editaddshape(shape); sf.editcellalue(fieldindex, shapeindex, name); // check that everything went smooth //MessageBox.Show("Number of points added: " + sf.numshapes); Extents extents = null; var center = (axmap1.extents as Extents).Center;

12 if (axmap1.projection == tkmapprojection.projection_none) axmap1.geoprojection = sf.geoprojection.clone(); if (extents == null) extents = sf.extents; will be used to setup display // the extents of the fist shapefile int drawhandle = axmap1.newdrawing(tkdrawreferencelist.dlspatiallyreferencedlist); int z = 0; for (int i = 0; z!= (sf.numshapes - 1) i!= (sf.numshapes); i++) double x1 = 0.0; double y1 = 0.0; double x2 = 0.0; double y2 = 0.0; //handle start poin Shape shp = sf.shape[z]; double x = 0.0; double y = 0.0; shp.get_xy(0, ref x, ref y); x1 = x; y1 = y; //handle end point shp = sf.shape[i]; x = 0.0; y = 0.0; shp.get_xy(0, ref x, ref y); x2 = x; y2 = y; if (i == (sf.numshapes - 1)) z++; i = z; axmap1.drawlineex(drawhandle, x1, y1, x2, y2, 5, 30); finally if (extents!= null) axmap1.extents = extents; axmap1.lockwindow(tklockmode.lmunlock); axmap1.redraw(); //message control //read all data from database for fill ComboBox From & Load private void btnload_click(object sender, EventArgs e) fillcbx(); MessageBox.Show("Please make sure source device connect to this application!"); btnsendmsg.enabled = true; //fill combo box for sender and receiver message void fillcbx() //read data for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with how you create the datagrid

13 if (Convert.ToBoolean(nodeInfoDataGridiew.Rows[i].Cells[5].alue.ToString()))//if checked (showed) string snode = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); cbfrom.items.add(snode); cbto.items.add(snode); private void btnsendmsg_click(object sender, EventArgs e) //show device name & Location drawnodes(); drawmnet(); ///clear ritch text box rtbin.clear(); //clear temporary variable temp = ""; string tujuan, dbtujuan; string address = ""; answer = 54; //read value selected tujuan = cbto.selecteditem.tostring(); //MessageBox.Show("Data send to "+tujuan); //convert to address al //read data for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with how you create the datagrid dbtujuan = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); if (tujuan.equals(dbtujuan)) address = nodeinfodatagridiew.rows[i].cells[1].alue.tostring(); //recv add in PID val //MessageBox.Show(address); //send unicast message //AT+UCAST:000D6F =Hello ComPort.Write("AT+UCAST:" + address + "=Hello\r\n"); time(answer); //not connected if (temp.substring(50, 4) == "NACK") MessageBox.Show("Node was not connected!"); " + belakang); //direct if (temp.substring(50, 5) == "SR:00") string depan = "", hope = ""; depan = cbfrom.selecteditem.tostring(); hope = temp.substring(73, 4); //MessageBox.Show("Koor Depan : " + depan + " Koor Belakang : drawlineaw(depan, hope); //using 1 hope else if (temp.substring(50, 5) == "SR:01") string depan = "", hopeaw = "", hopeak = ""; depan = cbfrom.selecteditem.tostring();

14 " + belakang); hopeaw = temp.substring(78, 4); hopeak = temp.substring(73, 4); //MessageBox.Show("Koor Depan : " + depan + " Koor Belakang : //source - hope 1 drawlineaw(depan, hopeaw); //hope 1 - target drawlinenx(hopeaw, hopeak); " + belakang); //using 2 hope else if (temp.substring(50, 5) == "SR:02") string depan = "", hopeaw = "", hopeak = ""; depan = cbfrom.selecteditem.tostring(); hopeaw = temp.substring(83, 4); hopeak = temp.substring(78, 4); //MessageBox.Show("Koor Depan : " + depan + " Koor Belakang : //source - hope 1 drawlineaw(depan, hopeaw); //hope 1 - hope 2 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(78, 4); hopeak = temp.substring(73, 4); //hope 2 - target drawlinenx(hopeaw, hopeak); " + belakang); //usig 3 hope else if (temp.substring(50, 5) == "SR:03") string depan = "", hopeaw = "", hopeak = ""; depan = cbfrom.selecteditem.tostring(); hopeaw = temp.substring(88, 4); hopeak = temp.substring(83, 4); //MessageBox.Show("Koor Depan : " + depan + " Koor Belakang : //source - hope 1 drawlineaw(depan, hopeaw); //hope 1 - hope 2 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(83, 4); hopeak = temp.substring(78, 4); //hope 2 - hope 3 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(78, 4); hopeak = temp.substring(73, 4); //hope 3 - target drawlinenx(hopeaw, hopeak); " + belakang); //using 4 hope else if (temp.substring(50, 5) == "SR:04") string depan = "", hopeaw = "", hopeak = ""; depan = cbfrom.selecteditem.tostring(); hopeaw = temp.substring(93, 4); hopeak = temp.substring(88, 4); //MessageBox.Show("Koor Depan : " + depan + " Koor Belakang : //source - hope 1 drawlineaw(depan, hopeaw); //hope 1 - hope 2 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(88, 4);

15 !"); hopeak = temp.substring(83, 4); //hope 2 - hope 3 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(83, 4); hopeak = temp.substring(78, 4); //hope 3 - hope 4 drawlinenx(hopeaw, hopeak); hopeaw = ""; hopeak = ""; hopeaw = temp.substring(78, 4); hopeak = temp.substring(73, 4); //hope 4 - target drawlinenx(hopeaw, hopeak); catch (Exception) MessageBox.Show("Serial Connection is offline, Please again void drawlineaw(string depan, string hope) ; //MessageBox.Show("recv depan:"+depan+"recv blkg:"+belakang); // it's default setting but just in case var gs = new GlobalSettings() AllowLayersWithoutProjections = true axmap1.projection = tkmapprojection.projection_wgs84; axmap1.grabprojectionfromdata = true; var sf = new Shapefile(); 20); // use empty string to create in-memory shapefile sf.createnewwithshapeid("", ShpfileType.SHP_POINT); int fieldindex = sf.editaddfield("name", FieldType.STRING_FIELD, 0, double Lat = 0.00, Lng = 0.00; string name, pidcode; int awal = 0, akhir = 0; for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with create the datagrid if (Convert.ToBoolean(nodeInfoDataGridiew.Rows[i].Cells[5].alue.ToString()))//if checked (showed) Lat = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[3].alue.ToString()); Lng = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[4].alue.ToString()); name = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); pidcode = nodeinfodatagridiew.rows[i].cells[2].alue.tostring(); if (name.equals(depan)) awal = i; if (pidcode.equals(hope)) akhir = i; //MessageBox.Show("Idx Awal :" + awal + "Idx Akhir:" + akhir); // convert our degrees to meters in map projection double projx = 0.0, projy = 0.0; axmap1.degreestoproj(lng, Lat, ref projx, ref projy); // create shapes for each location var shape = new Shape();

16 shape.create(shpfiletype.shp_point); shape.addpoint(projx, projy); // add it to shapefile along with name int shapeindex = sf.editaddshape(shape); sf.editcellalue(fieldindex, shapeindex, name); // check that everything went smooth //Debug.WriteLine("Number of points added: " + sf.numshapes); //MessageBox.Show("Number of points added: " + sf.numshapes); Extents extents = null; var center = (axmap1.extents as Extents).Center; double x1 = 0.0; double y1 = 0.0; double x2 = 0.0; double y2 = 0.0; if (axmap1.projection == tkmapprojection.projection_none) axmap1.geoprojection = sf.geoprojection.clone(); if (extents == null) extents = sf.extents; will be used to setup display // the extents of the fist shapefile int drawhandle = axmap1.newdrawing(tkdrawreferencelist.dlspatiallyreferencedlist); for (int i = 0; i < sf.numshapes; i++) Shape shp = sf.shape[i]; double x = 0.0; double y = 0.0; shp.get_xy(0, ref x, ref y); //test load data //MessageBox.Show("Index :" + i + "X:" + x + "Y:" + y); //axmap1.drawpointex(layerhandle, x pos, y pos, size, colour) axmap1.drawpointex(drawhandle, x, y, 10, 200); if (i == awal) x1 = x; y1 = y; if (i == akhir) x2 = x; y2 = y; //gambar axmap1.drawlineex(drawhandle, x1, y1, x2, y2, 5, 200); finally if (extents!= null) axmap1.extents = extents; axmap1.lockwindow(tklockmode.lmunlock); axmap1.redraw(); ; void drawlinenx(string hope, string nxthope) //MessageBox.Show("recv depan:"+depan+"recv blkg:"+belakang); // it's default setting but just in case var gs = new GlobalSettings() AllowLayersWithoutProjections = true

17 axmap1.projection = tkmapprojection.projection_wgs84; axmap1.grabprojectionfromdata = true; var sf = new Shapefile(); 20); // use empty string to create in-memory shapefile sf.createnewwithshapeid("", ShpfileType.SHP_POINT); int fieldindex = sf.editaddfield("name", FieldType.STRING_FIELD, 0, double Lat = 0.00, Lng = 0.00; string name, pidcode; int awal = 0, akhir = 0; for (int i = 0; i < nodeinfodatagridiew.rowcount - 1; i++)//-1 for some reason i dont understand, prob something wrong with create the datagrid if (Convert.ToBoolean(nodeInfoDataGridiew.Rows[i].Cells[5].alue.ToString()))//if checked (showed) Lat = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[3].alue.ToString()); Lng = Convert.ToDouble(nodeInfoDataGridiew.Rows[i].Cells[4].alue.ToString()); name = nodeinfodatagridiew.rows[i].cells[0].alue.tostring(); pidcode = nodeinfodatagridiew.rows[i].cells[2].alue.tostring(); if (pidcode.equals(hope)) awal = i; if (pidcode.equals(nxthope)) akhir = i; //MessageBox.Show("Idx Awal :" + awal + "Idx Akhir:" + akhir); // convert our degrees to meters in map projection double projx = 0.0, projy = 0.0; axmap1.degreestoproj(lng, Lat, ref projx, ref projy); // create shapes for each location var shape = new Shape(); shape.create(shpfiletype.shp_point); shape.addpoint(projx, projy); // add it to shapefile along with name int shapeindex = sf.editaddshape(shape); sf.editcellalue(fieldindex, shapeindex, name); // check that everything went smooth //Debug.WriteLine("Number of points added: " + sf.numshapes); //MessageBox.Show("Number of points added: " + sf.numshapes); Extents extents = null; var center = (axmap1.extents as Extents).Center; double x1 = 0.0; double y1 = 0.0; double x2 = 0.0; double y2 = 0.0; if (axmap1.projection == tkmapprojection.projection_none) axmap1.geoprojection = sf.geoprojection.clone(); if (extents == null) extents = sf.extents; will be used to setup display // the extents of the fist shapefile int drawhandle = axmap1.newdrawing(tkdrawreferencelist.dlspatiallyreferencedlist);

18 for (int i = 0; i < sf.numshapes; i++) Shape shp = sf.shape[i]; double x = 0.0; double y = 0.0; shp.get_xy(0, ref x, ref y); //test load data //MessageBox.Show("Index :" + i + "X:" + x + "Y:" + y); //axmap1.drawpointex(layerhandle, x pos, y pos, size, colour) axmap1.drawpointex(drawhandle, x, y, 10, 200); if (i == awal) x1 = x; y1 = y; if (i == akhir) x2 = x; y2 = y; //gambar axmap1.drawlineex(drawhandle, x1, y1, x2, y2, 5, 200); finally if (extents!= null) axmap1.extents = extents; axmap1.lockwindow(tklockmode.lmunlock); axmap1.redraw(); private void btnhelp_click(object sender, EventArgs e) Help_menu frm = new Help_menu(this); frm.show();

19 //Help_menu.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class Help_menu : Form string temp = String.Empty; public Help_menu() private Form1 mainform = null; public Help_menu(Form callingform) mainform = callingform as Form1; private void btnadd_node_click(object sender, EventArgs e) Add_node frm = new Add_node(this); frm.show(); private void btnedit_node_click(object sender, EventArgs e) Edit_node frm = new Edit_node(this); frm.show(); private void btndel_node_click(object sender, EventArgs e) Del_node frm = new Del_node(this); frm.show(); private void btns_loc_click(object sender, EventArgs e) S_Loc frm = new S_Loc(this); frm.show(); private void btnr_isual_click(object sender, EventArgs e) R_isual frm = new R_isual(this); frm.show(); private void btncon_device_click(object sender, EventArgs e) Con_device frm = new Con_device(this); frm.show(); private void btns_com_click(object sender, EventArgs e) S_Com frm = new S_Com(this); frm.show(); private void btnk_s_com_click(object sender, EventArgs e) K_S_Com frm = new K_S_Com(this);

20 frm.show(); private void button1_click(object sender, EventArgs e) OpenFileDialog dlg = new OpenFileDialog(); // Set filter options and filter index. dlg.filter = "Compiled HTML (.chm) *.chm All Files (*.*) *.*"; dlg.filterindex = 1; if (dlg.showdialog() == DialogResult.OK) //Define the data source for MapWinGIS.Shapefile instance temp = "file://" + dlg.filename; Help.ShowHelp(this, temp);

21 //Add_node.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class Add_node : Form public Add_node() private Help_menu mainform = null; public Add_node(Form callingform) mainform = callingform as Help_menu; private void Add_node_Load(object sender, EventArgs e) //Con_device.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class Con_device : Form public Con_device() private Help_menu mainform = null; public Con_device(Form callingform) mainform = callingform as Help_menu; private void Con_device_Load(object sender, EventArgs e)

22 //Del_node.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class Del_node : Form public Del_node() private Help_menu mainform = null; public Del_node(Form callingform) mainform = callingform as Help_menu; private void Del_node_Load(object sender, EventArgs e) //Edit_node.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class Edit_node : Form public Edit_node() private Help_menu mainform = null; public Edit_node(Form callingform) mainform = callingform as Help_menu; private void Edit_node_Load(object sender, EventArgs e)

23 //K_S_Com.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class K_S_Com : Form public K_S_Com() private Help_menu mainform = null; public K_S_Com(Form callingform) mainform = callingform as Help_menu; private void K_S_Com_Load(object sender, EventArgs e) //R_isual.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class R_isual : Form public R_isual() private Help_menu mainform = null; public R_isual(Form callingform) mainform = callingform as Help_menu; private void R_isual_Load(object sender, EventArgs e)

24 //S_Com.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class S_Com : Form public S_Com() private Help_menu mainform = null; public S_Com(Form callingform) mainform = callingform as Help_menu; private void S_Com_Load(object sender, EventArgs e) //S_Loc.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace ZLeAp_New public partial class S_Loc : Form public S_Loc() private Help_menu mainform = null; public S_Loc(Form callingform) mainform = callingform as Help_menu; private void S_Loc_Load(object sender, EventArgs e)

25 FORMULIR KONSULTASI SKRIPSI

26

27 DAFTAR RIWAYAT HIDUP Nama : Alexander Samuel Tempat/ tanggal lahir : Jakarta, 24 September 1993 Alamat : Jl. Kaswari Gg. Merpati Kota Sukabumi Telp/HP : Riwayat Pendidikan: 1. TK Sukapirena Kota Sukabumi SD Yuwati Bhakti Sukabumi SMP Yuwati Bhakti Sukabumi SMA Mardi Yuana Sukabumi Universitas Multimedia Nusantara Pogram Studi Sistem Komputer

CALCULATOR APPLICATION

CALCULATOR APPLICATION CALCULATOR APPLICATION Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at: This document describes how to create a simple Windows Forms Application using some Open Core Interface functions in C# with Microsoft Visual Studio Express 2013. 1 Preconditions The Open Core Interface

More information

C# Tutorial. Table of Contents

C# Tutorial. Table of Contents Table of Contents OVERVIEW... 4 Getting started... 4 CREATING NEW PROJECT... 4 TOOLBOX... 6 PROPERTIES WINDOW... 8 BUILD AND DEBUGGING TOOL... 9 BUILD MENU:... 9 DEBUG MENU:... 10 WINDOWS PROGRAMMING...

More information

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN A : LISTING PROGRAM LAMPIRAN A : LISTING PROGRAM 1. Form Utama (Cover) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

More information

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

if (say==0) { k.commandtext = Insert into kullanici(k_adi,sifre) values(' + textbox3.text + ',' + textbox4.text + '); k. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient;

More information

CSIS 1624 CLASS TEST 6

CSIS 1624 CLASS TEST 6 CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed

More information

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox] C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open

More information

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer C# Tutorial Create a Motivational Quotes Viewer Application in Visual Studio In this tutorial we will create a fun little application for Microsoft Windows using Visual Studio. You can use any version

More information

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding // Program 2 - Extra Credit // CIS 200-01 // Spring 2015 // Due: 3/11/2015 // By: Andrew L. Wright //Edited by : Ben Spalding // File: Prog2Form.cs // This class creates the main GUI for Program 2. It

More information

Object oriented lab /second year / review/lecturer: yasmin maki

Object oriented lab /second year / review/lecturer: yasmin maki 1) Examples of method (function): Note: the declaration of any method is : method name ( parameters list ).. Method body.. Access modifier : public,protected, private. Return

More information

IBSDK Quick Start Tutorial for C# 2010

IBSDK Quick Start Tutorial for C# 2010 IB-SDK-00003 Ver. 3.0.0 2012-04-04 IBSDK Quick Start Tutorial for C# 2010 Copyright @2012, lntegrated Biometrics LLC. All Rights Reserved 1 QuickStart Project C# 2010 Example Follow these steps to setup

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN A : LISTING PROGRAM 46 LAMPIRAN A : LISTING PROGRAM 1. Mainform /* * Created by SharpDevelop. * User: User7 * Date: 28/09/2015 * Time: 9:38 * * To change this template use Tools Options Coding Edit Standard Headers. */ using

More information

Lecture 8 Building an MDI Application

Lecture 8 Building an MDI Application Lecture 8 Building an MDI Application Introduction The MDI (Multiple Document Interface) provides a way to display multiple (child) windows forms inside a single main(parent) windows form. In this example

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 12 Visual Basic/C# Programming (330) REGIONAL 2017 Production Portion: Program 1: Calendar Analysis (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores

More information

Form Properties Window

Form Properties Window C# Tutorial Create a Save The Eggs Item Drop Game in Visual Studio Start Visual Studio, Start a new project. Under the C# language, choose Windows Form Application. Name the project savetheeggs and click

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) ) insert into bolumler values(1,'elektrik') insert into bolumler values(2,'makina') insert into bolumler

More information

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. //

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. // 1. MainForm.cs using System.Collections.Generic; using System.Drawing; LISTING PROGRAM / / Description of MainForm. / public partial class MainForm : Form public MainForm() The InitializeComponent()

More information

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this.

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this. A - 1 LISTING PROGRAM 1. Form Menu Utama using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace KompresiCitra / / Description of MainForm.

More information

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI;

More information

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Eyes of the Dragon - XNA Part 37 Map Editor Revisited Eyes of the Dragon - XNA Part 37 Map Editor Revisited I'm writing these tutorials for the XNA 4.0 framework. Even though Microsoft has ended support for XNA it still runs on all supported operating systems

More information

Appendix A Programkod

Appendix A Programkod Appendix A Programkod ProgramForm.cs using System; using System.Text; using System.Windows.Forms; using System.Net; using System.IO; using System.Text.RegularExpressions; using System.Collections.Generic;

More information

// Precondition: None // Postcondition: The address' name has been set to the // specified value set;

// Precondition: None // Postcondition: The address' name has been set to the // specified value set; // File: Address.cs // This classes stores a typical US address consisting of name, // two address lines, city, state, and 5 digit zip code. using System; using System.Collections.Generic; using System.Linq;

More information

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

string spath; string sedifile = 277_005010X228.X12; string sseffile = 277_005010X228.SemRef.EVAL0.SEF; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format); using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDIx64;

More information

UNIT-3. Prepared by R.VINODINI 1

UNIT-3. Prepared by R.VINODINI 1 Prepared by R.VINODINI 1 Prepared by R.VINODINI 2 Prepared by R.VINODINI 3 Prepared by R.VINODINI 4 Prepared by R.VINODINI 5 o o o o Prepared by R.VINODINI 6 Prepared by R.VINODINI 7 Prepared by R.VINODINI

More information

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND }

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO.Ports; using Microsoft.FlightSimulator.SimConnect;

More information

Huw Talliss Data Structures and Variables. Variables

Huw Talliss Data Structures and Variables. Variables Data Structures and Variables Variables The Regex class represents a read-only regular expression. It also contains static methods that allow use of other regular expression classes without explicitly

More information

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Experiment 5 : Creating a Windows application to interface with 7-Segment LED display Objectives : 1) To understand the how Windows Forms in the Windows-based applications. 2) To create a Window Application

More information

Answer on Question# Programming, C#

Answer on Question# Programming, C# Answer on Question#38723 - Programming, C# 1. The development team of SoftSols Inc. has revamped the software according to the requirements of FlyHigh Airlines and is in the process of testing the software.

More information

Writing Your First Autodesk Revit Model Review Plug-In

Writing Your First Autodesk Revit Model Review Plug-In Writing Your First Autodesk Revit Model Review Plug-In R. Robert Bell Sparling CP5880 The Revit Model Review plug-in is a great tool for checking a Revit model for matching the standards your company has

More information

Using Template Bookmarks for Automating Microsoft Word Reports

Using Template Bookmarks for Automating Microsoft Word Reports Using Template Bookmarks for Automating Microsoft Word Reports Darryl Bryk U.S. Army RDECOM-TARDEC Warren, MI 48397 Disclaimer: Reference herein to any specific commercial company, product, process, or

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

Chapter 8 Advanced GUI Features

Chapter 8 Advanced GUI Features 159 Chapter 8 Advanced GUI Features There are many other features we can easily add to a Windows C# application. We must be able to have menus and dialogs along with many other controls. One workhorse

More information

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK. Before you start - download the game assets from above or on MOOICT.COM to

More information

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below. APPENDIX 1 TABLE DETAILS Mainly three tables namely Teacher, Student and Class for small database of a school are used. The snapshots of all three tables are shown below. Details of Class table are shown

More information

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button Create an Interest Calculator with C# In This tutorial we will create an interest calculator in Visual Studio using C# programming Language. Programming is all about maths now we don t need to know every

More information

private void closetoolstripmenuitem_click(object sender, EventArgs e) { this.close(); }

private void closetoolstripmenuitem_click(object sender, EventArgs e) { this.close(); } MEMBER PAYMENTS FORM public partial class MemberPaymentsForm : Form public MemberPaymentsForm() private void MemberPaymentsForm_Load(object sender, EventArgs e) // TODO: This line of code loads data into

More information

A-1 LISTING PROGRAM. 1. Form1.cs. Universitas Sumatera Utara

A-1 LISTING PROGRAM. 1. Form1.cs. Universitas Sumatera Utara A-1 LISTING PROGRAM 1. Form1.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using IronPython.Hosting; using Microsoft.Scripting;

More information

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems Excel and C# Overview Introduction to DatabaseSupport Systems Building a Web-Enabled Decision Support System Integrating DSS in Business Curriculum 2 Decision Support Systems (DSS) A decision support system

More information

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock. C# Tutorial - Create a YouTube Alarm Clock in Visual Studio In this tutorial we will create a simple yet elegant YouTube alarm clock in Visual Studio using C# programming language. The main idea for this

More information

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them. We are working on Visual Studio 2010 but this project can be remade in any other version of visual studio. Start a new project in Visual Studio, make this a C# Windows Form Application and name it zombieshooter.

More information

Developing for Mobile Devices Lab (Part 1 of 2)

Developing for Mobile Devices Lab (Part 1 of 2) Developing for Mobile Devices Lab (Part 1 of 2) Overview Through these two lab sessions you will learn how to create mobile applications for Windows Mobile phones and PDAs. As developing for Windows Mobile

More information

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using 1 using System; 2 using System.Diagnostics; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using System.Drawing; 7 using System.Text; 8 using System.Windows.Forms;

More information

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0. Sub To Srt Converter This is the source code of this program. It is made in C# with.net 2.0. form1.css /* * Name: Sub to srt converter * Programmer: Paunoiu Alexandru Dumitru * Date: 5.11.2007 * Description:

More information

Chapter 6 Dialogs. Creating a Dialog Style Form

Chapter 6 Dialogs. Creating a Dialog Style Form Chapter 6 Dialogs We all know the importance of dialogs in Windows applications. Dialogs using the.net FCL are very easy to implement if you already know how to use basic controls on forms. A dialog is

More information

Inheriting Windows Forms with Visual C#.NET

Inheriting Windows Forms with Visual C#.NET Inheriting Windows Forms with Visual C#.NET Overview In order to understand the power of OOP, consider, for example, form inheritance, a new feature of.net that lets you create a base form that becomes

More information

Representing Recursive Relationships Using REP++ TreeView

Representing Recursive Relationships Using REP++ TreeView Representing Recursive Relationships Using REP++ TreeView Author(s): R&D Department Publication date: May 4, 2006 Revision date: May 2010 2010 Consyst SQL Inc. All rights reserved. Representing Recursive

More information

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project. C# Tutorial - Create a Batman Gravity Run Game Start a new project in visual studio and call it gravityrun It should be a windows form application with C# Click OK Change the size of the to 800,300 and

More information

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } using System using System.Collections.Generic using System.ComponentModel using System.Data using System.Drawing using System.Text using System.Windows.Forms using Edidev.FrameworkEDI 1 namespace csharp_gen277x214

More information

Start Visual Studio, create a new project called Helicopter Game and press OK

Start Visual Studio, create a new project called Helicopter Game and press OK C# Tutorial Create a helicopter flying and shooting game in visual studio In this tutorial we will create a fun little helicopter game in visual studio. You will be flying the helicopter which can shoot

More information

Click on the empty form and apply the following options to the properties Windows.

Click on the empty form and apply the following options to the properties Windows. Start New Project In Visual Studio Choose C# Windows Form Application Name it SpaceInvaders and Click OK. Click on the empty form and apply the following options to the properties Windows. This is the

More information

Visual Basic/C# Programming (330)

Visual Basic/C# Programming (330) Page 1 of 16 Visual Basic/C# Programming (330) REGIONAL 2016 Program: Character Stats (400 points) TOTAL POINTS (400 points) Judge/Graders: Please double check and verify all scores and answer keys! Property

More information

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011 Hands-On Lab Lab: Client Object Model Lab version: 1.0.0 Last updated: 2/23/2011 CONTENTS OVERVIEW... 3 EXERCISE 1: RETRIEVING LISTS... 4 EXERCISE 2: PRINTING A LIST... 8 EXERCISE 3: USING ADO.NET DATA

More information

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi Turku University of Applied Sciences Degree Programme in Business Information Technology

More information

APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende:

APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende: APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende: Interfaz gráfica de wiimocap. Obtención de las variables de los tres acelerómetros. Algoritmos de reconocimiento de posiciones. Inclinación

More information

The Visual Multi-DC-Motor Control System of Digital Signal Processor Based on Visual Studio 2010 Wenli Huang, Shunxin Liu

The Visual Multi-DC-Motor Control System of Digital Signal Processor Based on Visual Studio 2010 Wenli Huang, Shunxin Liu International Conference on Intelligent Systems Research and Mechatronics Engineering (ISRME 2015) The Visual Multi-DC-Motor Control System of Digital Signal Processor Based on Visual Studio 2010 Wenli

More information

C# winforms gridview

C# winforms gridview C# winforms gridview using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

More information

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky Brian Kiser November 2010 Vigilant C# 2.5 Commonwealth of Kentucky Frankfort, Kentucky Table of Contents 1.0 Work Sample Description Page 3 2.0 Skills Demonstrated 2.1 Software development competency using

More information

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان در این مقاله با دو روش از روشهای خواندن اطالعات از فایل های اکسل و نوشتن آنها در DataGridView بدون استفاده از ( Automation Excelبا استفاده از NPOI و( ADO.Net آشنا میشوید. راه اول : با استفاده از (xls)

More information

In-Class Worksheet #4

In-Class Worksheet #4 CSE 459.24 Programming in C# Richard Kidwell In-Class Worksheet #4 Creating a Windows Forms application with Data Binding You should have Visual Studio 2008 open. 1. Create a new Project either from the

More information

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); }

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); } Listing Program Kode Program Menu Home: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

More information

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0];

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0]; 1 LISTING PROGRAM using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace SortingApplication static class Program / / The main entry point for

More information

Project Proposal. GPS Collection Unit

Project Proposal. GPS Collection Unit Project Proposal 24 April 2007 Jerald Sussman, xxxxxxx@ieee.org Aaron Isaki, xxxxxxx@gmail.com Project Abstract This project is a prototype unit of a small Global Positioning System (GPS) collection and

More information

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

Conventions in this tutorial

Conventions in this tutorial This document provides an exercise using Digi JumpStart for Windows Embedded CE 6.0. This document shows how to develop, run, and debug a simple application on your target hardware platform. This tutorial

More information

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output General Date Your Company Name Tel: +44 1234 567 9898 Fax: +44 1234 545 9999 email: info@@company.com Microsoft Visual Studio C# Project Source Code Output Created using VScodePrint Macro Variables Substitution

More information

Chapter 12. Tool Strips, Status Strips, and Splitters

Chapter 12. Tool Strips, Status Strips, and Splitters Chapter 12 Tool Strips, Status Strips, and Splitters Tool Strips Usually called tool bars. The new ToolStrip class replaces the older ToolBar class of.net 1.1. Create easily customized, commonly employed

More information

Chapter 13 Working with Threads

Chapter 13 Working with Threads Chapter 13 Working with Threads Until relatively recently only advanced programmers understood and knew how to employ threads in application programs. Part of the problem was that using threads was not

More information

LISTING PROGRAM. a = b; b = c; c = a + b; } fibs.reverse(); for (int i = 0; i < fibs.count; i++) { if (n >= fibs[i]) { n = n - fibs[i];

LISTING PROGRAM. a = b; b = c; c = a + b; } fibs.reverse(); for (int i = 0; i < fibs.count; i++) { if (n >= fibs[i]) { n = n - fibs[i]; A-1 A LISTING PROGRAM 1. Fibonacci Code //membuat fungsi Fibonacci Code public static String GetFibonacciCode(int n) { StringBuilder fib = new StringBuilder("1"); int a, b, c; List fibs = new List();

More information

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

} } public void getir() { DataTable dt = vt.dtgetir(select* from stok order by stokadi); Form1 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

More information

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

XNA 4.0 RPG Tutorials. Part 11b. Game Editors XNA 4.0 RPG Tutorials Part 11b Game Editors I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials on

More information

private void Form1_Load(object sender, EventArgs e) {

private void Form1_Load(object sender, EventArgs e) { viii LAMPIRAN LISTING PROGRAM 1. Form Home using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

More information

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); }

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); } เว บแอพล เคช น using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace

More information

FDSc in ICT. Building a Program in C#

FDSc in ICT. Building a Program in C# FDSc in ICT Building a Program in C# Objectives To build a complete application in C# from scratch Make a banking app Make use of: Methods/Functions Classes Inheritance Scenario We have a bank that has

More information

Savoy ActiveX Control User Guide

Savoy ActiveX Control User Guide Savoy ActiveX Control User Guide Jazz Soft, Inc. Revision History 1 Revision History Version Date Name Description 1.00 Jul, 31 st, 2009 Hikaru Okada Created as new document 1.00a Aug, 22 nd, 2009 Hikaru

More information

II. Programming Technologies

II. Programming Technologies II. Programming Technologies II.1 The machine code program Code of algorithm steps + memory addresses: MOV AX,1234h ;0B8h 34h 12h - number (1234h) to AX register MUL WORD PTR [5678h] ;0F7h 26h 78h 56h

More information

namespace Gen837X222A1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace Gen837X222A1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

This is the start of the server code

This is the start of the server code This is the start of the server code using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Net; using System.Net.Sockets;

More information

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1 NIZOVI Niz deklarišemo navođenjemtipa elemenata za kojim sledi par srednjih zagrada[] i naziv niza. Ako je niz višedimenzionalni između zagrada[] se navode zarezi, čiji je broj za jedan manji od dimenzija

More information

LISTING PROGRAM. namespace vigenere_des { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); }

LISTING PROGRAM. namespace vigenere_des { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); } 59 LISTING PROGRAM Form Utama : using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation;

More information

Lampiran B. Program pengendali

Lampiran B. Program pengendali Lampiran B Program pengendali #pragma once namespace serial using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms;

More information

APARAT DE MASURA. Descrierea programului

APARAT DE MASURA. Descrierea programului APARAT DE MASURA Descrierea programului Acest program reprezinta un aparat de masura universal. Acest apparat poate fi modificat in functie de necesitatile utilizatorului. Modificarile pe care aparatul

More information

namespace csharp_gen837x223a2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

namespace csharp_gen837x223a2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Edidev.FrameworkEDI; 1 namespace

More information

private string sconnection = ConfigurationManager.ConnectionStrings["Development"].ConnectionString

private string sconnection = ConfigurationManager.ConnectionStrings[Development].ConnectionString using System; using System.Configuration; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Text; using System.Windows.Forms;

More information

Chapter 13: An Example Web Service Client

Chapter 13: An Example Web Service Client page 1 Chapter 13: An Example Web Service Client In this chapter, we are going to build a client web application that uses a free web service called Terraserver. Terraserver is a site run by Microsoft

More information

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية وتمتلك الشفرة البرمجية التالية : زر االقسام fr_dept fd = new

More information

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D.

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D. Chapter 2 Multiple Choice 1. According to the following figure, which statement is incorrect? A. The size of the selected object is 300 pixels wide by 300 pixels high. B. The name of the select object

More information

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample.

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample. Author: Carlos Kassab Date: July/24/2006 First install BOBS(BaaN Ole Broker Server), you

More information

Class Test 5. Create a simple paint program that conforms to the following requirements.

Class Test 5. Create a simple paint program that conforms to the following requirements. Class Test 5 Question 1 Use visual studio 2012 ultimate to create a C# windows forms application. Create a simple paint program that conforms to the following requirements. The control box is disabled

More information

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list C# cont d (C-sharp) (many of these slides are extracted and adapted from Deitel s book and slides, How to Program in C#. They are provided for CSE3403 students only. Not to be published or publicly distributed

More information

Getting Started with ComponentOne LiveLinq

Getting Started with ComponentOne LiveLinq Getting Started with ComponentOne LiveLinq What is LINQ? LINQ, or Language Integrated Query, is a set of features in.net 3.5 used for writing structured type-safe queries over local object collections

More information

M. Shahalam. Sid the Spider. Final Report December 7, EEL Intelligence Machine Design Laboratory

M. Shahalam. Sid the Spider. Final Report December 7, EEL Intelligence Machine Design Laboratory M. Shahalam Sid the Spider Final Report December 7, 2010 EEL 4665 - Intelligence Machine Design Laboratory TAs : Mike Pridgen Ryan Stevens Thomas Vermeer Tim Martin Devin Hughes Instructors: Dr. A. Antonio

More information

LISTING PROGRAM. private void filetoolstripmenuitem_click(object sender, EventArgs e) { this.hide(); Form2 fr = new Form2(); fr.

LISTING PROGRAM. private void filetoolstripmenuitem_click(object sender, EventArgs e) { this.hide(); Form2 fr = new Form2(); fr. Kode Program Form Home namespace SkripsiLagi public partial class Form9 : Form public Form9() LISTING PROGRAM private void filetoolstripmenuitem_click(object sender, EventArgs e) Form2 fr = new Form2();

More information

2.3 Add GDS Google Map to Visual Studio Toolbox and create a simple map project

2.3 Add GDS Google Map to Visual Studio Toolbox and create a simple map project 1. Introduction GDS Google Map is a Desktop.Net User Control, which can be embedded in Windows Forms Applications or hosted in WPF Applications. It integrates an interactive Google Map into your desktop

More information

PLATFORM TECHNOLOGY UNIT-4

PLATFORM TECHNOLOGY UNIT-4 VB.NET: Handling Exceptions Delegates and Events - Accessing Data ADO.NET Object Model-.NET Data Providers Direct Access to Data Accessing Data with Datasets. ADO.NET Object Model ADO.NET object model

More information

The Network. Multithreading. This tutorial can be found on -

The Network. Multithreading. This tutorial can be found on - This tutorial can be found on - http://www.informit.com/articles/article.aspx?p=25462&seqnum=5 Instant messaging is sweeping the world, and is rapidly replacing email as the preferred electronic communications

More information

LAMPIRAN A LISTING PROGRAM

LAMPIRAN A LISTING PROGRAM A-1 LAMPIRAN A LISTING PROGRAM FUNGSI public void StopWatchStart() stopwatch.reset(); stopwatch.start(); Cursor.Current = Cursors.WaitCursor; txtlog.text = ""; public void StopWatchStop(string Title) stopwatch.stop();

More information